compute-gen.go 4.7 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960
  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package compute provides access to the Compute Engine API.
  6. //
  7. // See https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/compute/v0.beta"
  12. // ...
  13. // computeService, err := compute.New(oauthHttpClient)
  14. package compute // import "google.golang.org/api/compute/v0.beta"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "compute:beta"
  43. const apiName = "compute"
  44. const apiVersion = "beta"
  45. const basePath = "https://www.googleapis.com/compute/beta/projects/"
  46. // OAuth2 scopes used by this API.
  47. const (
  48. // View and manage your data across Google Cloud Platform services
  49. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  50. // View and manage your Google Compute Engine resources
  51. ComputeScope = "https://www.googleapis.com/auth/compute"
  52. // View your Google Compute Engine resources
  53. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  54. // Manage your data and permissions in Google Cloud Storage
  55. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  56. // View your data in Google Cloud Storage
  57. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  58. // Manage your data in Google Cloud Storage
  59. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  60. )
  61. func New(client *http.Client) (*Service, error) {
  62. if client == nil {
  63. return nil, errors.New("client is nil")
  64. }
  65. s := &Service{client: client, BasePath: basePath}
  66. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  67. s.Addresses = NewAddressesService(s)
  68. s.Allocations = NewAllocationsService(s)
  69. s.Autoscalers = NewAutoscalersService(s)
  70. s.BackendBuckets = NewBackendBucketsService(s)
  71. s.BackendServices = NewBackendServicesService(s)
  72. s.DiskTypes = NewDiskTypesService(s)
  73. s.Disks = NewDisksService(s)
  74. s.Firewalls = NewFirewallsService(s)
  75. s.ForwardingRules = NewForwardingRulesService(s)
  76. s.GlobalAddresses = NewGlobalAddressesService(s)
  77. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  78. s.GlobalOperations = NewGlobalOperationsService(s)
  79. s.HealthChecks = NewHealthChecksService(s)
  80. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  81. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  82. s.Images = NewImagesService(s)
  83. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  84. s.InstanceGroups = NewInstanceGroupsService(s)
  85. s.InstanceTemplates = NewInstanceTemplatesService(s)
  86. s.Instances = NewInstancesService(s)
  87. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  88. s.InterconnectLocations = NewInterconnectLocationsService(s)
  89. s.Interconnects = NewInterconnectsService(s)
  90. s.LicenseCodes = NewLicenseCodesService(s)
  91. s.Licenses = NewLicensesService(s)
  92. s.MachineTypes = NewMachineTypesService(s)
  93. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  94. s.Networks = NewNetworksService(s)
  95. s.NodeGroups = NewNodeGroupsService(s)
  96. s.NodeTemplates = NewNodeTemplatesService(s)
  97. s.NodeTypes = NewNodeTypesService(s)
  98. s.Projects = NewProjectsService(s)
  99. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  100. s.RegionBackendServices = NewRegionBackendServicesService(s)
  101. s.RegionCommitments = NewRegionCommitmentsService(s)
  102. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  103. s.RegionDisks = NewRegionDisksService(s)
  104. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  105. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  106. s.RegionOperations = NewRegionOperationsService(s)
  107. s.Regions = NewRegionsService(s)
  108. s.ResourcePolicies = NewResourcePoliciesService(s)
  109. s.Routers = NewRoutersService(s)
  110. s.Routes = NewRoutesService(s)
  111. s.SecurityPolicies = NewSecurityPoliciesService(s)
  112. s.Snapshots = NewSnapshotsService(s)
  113. s.SslCertificates = NewSslCertificatesService(s)
  114. s.SslPolicies = NewSslPoliciesService(s)
  115. s.Subnetworks = NewSubnetworksService(s)
  116. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  117. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  118. s.TargetInstances = NewTargetInstancesService(s)
  119. s.TargetPools = NewTargetPoolsService(s)
  120. s.TargetSslProxies = NewTargetSslProxiesService(s)
  121. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  122. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  123. s.UrlMaps = NewUrlMapsService(s)
  124. s.VpnTunnels = NewVpnTunnelsService(s)
  125. s.ZoneOperations = NewZoneOperationsService(s)
  126. s.Zones = NewZonesService(s)
  127. return s, nil
  128. }
  129. type Service struct {
  130. client *http.Client
  131. BasePath string // API endpoint base URL
  132. UserAgent string // optional additional User-Agent fragment
  133. AcceleratorTypes *AcceleratorTypesService
  134. Addresses *AddressesService
  135. Allocations *AllocationsService
  136. Autoscalers *AutoscalersService
  137. BackendBuckets *BackendBucketsService
  138. BackendServices *BackendServicesService
  139. DiskTypes *DiskTypesService
  140. Disks *DisksService
  141. Firewalls *FirewallsService
  142. ForwardingRules *ForwardingRulesService
  143. GlobalAddresses *GlobalAddressesService
  144. GlobalForwardingRules *GlobalForwardingRulesService
  145. GlobalOperations *GlobalOperationsService
  146. HealthChecks *HealthChecksService
  147. HttpHealthChecks *HttpHealthChecksService
  148. HttpsHealthChecks *HttpsHealthChecksService
  149. Images *ImagesService
  150. InstanceGroupManagers *InstanceGroupManagersService
  151. InstanceGroups *InstanceGroupsService
  152. InstanceTemplates *InstanceTemplatesService
  153. Instances *InstancesService
  154. InterconnectAttachments *InterconnectAttachmentsService
  155. InterconnectLocations *InterconnectLocationsService
  156. Interconnects *InterconnectsService
  157. LicenseCodes *LicenseCodesService
  158. Licenses *LicensesService
  159. MachineTypes *MachineTypesService
  160. NetworkEndpointGroups *NetworkEndpointGroupsService
  161. Networks *NetworksService
  162. NodeGroups *NodeGroupsService
  163. NodeTemplates *NodeTemplatesService
  164. NodeTypes *NodeTypesService
  165. Projects *ProjectsService
  166. RegionAutoscalers *RegionAutoscalersService
  167. RegionBackendServices *RegionBackendServicesService
  168. RegionCommitments *RegionCommitmentsService
  169. RegionDiskTypes *RegionDiskTypesService
  170. RegionDisks *RegionDisksService
  171. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  172. RegionInstanceGroups *RegionInstanceGroupsService
  173. RegionOperations *RegionOperationsService
  174. Regions *RegionsService
  175. ResourcePolicies *ResourcePoliciesService
  176. Routers *RoutersService
  177. Routes *RoutesService
  178. SecurityPolicies *SecurityPoliciesService
  179. Snapshots *SnapshotsService
  180. SslCertificates *SslCertificatesService
  181. SslPolicies *SslPoliciesService
  182. Subnetworks *SubnetworksService
  183. TargetHttpProxies *TargetHttpProxiesService
  184. TargetHttpsProxies *TargetHttpsProxiesService
  185. TargetInstances *TargetInstancesService
  186. TargetPools *TargetPoolsService
  187. TargetSslProxies *TargetSslProxiesService
  188. TargetTcpProxies *TargetTcpProxiesService
  189. TargetVpnGateways *TargetVpnGatewaysService
  190. UrlMaps *UrlMapsService
  191. VpnTunnels *VpnTunnelsService
  192. ZoneOperations *ZoneOperationsService
  193. Zones *ZonesService
  194. }
  195. func (s *Service) userAgent() string {
  196. if s.UserAgent == "" {
  197. return googleapi.UserAgent
  198. }
  199. return googleapi.UserAgent + " " + s.UserAgent
  200. }
  201. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  202. rs := &AcceleratorTypesService{s: s}
  203. return rs
  204. }
  205. type AcceleratorTypesService struct {
  206. s *Service
  207. }
  208. func NewAddressesService(s *Service) *AddressesService {
  209. rs := &AddressesService{s: s}
  210. return rs
  211. }
  212. type AddressesService struct {
  213. s *Service
  214. }
  215. func NewAllocationsService(s *Service) *AllocationsService {
  216. rs := &AllocationsService{s: s}
  217. return rs
  218. }
  219. type AllocationsService struct {
  220. s *Service
  221. }
  222. func NewAutoscalersService(s *Service) *AutoscalersService {
  223. rs := &AutoscalersService{s: s}
  224. return rs
  225. }
  226. type AutoscalersService struct {
  227. s *Service
  228. }
  229. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  230. rs := &BackendBucketsService{s: s}
  231. return rs
  232. }
  233. type BackendBucketsService struct {
  234. s *Service
  235. }
  236. func NewBackendServicesService(s *Service) *BackendServicesService {
  237. rs := &BackendServicesService{s: s}
  238. return rs
  239. }
  240. type BackendServicesService struct {
  241. s *Service
  242. }
  243. func NewDiskTypesService(s *Service) *DiskTypesService {
  244. rs := &DiskTypesService{s: s}
  245. return rs
  246. }
  247. type DiskTypesService struct {
  248. s *Service
  249. }
  250. func NewDisksService(s *Service) *DisksService {
  251. rs := &DisksService{s: s}
  252. return rs
  253. }
  254. type DisksService struct {
  255. s *Service
  256. }
  257. func NewFirewallsService(s *Service) *FirewallsService {
  258. rs := &FirewallsService{s: s}
  259. return rs
  260. }
  261. type FirewallsService struct {
  262. s *Service
  263. }
  264. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  265. rs := &ForwardingRulesService{s: s}
  266. return rs
  267. }
  268. type ForwardingRulesService struct {
  269. s *Service
  270. }
  271. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  272. rs := &GlobalAddressesService{s: s}
  273. return rs
  274. }
  275. type GlobalAddressesService struct {
  276. s *Service
  277. }
  278. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  279. rs := &GlobalForwardingRulesService{s: s}
  280. return rs
  281. }
  282. type GlobalForwardingRulesService struct {
  283. s *Service
  284. }
  285. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  286. rs := &GlobalOperationsService{s: s}
  287. return rs
  288. }
  289. type GlobalOperationsService struct {
  290. s *Service
  291. }
  292. func NewHealthChecksService(s *Service) *HealthChecksService {
  293. rs := &HealthChecksService{s: s}
  294. return rs
  295. }
  296. type HealthChecksService struct {
  297. s *Service
  298. }
  299. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  300. rs := &HttpHealthChecksService{s: s}
  301. return rs
  302. }
  303. type HttpHealthChecksService struct {
  304. s *Service
  305. }
  306. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  307. rs := &HttpsHealthChecksService{s: s}
  308. return rs
  309. }
  310. type HttpsHealthChecksService struct {
  311. s *Service
  312. }
  313. func NewImagesService(s *Service) *ImagesService {
  314. rs := &ImagesService{s: s}
  315. return rs
  316. }
  317. type ImagesService struct {
  318. s *Service
  319. }
  320. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  321. rs := &InstanceGroupManagersService{s: s}
  322. return rs
  323. }
  324. type InstanceGroupManagersService struct {
  325. s *Service
  326. }
  327. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  328. rs := &InstanceGroupsService{s: s}
  329. return rs
  330. }
  331. type InstanceGroupsService struct {
  332. s *Service
  333. }
  334. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  335. rs := &InstanceTemplatesService{s: s}
  336. return rs
  337. }
  338. type InstanceTemplatesService struct {
  339. s *Service
  340. }
  341. func NewInstancesService(s *Service) *InstancesService {
  342. rs := &InstancesService{s: s}
  343. return rs
  344. }
  345. type InstancesService struct {
  346. s *Service
  347. }
  348. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  349. rs := &InterconnectAttachmentsService{s: s}
  350. return rs
  351. }
  352. type InterconnectAttachmentsService struct {
  353. s *Service
  354. }
  355. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  356. rs := &InterconnectLocationsService{s: s}
  357. return rs
  358. }
  359. type InterconnectLocationsService struct {
  360. s *Service
  361. }
  362. func NewInterconnectsService(s *Service) *InterconnectsService {
  363. rs := &InterconnectsService{s: s}
  364. return rs
  365. }
  366. type InterconnectsService struct {
  367. s *Service
  368. }
  369. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  370. rs := &LicenseCodesService{s: s}
  371. return rs
  372. }
  373. type LicenseCodesService struct {
  374. s *Service
  375. }
  376. func NewLicensesService(s *Service) *LicensesService {
  377. rs := &LicensesService{s: s}
  378. return rs
  379. }
  380. type LicensesService struct {
  381. s *Service
  382. }
  383. func NewMachineTypesService(s *Service) *MachineTypesService {
  384. rs := &MachineTypesService{s: s}
  385. return rs
  386. }
  387. type MachineTypesService struct {
  388. s *Service
  389. }
  390. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  391. rs := &NetworkEndpointGroupsService{s: s}
  392. return rs
  393. }
  394. type NetworkEndpointGroupsService struct {
  395. s *Service
  396. }
  397. func NewNetworksService(s *Service) *NetworksService {
  398. rs := &NetworksService{s: s}
  399. return rs
  400. }
  401. type NetworksService struct {
  402. s *Service
  403. }
  404. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  405. rs := &NodeGroupsService{s: s}
  406. return rs
  407. }
  408. type NodeGroupsService struct {
  409. s *Service
  410. }
  411. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  412. rs := &NodeTemplatesService{s: s}
  413. return rs
  414. }
  415. type NodeTemplatesService struct {
  416. s *Service
  417. }
  418. func NewNodeTypesService(s *Service) *NodeTypesService {
  419. rs := &NodeTypesService{s: s}
  420. return rs
  421. }
  422. type NodeTypesService struct {
  423. s *Service
  424. }
  425. func NewProjectsService(s *Service) *ProjectsService {
  426. rs := &ProjectsService{s: s}
  427. return rs
  428. }
  429. type ProjectsService struct {
  430. s *Service
  431. }
  432. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  433. rs := &RegionAutoscalersService{s: s}
  434. return rs
  435. }
  436. type RegionAutoscalersService struct {
  437. s *Service
  438. }
  439. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  440. rs := &RegionBackendServicesService{s: s}
  441. return rs
  442. }
  443. type RegionBackendServicesService struct {
  444. s *Service
  445. }
  446. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  447. rs := &RegionCommitmentsService{s: s}
  448. return rs
  449. }
  450. type RegionCommitmentsService struct {
  451. s *Service
  452. }
  453. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  454. rs := &RegionDiskTypesService{s: s}
  455. return rs
  456. }
  457. type RegionDiskTypesService struct {
  458. s *Service
  459. }
  460. func NewRegionDisksService(s *Service) *RegionDisksService {
  461. rs := &RegionDisksService{s: s}
  462. return rs
  463. }
  464. type RegionDisksService struct {
  465. s *Service
  466. }
  467. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  468. rs := &RegionInstanceGroupManagersService{s: s}
  469. return rs
  470. }
  471. type RegionInstanceGroupManagersService struct {
  472. s *Service
  473. }
  474. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  475. rs := &RegionInstanceGroupsService{s: s}
  476. return rs
  477. }
  478. type RegionInstanceGroupsService struct {
  479. s *Service
  480. }
  481. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  482. rs := &RegionOperationsService{s: s}
  483. return rs
  484. }
  485. type RegionOperationsService struct {
  486. s *Service
  487. }
  488. func NewRegionsService(s *Service) *RegionsService {
  489. rs := &RegionsService{s: s}
  490. return rs
  491. }
  492. type RegionsService struct {
  493. s *Service
  494. }
  495. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  496. rs := &ResourcePoliciesService{s: s}
  497. return rs
  498. }
  499. type ResourcePoliciesService struct {
  500. s *Service
  501. }
  502. func NewRoutersService(s *Service) *RoutersService {
  503. rs := &RoutersService{s: s}
  504. return rs
  505. }
  506. type RoutersService struct {
  507. s *Service
  508. }
  509. func NewRoutesService(s *Service) *RoutesService {
  510. rs := &RoutesService{s: s}
  511. return rs
  512. }
  513. type RoutesService struct {
  514. s *Service
  515. }
  516. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  517. rs := &SecurityPoliciesService{s: s}
  518. return rs
  519. }
  520. type SecurityPoliciesService struct {
  521. s *Service
  522. }
  523. func NewSnapshotsService(s *Service) *SnapshotsService {
  524. rs := &SnapshotsService{s: s}
  525. return rs
  526. }
  527. type SnapshotsService struct {
  528. s *Service
  529. }
  530. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  531. rs := &SslCertificatesService{s: s}
  532. return rs
  533. }
  534. type SslCertificatesService struct {
  535. s *Service
  536. }
  537. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  538. rs := &SslPoliciesService{s: s}
  539. return rs
  540. }
  541. type SslPoliciesService struct {
  542. s *Service
  543. }
  544. func NewSubnetworksService(s *Service) *SubnetworksService {
  545. rs := &SubnetworksService{s: s}
  546. return rs
  547. }
  548. type SubnetworksService struct {
  549. s *Service
  550. }
  551. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  552. rs := &TargetHttpProxiesService{s: s}
  553. return rs
  554. }
  555. type TargetHttpProxiesService struct {
  556. s *Service
  557. }
  558. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  559. rs := &TargetHttpsProxiesService{s: s}
  560. return rs
  561. }
  562. type TargetHttpsProxiesService struct {
  563. s *Service
  564. }
  565. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  566. rs := &TargetInstancesService{s: s}
  567. return rs
  568. }
  569. type TargetInstancesService struct {
  570. s *Service
  571. }
  572. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  573. rs := &TargetPoolsService{s: s}
  574. return rs
  575. }
  576. type TargetPoolsService struct {
  577. s *Service
  578. }
  579. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  580. rs := &TargetSslProxiesService{s: s}
  581. return rs
  582. }
  583. type TargetSslProxiesService struct {
  584. s *Service
  585. }
  586. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  587. rs := &TargetTcpProxiesService{s: s}
  588. return rs
  589. }
  590. type TargetTcpProxiesService struct {
  591. s *Service
  592. }
  593. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  594. rs := &TargetVpnGatewaysService{s: s}
  595. return rs
  596. }
  597. type TargetVpnGatewaysService struct {
  598. s *Service
  599. }
  600. func NewUrlMapsService(s *Service) *UrlMapsService {
  601. rs := &UrlMapsService{s: s}
  602. return rs
  603. }
  604. type UrlMapsService struct {
  605. s *Service
  606. }
  607. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  608. rs := &VpnTunnelsService{s: s}
  609. return rs
  610. }
  611. type VpnTunnelsService struct {
  612. s *Service
  613. }
  614. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  615. rs := &ZoneOperationsService{s: s}
  616. return rs
  617. }
  618. type ZoneOperationsService struct {
  619. s *Service
  620. }
  621. func NewZonesService(s *Service) *ZonesService {
  622. rs := &ZonesService{s: s}
  623. return rs
  624. }
  625. type ZonesService struct {
  626. s *Service
  627. }
  628. // AcceleratorConfig: A specification of the type and number of
  629. // accelerator cards attached to the instance.
  630. type AcceleratorConfig struct {
  631. // AcceleratorCount: The number of the guest accelerator cards exposed
  632. // to this instance.
  633. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  634. // AcceleratorType: Full or partial URL of the accelerator type resource
  635. // to attach to this instance. If you are creating an instance template,
  636. // specify only the accelerator name.
  637. AcceleratorType string `json:"acceleratorType,omitempty"`
  638. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  639. // unconditionally include in API requests. By default, fields with
  640. // empty values are omitted from API requests. However, any non-pointer,
  641. // non-interface field appearing in ForceSendFields will be sent to the
  642. // server regardless of whether the field is empty or not. This may be
  643. // used to include empty fields in Patch requests.
  644. ForceSendFields []string `json:"-"`
  645. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  646. // include in API requests with the JSON null value. By default, fields
  647. // with empty values are omitted from API requests. However, any field
  648. // with an empty value appearing in NullFields will be sent to the
  649. // server as null. It is an error if a field in this list has a
  650. // non-empty value. This may be used to include null fields in Patch
  651. // requests.
  652. NullFields []string `json:"-"`
  653. }
  654. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  655. type NoMethod AcceleratorConfig
  656. raw := NoMethod(*s)
  657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  658. }
  659. // AcceleratorType: An Accelerator Type resource. (== resource_for
  660. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  661. type AcceleratorType struct {
  662. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  663. // format.
  664. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  665. // Deprecated: [Output Only] The deprecation status associated with this
  666. // accelerator type.
  667. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  668. // Description: [Output Only] An optional textual description of the
  669. // resource.
  670. Description string `json:"description,omitempty"`
  671. // Id: [Output Only] The unique identifier for the resource. This
  672. // identifier is defined by the server.
  673. Id uint64 `json:"id,omitempty,string"`
  674. // Kind: [Output Only] The type of the resource. Always
  675. // compute#acceleratorType for accelerator types.
  676. Kind string `json:"kind,omitempty"`
  677. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  678. // allowed per instance.
  679. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  680. // Name: [Output Only] Name of the resource.
  681. Name string `json:"name,omitempty"`
  682. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  683. // resource.
  684. SelfLink string `json:"selfLink,omitempty"`
  685. // Zone: [Output Only] The name of the zone where the accelerator type
  686. // resides, such as us-central1-a. You must specify this field as part
  687. // of the HTTP request URL. It is not settable as a field in the request
  688. // body.
  689. Zone string `json:"zone,omitempty"`
  690. // ServerResponse contains the HTTP response code and headers from the
  691. // server.
  692. googleapi.ServerResponse `json:"-"`
  693. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  694. // to unconditionally include in API requests. By default, fields with
  695. // empty values are omitted from API requests. However, any non-pointer,
  696. // non-interface field appearing in ForceSendFields will be sent to the
  697. // server regardless of whether the field is empty or not. This may be
  698. // used to include empty fields in Patch requests.
  699. ForceSendFields []string `json:"-"`
  700. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  701. // include in API requests with the JSON null value. By default, fields
  702. // with empty values are omitted from API requests. However, any field
  703. // with an empty value appearing in NullFields will be sent to the
  704. // server as null. It is an error if a field in this list has a
  705. // non-empty value. This may be used to include null fields in Patch
  706. // requests.
  707. NullFields []string `json:"-"`
  708. }
  709. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  710. type NoMethod AcceleratorType
  711. raw := NoMethod(*s)
  712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  713. }
  714. type AcceleratorTypeAggregatedList struct {
  715. // Id: [Output Only] Unique identifier for the resource; defined by the
  716. // server.
  717. Id string `json:"id,omitempty"`
  718. // Items: A list of AcceleratorTypesScopedList resources.
  719. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  720. // Kind: [Output Only] Type of resource. Always
  721. // compute#acceleratorTypeAggregatedList for aggregated lists of
  722. // accelerator types.
  723. Kind string `json:"kind,omitempty"`
  724. // NextPageToken: [Output Only] This token allows you to get the next
  725. // page of results for list requests. If the number of results is larger
  726. // than maxResults, use the nextPageToken as a value for the query
  727. // parameter pageToken in the next list request. Subsequent list
  728. // requests will have their own nextPageToken to continue paging through
  729. // the results.
  730. NextPageToken string `json:"nextPageToken,omitempty"`
  731. // SelfLink: [Output Only] Server-defined URL for this resource.
  732. SelfLink string `json:"selfLink,omitempty"`
  733. // Warning: [Output Only] Informational warning message.
  734. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  735. // ServerResponse contains the HTTP response code and headers from the
  736. // server.
  737. googleapi.ServerResponse `json:"-"`
  738. // ForceSendFields is a list of field names (e.g. "Id") to
  739. // unconditionally include in API requests. By default, fields with
  740. // empty values are omitted from API requests. However, any non-pointer,
  741. // non-interface field appearing in ForceSendFields will be sent to the
  742. // server regardless of whether the field is empty or not. This may be
  743. // used to include empty fields in Patch requests.
  744. ForceSendFields []string `json:"-"`
  745. // NullFields is a list of field names (e.g. "Id") to include in API
  746. // requests with the JSON null value. By default, fields with empty
  747. // values are omitted from API requests. However, any field with an
  748. // empty value appearing in NullFields will be sent to the server as
  749. // null. It is an error if a field in this list has a non-empty value.
  750. // This may be used to include null fields in Patch requests.
  751. NullFields []string `json:"-"`
  752. }
  753. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  754. type NoMethod AcceleratorTypeAggregatedList
  755. raw := NoMethod(*s)
  756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  757. }
  758. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  759. // warning message.
  760. type AcceleratorTypeAggregatedListWarning struct {
  761. // Code: [Output Only] A warning code, if applicable. For example,
  762. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  763. // the response.
  764. //
  765. // Possible values:
  766. // "CLEANUP_FAILED"
  767. // "DEPRECATED_RESOURCE_USED"
  768. // "DEPRECATED_TYPE_USED"
  769. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  770. // "EXPERIMENTAL_TYPE_USED"
  771. // "EXTERNAL_API_WARNING"
  772. // "FIELD_VALUE_OVERRIDEN"
  773. // "INJECTED_KERNELS_DEPRECATED"
  774. // "MISSING_TYPE_DEPENDENCY"
  775. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  776. // "NEXT_HOP_CANNOT_IP_FORWARD"
  777. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  778. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  779. // "NEXT_HOP_NOT_RUNNING"
  780. // "NOT_CRITICAL_ERROR"
  781. // "NO_RESULTS_ON_PAGE"
  782. // "REQUIRED_TOS_AGREEMENT"
  783. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  784. // "RESOURCE_NOT_DELETED"
  785. // "SCHEMA_VALIDATION_IGNORED"
  786. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  787. // "UNDECLARED_PROPERTIES"
  788. // "UNREACHABLE"
  789. Code string `json:"code,omitempty"`
  790. // Data: [Output Only] Metadata about this warning in key: value format.
  791. // For example:
  792. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  793. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  794. // Message: [Output Only] A human-readable description of the warning
  795. // code.
  796. Message string `json:"message,omitempty"`
  797. // ForceSendFields is a list of field names (e.g. "Code") to
  798. // unconditionally include in API requests. By default, fields with
  799. // empty values are omitted from API requests. However, any non-pointer,
  800. // non-interface field appearing in ForceSendFields will be sent to the
  801. // server regardless of whether the field is empty or not. This may be
  802. // used to include empty fields in Patch requests.
  803. ForceSendFields []string `json:"-"`
  804. // NullFields is a list of field names (e.g. "Code") to include in API
  805. // requests with the JSON null value. By default, fields with empty
  806. // values are omitted from API requests. However, any field with an
  807. // empty value appearing in NullFields will be sent to the server as
  808. // null. It is an error if a field in this list has a non-empty value.
  809. // This may be used to include null fields in Patch requests.
  810. NullFields []string `json:"-"`
  811. }
  812. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  813. type NoMethod AcceleratorTypeAggregatedListWarning
  814. raw := NoMethod(*s)
  815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  816. }
  817. type AcceleratorTypeAggregatedListWarningData struct {
  818. // Key: [Output Only] A key that provides more detail on the warning
  819. // being returned. For example, for warnings where there are no results
  820. // in a list request for a particular zone, this key might be scope and
  821. // the key value might be the zone name. Other examples might be a key
  822. // indicating a deprecated resource and a suggested replacement, or a
  823. // warning about invalid network settings (for example, if an instance
  824. // attempts to perform IP forwarding but is not enabled for IP
  825. // forwarding).
  826. Key string `json:"key,omitempty"`
  827. // Value: [Output Only] A warning data value corresponding to the key.
  828. Value string `json:"value,omitempty"`
  829. // ForceSendFields is a list of field names (e.g. "Key") to
  830. // unconditionally include in API requests. By default, fields with
  831. // empty values are omitted from API requests. However, any non-pointer,
  832. // non-interface field appearing in ForceSendFields will be sent to the
  833. // server regardless of whether the field is empty or not. This may be
  834. // used to include empty fields in Patch requests.
  835. ForceSendFields []string `json:"-"`
  836. // NullFields is a list of field names (e.g. "Key") to include in API
  837. // requests with the JSON null value. By default, fields with empty
  838. // values are omitted from API requests. However, any field with an
  839. // empty value appearing in NullFields will be sent to the server as
  840. // null. It is an error if a field in this list has a non-empty value.
  841. // This may be used to include null fields in Patch requests.
  842. NullFields []string `json:"-"`
  843. }
  844. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  845. type NoMethod AcceleratorTypeAggregatedListWarningData
  846. raw := NoMethod(*s)
  847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  848. }
  849. // AcceleratorTypeList: Contains a list of accelerator types.
  850. type AcceleratorTypeList struct {
  851. // Id: [Output Only] Unique identifier for the resource; defined by the
  852. // server.
  853. Id string `json:"id,omitempty"`
  854. // Items: A list of AcceleratorType resources.
  855. Items []*AcceleratorType `json:"items,omitempty"`
  856. // Kind: [Output Only] Type of resource. Always
  857. // compute#acceleratorTypeList for lists of accelerator types.
  858. Kind string `json:"kind,omitempty"`
  859. // NextPageToken: [Output Only] This token allows you to get the next
  860. // page of results for list requests. If the number of results is larger
  861. // than maxResults, use the nextPageToken as a value for the query
  862. // parameter pageToken in the next list request. Subsequent list
  863. // requests will have their own nextPageToken to continue paging through
  864. // the results.
  865. NextPageToken string `json:"nextPageToken,omitempty"`
  866. // SelfLink: [Output Only] Server-defined URL for this resource.
  867. SelfLink string `json:"selfLink,omitempty"`
  868. // Warning: [Output Only] Informational warning message.
  869. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  870. // ServerResponse contains the HTTP response code and headers from the
  871. // server.
  872. googleapi.ServerResponse `json:"-"`
  873. // ForceSendFields is a list of field names (e.g. "Id") to
  874. // unconditionally include in API requests. By default, fields with
  875. // empty values are omitted from API requests. However, any non-pointer,
  876. // non-interface field appearing in ForceSendFields will be sent to the
  877. // server regardless of whether the field is empty or not. This may be
  878. // used to include empty fields in Patch requests.
  879. ForceSendFields []string `json:"-"`
  880. // NullFields is a list of field names (e.g. "Id") to include in API
  881. // requests with the JSON null value. By default, fields with empty
  882. // values are omitted from API requests. However, any field with an
  883. // empty value appearing in NullFields will be sent to the server as
  884. // null. It is an error if a field in this list has a non-empty value.
  885. // This may be used to include null fields in Patch requests.
  886. NullFields []string `json:"-"`
  887. }
  888. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  889. type NoMethod AcceleratorTypeList
  890. raw := NoMethod(*s)
  891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  892. }
  893. // AcceleratorTypeListWarning: [Output Only] Informational warning
  894. // message.
  895. type AcceleratorTypeListWarning struct {
  896. // Code: [Output Only] A warning code, if applicable. For example,
  897. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  898. // the response.
  899. //
  900. // Possible values:
  901. // "CLEANUP_FAILED"
  902. // "DEPRECATED_RESOURCE_USED"
  903. // "DEPRECATED_TYPE_USED"
  904. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  905. // "EXPERIMENTAL_TYPE_USED"
  906. // "EXTERNAL_API_WARNING"
  907. // "FIELD_VALUE_OVERRIDEN"
  908. // "INJECTED_KERNELS_DEPRECATED"
  909. // "MISSING_TYPE_DEPENDENCY"
  910. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  911. // "NEXT_HOP_CANNOT_IP_FORWARD"
  912. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  913. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  914. // "NEXT_HOP_NOT_RUNNING"
  915. // "NOT_CRITICAL_ERROR"
  916. // "NO_RESULTS_ON_PAGE"
  917. // "REQUIRED_TOS_AGREEMENT"
  918. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  919. // "RESOURCE_NOT_DELETED"
  920. // "SCHEMA_VALIDATION_IGNORED"
  921. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  922. // "UNDECLARED_PROPERTIES"
  923. // "UNREACHABLE"
  924. Code string `json:"code,omitempty"`
  925. // Data: [Output Only] Metadata about this warning in key: value format.
  926. // For example:
  927. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  928. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  929. // Message: [Output Only] A human-readable description of the warning
  930. // code.
  931. Message string `json:"message,omitempty"`
  932. // ForceSendFields is a list of field names (e.g. "Code") to
  933. // unconditionally include in API requests. By default, fields with
  934. // empty values are omitted from API requests. However, any non-pointer,
  935. // non-interface field appearing in ForceSendFields will be sent to the
  936. // server regardless of whether the field is empty or not. This may be
  937. // used to include empty fields in Patch requests.
  938. ForceSendFields []string `json:"-"`
  939. // NullFields is a list of field names (e.g. "Code") to include in API
  940. // requests with the JSON null value. By default, fields with empty
  941. // values are omitted from API requests. However, any field with an
  942. // empty value appearing in NullFields will be sent to the server as
  943. // null. It is an error if a field in this list has a non-empty value.
  944. // This may be used to include null fields in Patch requests.
  945. NullFields []string `json:"-"`
  946. }
  947. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  948. type NoMethod AcceleratorTypeListWarning
  949. raw := NoMethod(*s)
  950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  951. }
  952. type AcceleratorTypeListWarningData struct {
  953. // Key: [Output Only] A key that provides more detail on the warning
  954. // being returned. For example, for warnings where there are no results
  955. // in a list request for a particular zone, this key might be scope and
  956. // the key value might be the zone name. Other examples might be a key
  957. // indicating a deprecated resource and a suggested replacement, or a
  958. // warning about invalid network settings (for example, if an instance
  959. // attempts to perform IP forwarding but is not enabled for IP
  960. // forwarding).
  961. Key string `json:"key,omitempty"`
  962. // Value: [Output Only] A warning data value corresponding to the key.
  963. Value string `json:"value,omitempty"`
  964. // ForceSendFields is a list of field names (e.g. "Key") to
  965. // unconditionally include in API requests. By default, fields with
  966. // empty values are omitted from API requests. However, any non-pointer,
  967. // non-interface field appearing in ForceSendFields will be sent to the
  968. // server regardless of whether the field is empty or not. This may be
  969. // used to include empty fields in Patch requests.
  970. ForceSendFields []string `json:"-"`
  971. // NullFields is a list of field names (e.g. "Key") to include in API
  972. // requests with the JSON null value. By default, fields with empty
  973. // values are omitted from API requests. However, any field with an
  974. // empty value appearing in NullFields will be sent to the server as
  975. // null. It is an error if a field in this list has a non-empty value.
  976. // This may be used to include null fields in Patch requests.
  977. NullFields []string `json:"-"`
  978. }
  979. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  980. type NoMethod AcceleratorTypeListWarningData
  981. raw := NoMethod(*s)
  982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  983. }
  984. type AcceleratorTypesScopedList struct {
  985. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  986. // in this scope.
  987. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  988. // Warning: [Output Only] An informational warning that appears when the
  989. // accelerator types list is empty.
  990. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  991. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  992. // unconditionally include in API requests. By default, fields with
  993. // empty values are omitted from API requests. However, any non-pointer,
  994. // non-interface field appearing in ForceSendFields will be sent to the
  995. // server regardless of whether the field is empty or not. This may be
  996. // used to include empty fields in Patch requests.
  997. ForceSendFields []string `json:"-"`
  998. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  999. // include in API requests with the JSON null value. By default, fields
  1000. // with empty values are omitted from API requests. However, any field
  1001. // with an empty value appearing in NullFields will be sent to the
  1002. // server as null. It is an error if a field in this list has a
  1003. // non-empty value. This may be used to include null fields in Patch
  1004. // requests.
  1005. NullFields []string `json:"-"`
  1006. }
  1007. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1008. type NoMethod AcceleratorTypesScopedList
  1009. raw := NoMethod(*s)
  1010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1011. }
  1012. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1013. // warning that appears when the accelerator types list is empty.
  1014. type AcceleratorTypesScopedListWarning struct {
  1015. // Code: [Output Only] A warning code, if applicable. For example,
  1016. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1017. // the response.
  1018. //
  1019. // Possible values:
  1020. // "CLEANUP_FAILED"
  1021. // "DEPRECATED_RESOURCE_USED"
  1022. // "DEPRECATED_TYPE_USED"
  1023. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1024. // "EXPERIMENTAL_TYPE_USED"
  1025. // "EXTERNAL_API_WARNING"
  1026. // "FIELD_VALUE_OVERRIDEN"
  1027. // "INJECTED_KERNELS_DEPRECATED"
  1028. // "MISSING_TYPE_DEPENDENCY"
  1029. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1030. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1031. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1032. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1033. // "NEXT_HOP_NOT_RUNNING"
  1034. // "NOT_CRITICAL_ERROR"
  1035. // "NO_RESULTS_ON_PAGE"
  1036. // "REQUIRED_TOS_AGREEMENT"
  1037. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1038. // "RESOURCE_NOT_DELETED"
  1039. // "SCHEMA_VALIDATION_IGNORED"
  1040. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1041. // "UNDECLARED_PROPERTIES"
  1042. // "UNREACHABLE"
  1043. Code string `json:"code,omitempty"`
  1044. // Data: [Output Only] Metadata about this warning in key: value format.
  1045. // For example:
  1046. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1047. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1048. // Message: [Output Only] A human-readable description of the warning
  1049. // code.
  1050. Message string `json:"message,omitempty"`
  1051. // ForceSendFields is a list of field names (e.g. "Code") to
  1052. // unconditionally include in API requests. By default, fields with
  1053. // empty values are omitted from API requests. However, any non-pointer,
  1054. // non-interface field appearing in ForceSendFields will be sent to the
  1055. // server regardless of whether the field is empty or not. This may be
  1056. // used to include empty fields in Patch requests.
  1057. ForceSendFields []string `json:"-"`
  1058. // NullFields is a list of field names (e.g. "Code") to include in API
  1059. // requests with the JSON null value. By default, fields with empty
  1060. // values are omitted from API requests. However, any field with an
  1061. // empty value appearing in NullFields will be sent to the server as
  1062. // null. It is an error if a field in this list has a non-empty value.
  1063. // This may be used to include null fields in Patch requests.
  1064. NullFields []string `json:"-"`
  1065. }
  1066. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1067. type NoMethod AcceleratorTypesScopedListWarning
  1068. raw := NoMethod(*s)
  1069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1070. }
  1071. type AcceleratorTypesScopedListWarningData struct {
  1072. // Key: [Output Only] A key that provides more detail on the warning
  1073. // being returned. For example, for warnings where there are no results
  1074. // in a list request for a particular zone, this key might be scope and
  1075. // the key value might be the zone name. Other examples might be a key
  1076. // indicating a deprecated resource and a suggested replacement, or a
  1077. // warning about invalid network settings (for example, if an instance
  1078. // attempts to perform IP forwarding but is not enabled for IP
  1079. // forwarding).
  1080. Key string `json:"key,omitempty"`
  1081. // Value: [Output Only] A warning data value corresponding to the key.
  1082. Value string `json:"value,omitempty"`
  1083. // ForceSendFields is a list of field names (e.g. "Key") to
  1084. // unconditionally include in API requests. By default, fields with
  1085. // empty values are omitted from API requests. However, any non-pointer,
  1086. // non-interface field appearing in ForceSendFields will be sent to the
  1087. // server regardless of whether the field is empty or not. This may be
  1088. // used to include empty fields in Patch requests.
  1089. ForceSendFields []string `json:"-"`
  1090. // NullFields is a list of field names (e.g. "Key") to include in API
  1091. // requests with the JSON null value. By default, fields with empty
  1092. // values are omitted from API requests. However, any field with an
  1093. // empty value appearing in NullFields will be sent to the server as
  1094. // null. It is an error if a field in this list has a non-empty value.
  1095. // This may be used to include null fields in Patch requests.
  1096. NullFields []string `json:"-"`
  1097. }
  1098. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1099. type NoMethod AcceleratorTypesScopedListWarningData
  1100. raw := NoMethod(*s)
  1101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1102. }
  1103. // AccessConfig: An access configuration attached to an instance's
  1104. // network interface. Only one access config per instance is supported.
  1105. type AccessConfig struct {
  1106. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1107. // for access configs.
  1108. Kind string `json:"kind,omitempty"`
  1109. // Name: The name of this access configuration. The default and
  1110. // recommended name is External NAT but you can use any arbitrary string
  1111. // you would like. For example, My external IP or Network Access.
  1112. Name string `json:"name,omitempty"`
  1113. // NatIP: An external IP address associated with this instance. Specify
  1114. // an unused static external IP address available to the project or
  1115. // leave this field undefined to use an IP from a shared ephemeral IP
  1116. // address pool. If you specify a static external IP address, it must
  1117. // live in the same region as the zone of the instance.
  1118. NatIP string `json:"natIP,omitempty"`
  1119. // NetworkTier: This signifies the networking tier used for configuring
  1120. // this access configuration and can only take the following values:
  1121. // PREMIUM, STANDARD.
  1122. //
  1123. // If an AccessConfig is specified without a valid external IP address,
  1124. // an ephemeral IP will be created with this networkTier.
  1125. //
  1126. // If an AccessConfig with a valid external IP address is specified, it
  1127. // must match that of the networkTier associated with the Address
  1128. // resource owning that IP.
  1129. //
  1130. // Possible values:
  1131. // "PREMIUM"
  1132. // "STANDARD"
  1133. NetworkTier string `json:"networkTier,omitempty"`
  1134. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1135. // This field can only be set when the set_public_ptr field is enabled.
  1136. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1137. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1138. // created to map the external IP address of the instance to a DNS
  1139. // domain name.
  1140. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1141. // Type: The type of configuration. The default and only option is
  1142. // ONE_TO_ONE_NAT.
  1143. //
  1144. // Possible values:
  1145. // "ONE_TO_ONE_NAT" (default)
  1146. Type string `json:"type,omitempty"`
  1147. // ForceSendFields is a list of field names (e.g. "Kind") to
  1148. // unconditionally include in API requests. By default, fields with
  1149. // empty values are omitted from API requests. However, any non-pointer,
  1150. // non-interface field appearing in ForceSendFields will be sent to the
  1151. // server regardless of whether the field is empty or not. This may be
  1152. // used to include empty fields in Patch requests.
  1153. ForceSendFields []string `json:"-"`
  1154. // NullFields is a list of field names (e.g. "Kind") to include in API
  1155. // requests with the JSON null value. By default, fields with empty
  1156. // values are omitted from API requests. However, any field with an
  1157. // empty value appearing in NullFields will be sent to the server as
  1158. // null. It is an error if a field in this list has a non-empty value.
  1159. // This may be used to include null fields in Patch requests.
  1160. NullFields []string `json:"-"`
  1161. }
  1162. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1163. type NoMethod AccessConfig
  1164. raw := NoMethod(*s)
  1165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1166. }
  1167. // Address: A reserved address resource. (== resource_for beta.addresses
  1168. // ==) (== resource_for v1.addresses ==) (== resource_for
  1169. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1170. type Address struct {
  1171. // Address: The static IP address represented by this resource.
  1172. Address string `json:"address,omitempty"`
  1173. // AddressType: The type of address to reserve, either INTERNAL or
  1174. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1175. //
  1176. // Possible values:
  1177. // "EXTERNAL"
  1178. // "INTERNAL"
  1179. // "UNSPECIFIED_TYPE"
  1180. AddressType string `json:"addressType,omitempty"`
  1181. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1182. // format.
  1183. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1184. // Description: An optional description of this resource. Provide this
  1185. // property when you create the resource.
  1186. Description string `json:"description,omitempty"`
  1187. // Id: [Output Only] The unique identifier for the resource. This
  1188. // identifier is defined by the server.
  1189. Id uint64 `json:"id,omitempty,string"`
  1190. // IpVersion: The IP Version that will be used by this address. Valid
  1191. // options are IPV4 or IPV6. This can only be specified for a global
  1192. // address.
  1193. //
  1194. // Possible values:
  1195. // "IPV4"
  1196. // "IPV6"
  1197. // "UNSPECIFIED_VERSION"
  1198. IpVersion string `json:"ipVersion,omitempty"`
  1199. // Kind: [Output Only] Type of the resource. Always compute#address for
  1200. // addresses.
  1201. Kind string `json:"kind,omitempty"`
  1202. // LabelFingerprint: A fingerprint for the labels being applied to this
  1203. // Address, which is essentially a hash of the labels set used for
  1204. // optimistic locking. The fingerprint is initially generated by Compute
  1205. // Engine and changes after every request to modify or update labels.
  1206. // You must always provide an up-to-date fingerprint hash in order to
  1207. // update or change labels, otherwise the request will fail with error
  1208. // 412 conditionNotMet.
  1209. //
  1210. // To see the latest fingerprint, make a get() request to retrieve an
  1211. // Address.
  1212. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1213. // Labels: Labels to apply to this Address resource. These can be later
  1214. // modified by the setLabels method. Each label key/value must comply
  1215. // with RFC1035. Label values may be empty.
  1216. Labels map[string]string `json:"labels,omitempty"`
  1217. // Name: Name of the resource. Provided by the client when the resource
  1218. // is created. The name must be 1-63 characters long, and comply with
  1219. // RFC1035. Specifically, the name must be 1-63 characters long and
  1220. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1221. // the first character must be a lowercase letter, and all following
  1222. // characters must be a dash, lowercase letter, or digit, except the
  1223. // last character, which cannot be a dash.
  1224. Name string `json:"name,omitempty"`
  1225. // Network: The URL of the network in which to reserve the address. This
  1226. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1227. Network string `json:"network,omitempty"`
  1228. // NetworkTier: This signifies the networking tier used for configuring
  1229. // this Address and can only take the following values: PREMIUM,
  1230. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1231. // forwarding rules can be either Premium or Standard Tier. Standard
  1232. // Tier addresses applied to regional forwarding rules can be used with
  1233. // any external load balancer. Regional forwarding rules in Premium Tier
  1234. // can only be used with a Network load balancer.
  1235. //
  1236. // If this field is not specified, it is assumed to be PREMIUM.
  1237. //
  1238. // Possible values:
  1239. // "PREMIUM"
  1240. // "STANDARD"
  1241. NetworkTier string `json:"networkTier,omitempty"`
  1242. // PrefixLength: The prefix length if the resource reprensents an IP
  1243. // range.
  1244. PrefixLength int64 `json:"prefixLength,omitempty"`
  1245. // Purpose: The purpose of resource, only used with INTERNAL type.
  1246. //
  1247. // Possible values:
  1248. // "DNS_RESOLVER"
  1249. // "GCE_ENDPOINT"
  1250. // "VPC_PEERING"
  1251. Purpose string `json:"purpose,omitempty"`
  1252. // Region: [Output Only] URL of the region where the regional address
  1253. // resides. This field is not applicable to global addresses. You must
  1254. // specify this field as part of the HTTP request URL. You cannot set
  1255. // this field in the request body.
  1256. Region string `json:"region,omitempty"`
  1257. // SelfLink: [Output Only] Server-defined URL for the resource.
  1258. SelfLink string `json:"selfLink,omitempty"`
  1259. // Status: [Output Only] The status of the address, which can be one of
  1260. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1261. // currently in the process of being reserved. A RESERVED address is
  1262. // currently reserved and available to use. An IN_USE address is
  1263. // currently being used by another resource and is not available.
  1264. //
  1265. // Possible values:
  1266. // "IN_USE"
  1267. // "RESERVED"
  1268. // "RESERVING"
  1269. Status string `json:"status,omitempty"`
  1270. // Subnetwork: The URL of the subnetwork in which to reserve the
  1271. // address. If an IP address is specified, it must be within the
  1272. // subnetwork's IP range. This field can only be used with INTERNAL type
  1273. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1274. Subnetwork string `json:"subnetwork,omitempty"`
  1275. // Users: [Output Only] The URLs of the resources that are using this
  1276. // address.
  1277. Users []string `json:"users,omitempty"`
  1278. // ServerResponse contains the HTTP response code and headers from the
  1279. // server.
  1280. googleapi.ServerResponse `json:"-"`
  1281. // ForceSendFields is a list of field names (e.g. "Address") to
  1282. // unconditionally include in API requests. By default, fields with
  1283. // empty values are omitted from API requests. However, any non-pointer,
  1284. // non-interface field appearing in ForceSendFields will be sent to the
  1285. // server regardless of whether the field is empty or not. This may be
  1286. // used to include empty fields in Patch requests.
  1287. ForceSendFields []string `json:"-"`
  1288. // NullFields is a list of field names (e.g. "Address") to include in
  1289. // API requests with the JSON null value. By default, fields with empty
  1290. // values are omitted from API requests. However, any field with an
  1291. // empty value appearing in NullFields will be sent to the server as
  1292. // null. It is an error if a field in this list has a non-empty value.
  1293. // This may be used to include null fields in Patch requests.
  1294. NullFields []string `json:"-"`
  1295. }
  1296. func (s *Address) MarshalJSON() ([]byte, error) {
  1297. type NoMethod Address
  1298. raw := NoMethod(*s)
  1299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1300. }
  1301. type AddressAggregatedList struct {
  1302. // Id: [Output Only] Unique identifier for the resource; defined by the
  1303. // server.
  1304. Id string `json:"id,omitempty"`
  1305. // Items: A list of AddressesScopedList resources.
  1306. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1307. // Kind: [Output Only] Type of resource. Always
  1308. // compute#addressAggregatedList for aggregated lists of addresses.
  1309. Kind string `json:"kind,omitempty"`
  1310. // NextPageToken: [Output Only] This token allows you to get the next
  1311. // page of results for list requests. If the number of results is larger
  1312. // than maxResults, use the nextPageToken as a value for the query
  1313. // parameter pageToken in the next list request. Subsequent list
  1314. // requests will have their own nextPageToken to continue paging through
  1315. // the results.
  1316. NextPageToken string `json:"nextPageToken,omitempty"`
  1317. // SelfLink: [Output Only] Server-defined URL for this resource.
  1318. SelfLink string `json:"selfLink,omitempty"`
  1319. // Warning: [Output Only] Informational warning message.
  1320. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1321. // ServerResponse contains the HTTP response code and headers from the
  1322. // server.
  1323. googleapi.ServerResponse `json:"-"`
  1324. // ForceSendFields is a list of field names (e.g. "Id") to
  1325. // unconditionally include in API requests. By default, fields with
  1326. // empty values are omitted from API requests. However, any non-pointer,
  1327. // non-interface field appearing in ForceSendFields will be sent to the
  1328. // server regardless of whether the field is empty or not. This may be
  1329. // used to include empty fields in Patch requests.
  1330. ForceSendFields []string `json:"-"`
  1331. // NullFields is a list of field names (e.g. "Id") to include in API
  1332. // requests with the JSON null value. By default, fields with empty
  1333. // values are omitted from API requests. However, any field with an
  1334. // empty value appearing in NullFields will be sent to the server as
  1335. // null. It is an error if a field in this list has a non-empty value.
  1336. // This may be used to include null fields in Patch requests.
  1337. NullFields []string `json:"-"`
  1338. }
  1339. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1340. type NoMethod AddressAggregatedList
  1341. raw := NoMethod(*s)
  1342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1343. }
  1344. // AddressAggregatedListWarning: [Output Only] Informational warning
  1345. // message.
  1346. type AddressAggregatedListWarning struct {
  1347. // Code: [Output Only] A warning code, if applicable. For example,
  1348. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1349. // the response.
  1350. //
  1351. // Possible values:
  1352. // "CLEANUP_FAILED"
  1353. // "DEPRECATED_RESOURCE_USED"
  1354. // "DEPRECATED_TYPE_USED"
  1355. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1356. // "EXPERIMENTAL_TYPE_USED"
  1357. // "EXTERNAL_API_WARNING"
  1358. // "FIELD_VALUE_OVERRIDEN"
  1359. // "INJECTED_KERNELS_DEPRECATED"
  1360. // "MISSING_TYPE_DEPENDENCY"
  1361. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1362. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1363. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1364. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1365. // "NEXT_HOP_NOT_RUNNING"
  1366. // "NOT_CRITICAL_ERROR"
  1367. // "NO_RESULTS_ON_PAGE"
  1368. // "REQUIRED_TOS_AGREEMENT"
  1369. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1370. // "RESOURCE_NOT_DELETED"
  1371. // "SCHEMA_VALIDATION_IGNORED"
  1372. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1373. // "UNDECLARED_PROPERTIES"
  1374. // "UNREACHABLE"
  1375. Code string `json:"code,omitempty"`
  1376. // Data: [Output Only] Metadata about this warning in key: value format.
  1377. // For example:
  1378. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1379. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1380. // Message: [Output Only] A human-readable description of the warning
  1381. // code.
  1382. Message string `json:"message,omitempty"`
  1383. // ForceSendFields is a list of field names (e.g. "Code") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. // NullFields is a list of field names (e.g. "Code") to include in API
  1391. // requests with the JSON null value. By default, fields with empty
  1392. // values are omitted from API requests. However, any field with an
  1393. // empty value appearing in NullFields will be sent to the server as
  1394. // null. It is an error if a field in this list has a non-empty value.
  1395. // This may be used to include null fields in Patch requests.
  1396. NullFields []string `json:"-"`
  1397. }
  1398. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1399. type NoMethod AddressAggregatedListWarning
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. type AddressAggregatedListWarningData struct {
  1404. // Key: [Output Only] A key that provides more detail on the warning
  1405. // being returned. For example, for warnings where there are no results
  1406. // in a list request for a particular zone, this key might be scope and
  1407. // the key value might be the zone name. Other examples might be a key
  1408. // indicating a deprecated resource and a suggested replacement, or a
  1409. // warning about invalid network settings (for example, if an instance
  1410. // attempts to perform IP forwarding but is not enabled for IP
  1411. // forwarding).
  1412. Key string `json:"key,omitempty"`
  1413. // Value: [Output Only] A warning data value corresponding to the key.
  1414. Value string `json:"value,omitempty"`
  1415. // ForceSendFields is a list of field names (e.g. "Key") to
  1416. // unconditionally include in API requests. By default, fields with
  1417. // empty values are omitted from API requests. However, any non-pointer,
  1418. // non-interface field appearing in ForceSendFields will be sent to the
  1419. // server regardless of whether the field is empty or not. This may be
  1420. // used to include empty fields in Patch requests.
  1421. ForceSendFields []string `json:"-"`
  1422. // NullFields is a list of field names (e.g. "Key") to include in API
  1423. // requests with the JSON null value. By default, fields with empty
  1424. // values are omitted from API requests. However, any field with an
  1425. // empty value appearing in NullFields will be sent to the server as
  1426. // null. It is an error if a field in this list has a non-empty value.
  1427. // This may be used to include null fields in Patch requests.
  1428. NullFields []string `json:"-"`
  1429. }
  1430. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1431. type NoMethod AddressAggregatedListWarningData
  1432. raw := NoMethod(*s)
  1433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1434. }
  1435. // AddressList: Contains a list of addresses.
  1436. type AddressList struct {
  1437. // Id: [Output Only] Unique identifier for the resource; defined by the
  1438. // server.
  1439. Id string `json:"id,omitempty"`
  1440. // Items: A list of Address resources.
  1441. Items []*Address `json:"items,omitempty"`
  1442. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1443. // lists of addresses.
  1444. Kind string `json:"kind,omitempty"`
  1445. // NextPageToken: [Output Only] This token allows you to get the next
  1446. // page of results for list requests. If the number of results is larger
  1447. // than maxResults, use the nextPageToken as a value for the query
  1448. // parameter pageToken in the next list request. Subsequent list
  1449. // requests will have their own nextPageToken to continue paging through
  1450. // the results.
  1451. NextPageToken string `json:"nextPageToken,omitempty"`
  1452. // SelfLink: [Output Only] Server-defined URL for this resource.
  1453. SelfLink string `json:"selfLink,omitempty"`
  1454. // Warning: [Output Only] Informational warning message.
  1455. Warning *AddressListWarning `json:"warning,omitempty"`
  1456. // ServerResponse contains the HTTP response code and headers from the
  1457. // server.
  1458. googleapi.ServerResponse `json:"-"`
  1459. // ForceSendFields is a list of field names (e.g. "Id") to
  1460. // unconditionally include in API requests. By default, fields with
  1461. // empty values are omitted from API requests. However, any non-pointer,
  1462. // non-interface field appearing in ForceSendFields will be sent to the
  1463. // server regardless of whether the field is empty or not. This may be
  1464. // used to include empty fields in Patch requests.
  1465. ForceSendFields []string `json:"-"`
  1466. // NullFields is a list of field names (e.g. "Id") to include in API
  1467. // requests with the JSON null value. By default, fields with empty
  1468. // values are omitted from API requests. However, any field with an
  1469. // empty value appearing in NullFields will be sent to the server as
  1470. // null. It is an error if a field in this list has a non-empty value.
  1471. // This may be used to include null fields in Patch requests.
  1472. NullFields []string `json:"-"`
  1473. }
  1474. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1475. type NoMethod AddressList
  1476. raw := NoMethod(*s)
  1477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1478. }
  1479. // AddressListWarning: [Output Only] Informational warning message.
  1480. type AddressListWarning struct {
  1481. // Code: [Output Only] A warning code, if applicable. For example,
  1482. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1483. // the response.
  1484. //
  1485. // Possible values:
  1486. // "CLEANUP_FAILED"
  1487. // "DEPRECATED_RESOURCE_USED"
  1488. // "DEPRECATED_TYPE_USED"
  1489. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1490. // "EXPERIMENTAL_TYPE_USED"
  1491. // "EXTERNAL_API_WARNING"
  1492. // "FIELD_VALUE_OVERRIDEN"
  1493. // "INJECTED_KERNELS_DEPRECATED"
  1494. // "MISSING_TYPE_DEPENDENCY"
  1495. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1496. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1497. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1498. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1499. // "NEXT_HOP_NOT_RUNNING"
  1500. // "NOT_CRITICAL_ERROR"
  1501. // "NO_RESULTS_ON_PAGE"
  1502. // "REQUIRED_TOS_AGREEMENT"
  1503. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1504. // "RESOURCE_NOT_DELETED"
  1505. // "SCHEMA_VALIDATION_IGNORED"
  1506. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1507. // "UNDECLARED_PROPERTIES"
  1508. // "UNREACHABLE"
  1509. Code string `json:"code,omitempty"`
  1510. // Data: [Output Only] Metadata about this warning in key: value format.
  1511. // For example:
  1512. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1513. Data []*AddressListWarningData `json:"data,omitempty"`
  1514. // Message: [Output Only] A human-readable description of the warning
  1515. // code.
  1516. Message string `json:"message,omitempty"`
  1517. // ForceSendFields is a list of field names (e.g. "Code") to
  1518. // unconditionally include in API requests. By default, fields with
  1519. // empty values are omitted from API requests. However, any non-pointer,
  1520. // non-interface field appearing in ForceSendFields will be sent to the
  1521. // server regardless of whether the field is empty or not. This may be
  1522. // used to include empty fields in Patch requests.
  1523. ForceSendFields []string `json:"-"`
  1524. // NullFields is a list of field names (e.g. "Code") to include in API
  1525. // requests with the JSON null value. By default, fields with empty
  1526. // values are omitted from API requests. However, any field with an
  1527. // empty value appearing in NullFields will be sent to the server as
  1528. // null. It is an error if a field in this list has a non-empty value.
  1529. // This may be used to include null fields in Patch requests.
  1530. NullFields []string `json:"-"`
  1531. }
  1532. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1533. type NoMethod AddressListWarning
  1534. raw := NoMethod(*s)
  1535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1536. }
  1537. type AddressListWarningData struct {
  1538. // Key: [Output Only] A key that provides more detail on the warning
  1539. // being returned. For example, for warnings where there are no results
  1540. // in a list request for a particular zone, this key might be scope and
  1541. // the key value might be the zone name. Other examples might be a key
  1542. // indicating a deprecated resource and a suggested replacement, or a
  1543. // warning about invalid network settings (for example, if an instance
  1544. // attempts to perform IP forwarding but is not enabled for IP
  1545. // forwarding).
  1546. Key string `json:"key,omitempty"`
  1547. // Value: [Output Only] A warning data value corresponding to the key.
  1548. Value string `json:"value,omitempty"`
  1549. // ForceSendFields is a list of field names (e.g. "Key") to
  1550. // unconditionally include in API requests. By default, fields with
  1551. // empty values are omitted from API requests. However, any non-pointer,
  1552. // non-interface field appearing in ForceSendFields will be sent to the
  1553. // server regardless of whether the field is empty or not. This may be
  1554. // used to include empty fields in Patch requests.
  1555. ForceSendFields []string `json:"-"`
  1556. // NullFields is a list of field names (e.g. "Key") to include in API
  1557. // requests with the JSON null value. By default, fields with empty
  1558. // values are omitted from API requests. However, any field with an
  1559. // empty value appearing in NullFields will be sent to the server as
  1560. // null. It is an error if a field in this list has a non-empty value.
  1561. // This may be used to include null fields in Patch requests.
  1562. NullFields []string `json:"-"`
  1563. }
  1564. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1565. type NoMethod AddressListWarningData
  1566. raw := NoMethod(*s)
  1567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1568. }
  1569. type AddressesScopedList struct {
  1570. // Addresses: [Output Only] A list of addresses contained in this scope.
  1571. Addresses []*Address `json:"addresses,omitempty"`
  1572. // Warning: [Output Only] Informational warning which replaces the list
  1573. // of addresses when the list is empty.
  1574. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1575. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1576. // unconditionally include in API requests. By default, fields with
  1577. // empty values are omitted from API requests. However, any non-pointer,
  1578. // non-interface field appearing in ForceSendFields will be sent to the
  1579. // server regardless of whether the field is empty or not. This may be
  1580. // used to include empty fields in Patch requests.
  1581. ForceSendFields []string `json:"-"`
  1582. // NullFields is a list of field names (e.g. "Addresses") to include in
  1583. // API requests with the JSON null value. By default, fields with empty
  1584. // values are omitted from API requests. However, any field with an
  1585. // empty value appearing in NullFields will be sent to the server as
  1586. // null. It is an error if a field in this list has a non-empty value.
  1587. // This may be used to include null fields in Patch requests.
  1588. NullFields []string `json:"-"`
  1589. }
  1590. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1591. type NoMethod AddressesScopedList
  1592. raw := NoMethod(*s)
  1593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1594. }
  1595. // AddressesScopedListWarning: [Output Only] Informational warning which
  1596. // replaces the list of addresses when the list is empty.
  1597. type AddressesScopedListWarning struct {
  1598. // Code: [Output Only] A warning code, if applicable. For example,
  1599. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1600. // the response.
  1601. //
  1602. // Possible values:
  1603. // "CLEANUP_FAILED"
  1604. // "DEPRECATED_RESOURCE_USED"
  1605. // "DEPRECATED_TYPE_USED"
  1606. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1607. // "EXPERIMENTAL_TYPE_USED"
  1608. // "EXTERNAL_API_WARNING"
  1609. // "FIELD_VALUE_OVERRIDEN"
  1610. // "INJECTED_KERNELS_DEPRECATED"
  1611. // "MISSING_TYPE_DEPENDENCY"
  1612. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1613. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1614. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1615. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1616. // "NEXT_HOP_NOT_RUNNING"
  1617. // "NOT_CRITICAL_ERROR"
  1618. // "NO_RESULTS_ON_PAGE"
  1619. // "REQUIRED_TOS_AGREEMENT"
  1620. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1621. // "RESOURCE_NOT_DELETED"
  1622. // "SCHEMA_VALIDATION_IGNORED"
  1623. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1624. // "UNDECLARED_PROPERTIES"
  1625. // "UNREACHABLE"
  1626. Code string `json:"code,omitempty"`
  1627. // Data: [Output Only] Metadata about this warning in key: value format.
  1628. // For example:
  1629. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1630. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1631. // Message: [Output Only] A human-readable description of the warning
  1632. // code.
  1633. Message string `json:"message,omitempty"`
  1634. // ForceSendFields is a list of field names (e.g. "Code") to
  1635. // unconditionally include in API requests. By default, fields with
  1636. // empty values are omitted from API requests. However, any non-pointer,
  1637. // non-interface field appearing in ForceSendFields will be sent to the
  1638. // server regardless of whether the field is empty or not. This may be
  1639. // used to include empty fields in Patch requests.
  1640. ForceSendFields []string `json:"-"`
  1641. // NullFields is a list of field names (e.g. "Code") to include in API
  1642. // requests with the JSON null value. By default, fields with empty
  1643. // values are omitted from API requests. However, any field with an
  1644. // empty value appearing in NullFields will be sent to the server as
  1645. // null. It is an error if a field in this list has a non-empty value.
  1646. // This may be used to include null fields in Patch requests.
  1647. NullFields []string `json:"-"`
  1648. }
  1649. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1650. type NoMethod AddressesScopedListWarning
  1651. raw := NoMethod(*s)
  1652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1653. }
  1654. type AddressesScopedListWarningData struct {
  1655. // Key: [Output Only] A key that provides more detail on the warning
  1656. // being returned. For example, for warnings where there are no results
  1657. // in a list request for a particular zone, this key might be scope and
  1658. // the key value might be the zone name. Other examples might be a key
  1659. // indicating a deprecated resource and a suggested replacement, or a
  1660. // warning about invalid network settings (for example, if an instance
  1661. // attempts to perform IP forwarding but is not enabled for IP
  1662. // forwarding).
  1663. Key string `json:"key,omitempty"`
  1664. // Value: [Output Only] A warning data value corresponding to the key.
  1665. Value string `json:"value,omitempty"`
  1666. // ForceSendFields is a list of field names (e.g. "Key") to
  1667. // unconditionally include in API requests. By default, fields with
  1668. // empty values are omitted from API requests. However, any non-pointer,
  1669. // non-interface field appearing in ForceSendFields will be sent to the
  1670. // server regardless of whether the field is empty or not. This may be
  1671. // used to include empty fields in Patch requests.
  1672. ForceSendFields []string `json:"-"`
  1673. // NullFields is a list of field names (e.g. "Key") to include in API
  1674. // requests with the JSON null value. By default, fields with empty
  1675. // values are omitted from API requests. However, any field with an
  1676. // empty value appearing in NullFields will be sent to the server as
  1677. // null. It is an error if a field in this list has a non-empty value.
  1678. // This may be used to include null fields in Patch requests.
  1679. NullFields []string `json:"-"`
  1680. }
  1681. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1682. type NoMethod AddressesScopedListWarningData
  1683. raw := NoMethod(*s)
  1684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1685. }
  1686. // AliasIpRange: An alias IP range attached to an instance's network
  1687. // interface.
  1688. type AliasIpRange struct {
  1689. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1690. // This IP CIDR range must belong to the specified subnetwork and cannot
  1691. // contain IP addresses reserved by system or used by other network
  1692. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1693. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1694. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1695. // SubnetworkRangeName: Optional subnetwork secondary range name
  1696. // specifying the secondary range from which to allocate the IP CIDR
  1697. // range for this alias IP range. If left unspecified, the primary range
  1698. // of the subnetwork will be used.
  1699. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1700. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1701. // unconditionally include in API requests. By default, fields with
  1702. // empty values are omitted from API requests. However, any non-pointer,
  1703. // non-interface field appearing in ForceSendFields will be sent to the
  1704. // server regardless of whether the field is empty or not. This may be
  1705. // used to include empty fields in Patch requests.
  1706. ForceSendFields []string `json:"-"`
  1707. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1708. // in API requests with the JSON null value. By default, fields with
  1709. // empty values are omitted from API requests. However, any field with
  1710. // an empty value appearing in NullFields will be sent to the server as
  1711. // null. It is an error if a field in this list has a non-empty value.
  1712. // This may be used to include null fields in Patch requests.
  1713. NullFields []string `json:"-"`
  1714. }
  1715. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1716. type NoMethod AliasIpRange
  1717. raw := NoMethod(*s)
  1718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1719. }
  1720. // Allocation: Allocation resource
  1721. type Allocation struct {
  1722. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1723. // format.
  1724. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1725. Description string `json:"description,omitempty"`
  1726. // Id: [Output Only] The unique identifier for the resource. This
  1727. // identifier is defined by the server.
  1728. Id uint64 `json:"id,omitempty,string"`
  1729. // Kind: [Output Only] Type of the resource. Always compute#allocations
  1730. // for allocations.
  1731. Kind string `json:"kind,omitempty"`
  1732. // Name: The name of the resource, provided by the client when initially
  1733. // creating the resource. The resource name must be 1-63 characters
  1734. // long, and comply with RFC1035. Specifically, the name must be 1-63
  1735. // characters long and match the regular expression
  1736. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  1737. // a lowercase letter, and all following characters must be a dash,
  1738. // lowercase letter, or digit, except the last character, which cannot
  1739. // be a dash.
  1740. Name string `json:"name,omitempty"`
  1741. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1742. // resource.
  1743. SelfLink string `json:"selfLink,omitempty"`
  1744. SpecificAllocation *AllocationSpecificSKUAllocation `json:"specificAllocation,omitempty"`
  1745. // SpecificAllocationRequired: Indicates whether the allocation can be
  1746. // consumed by VMs with "any allocation" defined. If the field is set,
  1747. // then only VMs that target the allocation by name using
  1748. // --allocation-affinity can consume this allocation.
  1749. SpecificAllocationRequired bool `json:"specificAllocationRequired,omitempty"`
  1750. Zone string `json:"zone,omitempty"`
  1751. // ServerResponse contains the HTTP response code and headers from the
  1752. // server.
  1753. googleapi.ServerResponse `json:"-"`
  1754. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1755. // to unconditionally include in API requests. By default, fields with
  1756. // empty values are omitted from API requests. However, any non-pointer,
  1757. // non-interface field appearing in ForceSendFields will be sent to the
  1758. // server regardless of whether the field is empty or not. This may be
  1759. // used to include empty fields in Patch requests.
  1760. ForceSendFields []string `json:"-"`
  1761. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  1762. // include in API requests with the JSON null value. By default, fields
  1763. // with empty values are omitted from API requests. However, any field
  1764. // with an empty value appearing in NullFields will be sent to the
  1765. // server as null. It is an error if a field in this list has a
  1766. // non-empty value. This may be used to include null fields in Patch
  1767. // requests.
  1768. NullFields []string `json:"-"`
  1769. }
  1770. func (s *Allocation) MarshalJSON() ([]byte, error) {
  1771. type NoMethod Allocation
  1772. raw := NoMethod(*s)
  1773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1774. }
  1775. // AllocationAffinity: AllocationAffinity is the configuration of
  1776. // desired allocation which this instance could take capacity from.
  1777. type AllocationAffinity struct {
  1778. // Possible values:
  1779. // "ANY_ALLOCATION"
  1780. // "NO_ALLOCATION"
  1781. // "SPECIFIC_ALLOCATION"
  1782. // "UNSPECIFIED"
  1783. ConsumeAllocationType string `json:"consumeAllocationType,omitempty"`
  1784. // Key: Corresponds to the label key of allocation resource.
  1785. Key string `json:"key,omitempty"`
  1786. // Values: Corresponds to the label values of allocation resource.
  1787. Values []string `json:"values,omitempty"`
  1788. // ForceSendFields is a list of field names (e.g.
  1789. // "ConsumeAllocationType") to unconditionally include in API requests.
  1790. // By default, fields with empty values are omitted from API requests.
  1791. // However, any non-pointer, non-interface field appearing in
  1792. // ForceSendFields will be sent to the server regardless of whether the
  1793. // field is empty or not. This may be used to include empty fields in
  1794. // Patch requests.
  1795. ForceSendFields []string `json:"-"`
  1796. // NullFields is a list of field names (e.g. "ConsumeAllocationType") to
  1797. // include in API requests with the JSON null value. By default, fields
  1798. // with empty values are omitted from API requests. However, any field
  1799. // with an empty value appearing in NullFields will be sent to the
  1800. // server as null. It is an error if a field in this list has a
  1801. // non-empty value. This may be used to include null fields in Patch
  1802. // requests.
  1803. NullFields []string `json:"-"`
  1804. }
  1805. func (s *AllocationAffinity) MarshalJSON() ([]byte, error) {
  1806. type NoMethod AllocationAffinity
  1807. raw := NoMethod(*s)
  1808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1809. }
  1810. // AllocationAggregatedList: Contains a list of allocations.
  1811. type AllocationAggregatedList struct {
  1812. // Id: [Output Only] Unique identifier for the resource; defined by the
  1813. // server.
  1814. Id string `json:"id,omitempty"`
  1815. // Items: A list of Allocation resources.
  1816. Items map[string]AllocationsScopedList `json:"items,omitempty"`
  1817. // Kind: Type of resource.
  1818. Kind string `json:"kind,omitempty"`
  1819. // NextPageToken: [Output Only] This token allows you to get the next
  1820. // page of results for list requests. If the number of results is larger
  1821. // than maxResults, use the nextPageToken as a value for the query
  1822. // parameter pageToken in the next list request. Subsequent list
  1823. // requests will have their own nextPageToken to continue paging through
  1824. // the results.
  1825. NextPageToken string `json:"nextPageToken,omitempty"`
  1826. // SelfLink: [Output Only] Server-defined URL for this resource.
  1827. SelfLink string `json:"selfLink,omitempty"`
  1828. // Warning: [Output Only] Informational warning message.
  1829. Warning *AllocationAggregatedListWarning `json:"warning,omitempty"`
  1830. // ServerResponse contains the HTTP response code and headers from the
  1831. // server.
  1832. googleapi.ServerResponse `json:"-"`
  1833. // ForceSendFields is a list of field names (e.g. "Id") to
  1834. // unconditionally include in API requests. By default, fields with
  1835. // empty values are omitted from API requests. However, any non-pointer,
  1836. // non-interface field appearing in ForceSendFields will be sent to the
  1837. // server regardless of whether the field is empty or not. This may be
  1838. // used to include empty fields in Patch requests.
  1839. ForceSendFields []string `json:"-"`
  1840. // NullFields is a list of field names (e.g. "Id") to include in API
  1841. // requests with the JSON null value. By default, fields with empty
  1842. // values are omitted from API requests. However, any field with an
  1843. // empty value appearing in NullFields will be sent to the server as
  1844. // null. It is an error if a field in this list has a non-empty value.
  1845. // This may be used to include null fields in Patch requests.
  1846. NullFields []string `json:"-"`
  1847. }
  1848. func (s *AllocationAggregatedList) MarshalJSON() ([]byte, error) {
  1849. type NoMethod AllocationAggregatedList
  1850. raw := NoMethod(*s)
  1851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1852. }
  1853. // AllocationAggregatedListWarning: [Output Only] Informational warning
  1854. // message.
  1855. type AllocationAggregatedListWarning struct {
  1856. // Code: [Output Only] A warning code, if applicable. For example,
  1857. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1858. // the response.
  1859. //
  1860. // Possible values:
  1861. // "CLEANUP_FAILED"
  1862. // "DEPRECATED_RESOURCE_USED"
  1863. // "DEPRECATED_TYPE_USED"
  1864. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1865. // "EXPERIMENTAL_TYPE_USED"
  1866. // "EXTERNAL_API_WARNING"
  1867. // "FIELD_VALUE_OVERRIDEN"
  1868. // "INJECTED_KERNELS_DEPRECATED"
  1869. // "MISSING_TYPE_DEPENDENCY"
  1870. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1871. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1872. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1873. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1874. // "NEXT_HOP_NOT_RUNNING"
  1875. // "NOT_CRITICAL_ERROR"
  1876. // "NO_RESULTS_ON_PAGE"
  1877. // "REQUIRED_TOS_AGREEMENT"
  1878. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1879. // "RESOURCE_NOT_DELETED"
  1880. // "SCHEMA_VALIDATION_IGNORED"
  1881. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1882. // "UNDECLARED_PROPERTIES"
  1883. // "UNREACHABLE"
  1884. Code string `json:"code,omitempty"`
  1885. // Data: [Output Only] Metadata about this warning in key: value format.
  1886. // For example:
  1887. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1888. Data []*AllocationAggregatedListWarningData `json:"data,omitempty"`
  1889. // Message: [Output Only] A human-readable description of the warning
  1890. // code.
  1891. Message string `json:"message,omitempty"`
  1892. // ForceSendFields is a list of field names (e.g. "Code") to
  1893. // unconditionally include in API requests. By default, fields with
  1894. // empty values are omitted from API requests. However, any non-pointer,
  1895. // non-interface field appearing in ForceSendFields will be sent to the
  1896. // server regardless of whether the field is empty or not. This may be
  1897. // used to include empty fields in Patch requests.
  1898. ForceSendFields []string `json:"-"`
  1899. // NullFields is a list of field names (e.g. "Code") to include in API
  1900. // requests with the JSON null value. By default, fields with empty
  1901. // values are omitted from API requests. However, any field with an
  1902. // empty value appearing in NullFields will be sent to the server as
  1903. // null. It is an error if a field in this list has a non-empty value.
  1904. // This may be used to include null fields in Patch requests.
  1905. NullFields []string `json:"-"`
  1906. }
  1907. func (s *AllocationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1908. type NoMethod AllocationAggregatedListWarning
  1909. raw := NoMethod(*s)
  1910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1911. }
  1912. type AllocationAggregatedListWarningData struct {
  1913. // Key: [Output Only] A key that provides more detail on the warning
  1914. // being returned. For example, for warnings where there are no results
  1915. // in a list request for a particular zone, this key might be scope and
  1916. // the key value might be the zone name. Other examples might be a key
  1917. // indicating a deprecated resource and a suggested replacement, or a
  1918. // warning about invalid network settings (for example, if an instance
  1919. // attempts to perform IP forwarding but is not enabled for IP
  1920. // forwarding).
  1921. Key string `json:"key,omitempty"`
  1922. // Value: [Output Only] A warning data value corresponding to the key.
  1923. Value string `json:"value,omitempty"`
  1924. // ForceSendFields is a list of field names (e.g. "Key") to
  1925. // unconditionally include in API requests. By default, fields with
  1926. // empty values are omitted from API requests. However, any non-pointer,
  1927. // non-interface field appearing in ForceSendFields will be sent to the
  1928. // server regardless of whether the field is empty or not. This may be
  1929. // used to include empty fields in Patch requests.
  1930. ForceSendFields []string `json:"-"`
  1931. // NullFields is a list of field names (e.g. "Key") to include in API
  1932. // requests with the JSON null value. By default, fields with empty
  1933. // values are omitted from API requests. However, any field with an
  1934. // empty value appearing in NullFields will be sent to the server as
  1935. // null. It is an error if a field in this list has a non-empty value.
  1936. // This may be used to include null fields in Patch requests.
  1937. NullFields []string `json:"-"`
  1938. }
  1939. func (s *AllocationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1940. type NoMethod AllocationAggregatedListWarningData
  1941. raw := NoMethod(*s)
  1942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1943. }
  1944. type AllocationList struct {
  1945. // Id: [Output Only] The unique identifier for the resource. This
  1946. // identifier is defined by the server.
  1947. Id string `json:"id,omitempty"`
  1948. // Items: [Output Only] A list of Allocation resources.
  1949. Items []*Allocation `json:"items,omitempty"`
  1950. // Kind: [Output Only] Type of resource.Always compute#allocationsList
  1951. // for listsof allocations
  1952. Kind string `json:"kind,omitempty"`
  1953. // NextPageToken: [Output Only] This token allows you to get the next
  1954. // page of results for list requests. If the number of results is larger
  1955. // than maxResults, use the nextPageToken as a value for the query
  1956. // parameter pageToken in the next list request. Subsequent list
  1957. // requests will have their own nextPageToken to continue paging through
  1958. // the results.
  1959. NextPageToken string `json:"nextPageToken,omitempty"`
  1960. // SelfLink: [Output Only] Server-defined URL for this resource.
  1961. SelfLink string `json:"selfLink,omitempty"`
  1962. // Warning: [Output Only] Informational warning message.
  1963. Warning *AllocationListWarning `json:"warning,omitempty"`
  1964. // ServerResponse contains the HTTP response code and headers from the
  1965. // server.
  1966. googleapi.ServerResponse `json:"-"`
  1967. // ForceSendFields is a list of field names (e.g. "Id") to
  1968. // unconditionally include in API requests. By default, fields with
  1969. // empty values are omitted from API requests. However, any non-pointer,
  1970. // non-interface field appearing in ForceSendFields will be sent to the
  1971. // server regardless of whether the field is empty or not. This may be
  1972. // used to include empty fields in Patch requests.
  1973. ForceSendFields []string `json:"-"`
  1974. // NullFields is a list of field names (e.g. "Id") to include in API
  1975. // requests with the JSON null value. By default, fields with empty
  1976. // values are omitted from API requests. However, any field with an
  1977. // empty value appearing in NullFields will be sent to the server as
  1978. // null. It is an error if a field in this list has a non-empty value.
  1979. // This may be used to include null fields in Patch requests.
  1980. NullFields []string `json:"-"`
  1981. }
  1982. func (s *AllocationList) MarshalJSON() ([]byte, error) {
  1983. type NoMethod AllocationList
  1984. raw := NoMethod(*s)
  1985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1986. }
  1987. // AllocationListWarning: [Output Only] Informational warning message.
  1988. type AllocationListWarning struct {
  1989. // Code: [Output Only] A warning code, if applicable. For example,
  1990. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1991. // the response.
  1992. //
  1993. // Possible values:
  1994. // "CLEANUP_FAILED"
  1995. // "DEPRECATED_RESOURCE_USED"
  1996. // "DEPRECATED_TYPE_USED"
  1997. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1998. // "EXPERIMENTAL_TYPE_USED"
  1999. // "EXTERNAL_API_WARNING"
  2000. // "FIELD_VALUE_OVERRIDEN"
  2001. // "INJECTED_KERNELS_DEPRECATED"
  2002. // "MISSING_TYPE_DEPENDENCY"
  2003. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2004. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2005. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2006. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2007. // "NEXT_HOP_NOT_RUNNING"
  2008. // "NOT_CRITICAL_ERROR"
  2009. // "NO_RESULTS_ON_PAGE"
  2010. // "REQUIRED_TOS_AGREEMENT"
  2011. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2012. // "RESOURCE_NOT_DELETED"
  2013. // "SCHEMA_VALIDATION_IGNORED"
  2014. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2015. // "UNDECLARED_PROPERTIES"
  2016. // "UNREACHABLE"
  2017. Code string `json:"code,omitempty"`
  2018. // Data: [Output Only] Metadata about this warning in key: value format.
  2019. // For example:
  2020. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2021. Data []*AllocationListWarningData `json:"data,omitempty"`
  2022. // Message: [Output Only] A human-readable description of the warning
  2023. // code.
  2024. Message string `json:"message,omitempty"`
  2025. // ForceSendFields is a list of field names (e.g. "Code") to
  2026. // unconditionally include in API requests. By default, fields with
  2027. // empty values are omitted from API requests. However, any non-pointer,
  2028. // non-interface field appearing in ForceSendFields will be sent to the
  2029. // server regardless of whether the field is empty or not. This may be
  2030. // used to include empty fields in Patch requests.
  2031. ForceSendFields []string `json:"-"`
  2032. // NullFields is a list of field names (e.g. "Code") to include in API
  2033. // requests with the JSON null value. By default, fields with empty
  2034. // values are omitted from API requests. However, any field with an
  2035. // empty value appearing in NullFields will be sent to the server as
  2036. // null. It is an error if a field in this list has a non-empty value.
  2037. // This may be used to include null fields in Patch requests.
  2038. NullFields []string `json:"-"`
  2039. }
  2040. func (s *AllocationListWarning) MarshalJSON() ([]byte, error) {
  2041. type NoMethod AllocationListWarning
  2042. raw := NoMethod(*s)
  2043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2044. }
  2045. type AllocationListWarningData struct {
  2046. // Key: [Output Only] A key that provides more detail on the warning
  2047. // being returned. For example, for warnings where there are no results
  2048. // in a list request for a particular zone, this key might be scope and
  2049. // the key value might be the zone name. Other examples might be a key
  2050. // indicating a deprecated resource and a suggested replacement, or a
  2051. // warning about invalid network settings (for example, if an instance
  2052. // attempts to perform IP forwarding but is not enabled for IP
  2053. // forwarding).
  2054. Key string `json:"key,omitempty"`
  2055. // Value: [Output Only] A warning data value corresponding to the key.
  2056. Value string `json:"value,omitempty"`
  2057. // ForceSendFields is a list of field names (e.g. "Key") to
  2058. // unconditionally include in API requests. By default, fields with
  2059. // empty values are omitted from API requests. However, any non-pointer,
  2060. // non-interface field appearing in ForceSendFields will be sent to the
  2061. // server regardless of whether the field is empty or not. This may be
  2062. // used to include empty fields in Patch requests.
  2063. ForceSendFields []string `json:"-"`
  2064. // NullFields is a list of field names (e.g. "Key") to include in API
  2065. // requests with the JSON null value. By default, fields with empty
  2066. // values are omitted from API requests. However, any field with an
  2067. // empty value appearing in NullFields will be sent to the server as
  2068. // null. It is an error if a field in this list has a non-empty value.
  2069. // This may be used to include null fields in Patch requests.
  2070. NullFields []string `json:"-"`
  2071. }
  2072. func (s *AllocationListWarningData) MarshalJSON() ([]byte, error) {
  2073. type NoMethod AllocationListWarningData
  2074. raw := NoMethod(*s)
  2075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2076. }
  2077. // AllocationSpecificSKUAllocation: This allocation type allows to pre
  2078. // allocate specific instance configuration.
  2079. type AllocationSpecificSKUAllocation struct {
  2080. // Count: Specifies number of resources that are allocated.
  2081. Count int64 `json:"count,omitempty,string"`
  2082. // InUseCount: [OutputOnly] Indicates how many resource are in use.
  2083. InUseCount int64 `json:"inUseCount,omitempty,string"`
  2084. InstanceProperties *AllocationSpecificSKUAllocationAllocatedInstanceProperties `json:"instanceProperties,omitempty"`
  2085. // ForceSendFields is a list of field names (e.g. "Count") to
  2086. // unconditionally include in API requests. By default, fields with
  2087. // empty values are omitted from API requests. However, any non-pointer,
  2088. // non-interface field appearing in ForceSendFields will be sent to the
  2089. // server regardless of whether the field is empty or not. This may be
  2090. // used to include empty fields in Patch requests.
  2091. ForceSendFields []string `json:"-"`
  2092. // NullFields is a list of field names (e.g. "Count") to include in API
  2093. // requests with the JSON null value. By default, fields with empty
  2094. // values are omitted from API requests. However, any field with an
  2095. // empty value appearing in NullFields will be sent to the server as
  2096. // null. It is an error if a field in this list has a non-empty value.
  2097. // This may be used to include null fields in Patch requests.
  2098. NullFields []string `json:"-"`
  2099. }
  2100. func (s *AllocationSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
  2101. type NoMethod AllocationSpecificSKUAllocation
  2102. raw := NoMethod(*s)
  2103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2104. }
  2105. // AllocationSpecificSKUAllocationAllocatedInstanceProperties:
  2106. // Properties of the SKU instances being reserved.
  2107. type AllocationSpecificSKUAllocationAllocatedInstanceProperties struct {
  2108. // GuestAccelerators: Specifies accelerator type and count.
  2109. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  2110. // LocalSsds: Specifies amount of local ssd to reserve with each
  2111. // instance. The type of disk is local-ssd.
  2112. LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk `json:"localSsds,omitempty"`
  2113. // MachineType: Specifies type of machine (name only) which has fixed
  2114. // number of vCPUs and fixed amount of memory. This also includes
  2115. // specifying custom machine type following
  2116. // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
  2117. MachineType string `json:"machineType,omitempty"`
  2118. // MinCpuPlatform: Minimum cpu platform the allocation.
  2119. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  2120. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  2121. // to unconditionally include in API requests. By default, fields with
  2122. // empty values are omitted from API requests. However, any non-pointer,
  2123. // non-interface field appearing in ForceSendFields will be sent to the
  2124. // server regardless of whether the field is empty or not. This may be
  2125. // used to include empty fields in Patch requests.
  2126. ForceSendFields []string `json:"-"`
  2127. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  2128. // include in API requests with the JSON null value. By default, fields
  2129. // with empty values are omitted from API requests. However, any field
  2130. // with an empty value appearing in NullFields will be sent to the
  2131. // server as null. It is an error if a field in this list has a
  2132. // non-empty value. This may be used to include null fields in Patch
  2133. // requests.
  2134. NullFields []string `json:"-"`
  2135. }
  2136. func (s *AllocationSpecificSKUAllocationAllocatedInstanceProperties) MarshalJSON() ([]byte, error) {
  2137. type NoMethod AllocationSpecificSKUAllocationAllocatedInstanceProperties
  2138. raw := NoMethod(*s)
  2139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2140. }
  2141. type AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk struct {
  2142. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2143. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2144. // Interface: Specifies the disk interface to use for attaching this
  2145. // disk, which is either SCSI or NVME. The default is SCSI. For
  2146. // performance characteristics of SCSI over NVMe, see Local SSD
  2147. // performance.
  2148. //
  2149. // Possible values:
  2150. // "NVME"
  2151. // "SCSI"
  2152. Interface string `json:"interface,omitempty"`
  2153. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  2154. // unconditionally include in API requests. By default, fields with
  2155. // empty values are omitted from API requests. However, any non-pointer,
  2156. // non-interface field appearing in ForceSendFields will be sent to the
  2157. // server regardless of whether the field is empty or not. This may be
  2158. // used to include empty fields in Patch requests.
  2159. ForceSendFields []string `json:"-"`
  2160. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  2161. // API requests with the JSON null value. By default, fields with empty
  2162. // values are omitted from API requests. However, any field with an
  2163. // empty value appearing in NullFields will be sent to the server as
  2164. // null. It is an error if a field in this list has a non-empty value.
  2165. // This may be used to include null fields in Patch requests.
  2166. NullFields []string `json:"-"`
  2167. }
  2168. func (s *AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk) MarshalJSON() ([]byte, error) {
  2169. type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk
  2170. raw := NoMethod(*s)
  2171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2172. }
  2173. type AllocationsScopedList struct {
  2174. // Allocations: A list of allocations contained in this scope.
  2175. Allocations []*Allocation `json:"allocations,omitempty"`
  2176. // Warning: Informational warning which replaces the list of allocations
  2177. // when the list is empty.
  2178. Warning *AllocationsScopedListWarning `json:"warning,omitempty"`
  2179. // ForceSendFields is a list of field names (e.g. "Allocations") to
  2180. // unconditionally include in API requests. By default, fields with
  2181. // empty values are omitted from API requests. However, any non-pointer,
  2182. // non-interface field appearing in ForceSendFields will be sent to the
  2183. // server regardless of whether the field is empty or not. This may be
  2184. // used to include empty fields in Patch requests.
  2185. ForceSendFields []string `json:"-"`
  2186. // NullFields is a list of field names (e.g. "Allocations") to include
  2187. // in API requests with the JSON null value. By default, fields with
  2188. // empty values are omitted from API requests. However, any field with
  2189. // an empty value appearing in NullFields will be sent to the server as
  2190. // null. It is an error if a field in this list has a non-empty value.
  2191. // This may be used to include null fields in Patch requests.
  2192. NullFields []string `json:"-"`
  2193. }
  2194. func (s *AllocationsScopedList) MarshalJSON() ([]byte, error) {
  2195. type NoMethod AllocationsScopedList
  2196. raw := NoMethod(*s)
  2197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2198. }
  2199. // AllocationsScopedListWarning: Informational warning which replaces
  2200. // the list of allocations when the list is empty.
  2201. type AllocationsScopedListWarning struct {
  2202. // Code: [Output Only] A warning code, if applicable. For example,
  2203. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2204. // the response.
  2205. //
  2206. // Possible values:
  2207. // "CLEANUP_FAILED"
  2208. // "DEPRECATED_RESOURCE_USED"
  2209. // "DEPRECATED_TYPE_USED"
  2210. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2211. // "EXPERIMENTAL_TYPE_USED"
  2212. // "EXTERNAL_API_WARNING"
  2213. // "FIELD_VALUE_OVERRIDEN"
  2214. // "INJECTED_KERNELS_DEPRECATED"
  2215. // "MISSING_TYPE_DEPENDENCY"
  2216. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2217. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2218. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2219. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2220. // "NEXT_HOP_NOT_RUNNING"
  2221. // "NOT_CRITICAL_ERROR"
  2222. // "NO_RESULTS_ON_PAGE"
  2223. // "REQUIRED_TOS_AGREEMENT"
  2224. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2225. // "RESOURCE_NOT_DELETED"
  2226. // "SCHEMA_VALIDATION_IGNORED"
  2227. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2228. // "UNDECLARED_PROPERTIES"
  2229. // "UNREACHABLE"
  2230. Code string `json:"code,omitempty"`
  2231. // Data: [Output Only] Metadata about this warning in key: value format.
  2232. // For example:
  2233. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2234. Data []*AllocationsScopedListWarningData `json:"data,omitempty"`
  2235. // Message: [Output Only] A human-readable description of the warning
  2236. // code.
  2237. Message string `json:"message,omitempty"`
  2238. // ForceSendFields is a list of field names (e.g. "Code") to
  2239. // unconditionally include in API requests. By default, fields with
  2240. // empty values are omitted from API requests. However, any non-pointer,
  2241. // non-interface field appearing in ForceSendFields will be sent to the
  2242. // server regardless of whether the field is empty or not. This may be
  2243. // used to include empty fields in Patch requests.
  2244. ForceSendFields []string `json:"-"`
  2245. // NullFields is a list of field names (e.g. "Code") to include in API
  2246. // requests with the JSON null value. By default, fields with empty
  2247. // values are omitted from API requests. However, any field with an
  2248. // empty value appearing in NullFields will be sent to the server as
  2249. // null. It is an error if a field in this list has a non-empty value.
  2250. // This may be used to include null fields in Patch requests.
  2251. NullFields []string `json:"-"`
  2252. }
  2253. func (s *AllocationsScopedListWarning) MarshalJSON() ([]byte, error) {
  2254. type NoMethod AllocationsScopedListWarning
  2255. raw := NoMethod(*s)
  2256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2257. }
  2258. type AllocationsScopedListWarningData struct {
  2259. // Key: [Output Only] A key that provides more detail on the warning
  2260. // being returned. For example, for warnings where there are no results
  2261. // in a list request for a particular zone, this key might be scope and
  2262. // the key value might be the zone name. Other examples might be a key
  2263. // indicating a deprecated resource and a suggested replacement, or a
  2264. // warning about invalid network settings (for example, if an instance
  2265. // attempts to perform IP forwarding but is not enabled for IP
  2266. // forwarding).
  2267. Key string `json:"key,omitempty"`
  2268. // Value: [Output Only] A warning data value corresponding to the key.
  2269. Value string `json:"value,omitempty"`
  2270. // ForceSendFields is a list of field names (e.g. "Key") to
  2271. // unconditionally include in API requests. By default, fields with
  2272. // empty values are omitted from API requests. However, any non-pointer,
  2273. // non-interface field appearing in ForceSendFields will be sent to the
  2274. // server regardless of whether the field is empty or not. This may be
  2275. // used to include empty fields in Patch requests.
  2276. ForceSendFields []string `json:"-"`
  2277. // NullFields is a list of field names (e.g. "Key") to include in API
  2278. // requests with the JSON null value. By default, fields with empty
  2279. // values are omitted from API requests. However, any field with an
  2280. // empty value appearing in NullFields will be sent to the server as
  2281. // null. It is an error if a field in this list has a non-empty value.
  2282. // This may be used to include null fields in Patch requests.
  2283. NullFields []string `json:"-"`
  2284. }
  2285. func (s *AllocationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  2286. type NoMethod AllocationsScopedListWarningData
  2287. raw := NoMethod(*s)
  2288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2289. }
  2290. // AttachedDisk: An instance-attached disk resource.
  2291. type AttachedDisk struct {
  2292. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  2293. // instance is deleted (but not when the disk is detached from the
  2294. // instance).
  2295. AutoDelete bool `json:"autoDelete,omitempty"`
  2296. // Boot: Indicates that this is a boot disk. The virtual machine will
  2297. // use the first partition of the disk for its root filesystem.
  2298. Boot bool `json:"boot,omitempty"`
  2299. // DeviceName: Specifies a unique device name of your choice that is
  2300. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  2301. // system running within the instance. This name can be used to
  2302. // reference the device for mounting, resizing, and so on, from within
  2303. // the instance.
  2304. //
  2305. // If not specified, the server chooses a default device name to apply
  2306. // to this disk, in the form persistent-disks-x, where x is a number
  2307. // assigned by Google Compute Engine. This field is only applicable for
  2308. // persistent disks.
  2309. DeviceName string `json:"deviceName,omitempty"`
  2310. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  2311. // customer-supplied encryption key.
  2312. //
  2313. // If you are creating a new disk, this field encrypts the new disk
  2314. // using an encryption key that you provide. If you are attaching an
  2315. // existing disk that is already encrypted, this field decrypts the disk
  2316. // using the customer-supplied encryption key.
  2317. //
  2318. // If you encrypt a disk using a customer-supplied key, you must provide
  2319. // the same key again when you attempt to use this resource at a later
  2320. // time. For example, you must provide the key when you create a
  2321. // snapshot or an image from the disk or when you attach the disk to a
  2322. // virtual machine instance.
  2323. //
  2324. // If you do not provide an encryption key, then the disk will be
  2325. // encrypted using an automatically generated key and you do not need to
  2326. // provide a key to use the disk later.
  2327. //
  2328. // Instance templates do not store customer-supplied encryption keys, so
  2329. // you cannot use your own keys to encrypt disks in a managed instance
  2330. // group.
  2331. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2332. // GuestOsFeatures: A list of features to enable on the guest operating
  2333. // system. Applicable only for bootable images. Read Enabling guest
  2334. // operating system features to see a list of available options.
  2335. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2336. // Index: [Output Only] A zero-based index to this disk, where 0 is
  2337. // reserved for the boot disk. If you have many disks attached to an
  2338. // instance, each disk would have a unique index number.
  2339. Index int64 `json:"index,omitempty"`
  2340. // InitializeParams: [Input Only] Specifies the parameters for a new
  2341. // disk that will be created alongside the new instance. Use
  2342. // initialization parameters to create boot disks or local SSDs attached
  2343. // to the new instance.
  2344. //
  2345. // This property is mutually exclusive with the source property; you can
  2346. // only define one or the other, but not both.
  2347. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  2348. // Interface: Specifies the disk interface to use for attaching this
  2349. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  2350. // disks must always use SCSI and the request will fail if you attempt
  2351. // to attach a persistent disk in any other format than SCSI. Local SSDs
  2352. // can use either NVME or SCSI. For performance characteristics of SCSI
  2353. // over NVMe, see Local SSD performance.
  2354. //
  2355. // Possible values:
  2356. // "NVME"
  2357. // "SCSI"
  2358. Interface string `json:"interface,omitempty"`
  2359. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  2360. // for attached disks.
  2361. Kind string `json:"kind,omitempty"`
  2362. // Licenses: [Output Only] Any valid publicly visible licenses.
  2363. Licenses []string `json:"licenses,omitempty"`
  2364. // Mode: The mode in which to attach this disk, either READ_WRITE or
  2365. // READ_ONLY. If not specified, the default is to attach the disk in
  2366. // READ_WRITE mode.
  2367. //
  2368. // Possible values:
  2369. // "READ_ONLY"
  2370. // "READ_WRITE"
  2371. Mode string `json:"mode,omitempty"`
  2372. // Source: Specifies a valid partial or full URL to an existing
  2373. // Persistent Disk resource. When creating a new instance, one of
  2374. // initializeParams.sourceImage or disks.source is required except for
  2375. // local SSD.
  2376. //
  2377. // If desired, you can also attach existing non-root persistent disks
  2378. // using this property. This field is only applicable for persistent
  2379. // disks.
  2380. //
  2381. // Note that for InstanceTemplate, specify the disk name, not the URL
  2382. // for the disk.
  2383. Source string `json:"source,omitempty"`
  2384. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  2385. // If not specified, the default is PERSISTENT.
  2386. //
  2387. // Possible values:
  2388. // "PERSISTENT"
  2389. // "SCRATCH"
  2390. Type string `json:"type,omitempty"`
  2391. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  2392. // unconditionally include in API requests. By default, fields with
  2393. // empty values are omitted from API requests. However, any non-pointer,
  2394. // non-interface field appearing in ForceSendFields will be sent to the
  2395. // server regardless of whether the field is empty or not. This may be
  2396. // used to include empty fields in Patch requests.
  2397. ForceSendFields []string `json:"-"`
  2398. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  2399. // API requests with the JSON null value. By default, fields with empty
  2400. // values are omitted from API requests. However, any field with an
  2401. // empty value appearing in NullFields will be sent to the server as
  2402. // null. It is an error if a field in this list has a non-empty value.
  2403. // This may be used to include null fields in Patch requests.
  2404. NullFields []string `json:"-"`
  2405. }
  2406. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  2407. type NoMethod AttachedDisk
  2408. raw := NoMethod(*s)
  2409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2410. }
  2411. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  2412. // for a new disk that will be created alongside the new instance. Use
  2413. // initialization parameters to create boot disks or local SSDs attached
  2414. // to the new instance.
  2415. //
  2416. // This property is mutually exclusive with the source property; you can
  2417. // only define one or the other, but not both.
  2418. type AttachedDiskInitializeParams struct {
  2419. // Description: An optional description. Provide this property when
  2420. // creating the disk.
  2421. Description string `json:"description,omitempty"`
  2422. // DiskName: Specifies the disk name. If not specified, the default is
  2423. // to use the name of the instance. If the disk with the instance name
  2424. // exists already in the given zone/region, a new name will be
  2425. // automatically generated.
  2426. DiskName string `json:"diskName,omitempty"`
  2427. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2428. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2429. // DiskType: Specifies the disk type to use to create the instance. If
  2430. // not specified, the default is pd-standard, specified using the full
  2431. // URL. For
  2432. // example:
  2433. // https://www.googleapis.com/compute/v1/projects/project/zones/
  2434. // zone/diskTypes/pd-standard
  2435. //
  2436. //
  2437. // Other values include pd-ssd and local-ssd. If you define this field,
  2438. // you can provide either the full or partial URL. For example, the
  2439. // following are valid values:
  2440. // -
  2441. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  2442. // - projects/project/zones/zone/diskTypes/diskType
  2443. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  2444. // is the name of the disk type, not URL.
  2445. DiskType string `json:"diskType,omitempty"`
  2446. // Labels: Labels to apply to this disk. These can be later modified by
  2447. // the disks.setLabels method. This field is only applicable for
  2448. // persistent disks.
  2449. Labels map[string]string `json:"labels,omitempty"`
  2450. // SourceImage: The source image to create this disk. When creating a
  2451. // new instance, one of initializeParams.sourceImage or disks.source is
  2452. // required except for local SSD.
  2453. //
  2454. // To create a disk with one of the public operating system images,
  2455. // specify the image by its family name. For example, specify
  2456. // family/debian-9 to use the latest Debian 9
  2457. // image:
  2458. // projects/debian-cloud/global/images/family/debian-9
  2459. //
  2460. //
  2461. // Alternati
  2462. // vely, use a specific version of a public operating system
  2463. // image:
  2464. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  2465. //
  2466. //
  2467. //
  2468. // To create a disk with a custom image that you created, specify the
  2469. // image name in the following
  2470. // format:
  2471. // global/images/my-custom-image
  2472. //
  2473. //
  2474. // You can also specify a custom image by its image family, which
  2475. // returns the latest version of the image in that family. Replace the
  2476. // image name with
  2477. // family/family-name:
  2478. // global/images/family/my-image-family
  2479. //
  2480. //
  2481. // If the source image is deleted later, this field will not be set.
  2482. SourceImage string `json:"sourceImage,omitempty"`
  2483. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2484. // source image. Required if the source image is protected by a
  2485. // customer-supplied encryption key.
  2486. //
  2487. // Instance templates do not store customer-supplied encryption keys, so
  2488. // you cannot create disks for instances in a managed instance group if
  2489. // the source images are encrypted with your own keys.
  2490. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2491. // ForceSendFields is a list of field names (e.g. "Description") to
  2492. // unconditionally include in API requests. By default, fields with
  2493. // empty values are omitted from API requests. However, any non-pointer,
  2494. // non-interface field appearing in ForceSendFields will be sent to the
  2495. // server regardless of whether the field is empty or not. This may be
  2496. // used to include empty fields in Patch requests.
  2497. ForceSendFields []string `json:"-"`
  2498. // NullFields is a list of field names (e.g. "Description") to include
  2499. // in API requests with the JSON null value. By default, fields with
  2500. // empty values are omitted from API requests. However, any field with
  2501. // an empty value appearing in NullFields will be sent to the server as
  2502. // null. It is an error if a field in this list has a non-empty value.
  2503. // This may be used to include null fields in Patch requests.
  2504. NullFields []string `json:"-"`
  2505. }
  2506. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2507. type NoMethod AttachedDiskInitializeParams
  2508. raw := NoMethod(*s)
  2509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2510. }
  2511. // AuditConfig: Specifies the audit configuration for a service. The
  2512. // configuration determines which permission types are logged, and what
  2513. // identities, if any, are exempted from logging. An AuditConfig must
  2514. // have one or more AuditLogConfigs.
  2515. //
  2516. // If there are AuditConfigs for both `allServices` and a specific
  2517. // service, the union of the two AuditConfigs is used for that service:
  2518. // the log_types specified in each AuditConfig are enabled, and the
  2519. // exempted_members in each AuditLogConfig are exempted.
  2520. //
  2521. // Example Policy with multiple AuditConfigs:
  2522. //
  2523. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2524. // [ { "log_type": "DATA_READ", "exempted_members": [
  2525. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2526. // "log_type": "ADMIN_READ", } ] }, { "service":
  2527. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2528. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2529. // "user:bar@gmail.com" ] } ] } ] }
  2530. //
  2531. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2532. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2533. // logging, and bar@gmail.com from DATA_WRITE logging.
  2534. type AuditConfig struct {
  2535. // AuditLogConfigs: The configuration for logging of each type of
  2536. // permission.
  2537. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2538. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2539. // Service: Specifies a service that will be enabled for audit logging.
  2540. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2541. // `allServices` is a special value that covers all services.
  2542. Service string `json:"service,omitempty"`
  2543. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2544. // unconditionally include in API requests. By default, fields with
  2545. // empty values are omitted from API requests. However, any non-pointer,
  2546. // non-interface field appearing in ForceSendFields will be sent to the
  2547. // server regardless of whether the field is empty or not. This may be
  2548. // used to include empty fields in Patch requests.
  2549. ForceSendFields []string `json:"-"`
  2550. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2551. // include in API requests with the JSON null value. By default, fields
  2552. // with empty values are omitted from API requests. However, any field
  2553. // with an empty value appearing in NullFields will be sent to the
  2554. // server as null. It is an error if a field in this list has a
  2555. // non-empty value. This may be used to include null fields in Patch
  2556. // requests.
  2557. NullFields []string `json:"-"`
  2558. }
  2559. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2560. type NoMethod AuditConfig
  2561. raw := NoMethod(*s)
  2562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2563. }
  2564. // AuditLogConfig: Provides the configuration for logging a type of
  2565. // permissions. Example:
  2566. //
  2567. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2568. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2569. // "DATA_WRITE", } ] }
  2570. //
  2571. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2572. // foo@gmail.com from DATA_READ logging.
  2573. type AuditLogConfig struct {
  2574. // ExemptedMembers: Specifies the identities that do not cause logging
  2575. // for this type of permission. Follows the same format of
  2576. // [Binding.members][].
  2577. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2578. // LogType: The log type that this config enables.
  2579. //
  2580. // Possible values:
  2581. // "ADMIN_READ"
  2582. // "DATA_READ"
  2583. // "DATA_WRITE"
  2584. // "LOG_TYPE_UNSPECIFIED"
  2585. LogType string `json:"logType,omitempty"`
  2586. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2587. // unconditionally include in API requests. By default, fields with
  2588. // empty values are omitted from API requests. However, any non-pointer,
  2589. // non-interface field appearing in ForceSendFields will be sent to the
  2590. // server regardless of whether the field is empty or not. This may be
  2591. // used to include empty fields in Patch requests.
  2592. ForceSendFields []string `json:"-"`
  2593. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2594. // include in API requests with the JSON null value. By default, fields
  2595. // with empty values are omitted from API requests. However, any field
  2596. // with an empty value appearing in NullFields will be sent to the
  2597. // server as null. It is an error if a field in this list has a
  2598. // non-empty value. This may be used to include null fields in Patch
  2599. // requests.
  2600. NullFields []string `json:"-"`
  2601. }
  2602. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2603. type NoMethod AuditLogConfig
  2604. raw := NoMethod(*s)
  2605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2606. }
  2607. // AuthorizationLoggingOptions: Authorization-related information used
  2608. // by Cloud Audit Logging.
  2609. type AuthorizationLoggingOptions struct {
  2610. // PermissionType: The type of the permission that was checked.
  2611. //
  2612. // Possible values:
  2613. // "ADMIN_READ"
  2614. // "ADMIN_WRITE"
  2615. // "DATA_READ"
  2616. // "DATA_WRITE"
  2617. // "PERMISSION_TYPE_UNSPECIFIED"
  2618. PermissionType string `json:"permissionType,omitempty"`
  2619. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2620. // unconditionally include in API requests. By default, fields with
  2621. // empty values are omitted from API requests. However, any non-pointer,
  2622. // non-interface field appearing in ForceSendFields will be sent to the
  2623. // server regardless of whether the field is empty or not. This may be
  2624. // used to include empty fields in Patch requests.
  2625. ForceSendFields []string `json:"-"`
  2626. // NullFields is a list of field names (e.g. "PermissionType") to
  2627. // include in API requests with the JSON null value. By default, fields
  2628. // with empty values are omitted from API requests. However, any field
  2629. // with an empty value appearing in NullFields will be sent to the
  2630. // server as null. It is an error if a field in this list has a
  2631. // non-empty value. This may be used to include null fields in Patch
  2632. // requests.
  2633. NullFields []string `json:"-"`
  2634. }
  2635. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2636. type NoMethod AuthorizationLoggingOptions
  2637. raw := NoMethod(*s)
  2638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2639. }
  2640. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2641. // to automatically scale virtual machine instances in managed instance
  2642. // groups according to an autoscaling policy that you define. For more
  2643. // information, read Autoscaling Groups of Instances. (== resource_for
  2644. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2645. // resource_for beta.regionAutoscalers ==) (== resource_for
  2646. // v1.regionAutoscalers ==)
  2647. type Autoscaler struct {
  2648. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2649. // algorithm. You can define one or more of the policies for an
  2650. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2651. // loadBalancingUtilization.
  2652. //
  2653. // If none of these are specified, the default will be to autoscale
  2654. // based on cpuUtilization to 0.6 or 60%.
  2655. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2656. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2657. // format.
  2658. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2659. // Description: An optional description of this resource. Provide this
  2660. // property when you create the resource.
  2661. Description string `json:"description,omitempty"`
  2662. // Id: [Output Only] The unique identifier for the resource. This
  2663. // identifier is defined by the server.
  2664. Id uint64 `json:"id,omitempty,string"`
  2665. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2666. // for autoscalers.
  2667. Kind string `json:"kind,omitempty"`
  2668. // Name: Name of the resource. Provided by the client when the resource
  2669. // is created. The name must be 1-63 characters long, and comply with
  2670. // RFC1035. Specifically, the name must be 1-63 characters long and
  2671. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2672. // the first character must be a lowercase letter, and all following
  2673. // characters must be a dash, lowercase letter, or digit, except the
  2674. // last character, which cannot be a dash.
  2675. Name string `json:"name,omitempty"`
  2676. // Region: [Output Only] URL of the region where the instance group
  2677. // resides (for autoscalers living in regional scope).
  2678. Region string `json:"region,omitempty"`
  2679. // SelfLink: [Output Only] Server-defined URL for the resource.
  2680. SelfLink string `json:"selfLink,omitempty"`
  2681. // Status: [Output Only] The status of the autoscaler configuration.
  2682. //
  2683. // Possible values:
  2684. // "ACTIVE"
  2685. // "DELETING"
  2686. // "ERROR"
  2687. // "PENDING"
  2688. Status string `json:"status,omitempty"`
  2689. // StatusDetails: [Output Only] Human-readable details about the current
  2690. // state of the autoscaler. Read the documentation for Commonly returned
  2691. // status messages for examples of status messages you might encounter.
  2692. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2693. // Target: URL of the managed instance group that this autoscaler will
  2694. // scale.
  2695. Target string `json:"target,omitempty"`
  2696. // Zone: [Output Only] URL of the zone where the instance group resides
  2697. // (for autoscalers living in zonal scope).
  2698. Zone string `json:"zone,omitempty"`
  2699. // ServerResponse contains the HTTP response code and headers from the
  2700. // server.
  2701. googleapi.ServerResponse `json:"-"`
  2702. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2703. // to unconditionally include in API requests. By default, fields with
  2704. // empty values are omitted from API requests. However, any non-pointer,
  2705. // non-interface field appearing in ForceSendFields will be sent to the
  2706. // server regardless of whether the field is empty or not. This may be
  2707. // used to include empty fields in Patch requests.
  2708. ForceSendFields []string `json:"-"`
  2709. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2710. // include in API requests with the JSON null value. By default, fields
  2711. // with empty values are omitted from API requests. However, any field
  2712. // with an empty value appearing in NullFields will be sent to the
  2713. // server as null. It is an error if a field in this list has a
  2714. // non-empty value. This may be used to include null fields in Patch
  2715. // requests.
  2716. NullFields []string `json:"-"`
  2717. }
  2718. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2719. type NoMethod Autoscaler
  2720. raw := NoMethod(*s)
  2721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2722. }
  2723. type AutoscalerAggregatedList struct {
  2724. // Id: [Output Only] Unique identifier for the resource; defined by the
  2725. // server.
  2726. Id string `json:"id,omitempty"`
  2727. // Items: A list of AutoscalersScopedList resources.
  2728. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2729. // Kind: [Output Only] Type of resource. Always
  2730. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2731. Kind string `json:"kind,omitempty"`
  2732. // NextPageToken: [Output Only] This token allows you to get the next
  2733. // page of results for list requests. If the number of results is larger
  2734. // than maxResults, use the nextPageToken as a value for the query
  2735. // parameter pageToken in the next list request. Subsequent list
  2736. // requests will have their own nextPageToken to continue paging through
  2737. // the results.
  2738. NextPageToken string `json:"nextPageToken,omitempty"`
  2739. // SelfLink: [Output Only] Server-defined URL for this resource.
  2740. SelfLink string `json:"selfLink,omitempty"`
  2741. // Warning: [Output Only] Informational warning message.
  2742. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2743. // ServerResponse contains the HTTP response code and headers from the
  2744. // server.
  2745. googleapi.ServerResponse `json:"-"`
  2746. // ForceSendFields is a list of field names (e.g. "Id") to
  2747. // unconditionally include in API requests. By default, fields with
  2748. // empty values are omitted from API requests. However, any non-pointer,
  2749. // non-interface field appearing in ForceSendFields will be sent to the
  2750. // server regardless of whether the field is empty or not. This may be
  2751. // used to include empty fields in Patch requests.
  2752. ForceSendFields []string `json:"-"`
  2753. // NullFields is a list of field names (e.g. "Id") to include in API
  2754. // requests with the JSON null value. By default, fields with empty
  2755. // values are omitted from API requests. However, any field with an
  2756. // empty value appearing in NullFields will be sent to the server as
  2757. // null. It is an error if a field in this list has a non-empty value.
  2758. // This may be used to include null fields in Patch requests.
  2759. NullFields []string `json:"-"`
  2760. }
  2761. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2762. type NoMethod AutoscalerAggregatedList
  2763. raw := NoMethod(*s)
  2764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2765. }
  2766. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2767. // message.
  2768. type AutoscalerAggregatedListWarning struct {
  2769. // Code: [Output Only] A warning code, if applicable. For example,
  2770. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2771. // the response.
  2772. //
  2773. // Possible values:
  2774. // "CLEANUP_FAILED"
  2775. // "DEPRECATED_RESOURCE_USED"
  2776. // "DEPRECATED_TYPE_USED"
  2777. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2778. // "EXPERIMENTAL_TYPE_USED"
  2779. // "EXTERNAL_API_WARNING"
  2780. // "FIELD_VALUE_OVERRIDEN"
  2781. // "INJECTED_KERNELS_DEPRECATED"
  2782. // "MISSING_TYPE_DEPENDENCY"
  2783. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2784. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2785. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2786. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2787. // "NEXT_HOP_NOT_RUNNING"
  2788. // "NOT_CRITICAL_ERROR"
  2789. // "NO_RESULTS_ON_PAGE"
  2790. // "REQUIRED_TOS_AGREEMENT"
  2791. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2792. // "RESOURCE_NOT_DELETED"
  2793. // "SCHEMA_VALIDATION_IGNORED"
  2794. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2795. // "UNDECLARED_PROPERTIES"
  2796. // "UNREACHABLE"
  2797. Code string `json:"code,omitempty"`
  2798. // Data: [Output Only] Metadata about this warning in key: value format.
  2799. // For example:
  2800. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2801. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2802. // Message: [Output Only] A human-readable description of the warning
  2803. // code.
  2804. Message string `json:"message,omitempty"`
  2805. // ForceSendFields is a list of field names (e.g. "Code") to
  2806. // unconditionally include in API requests. By default, fields with
  2807. // empty values are omitted from API requests. However, any non-pointer,
  2808. // non-interface field appearing in ForceSendFields will be sent to the
  2809. // server regardless of whether the field is empty or not. This may be
  2810. // used to include empty fields in Patch requests.
  2811. ForceSendFields []string `json:"-"`
  2812. // NullFields is a list of field names (e.g. "Code") to include in API
  2813. // requests with the JSON null value. By default, fields with empty
  2814. // values are omitted from API requests. However, any field with an
  2815. // empty value appearing in NullFields will be sent to the server as
  2816. // null. It is an error if a field in this list has a non-empty value.
  2817. // This may be used to include null fields in Patch requests.
  2818. NullFields []string `json:"-"`
  2819. }
  2820. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2821. type NoMethod AutoscalerAggregatedListWarning
  2822. raw := NoMethod(*s)
  2823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2824. }
  2825. type AutoscalerAggregatedListWarningData struct {
  2826. // Key: [Output Only] A key that provides more detail on the warning
  2827. // being returned. For example, for warnings where there are no results
  2828. // in a list request for a particular zone, this key might be scope and
  2829. // the key value might be the zone name. Other examples might be a key
  2830. // indicating a deprecated resource and a suggested replacement, or a
  2831. // warning about invalid network settings (for example, if an instance
  2832. // attempts to perform IP forwarding but is not enabled for IP
  2833. // forwarding).
  2834. Key string `json:"key,omitempty"`
  2835. // Value: [Output Only] A warning data value corresponding to the key.
  2836. Value string `json:"value,omitempty"`
  2837. // ForceSendFields is a list of field names (e.g. "Key") to
  2838. // unconditionally include in API requests. By default, fields with
  2839. // empty values are omitted from API requests. However, any non-pointer,
  2840. // non-interface field appearing in ForceSendFields will be sent to the
  2841. // server regardless of whether the field is empty or not. This may be
  2842. // used to include empty fields in Patch requests.
  2843. ForceSendFields []string `json:"-"`
  2844. // NullFields is a list of field names (e.g. "Key") to include in API
  2845. // requests with the JSON null value. By default, fields with empty
  2846. // values are omitted from API requests. However, any field with an
  2847. // empty value appearing in NullFields will be sent to the server as
  2848. // null. It is an error if a field in this list has a non-empty value.
  2849. // This may be used to include null fields in Patch requests.
  2850. NullFields []string `json:"-"`
  2851. }
  2852. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2853. type NoMethod AutoscalerAggregatedListWarningData
  2854. raw := NoMethod(*s)
  2855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2856. }
  2857. // AutoscalerList: Contains a list of Autoscaler resources.
  2858. type AutoscalerList struct {
  2859. // Id: [Output Only] Unique identifier for the resource; defined by the
  2860. // server.
  2861. Id string `json:"id,omitempty"`
  2862. // Items: A list of Autoscaler resources.
  2863. Items []*Autoscaler `json:"items,omitempty"`
  2864. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2865. // for lists of autoscalers.
  2866. Kind string `json:"kind,omitempty"`
  2867. // NextPageToken: [Output Only] This token allows you to get the next
  2868. // page of results for list requests. If the number of results is larger
  2869. // than maxResults, use the nextPageToken as a value for the query
  2870. // parameter pageToken in the next list request. Subsequent list
  2871. // requests will have their own nextPageToken to continue paging through
  2872. // the results.
  2873. NextPageToken string `json:"nextPageToken,omitempty"`
  2874. // SelfLink: [Output Only] Server-defined URL for this resource.
  2875. SelfLink string `json:"selfLink,omitempty"`
  2876. // Warning: [Output Only] Informational warning message.
  2877. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2878. // ServerResponse contains the HTTP response code and headers from the
  2879. // server.
  2880. googleapi.ServerResponse `json:"-"`
  2881. // ForceSendFields is a list of field names (e.g. "Id") to
  2882. // unconditionally include in API requests. By default, fields with
  2883. // empty values are omitted from API requests. However, any non-pointer,
  2884. // non-interface field appearing in ForceSendFields will be sent to the
  2885. // server regardless of whether the field is empty or not. This may be
  2886. // used to include empty fields in Patch requests.
  2887. ForceSendFields []string `json:"-"`
  2888. // NullFields is a list of field names (e.g. "Id") to include in API
  2889. // requests with the JSON null value. By default, fields with empty
  2890. // values are omitted from API requests. However, any field with an
  2891. // empty value appearing in NullFields will be sent to the server as
  2892. // null. It is an error if a field in this list has a non-empty value.
  2893. // This may be used to include null fields in Patch requests.
  2894. NullFields []string `json:"-"`
  2895. }
  2896. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2897. type NoMethod AutoscalerList
  2898. raw := NoMethod(*s)
  2899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2900. }
  2901. // AutoscalerListWarning: [Output Only] Informational warning message.
  2902. type AutoscalerListWarning struct {
  2903. // Code: [Output Only] A warning code, if applicable. For example,
  2904. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2905. // the response.
  2906. //
  2907. // Possible values:
  2908. // "CLEANUP_FAILED"
  2909. // "DEPRECATED_RESOURCE_USED"
  2910. // "DEPRECATED_TYPE_USED"
  2911. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2912. // "EXPERIMENTAL_TYPE_USED"
  2913. // "EXTERNAL_API_WARNING"
  2914. // "FIELD_VALUE_OVERRIDEN"
  2915. // "INJECTED_KERNELS_DEPRECATED"
  2916. // "MISSING_TYPE_DEPENDENCY"
  2917. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2918. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2919. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2920. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2921. // "NEXT_HOP_NOT_RUNNING"
  2922. // "NOT_CRITICAL_ERROR"
  2923. // "NO_RESULTS_ON_PAGE"
  2924. // "REQUIRED_TOS_AGREEMENT"
  2925. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2926. // "RESOURCE_NOT_DELETED"
  2927. // "SCHEMA_VALIDATION_IGNORED"
  2928. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2929. // "UNDECLARED_PROPERTIES"
  2930. // "UNREACHABLE"
  2931. Code string `json:"code,omitempty"`
  2932. // Data: [Output Only] Metadata about this warning in key: value format.
  2933. // For example:
  2934. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2935. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2936. // Message: [Output Only] A human-readable description of the warning
  2937. // code.
  2938. Message string `json:"message,omitempty"`
  2939. // ForceSendFields is a list of field names (e.g. "Code") to
  2940. // unconditionally include in API requests. By default, fields with
  2941. // empty values are omitted from API requests. However, any non-pointer,
  2942. // non-interface field appearing in ForceSendFields will be sent to the
  2943. // server regardless of whether the field is empty or not. This may be
  2944. // used to include empty fields in Patch requests.
  2945. ForceSendFields []string `json:"-"`
  2946. // NullFields is a list of field names (e.g. "Code") to include in API
  2947. // requests with the JSON null value. By default, fields with empty
  2948. // values are omitted from API requests. However, any field with an
  2949. // empty value appearing in NullFields will be sent to the server as
  2950. // null. It is an error if a field in this list has a non-empty value.
  2951. // This may be used to include null fields in Patch requests.
  2952. NullFields []string `json:"-"`
  2953. }
  2954. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2955. type NoMethod AutoscalerListWarning
  2956. raw := NoMethod(*s)
  2957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2958. }
  2959. type AutoscalerListWarningData struct {
  2960. // Key: [Output Only] A key that provides more detail on the warning
  2961. // being returned. For example, for warnings where there are no results
  2962. // in a list request for a particular zone, this key might be scope and
  2963. // the key value might be the zone name. Other examples might be a key
  2964. // indicating a deprecated resource and a suggested replacement, or a
  2965. // warning about invalid network settings (for example, if an instance
  2966. // attempts to perform IP forwarding but is not enabled for IP
  2967. // forwarding).
  2968. Key string `json:"key,omitempty"`
  2969. // Value: [Output Only] A warning data value corresponding to the key.
  2970. Value string `json:"value,omitempty"`
  2971. // ForceSendFields is a list of field names (e.g. "Key") to
  2972. // unconditionally include in API requests. By default, fields with
  2973. // empty values are omitted from API requests. However, any non-pointer,
  2974. // non-interface field appearing in ForceSendFields will be sent to the
  2975. // server regardless of whether the field is empty or not. This may be
  2976. // used to include empty fields in Patch requests.
  2977. ForceSendFields []string `json:"-"`
  2978. // NullFields is a list of field names (e.g. "Key") to include in API
  2979. // requests with the JSON null value. By default, fields with empty
  2980. // values are omitted from API requests. However, any field with an
  2981. // empty value appearing in NullFields will be sent to the server as
  2982. // null. It is an error if a field in this list has a non-empty value.
  2983. // This may be used to include null fields in Patch requests.
  2984. NullFields []string `json:"-"`
  2985. }
  2986. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2987. type NoMethod AutoscalerListWarningData
  2988. raw := NoMethod(*s)
  2989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2990. }
  2991. type AutoscalerStatusDetails struct {
  2992. // Message: The status message.
  2993. Message string `json:"message,omitempty"`
  2994. // Type: The type of error returned.
  2995. //
  2996. // Possible values:
  2997. // "ALL_INSTANCES_UNHEALTHY"
  2998. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2999. // "CAPPED_AT_MAX_NUM_REPLICAS"
  3000. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  3001. // "CUSTOM_METRIC_INVALID"
  3002. // "MIN_EQUALS_MAX"
  3003. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  3004. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  3005. // "MORE_THAN_ONE_BACKEND_SERVICE"
  3006. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  3007. // "REGION_RESOURCE_STOCKOUT"
  3008. // "SCALING_TARGET_DOES_NOT_EXIST"
  3009. // "UNKNOWN"
  3010. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  3011. // "ZONE_RESOURCE_STOCKOUT"
  3012. Type string `json:"type,omitempty"`
  3013. // ForceSendFields is a list of field names (e.g. "Message") to
  3014. // unconditionally include in API requests. By default, fields with
  3015. // empty values are omitted from API requests. However, any non-pointer,
  3016. // non-interface field appearing in ForceSendFields will be sent to the
  3017. // server regardless of whether the field is empty or not. This may be
  3018. // used to include empty fields in Patch requests.
  3019. ForceSendFields []string `json:"-"`
  3020. // NullFields is a list of field names (e.g. "Message") to include in
  3021. // API requests with the JSON null value. By default, fields with empty
  3022. // values are omitted from API requests. However, any field with an
  3023. // empty value appearing in NullFields will be sent to the server as
  3024. // null. It is an error if a field in this list has a non-empty value.
  3025. // This may be used to include null fields in Patch requests.
  3026. NullFields []string `json:"-"`
  3027. }
  3028. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  3029. type NoMethod AutoscalerStatusDetails
  3030. raw := NoMethod(*s)
  3031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3032. }
  3033. type AutoscalersScopedList struct {
  3034. // Autoscalers: [Output Only] A list of autoscalers contained in this
  3035. // scope.
  3036. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  3037. // Warning: [Output Only] Informational warning which replaces the list
  3038. // of autoscalers when the list is empty.
  3039. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  3040. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  3041. // unconditionally include in API requests. By default, fields with
  3042. // empty values are omitted from API requests. However, any non-pointer,
  3043. // non-interface field appearing in ForceSendFields will be sent to the
  3044. // server regardless of whether the field is empty or not. This may be
  3045. // used to include empty fields in Patch requests.
  3046. ForceSendFields []string `json:"-"`
  3047. // NullFields is a list of field names (e.g. "Autoscalers") to include
  3048. // in API requests with the JSON null value. By default, fields with
  3049. // empty values are omitted from API requests. However, any field with
  3050. // an empty value appearing in NullFields will be sent to the server as
  3051. // null. It is an error if a field in this list has a non-empty value.
  3052. // This may be used to include null fields in Patch requests.
  3053. NullFields []string `json:"-"`
  3054. }
  3055. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  3056. type NoMethod AutoscalersScopedList
  3057. raw := NoMethod(*s)
  3058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3059. }
  3060. // AutoscalersScopedListWarning: [Output Only] Informational warning
  3061. // which replaces the list of autoscalers when the list is empty.
  3062. type AutoscalersScopedListWarning struct {
  3063. // Code: [Output Only] A warning code, if applicable. For example,
  3064. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3065. // the response.
  3066. //
  3067. // Possible values:
  3068. // "CLEANUP_FAILED"
  3069. // "DEPRECATED_RESOURCE_USED"
  3070. // "DEPRECATED_TYPE_USED"
  3071. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3072. // "EXPERIMENTAL_TYPE_USED"
  3073. // "EXTERNAL_API_WARNING"
  3074. // "FIELD_VALUE_OVERRIDEN"
  3075. // "INJECTED_KERNELS_DEPRECATED"
  3076. // "MISSING_TYPE_DEPENDENCY"
  3077. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3078. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3079. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3080. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3081. // "NEXT_HOP_NOT_RUNNING"
  3082. // "NOT_CRITICAL_ERROR"
  3083. // "NO_RESULTS_ON_PAGE"
  3084. // "REQUIRED_TOS_AGREEMENT"
  3085. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3086. // "RESOURCE_NOT_DELETED"
  3087. // "SCHEMA_VALIDATION_IGNORED"
  3088. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3089. // "UNDECLARED_PROPERTIES"
  3090. // "UNREACHABLE"
  3091. Code string `json:"code,omitempty"`
  3092. // Data: [Output Only] Metadata about this warning in key: value format.
  3093. // For example:
  3094. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3095. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  3096. // Message: [Output Only] A human-readable description of the warning
  3097. // code.
  3098. Message string `json:"message,omitempty"`
  3099. // ForceSendFields is a list of field names (e.g. "Code") to
  3100. // unconditionally include in API requests. By default, fields with
  3101. // empty values are omitted from API requests. However, any non-pointer,
  3102. // non-interface field appearing in ForceSendFields will be sent to the
  3103. // server regardless of whether the field is empty or not. This may be
  3104. // used to include empty fields in Patch requests.
  3105. ForceSendFields []string `json:"-"`
  3106. // NullFields is a list of field names (e.g. "Code") to include in API
  3107. // requests with the JSON null value. By default, fields with empty
  3108. // values are omitted from API requests. However, any field with an
  3109. // empty value appearing in NullFields will be sent to the server as
  3110. // null. It is an error if a field in this list has a non-empty value.
  3111. // This may be used to include null fields in Patch requests.
  3112. NullFields []string `json:"-"`
  3113. }
  3114. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  3115. type NoMethod AutoscalersScopedListWarning
  3116. raw := NoMethod(*s)
  3117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3118. }
  3119. type AutoscalersScopedListWarningData struct {
  3120. // Key: [Output Only] A key that provides more detail on the warning
  3121. // being returned. For example, for warnings where there are no results
  3122. // in a list request for a particular zone, this key might be scope and
  3123. // the key value might be the zone name. Other examples might be a key
  3124. // indicating a deprecated resource and a suggested replacement, or a
  3125. // warning about invalid network settings (for example, if an instance
  3126. // attempts to perform IP forwarding but is not enabled for IP
  3127. // forwarding).
  3128. Key string `json:"key,omitempty"`
  3129. // Value: [Output Only] A warning data value corresponding to the key.
  3130. Value string `json:"value,omitempty"`
  3131. // ForceSendFields is a list of field names (e.g. "Key") to
  3132. // unconditionally include in API requests. By default, fields with
  3133. // empty values are omitted from API requests. However, any non-pointer,
  3134. // non-interface field appearing in ForceSendFields will be sent to the
  3135. // server regardless of whether the field is empty or not. This may be
  3136. // used to include empty fields in Patch requests.
  3137. ForceSendFields []string `json:"-"`
  3138. // NullFields is a list of field names (e.g. "Key") to include in API
  3139. // requests with the JSON null value. By default, fields with empty
  3140. // values are omitted from API requests. However, any field with an
  3141. // empty value appearing in NullFields will be sent to the server as
  3142. // null. It is an error if a field in this list has a non-empty value.
  3143. // This may be used to include null fields in Patch requests.
  3144. NullFields []string `json:"-"`
  3145. }
  3146. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3147. type NoMethod AutoscalersScopedListWarningData
  3148. raw := NoMethod(*s)
  3149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3150. }
  3151. // AutoscalingPolicy: Cloud Autoscaler policy.
  3152. type AutoscalingPolicy struct {
  3153. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  3154. // wait before it starts collecting information from a new instance.
  3155. // This prevents the autoscaler from collecting information when the
  3156. // instance is initializing, during which the collected usage would not
  3157. // be reliable. The default time autoscaler waits is 60
  3158. // seconds.
  3159. //
  3160. // Virtual machine initialization times might vary because of numerous
  3161. // factors. We recommend that you test how long an instance may take to
  3162. // initialize. To do this, create an instance and time the startup
  3163. // process.
  3164. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  3165. // CpuUtilization: Defines the CPU utilization policy that allows the
  3166. // autoscaler to scale based on the average CPU utilization of a managed
  3167. // instance group.
  3168. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  3169. // CustomMetricUtilizations: Configuration parameters of autoscaling
  3170. // based on a custom metric.
  3171. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  3172. // LoadBalancingUtilization: Configuration parameters of autoscaling
  3173. // based on load balancer.
  3174. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  3175. // MaxNumReplicas: The maximum number of instances that the autoscaler
  3176. // can scale up to. This is required when creating or updating an
  3177. // autoscaler. The maximum number of replicas should not be lower than
  3178. // minimal number of replicas.
  3179. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  3180. // MinNumReplicas: The minimum number of replicas that the autoscaler
  3181. // can scale down to. This cannot be less than 0. If not provided,
  3182. // autoscaler will choose a default value depending on maximum number of
  3183. // instances allowed.
  3184. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  3185. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  3186. // to unconditionally include in API requests. By default, fields with
  3187. // empty values are omitted from API requests. However, any non-pointer,
  3188. // non-interface field appearing in ForceSendFields will be sent to the
  3189. // server regardless of whether the field is empty or not. This may be
  3190. // used to include empty fields in Patch requests.
  3191. ForceSendFields []string `json:"-"`
  3192. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  3193. // include in API requests with the JSON null value. By default, fields
  3194. // with empty values are omitted from API requests. However, any field
  3195. // with an empty value appearing in NullFields will be sent to the
  3196. // server as null. It is an error if a field in this list has a
  3197. // non-empty value. This may be used to include null fields in Patch
  3198. // requests.
  3199. NullFields []string `json:"-"`
  3200. }
  3201. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  3202. type NoMethod AutoscalingPolicy
  3203. raw := NoMethod(*s)
  3204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3205. }
  3206. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  3207. type AutoscalingPolicyCpuUtilization struct {
  3208. // UtilizationTarget: The target CPU utilization that the autoscaler
  3209. // should maintain. Must be a float value in the range (0, 1]. If not
  3210. // specified, the default is 0.6.
  3211. //
  3212. // If the CPU level is below the target utilization, the autoscaler
  3213. // scales down the number of instances until it reaches the minimum
  3214. // number of instances you specified or until the average CPU of your
  3215. // instances reaches the target utilization.
  3216. //
  3217. // If the average CPU is above the target utilization, the autoscaler
  3218. // scales up until it reaches the maximum number of instances you
  3219. // specified or until the average utilization reaches the target
  3220. // utilization.
  3221. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3222. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3223. // to unconditionally include in API requests. By default, fields with
  3224. // empty values are omitted from API requests. However, any non-pointer,
  3225. // non-interface field appearing in ForceSendFields will be sent to the
  3226. // server regardless of whether the field is empty or not. This may be
  3227. // used to include empty fields in Patch requests.
  3228. ForceSendFields []string `json:"-"`
  3229. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3230. // include in API requests with the JSON null value. By default, fields
  3231. // with empty values are omitted from API requests. However, any field
  3232. // with an empty value appearing in NullFields will be sent to the
  3233. // server as null. It is an error if a field in this list has a
  3234. // non-empty value. This may be used to include null fields in Patch
  3235. // requests.
  3236. NullFields []string `json:"-"`
  3237. }
  3238. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  3239. type NoMethod AutoscalingPolicyCpuUtilization
  3240. raw := NoMethod(*s)
  3241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3242. }
  3243. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  3244. type NoMethod AutoscalingPolicyCpuUtilization
  3245. var s1 struct {
  3246. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3247. *NoMethod
  3248. }
  3249. s1.NoMethod = (*NoMethod)(s)
  3250. if err := json.Unmarshal(data, &s1); err != nil {
  3251. return err
  3252. }
  3253. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3254. return nil
  3255. }
  3256. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  3257. // policy.
  3258. type AutoscalingPolicyCustomMetricUtilization struct {
  3259. // Filter: A filter string, compatible with a Stackdriver Monitoring
  3260. // filter string for TimeSeries.list API call. This filter is used to
  3261. // select a specific TimeSeries for the purpose of autoscaling and to
  3262. // determine whether the metric is exporting per-instance or per-group
  3263. // data.
  3264. //
  3265. // For the filter to be valid for autoscaling purposes, the following
  3266. // rules apply:
  3267. // - You can only use the AND operator for joining selectors.
  3268. // - You can only use direct equality comparison operator (=) without
  3269. // any functions for each selector.
  3270. // - You can specify the metric in both the filter string and in the
  3271. // metric field. However, if specified in both places, the metric must
  3272. // be identical.
  3273. // - The monitored resource type determines what kind of values are
  3274. // expected for the metric. If it is a gce_instance, the autoscaler
  3275. // expects the metric to include a separate TimeSeries for each instance
  3276. // in a group. In such a case, you cannot filter on resource labels.
  3277. // If the resource type is any other value, the autoscaler expects this
  3278. // metric to contain values that apply to the entire autoscaled instance
  3279. // group and resource label filtering can be performed to point
  3280. // autoscaler at the correct TimeSeries to scale upon. This is called a
  3281. // per-group metric for the purpose of autoscaling.
  3282. //
  3283. // If not specified, the type defaults to gce_instance.
  3284. //
  3285. // You should provide a filter that is selective enough to pick just one
  3286. // TimeSeries for the autoscaled group or for each of the instances (if
  3287. // you are using gce_instance resource type). If multiple TimeSeries are
  3288. // returned upon the query execution, the autoscaler will sum their
  3289. // respective values to obtain its scaling value.
  3290. Filter string `json:"filter,omitempty"`
  3291. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  3292. // The metric cannot have negative values.
  3293. //
  3294. // The metric must have a value type of INT64 or DOUBLE.
  3295. Metric string `json:"metric,omitempty"`
  3296. // SingleInstanceAssignment: If scaling is based on a per-group metric
  3297. // value that represents the total amount of work to be done or resource
  3298. // usage, set this value to an amount assigned for a single instance of
  3299. // the scaled group. Autoscaler will keep the number of instances
  3300. // proportional to the value of this metric, the metric itself should
  3301. // not change value due to group resizing.
  3302. //
  3303. // A good metric to use with the target is for example
  3304. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  3305. // custom metric exporting the total number of requests coming to your
  3306. // instances.
  3307. //
  3308. // A bad example would be a metric exporting an average or median
  3309. // latency, since this value can't include a chunk assignable to a
  3310. // single instance, it could be better used with utilization_target
  3311. // instead.
  3312. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  3313. // UtilizationTarget: The target value of the metric that autoscaler
  3314. // should maintain. This must be a positive value. A utilization metric
  3315. // scales number of virtual machines handling requests to increase or
  3316. // decrease proportionally to the metric.
  3317. //
  3318. // For example, a good metric to use as a utilization_target is
  3319. // compute.googleapis.com/instance/network/received_bytes_count. The
  3320. // autoscaler will work to keep this value constant for each of the
  3321. // instances.
  3322. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3323. // UtilizationTargetType: Defines how target utilization value is
  3324. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  3325. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  3326. //
  3327. // Possible values:
  3328. // "DELTA_PER_MINUTE"
  3329. // "DELTA_PER_SECOND"
  3330. // "GAUGE"
  3331. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  3332. // ForceSendFields is a list of field names (e.g. "Filter") to
  3333. // unconditionally include in API requests. By default, fields with
  3334. // empty values are omitted from API requests. However, any non-pointer,
  3335. // non-interface field appearing in ForceSendFields will be sent to the
  3336. // server regardless of whether the field is empty or not. This may be
  3337. // used to include empty fields in Patch requests.
  3338. ForceSendFields []string `json:"-"`
  3339. // NullFields is a list of field names (e.g. "Filter") to include in API
  3340. // requests with the JSON null value. By default, fields with empty
  3341. // values are omitted from API requests. However, any field with an
  3342. // empty value appearing in NullFields will be sent to the server as
  3343. // null. It is an error if a field in this list has a non-empty value.
  3344. // This may be used to include null fields in Patch requests.
  3345. NullFields []string `json:"-"`
  3346. }
  3347. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  3348. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3349. raw := NoMethod(*s)
  3350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3351. }
  3352. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  3353. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3354. var s1 struct {
  3355. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  3356. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3357. *NoMethod
  3358. }
  3359. s1.NoMethod = (*NoMethod)(s)
  3360. if err := json.Unmarshal(data, &s1); err != nil {
  3361. return err
  3362. }
  3363. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  3364. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3365. return nil
  3366. }
  3367. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  3368. // of autoscaling based on load balancing.
  3369. type AutoscalingPolicyLoadBalancingUtilization struct {
  3370. // UtilizationTarget: Fraction of backend capacity utilization (set in
  3371. // HTTP(s) load balancing configuration) that autoscaler should
  3372. // maintain. Must be a positive float value. If not defined, the default
  3373. // is 0.8.
  3374. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3375. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3376. // to unconditionally include in API requests. By default, fields with
  3377. // empty values are omitted from API requests. However, any non-pointer,
  3378. // non-interface field appearing in ForceSendFields will be sent to the
  3379. // server regardless of whether the field is empty or not. This may be
  3380. // used to include empty fields in Patch requests.
  3381. ForceSendFields []string `json:"-"`
  3382. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3383. // include in API requests with the JSON null value. By default, fields
  3384. // with empty values are omitted from API requests. However, any field
  3385. // with an empty value appearing in NullFields will be sent to the
  3386. // server as null. It is an error if a field in this list has a
  3387. // non-empty value. This may be used to include null fields in Patch
  3388. // requests.
  3389. NullFields []string `json:"-"`
  3390. }
  3391. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  3392. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3393. raw := NoMethod(*s)
  3394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3395. }
  3396. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  3397. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3398. var s1 struct {
  3399. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3400. *NoMethod
  3401. }
  3402. s1.NoMethod = (*NoMethod)(s)
  3403. if err := json.Unmarshal(data, &s1); err != nil {
  3404. return err
  3405. }
  3406. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3407. return nil
  3408. }
  3409. // Backend: Message containing information of one individual backend.
  3410. type Backend struct {
  3411. // BalancingMode: Specifies the balancing mode for this backend. For
  3412. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3413. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3414. // TCP/SSL).
  3415. //
  3416. // For Internal Load Balancing, the default and only supported mode is
  3417. // CONNECTION.
  3418. //
  3419. // Possible values:
  3420. // "CONNECTION"
  3421. // "RATE"
  3422. // "UTILIZATION"
  3423. BalancingMode string `json:"balancingMode,omitempty"`
  3424. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3425. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3426. // 1, which means the group will serve up to 100% of its configured
  3427. // capacity (depending on balancingMode). A setting of 0 means the group
  3428. // is completely drained, offering 0% of its available Capacity. Valid
  3429. // range is [0.0,1.0].
  3430. //
  3431. // This cannot be used for internal load balancing.
  3432. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3433. // Description: An optional description of this resource. Provide this
  3434. // property when you create the resource.
  3435. Description string `json:"description,omitempty"`
  3436. // Group: The fully-qualified URL of an Instance Group or Network
  3437. // Endpoint Group resource. In case of instance group this defines the
  3438. // list of instances that serve traffic. Member virtual machine
  3439. // instances from each instance group must live in the same zone as the
  3440. // instance group itself. No two backends in a backend service are
  3441. // allowed to use same Instance Group resource.
  3442. //
  3443. // For Network Endpoint Groups this defines list of endpoints. All
  3444. // endpoints of Network Endpoint Group must be hosted on instances
  3445. // located in the same zone as the Network Endpoint Group.
  3446. //
  3447. // Backend service can not contain mix of Instance Group and Network
  3448. // Endpoint Group backends.
  3449. //
  3450. // Note that you must specify an Instance Group or Network Endpoint
  3451. // Group resource using the fully-qualified URL, rather than a partial
  3452. // URL.
  3453. //
  3454. // When the BackendService has load balancing scheme INTERNAL, the
  3455. // instance group must be within the same region as the BackendService.
  3456. // Network Endpoint Groups are not supported for INTERNAL load balancing
  3457. // scheme.
  3458. Group string `json:"group,omitempty"`
  3459. // MaxConnections: The max number of simultaneous connections for the
  3460. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3461. // modes. For CONNECTION mode, either maxConnections or
  3462. // maxConnectionsPerInstance must be set.
  3463. //
  3464. // This cannot be used for internal load balancing.
  3465. MaxConnections int64 `json:"maxConnections,omitempty"`
  3466. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3467. // that a single backend network endpoint can handle. This is used to
  3468. // calculate the capacity of the group. Can be used in either CONNECTION
  3469. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3470. // maxConnections or maxConnectionsPerEndpoint must be set.
  3471. //
  3472. // This cannot be used for internal load balancing.
  3473. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3474. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3475. // that a single backend instance can handle. This is used to calculate
  3476. // the capacity of the group. Can be used in either CONNECTION or
  3477. // UTILIZATION balancing modes. For CONNECTION mode, either
  3478. // maxConnections or maxConnectionsPerInstance must be set.
  3479. //
  3480. // This cannot be used for internal load balancing.
  3481. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3482. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3483. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3484. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3485. // set.
  3486. //
  3487. // This cannot be used for internal load balancing.
  3488. MaxRate int64 `json:"maxRate,omitempty"`
  3489. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3490. // backend network endpoint can handle. This is used to calculate the
  3491. // capacity of the group. Can be used in either balancing mode. For RATE
  3492. // mode, either maxRate or maxRatePerEndpoint must be set.
  3493. //
  3494. // This cannot be used for internal load balancing.
  3495. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3496. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3497. // backend instance can handle. This is used to calculate the capacity
  3498. // of the group. Can be used in either balancing mode. For RATE mode,
  3499. // either maxRate or maxRatePerInstance must be set.
  3500. //
  3501. // This cannot be used for internal load balancing.
  3502. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3503. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3504. // defines the CPU utilization target for the group. The default is 0.8.
  3505. // Valid range is [0.0, 1.0].
  3506. //
  3507. // This cannot be used for internal load balancing.
  3508. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3509. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3510. // unconditionally include in API requests. By default, fields with
  3511. // empty values are omitted from API requests. However, any non-pointer,
  3512. // non-interface field appearing in ForceSendFields will be sent to the
  3513. // server regardless of whether the field is empty or not. This may be
  3514. // used to include empty fields in Patch requests.
  3515. ForceSendFields []string `json:"-"`
  3516. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3517. // in API requests with the JSON null value. By default, fields with
  3518. // empty values are omitted from API requests. However, any field with
  3519. // an empty value appearing in NullFields will be sent to the server as
  3520. // null. It is an error if a field in this list has a non-empty value.
  3521. // This may be used to include null fields in Patch requests.
  3522. NullFields []string `json:"-"`
  3523. }
  3524. func (s *Backend) MarshalJSON() ([]byte, error) {
  3525. type NoMethod Backend
  3526. raw := NoMethod(*s)
  3527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3528. }
  3529. func (s *Backend) UnmarshalJSON(data []byte) error {
  3530. type NoMethod Backend
  3531. var s1 struct {
  3532. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3533. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3534. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3535. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3536. *NoMethod
  3537. }
  3538. s1.NoMethod = (*NoMethod)(s)
  3539. if err := json.Unmarshal(data, &s1); err != nil {
  3540. return err
  3541. }
  3542. s.CapacityScaler = float64(s1.CapacityScaler)
  3543. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3544. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3545. s.MaxUtilization = float64(s1.MaxUtilization)
  3546. return nil
  3547. }
  3548. // BackendBucket: A BackendBucket resource. This resource defines a
  3549. // Cloud Storage bucket.
  3550. type BackendBucket struct {
  3551. // BucketName: Cloud Storage bucket name.
  3552. BucketName string `json:"bucketName,omitempty"`
  3553. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  3554. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  3555. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3556. // format.
  3557. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3558. // Description: An optional textual description of the resource;
  3559. // provided by the client when the resource is created.
  3560. Description string `json:"description,omitempty"`
  3561. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  3562. EnableCdn bool `json:"enableCdn,omitempty"`
  3563. // Id: [Output Only] Unique identifier for the resource; defined by the
  3564. // server.
  3565. Id uint64 `json:"id,omitempty,string"`
  3566. // Kind: Type of the resource.
  3567. Kind string `json:"kind,omitempty"`
  3568. // Name: Name of the resource. Provided by the client when the resource
  3569. // is created. The name must be 1-63 characters long, and comply with
  3570. // RFC1035. Specifically, the name must be 1-63 characters long and
  3571. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3572. // the first character must be a lowercase letter, and all following
  3573. // characters must be a dash, lowercase letter, or digit, except the
  3574. // last character, which cannot be a dash.
  3575. Name string `json:"name,omitempty"`
  3576. // SelfLink: [Output Only] Server-defined URL for the resource.
  3577. SelfLink string `json:"selfLink,omitempty"`
  3578. // ServerResponse contains the HTTP response code and headers from the
  3579. // server.
  3580. googleapi.ServerResponse `json:"-"`
  3581. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3582. // unconditionally include in API requests. By default, fields with
  3583. // empty values are omitted from API requests. However, any non-pointer,
  3584. // non-interface field appearing in ForceSendFields will be sent to the
  3585. // server regardless of whether the field is empty or not. This may be
  3586. // used to include empty fields in Patch requests.
  3587. ForceSendFields []string `json:"-"`
  3588. // NullFields is a list of field names (e.g. "BucketName") to include in
  3589. // API requests with the JSON null value. By default, fields with empty
  3590. // values are omitted from API requests. However, any field with an
  3591. // empty value appearing in NullFields will be sent to the server as
  3592. // null. It is an error if a field in this list has a non-empty value.
  3593. // This may be used to include null fields in Patch requests.
  3594. NullFields []string `json:"-"`
  3595. }
  3596. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3597. type NoMethod BackendBucket
  3598. raw := NoMethod(*s)
  3599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3600. }
  3601. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3602. // for a backend bucket.
  3603. type BackendBucketCdnPolicy struct {
  3604. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3605. // signed URL request will be considered fresh. After this time period,
  3606. // the response will be revalidated before being served. Defaults to 1hr
  3607. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3608. // will internally behave as though all responses from this backend had
  3609. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3610. // existing Cache-Control header. The actual headers served in responses
  3611. // will not be altered.
  3612. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3613. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3614. // request URLs.
  3615. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3616. // ForceSendFields is a list of field names (e.g.
  3617. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3618. // requests. By default, fields with empty values are omitted from API
  3619. // requests. However, any non-pointer, non-interface field appearing in
  3620. // ForceSendFields will be sent to the server regardless of whether the
  3621. // field is empty or not. This may be used to include empty fields in
  3622. // Patch requests.
  3623. ForceSendFields []string `json:"-"`
  3624. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3625. // to include in API requests with the JSON null value. By default,
  3626. // fields with empty values are omitted from API requests. However, any
  3627. // field with an empty value appearing in NullFields will be sent to the
  3628. // server as null. It is an error if a field in this list has a
  3629. // non-empty value. This may be used to include null fields in Patch
  3630. // requests.
  3631. NullFields []string `json:"-"`
  3632. }
  3633. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3634. type NoMethod BackendBucketCdnPolicy
  3635. raw := NoMethod(*s)
  3636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3637. }
  3638. // BackendBucketList: Contains a list of BackendBucket resources.
  3639. type BackendBucketList struct {
  3640. // Id: [Output Only] Unique identifier for the resource; defined by the
  3641. // server.
  3642. Id string `json:"id,omitempty"`
  3643. // Items: A list of BackendBucket resources.
  3644. Items []*BackendBucket `json:"items,omitempty"`
  3645. // Kind: Type of resource.
  3646. Kind string `json:"kind,omitempty"`
  3647. // NextPageToken: [Output Only] This token allows you to get the next
  3648. // page of results for list requests. If the number of results is larger
  3649. // than maxResults, use the nextPageToken as a value for the query
  3650. // parameter pageToken in the next list request. Subsequent list
  3651. // requests will have their own nextPageToken to continue paging through
  3652. // the results.
  3653. NextPageToken string `json:"nextPageToken,omitempty"`
  3654. // SelfLink: [Output Only] Server-defined URL for this resource.
  3655. SelfLink string `json:"selfLink,omitempty"`
  3656. // Warning: [Output Only] Informational warning message.
  3657. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3658. // ServerResponse contains the HTTP response code and headers from the
  3659. // server.
  3660. googleapi.ServerResponse `json:"-"`
  3661. // ForceSendFields is a list of field names (e.g. "Id") to
  3662. // unconditionally include in API requests. By default, fields with
  3663. // empty values are omitted from API requests. However, any non-pointer,
  3664. // non-interface field appearing in ForceSendFields will be sent to the
  3665. // server regardless of whether the field is empty or not. This may be
  3666. // used to include empty fields in Patch requests.
  3667. ForceSendFields []string `json:"-"`
  3668. // NullFields is a list of field names (e.g. "Id") to include in API
  3669. // requests with the JSON null value. By default, fields with empty
  3670. // values are omitted from API requests. However, any field with an
  3671. // empty value appearing in NullFields will be sent to the server as
  3672. // null. It is an error if a field in this list has a non-empty value.
  3673. // This may be used to include null fields in Patch requests.
  3674. NullFields []string `json:"-"`
  3675. }
  3676. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3677. type NoMethod BackendBucketList
  3678. raw := NoMethod(*s)
  3679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3680. }
  3681. // BackendBucketListWarning: [Output Only] Informational warning
  3682. // message.
  3683. type BackendBucketListWarning struct {
  3684. // Code: [Output Only] A warning code, if applicable. For example,
  3685. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3686. // the response.
  3687. //
  3688. // Possible values:
  3689. // "CLEANUP_FAILED"
  3690. // "DEPRECATED_RESOURCE_USED"
  3691. // "DEPRECATED_TYPE_USED"
  3692. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3693. // "EXPERIMENTAL_TYPE_USED"
  3694. // "EXTERNAL_API_WARNING"
  3695. // "FIELD_VALUE_OVERRIDEN"
  3696. // "INJECTED_KERNELS_DEPRECATED"
  3697. // "MISSING_TYPE_DEPENDENCY"
  3698. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3699. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3700. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3701. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3702. // "NEXT_HOP_NOT_RUNNING"
  3703. // "NOT_CRITICAL_ERROR"
  3704. // "NO_RESULTS_ON_PAGE"
  3705. // "REQUIRED_TOS_AGREEMENT"
  3706. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3707. // "RESOURCE_NOT_DELETED"
  3708. // "SCHEMA_VALIDATION_IGNORED"
  3709. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3710. // "UNDECLARED_PROPERTIES"
  3711. // "UNREACHABLE"
  3712. Code string `json:"code,omitempty"`
  3713. // Data: [Output Only] Metadata about this warning in key: value format.
  3714. // For example:
  3715. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3716. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3717. // Message: [Output Only] A human-readable description of the warning
  3718. // code.
  3719. Message string `json:"message,omitempty"`
  3720. // ForceSendFields is a list of field names (e.g. "Code") to
  3721. // unconditionally include in API requests. By default, fields with
  3722. // empty values are omitted from API requests. However, any non-pointer,
  3723. // non-interface field appearing in ForceSendFields will be sent to the
  3724. // server regardless of whether the field is empty or not. This may be
  3725. // used to include empty fields in Patch requests.
  3726. ForceSendFields []string `json:"-"`
  3727. // NullFields is a list of field names (e.g. "Code") to include in API
  3728. // requests with the JSON null value. By default, fields with empty
  3729. // values are omitted from API requests. However, any field with an
  3730. // empty value appearing in NullFields will be sent to the server as
  3731. // null. It is an error if a field in this list has a non-empty value.
  3732. // This may be used to include null fields in Patch requests.
  3733. NullFields []string `json:"-"`
  3734. }
  3735. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3736. type NoMethod BackendBucketListWarning
  3737. raw := NoMethod(*s)
  3738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3739. }
  3740. type BackendBucketListWarningData struct {
  3741. // Key: [Output Only] A key that provides more detail on the warning
  3742. // being returned. For example, for warnings where there are no results
  3743. // in a list request for a particular zone, this key might be scope and
  3744. // the key value might be the zone name. Other examples might be a key
  3745. // indicating a deprecated resource and a suggested replacement, or a
  3746. // warning about invalid network settings (for example, if an instance
  3747. // attempts to perform IP forwarding but is not enabled for IP
  3748. // forwarding).
  3749. Key string `json:"key,omitempty"`
  3750. // Value: [Output Only] A warning data value corresponding to the key.
  3751. Value string `json:"value,omitempty"`
  3752. // ForceSendFields is a list of field names (e.g. "Key") to
  3753. // unconditionally include in API requests. By default, fields with
  3754. // empty values are omitted from API requests. However, any non-pointer,
  3755. // non-interface field appearing in ForceSendFields will be sent to the
  3756. // server regardless of whether the field is empty or not. This may be
  3757. // used to include empty fields in Patch requests.
  3758. ForceSendFields []string `json:"-"`
  3759. // NullFields is a list of field names (e.g. "Key") to include in API
  3760. // requests with the JSON null value. By default, fields with empty
  3761. // values are omitted from API requests. However, any field with an
  3762. // empty value appearing in NullFields will be sent to the server as
  3763. // null. It is an error if a field in this list has a non-empty value.
  3764. // This may be used to include null fields in Patch requests.
  3765. NullFields []string `json:"-"`
  3766. }
  3767. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3768. type NoMethod BackendBucketListWarningData
  3769. raw := NoMethod(*s)
  3770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3771. }
  3772. // BackendService: A BackendService resource. This resource defines a
  3773. // group of backend virtual machines and their serving capacity. (==
  3774. // resource_for v1.backendService ==) (== resource_for
  3775. // beta.backendService ==)
  3776. type BackendService struct {
  3777. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3778. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3779. // non-persistent and lasts only until the end of the browser session
  3780. // (or equivalent). The maximum allowed value for TTL is one day.
  3781. //
  3782. // When the load balancing scheme is INTERNAL, this field is not used.
  3783. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3784. // Backends: The list of backends that serve this BackendService.
  3785. Backends []*Backend `json:"backends,omitempty"`
  3786. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3787. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3788. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3789. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3790. // format.
  3791. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3792. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3793. // add to proxied requests.
  3794. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3795. // Description: An optional description of this resource. Provide this
  3796. // property when you create the resource.
  3797. Description string `json:"description,omitempty"`
  3798. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3799. //
  3800. // When the load balancing scheme is INTERNAL, this field is not used.
  3801. EnableCDN bool `json:"enableCDN,omitempty"`
  3802. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3803. // stored in this object. This field is used in optimistic locking. This
  3804. // field will be ignored when inserting a BackendService. An up-to-date
  3805. // fingerprint must be provided in order to update the BackendService,
  3806. // otherwise the request will fail with error 412 conditionNotMet.
  3807. //
  3808. // To see the latest fingerprint, make a get() request to retrieve a
  3809. // BackendService.
  3810. Fingerprint string `json:"fingerprint,omitempty"`
  3811. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3812. // HttpsHealthCheck resource for health checking this BackendService.
  3813. // Currently at most one health check can be specified, and a health
  3814. // check is required for Compute Engine backend services. A health check
  3815. // must not be specified for App Engine backend and Cloud Function
  3816. // backend.
  3817. //
  3818. // For internal load balancing, a URL to a HealthCheck resource must be
  3819. // specified instead.
  3820. HealthChecks []string `json:"healthChecks,omitempty"`
  3821. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3822. // Id: [Output Only] The unique identifier for the resource. This
  3823. // identifier is defined by the server.
  3824. Id uint64 `json:"id,omitempty,string"`
  3825. // Kind: [Output Only] Type of resource. Always compute#backendService
  3826. // for backend services.
  3827. Kind string `json:"kind,omitempty"`
  3828. // LoadBalancingScheme: Indicates whether the backend service will be
  3829. // used with internal or external load balancing. A backend service
  3830. // created for one type of load balancing cannot be used with the other.
  3831. // Possible values are INTERNAL and EXTERNAL.
  3832. //
  3833. // Possible values:
  3834. // "EXTERNAL"
  3835. // "INTERNAL"
  3836. // "INVALID_LOAD_BALANCING_SCHEME"
  3837. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3838. // Name: Name of the resource. Provided by the client when the resource
  3839. // is created. The name must be 1-63 characters long, and comply with
  3840. // RFC1035. Specifically, the name must be 1-63 characters long and
  3841. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3842. // the first character must be a lowercase letter, and all following
  3843. // characters must be a dash, lowercase letter, or digit, except the
  3844. // last character, which cannot be a dash.
  3845. Name string `json:"name,omitempty"`
  3846. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3847. // backend. The default value is 80.
  3848. //
  3849. // This cannot be used for internal load balancing.
  3850. Port int64 `json:"port,omitempty"`
  3851. // PortName: Name of backend port. The same name should appear in the
  3852. // instance groups referenced by this service. Required when the load
  3853. // balancing scheme is EXTERNAL.
  3854. //
  3855. // When the load balancing scheme is INTERNAL, this field is not used.
  3856. PortName string `json:"portName,omitempty"`
  3857. // Protocol: The protocol this BackendService uses to communicate with
  3858. // backends.
  3859. //
  3860. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3861. // HTTP.
  3862. //
  3863. // For internal load balancing, the possible values are TCP and UDP, and
  3864. // the default is TCP.
  3865. //
  3866. // Possible values:
  3867. // "HTTP"
  3868. // "HTTP2"
  3869. // "HTTPS"
  3870. // "SSL"
  3871. // "TCP"
  3872. // "UDP"
  3873. Protocol string `json:"protocol,omitempty"`
  3874. // Region: [Output Only] URL of the region where the regional backend
  3875. // service resides. This field is not applicable to global backend
  3876. // services. You must specify this field as part of the HTTP request
  3877. // URL. It is not settable as a field in the request body.
  3878. Region string `json:"region,omitempty"`
  3879. // SecurityPolicy: [Output Only] The resource URL for the security
  3880. // policy associated with this backend service.
  3881. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3882. // SelfLink: [Output Only] Server-defined URL for the resource.
  3883. SelfLink string `json:"selfLink,omitempty"`
  3884. // SessionAffinity: Type of session affinity to use. The default is
  3885. // NONE.
  3886. //
  3887. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3888. // or GENERATED_COOKIE.
  3889. //
  3890. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3891. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3892. //
  3893. // When the protocol is UDP, this field is not used.
  3894. //
  3895. // Possible values:
  3896. // "CLIENT_IP"
  3897. // "CLIENT_IP_PORT_PROTO"
  3898. // "CLIENT_IP_PROTO"
  3899. // "GENERATED_COOKIE"
  3900. // "NONE"
  3901. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3902. // TimeoutSec: How many seconds to wait for the backend before
  3903. // considering it a failed request. Default is 30 seconds.
  3904. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3905. // ServerResponse contains the HTTP response code and headers from the
  3906. // server.
  3907. googleapi.ServerResponse `json:"-"`
  3908. // ForceSendFields is a list of field names (e.g.
  3909. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3910. // By default, fields with empty values are omitted from API requests.
  3911. // However, any non-pointer, non-interface field appearing in
  3912. // ForceSendFields will be sent to the server regardless of whether the
  3913. // field is empty or not. This may be used to include empty fields in
  3914. // Patch requests.
  3915. ForceSendFields []string `json:"-"`
  3916. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3917. // include in API requests with the JSON null value. By default, fields
  3918. // with empty values are omitted from API requests. However, any field
  3919. // with an empty value appearing in NullFields will be sent to the
  3920. // server as null. It is an error if a field in this list has a
  3921. // non-empty value. This may be used to include null fields in Patch
  3922. // requests.
  3923. NullFields []string `json:"-"`
  3924. }
  3925. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3926. type NoMethod BackendService
  3927. raw := NoMethod(*s)
  3928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3929. }
  3930. // BackendServiceAggregatedList: Contains a list of
  3931. // BackendServicesScopedList.
  3932. type BackendServiceAggregatedList struct {
  3933. // Id: [Output Only] Unique identifier for the resource; defined by the
  3934. // server.
  3935. Id string `json:"id,omitempty"`
  3936. // Items: A list of BackendServicesScopedList resources.
  3937. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3938. // Kind: Type of resource.
  3939. Kind string `json:"kind,omitempty"`
  3940. // NextPageToken: [Output Only] This token allows you to get the next
  3941. // page of results for list requests. If the number of results is larger
  3942. // than maxResults, use the nextPageToken as a value for the query
  3943. // parameter pageToken in the next list request. Subsequent list
  3944. // requests will have their own nextPageToken to continue paging through
  3945. // the results.
  3946. NextPageToken string `json:"nextPageToken,omitempty"`
  3947. // SelfLink: [Output Only] Server-defined URL for this resource.
  3948. SelfLink string `json:"selfLink,omitempty"`
  3949. // Warning: [Output Only] Informational warning message.
  3950. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3951. // ServerResponse contains the HTTP response code and headers from the
  3952. // server.
  3953. googleapi.ServerResponse `json:"-"`
  3954. // ForceSendFields is a list of field names (e.g. "Id") to
  3955. // unconditionally include in API requests. By default, fields with
  3956. // empty values are omitted from API requests. However, any non-pointer,
  3957. // non-interface field appearing in ForceSendFields will be sent to the
  3958. // server regardless of whether the field is empty or not. This may be
  3959. // used to include empty fields in Patch requests.
  3960. ForceSendFields []string `json:"-"`
  3961. // NullFields is a list of field names (e.g. "Id") to include in API
  3962. // requests with the JSON null value. By default, fields with empty
  3963. // values are omitted from API requests. However, any field with an
  3964. // empty value appearing in NullFields will be sent to the server as
  3965. // null. It is an error if a field in this list has a non-empty value.
  3966. // This may be used to include null fields in Patch requests.
  3967. NullFields []string `json:"-"`
  3968. }
  3969. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3970. type NoMethod BackendServiceAggregatedList
  3971. raw := NoMethod(*s)
  3972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3973. }
  3974. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3975. // warning message.
  3976. type BackendServiceAggregatedListWarning struct {
  3977. // Code: [Output Only] A warning code, if applicable. For example,
  3978. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3979. // the response.
  3980. //
  3981. // Possible values:
  3982. // "CLEANUP_FAILED"
  3983. // "DEPRECATED_RESOURCE_USED"
  3984. // "DEPRECATED_TYPE_USED"
  3985. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3986. // "EXPERIMENTAL_TYPE_USED"
  3987. // "EXTERNAL_API_WARNING"
  3988. // "FIELD_VALUE_OVERRIDEN"
  3989. // "INJECTED_KERNELS_DEPRECATED"
  3990. // "MISSING_TYPE_DEPENDENCY"
  3991. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3992. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3993. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3994. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3995. // "NEXT_HOP_NOT_RUNNING"
  3996. // "NOT_CRITICAL_ERROR"
  3997. // "NO_RESULTS_ON_PAGE"
  3998. // "REQUIRED_TOS_AGREEMENT"
  3999. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4000. // "RESOURCE_NOT_DELETED"
  4001. // "SCHEMA_VALIDATION_IGNORED"
  4002. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4003. // "UNDECLARED_PROPERTIES"
  4004. // "UNREACHABLE"
  4005. Code string `json:"code,omitempty"`
  4006. // Data: [Output Only] Metadata about this warning in key: value format.
  4007. // For example:
  4008. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4009. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  4010. // Message: [Output Only] A human-readable description of the warning
  4011. // code.
  4012. Message string `json:"message,omitempty"`
  4013. // ForceSendFields is a list of field names (e.g. "Code") to
  4014. // unconditionally include in API requests. By default, fields with
  4015. // empty values are omitted from API requests. However, any non-pointer,
  4016. // non-interface field appearing in ForceSendFields will be sent to the
  4017. // server regardless of whether the field is empty or not. This may be
  4018. // used to include empty fields in Patch requests.
  4019. ForceSendFields []string `json:"-"`
  4020. // NullFields is a list of field names (e.g. "Code") to include in API
  4021. // requests with the JSON null value. By default, fields with empty
  4022. // values are omitted from API requests. However, any field with an
  4023. // empty value appearing in NullFields will be sent to the server as
  4024. // null. It is an error if a field in this list has a non-empty value.
  4025. // This may be used to include null fields in Patch requests.
  4026. NullFields []string `json:"-"`
  4027. }
  4028. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4029. type NoMethod BackendServiceAggregatedListWarning
  4030. raw := NoMethod(*s)
  4031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4032. }
  4033. type BackendServiceAggregatedListWarningData struct {
  4034. // Key: [Output Only] A key that provides more detail on the warning
  4035. // being returned. For example, for warnings where there are no results
  4036. // in a list request for a particular zone, this key might be scope and
  4037. // the key value might be the zone name. Other examples might be a key
  4038. // indicating a deprecated resource and a suggested replacement, or a
  4039. // warning about invalid network settings (for example, if an instance
  4040. // attempts to perform IP forwarding but is not enabled for IP
  4041. // forwarding).
  4042. Key string `json:"key,omitempty"`
  4043. // Value: [Output Only] A warning data value corresponding to the key.
  4044. Value string `json:"value,omitempty"`
  4045. // ForceSendFields is a list of field names (e.g. "Key") to
  4046. // unconditionally include in API requests. By default, fields with
  4047. // empty values are omitted from API requests. However, any non-pointer,
  4048. // non-interface field appearing in ForceSendFields will be sent to the
  4049. // server regardless of whether the field is empty or not. This may be
  4050. // used to include empty fields in Patch requests.
  4051. ForceSendFields []string `json:"-"`
  4052. // NullFields is a list of field names (e.g. "Key") to include in API
  4053. // requests with the JSON null value. By default, fields with empty
  4054. // values are omitted from API requests. However, any field with an
  4055. // empty value appearing in NullFields will be sent to the server as
  4056. // null. It is an error if a field in this list has a non-empty value.
  4057. // This may be used to include null fields in Patch requests.
  4058. NullFields []string `json:"-"`
  4059. }
  4060. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4061. type NoMethod BackendServiceAggregatedListWarningData
  4062. raw := NoMethod(*s)
  4063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4064. }
  4065. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  4066. // for a backend service.
  4067. type BackendServiceCdnPolicy struct {
  4068. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  4069. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  4070. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4071. // signed URL request will be considered fresh. After this time period,
  4072. // the response will be revalidated before being served. Defaults to 1hr
  4073. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4074. // will internally behave as though all responses from this backend had
  4075. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4076. // existing Cache-Control header. The actual headers served in responses
  4077. // will not be altered.
  4078. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4079. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4080. // request URLs.
  4081. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4082. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  4083. // unconditionally include in API requests. By default, fields with
  4084. // empty values are omitted from API requests. However, any non-pointer,
  4085. // non-interface field appearing in ForceSendFields will be sent to the
  4086. // server regardless of whether the field is empty or not. This may be
  4087. // used to include empty fields in Patch requests.
  4088. ForceSendFields []string `json:"-"`
  4089. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  4090. // include in API requests with the JSON null value. By default, fields
  4091. // with empty values are omitted from API requests. However, any field
  4092. // with an empty value appearing in NullFields will be sent to the
  4093. // server as null. It is an error if a field in this list has a
  4094. // non-empty value. This may be used to include null fields in Patch
  4095. // requests.
  4096. NullFields []string `json:"-"`
  4097. }
  4098. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  4099. type NoMethod BackendServiceCdnPolicy
  4100. raw := NoMethod(*s)
  4101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4102. }
  4103. type BackendServiceGroupHealth struct {
  4104. // HealthStatus: Health state of the backend instances or endpoints in
  4105. // requested instance or network endpoint group, determined based on
  4106. // configured health checks.
  4107. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  4108. // Kind: [Output Only] Type of resource. Always
  4109. // compute#backendServiceGroupHealth for the health of backend services.
  4110. Kind string `json:"kind,omitempty"`
  4111. // ServerResponse contains the HTTP response code and headers from the
  4112. // server.
  4113. googleapi.ServerResponse `json:"-"`
  4114. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  4115. // unconditionally include in API requests. By default, fields with
  4116. // empty values are omitted from API requests. However, any non-pointer,
  4117. // non-interface field appearing in ForceSendFields will be sent to the
  4118. // server regardless of whether the field is empty or not. This may be
  4119. // used to include empty fields in Patch requests.
  4120. ForceSendFields []string `json:"-"`
  4121. // NullFields is a list of field names (e.g. "HealthStatus") to include
  4122. // in API requests with the JSON null value. By default, fields with
  4123. // empty values are omitted from API requests. However, any field with
  4124. // an empty value appearing in NullFields will be sent to the server as
  4125. // null. It is an error if a field in this list has a non-empty value.
  4126. // This may be used to include null fields in Patch requests.
  4127. NullFields []string `json:"-"`
  4128. }
  4129. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  4130. type NoMethod BackendServiceGroupHealth
  4131. raw := NoMethod(*s)
  4132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4133. }
  4134. // BackendServiceIAP: Identity-Aware Proxy
  4135. type BackendServiceIAP struct {
  4136. Enabled bool `json:"enabled,omitempty"`
  4137. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  4138. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  4139. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  4140. // field oauth2_client_secret above.
  4141. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  4142. // ForceSendFields is a list of field names (e.g. "Enabled") to
  4143. // unconditionally include in API requests. By default, fields with
  4144. // empty values are omitted from API requests. However, any non-pointer,
  4145. // non-interface field appearing in ForceSendFields will be sent to the
  4146. // server regardless of whether the field is empty or not. This may be
  4147. // used to include empty fields in Patch requests.
  4148. ForceSendFields []string `json:"-"`
  4149. // NullFields is a list of field names (e.g. "Enabled") to include in
  4150. // API requests with the JSON null value. By default, fields with empty
  4151. // values are omitted from API requests. However, any field with an
  4152. // empty value appearing in NullFields will be sent to the server as
  4153. // null. It is an error if a field in this list has a non-empty value.
  4154. // This may be used to include null fields in Patch requests.
  4155. NullFields []string `json:"-"`
  4156. }
  4157. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  4158. type NoMethod BackendServiceIAP
  4159. raw := NoMethod(*s)
  4160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4161. }
  4162. // BackendServiceList: Contains a list of BackendService resources.
  4163. type BackendServiceList struct {
  4164. // Id: [Output Only] Unique identifier for the resource; defined by the
  4165. // server.
  4166. Id string `json:"id,omitempty"`
  4167. // Items: A list of BackendService resources.
  4168. Items []*BackendService `json:"items,omitempty"`
  4169. // Kind: [Output Only] Type of resource. Always
  4170. // compute#backendServiceList for lists of backend services.
  4171. Kind string `json:"kind,omitempty"`
  4172. // NextPageToken: [Output Only] This token allows you to get the next
  4173. // page of results for list requests. If the number of results is larger
  4174. // than maxResults, use the nextPageToken as a value for the query
  4175. // parameter pageToken in the next list request. Subsequent list
  4176. // requests will have their own nextPageToken to continue paging through
  4177. // the results.
  4178. NextPageToken string `json:"nextPageToken,omitempty"`
  4179. // SelfLink: [Output Only] Server-defined URL for this resource.
  4180. SelfLink string `json:"selfLink,omitempty"`
  4181. // Warning: [Output Only] Informational warning message.
  4182. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  4183. // ServerResponse contains the HTTP response code and headers from the
  4184. // server.
  4185. googleapi.ServerResponse `json:"-"`
  4186. // ForceSendFields is a list of field names (e.g. "Id") to
  4187. // unconditionally include in API requests. By default, fields with
  4188. // empty values are omitted from API requests. However, any non-pointer,
  4189. // non-interface field appearing in ForceSendFields will be sent to the
  4190. // server regardless of whether the field is empty or not. This may be
  4191. // used to include empty fields in Patch requests.
  4192. ForceSendFields []string `json:"-"`
  4193. // NullFields is a list of field names (e.g. "Id") to include in API
  4194. // requests with the JSON null value. By default, fields with empty
  4195. // values are omitted from API requests. However, any field with an
  4196. // empty value appearing in NullFields will be sent to the server as
  4197. // null. It is an error if a field in this list has a non-empty value.
  4198. // This may be used to include null fields in Patch requests.
  4199. NullFields []string `json:"-"`
  4200. }
  4201. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  4202. type NoMethod BackendServiceList
  4203. raw := NoMethod(*s)
  4204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4205. }
  4206. // BackendServiceListWarning: [Output Only] Informational warning
  4207. // message.
  4208. type BackendServiceListWarning struct {
  4209. // Code: [Output Only] A warning code, if applicable. For example,
  4210. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4211. // the response.
  4212. //
  4213. // Possible values:
  4214. // "CLEANUP_FAILED"
  4215. // "DEPRECATED_RESOURCE_USED"
  4216. // "DEPRECATED_TYPE_USED"
  4217. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4218. // "EXPERIMENTAL_TYPE_USED"
  4219. // "EXTERNAL_API_WARNING"
  4220. // "FIELD_VALUE_OVERRIDEN"
  4221. // "INJECTED_KERNELS_DEPRECATED"
  4222. // "MISSING_TYPE_DEPENDENCY"
  4223. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4224. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4225. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4226. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4227. // "NEXT_HOP_NOT_RUNNING"
  4228. // "NOT_CRITICAL_ERROR"
  4229. // "NO_RESULTS_ON_PAGE"
  4230. // "REQUIRED_TOS_AGREEMENT"
  4231. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4232. // "RESOURCE_NOT_DELETED"
  4233. // "SCHEMA_VALIDATION_IGNORED"
  4234. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4235. // "UNDECLARED_PROPERTIES"
  4236. // "UNREACHABLE"
  4237. Code string `json:"code,omitempty"`
  4238. // Data: [Output Only] Metadata about this warning in key: value format.
  4239. // For example:
  4240. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4241. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4242. // Message: [Output Only] A human-readable description of the warning
  4243. // code.
  4244. Message string `json:"message,omitempty"`
  4245. // ForceSendFields is a list of field names (e.g. "Code") to
  4246. // unconditionally include in API requests. By default, fields with
  4247. // empty values are omitted from API requests. However, any non-pointer,
  4248. // non-interface field appearing in ForceSendFields will be sent to the
  4249. // server regardless of whether the field is empty or not. This may be
  4250. // used to include empty fields in Patch requests.
  4251. ForceSendFields []string `json:"-"`
  4252. // NullFields is a list of field names (e.g. "Code") to include in API
  4253. // requests with the JSON null value. By default, fields with empty
  4254. // values are omitted from API requests. However, any field with an
  4255. // empty value appearing in NullFields will be sent to the server as
  4256. // null. It is an error if a field in this list has a non-empty value.
  4257. // This may be used to include null fields in Patch requests.
  4258. NullFields []string `json:"-"`
  4259. }
  4260. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4261. type NoMethod BackendServiceListWarning
  4262. raw := NoMethod(*s)
  4263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4264. }
  4265. type BackendServiceListWarningData struct {
  4266. // Key: [Output Only] A key that provides more detail on the warning
  4267. // being returned. For example, for warnings where there are no results
  4268. // in a list request for a particular zone, this key might be scope and
  4269. // the key value might be the zone name. Other examples might be a key
  4270. // indicating a deprecated resource and a suggested replacement, or a
  4271. // warning about invalid network settings (for example, if an instance
  4272. // attempts to perform IP forwarding but is not enabled for IP
  4273. // forwarding).
  4274. Key string `json:"key,omitempty"`
  4275. // Value: [Output Only] A warning data value corresponding to the key.
  4276. Value string `json:"value,omitempty"`
  4277. // ForceSendFields is a list of field names (e.g. "Key") to
  4278. // unconditionally include in API requests. By default, fields with
  4279. // empty values are omitted from API requests. However, any non-pointer,
  4280. // non-interface field appearing in ForceSendFields will be sent to the
  4281. // server regardless of whether the field is empty or not. This may be
  4282. // used to include empty fields in Patch requests.
  4283. ForceSendFields []string `json:"-"`
  4284. // NullFields is a list of field names (e.g. "Key") to include in API
  4285. // requests with the JSON null value. By default, fields with empty
  4286. // values are omitted from API requests. However, any field with an
  4287. // empty value appearing in NullFields will be sent to the server as
  4288. // null. It is an error if a field in this list has a non-empty value.
  4289. // This may be used to include null fields in Patch requests.
  4290. NullFields []string `json:"-"`
  4291. }
  4292. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  4293. type NoMethod BackendServiceListWarningData
  4294. raw := NoMethod(*s)
  4295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4296. }
  4297. type BackendServiceReference struct {
  4298. BackendService string `json:"backendService,omitempty"`
  4299. // ForceSendFields is a list of field names (e.g. "BackendService") to
  4300. // unconditionally include in API requests. By default, fields with
  4301. // empty values are omitted from API requests. However, any non-pointer,
  4302. // non-interface field appearing in ForceSendFields will be sent to the
  4303. // server regardless of whether the field is empty or not. This may be
  4304. // used to include empty fields in Patch requests.
  4305. ForceSendFields []string `json:"-"`
  4306. // NullFields is a list of field names (e.g. "BackendService") to
  4307. // include in API requests with the JSON null value. By default, fields
  4308. // with empty values are omitted from API requests. However, any field
  4309. // with an empty value appearing in NullFields will be sent to the
  4310. // server as null. It is an error if a field in this list has a
  4311. // non-empty value. This may be used to include null fields in Patch
  4312. // requests.
  4313. NullFields []string `json:"-"`
  4314. }
  4315. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  4316. type NoMethod BackendServiceReference
  4317. raw := NoMethod(*s)
  4318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4319. }
  4320. type BackendServicesScopedList struct {
  4321. // BackendServices: A list of BackendServices contained in this scope.
  4322. BackendServices []*BackendService `json:"backendServices,omitempty"`
  4323. // Warning: Informational warning which replaces the list of backend
  4324. // services when the list is empty.
  4325. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  4326. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  4327. // unconditionally include in API requests. By default, fields with
  4328. // empty values are omitted from API requests. However, any non-pointer,
  4329. // non-interface field appearing in ForceSendFields will be sent to the
  4330. // server regardless of whether the field is empty or not. This may be
  4331. // used to include empty fields in Patch requests.
  4332. ForceSendFields []string `json:"-"`
  4333. // NullFields is a list of field names (e.g. "BackendServices") to
  4334. // include in API requests with the JSON null value. By default, fields
  4335. // with empty values are omitted from API requests. However, any field
  4336. // with an empty value appearing in NullFields will be sent to the
  4337. // server as null. It is an error if a field in this list has a
  4338. // non-empty value. This may be used to include null fields in Patch
  4339. // requests.
  4340. NullFields []string `json:"-"`
  4341. }
  4342. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  4343. type NoMethod BackendServicesScopedList
  4344. raw := NoMethod(*s)
  4345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4346. }
  4347. // BackendServicesScopedListWarning: Informational warning which
  4348. // replaces the list of backend services when the list is empty.
  4349. type BackendServicesScopedListWarning struct {
  4350. // Code: [Output Only] A warning code, if applicable. For example,
  4351. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4352. // the response.
  4353. //
  4354. // Possible values:
  4355. // "CLEANUP_FAILED"
  4356. // "DEPRECATED_RESOURCE_USED"
  4357. // "DEPRECATED_TYPE_USED"
  4358. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4359. // "EXPERIMENTAL_TYPE_USED"
  4360. // "EXTERNAL_API_WARNING"
  4361. // "FIELD_VALUE_OVERRIDEN"
  4362. // "INJECTED_KERNELS_DEPRECATED"
  4363. // "MISSING_TYPE_DEPENDENCY"
  4364. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4365. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4366. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4367. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4368. // "NEXT_HOP_NOT_RUNNING"
  4369. // "NOT_CRITICAL_ERROR"
  4370. // "NO_RESULTS_ON_PAGE"
  4371. // "REQUIRED_TOS_AGREEMENT"
  4372. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4373. // "RESOURCE_NOT_DELETED"
  4374. // "SCHEMA_VALIDATION_IGNORED"
  4375. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4376. // "UNDECLARED_PROPERTIES"
  4377. // "UNREACHABLE"
  4378. Code string `json:"code,omitempty"`
  4379. // Data: [Output Only] Metadata about this warning in key: value format.
  4380. // For example:
  4381. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4382. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  4383. // Message: [Output Only] A human-readable description of the warning
  4384. // code.
  4385. Message string `json:"message,omitempty"`
  4386. // ForceSendFields is a list of field names (e.g. "Code") to
  4387. // unconditionally include in API requests. By default, fields with
  4388. // empty values are omitted from API requests. However, any non-pointer,
  4389. // non-interface field appearing in ForceSendFields will be sent to the
  4390. // server regardless of whether the field is empty or not. This may be
  4391. // used to include empty fields in Patch requests.
  4392. ForceSendFields []string `json:"-"`
  4393. // NullFields is a list of field names (e.g. "Code") to include in API
  4394. // requests with the JSON null value. By default, fields with empty
  4395. // values are omitted from API requests. However, any field with an
  4396. // empty value appearing in NullFields will be sent to the server as
  4397. // null. It is an error if a field in this list has a non-empty value.
  4398. // This may be used to include null fields in Patch requests.
  4399. NullFields []string `json:"-"`
  4400. }
  4401. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  4402. type NoMethod BackendServicesScopedListWarning
  4403. raw := NoMethod(*s)
  4404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4405. }
  4406. type BackendServicesScopedListWarningData struct {
  4407. // Key: [Output Only] A key that provides more detail on the warning
  4408. // being returned. For example, for warnings where there are no results
  4409. // in a list request for a particular zone, this key might be scope and
  4410. // the key value might be the zone name. Other examples might be a key
  4411. // indicating a deprecated resource and a suggested replacement, or a
  4412. // warning about invalid network settings (for example, if an instance
  4413. // attempts to perform IP forwarding but is not enabled for IP
  4414. // forwarding).
  4415. Key string `json:"key,omitempty"`
  4416. // Value: [Output Only] A warning data value corresponding to the key.
  4417. Value string `json:"value,omitempty"`
  4418. // ForceSendFields is a list of field names (e.g. "Key") to
  4419. // unconditionally include in API requests. By default, fields with
  4420. // empty values are omitted from API requests. However, any non-pointer,
  4421. // non-interface field appearing in ForceSendFields will be sent to the
  4422. // server regardless of whether the field is empty or not. This may be
  4423. // used to include empty fields in Patch requests.
  4424. ForceSendFields []string `json:"-"`
  4425. // NullFields is a list of field names (e.g. "Key") to include in API
  4426. // requests with the JSON null value. By default, fields with empty
  4427. // values are omitted from API requests. However, any field with an
  4428. // empty value appearing in NullFields will be sent to the server as
  4429. // null. It is an error if a field in this list has a non-empty value.
  4430. // This may be used to include null fields in Patch requests.
  4431. NullFields []string `json:"-"`
  4432. }
  4433. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4434. type NoMethod BackendServicesScopedListWarningData
  4435. raw := NoMethod(*s)
  4436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4437. }
  4438. // Binding: Associates `members` with a `role`.
  4439. type Binding struct {
  4440. // Condition: Unimplemented. The condition that is associated with this
  4441. // binding. NOTE: an unsatisfied condition will not allow user access
  4442. // via current binding. Different bindings, including their conditions,
  4443. // are examined independently.
  4444. Condition *Expr `json:"condition,omitempty"`
  4445. // Members: Specifies the identities requesting access for a Cloud
  4446. // Platform resource. `members` can have the following values:
  4447. //
  4448. // * `allUsers`: A special identifier that represents anyone who is on
  4449. // the internet; with or without a Google account.
  4450. //
  4451. // * `allAuthenticatedUsers`: A special identifier that represents
  4452. // anyone who is authenticated with a Google account or a service
  4453. // account.
  4454. //
  4455. // * `user:{emailid}`: An email address that represents a specific
  4456. // Google account. For example, `alice@gmail.com` .
  4457. //
  4458. //
  4459. //
  4460. // * `serviceAccount:{emailid}`: An email address that represents a
  4461. // service account. For example,
  4462. // `my-other-app@appspot.gserviceaccount.com`.
  4463. //
  4464. // * `group:{emailid}`: An email address that represents a Google group.
  4465. // For example, `admins@example.com`.
  4466. //
  4467. //
  4468. //
  4469. // * `domain:{domain}`: A Google Apps domain name that represents all
  4470. // the users of that domain. For example, `google.com` or `example.com`.
  4471. Members []string `json:"members,omitempty"`
  4472. // Role: Role that is assigned to `members`. For example,
  4473. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  4474. Role string `json:"role,omitempty"`
  4475. // ForceSendFields is a list of field names (e.g. "Condition") to
  4476. // unconditionally include in API requests. By default, fields with
  4477. // empty values are omitted from API requests. However, any non-pointer,
  4478. // non-interface field appearing in ForceSendFields will be sent to the
  4479. // server regardless of whether the field is empty or not. This may be
  4480. // used to include empty fields in Patch requests.
  4481. ForceSendFields []string `json:"-"`
  4482. // NullFields is a list of field names (e.g. "Condition") to include in
  4483. // API requests with the JSON null value. By default, fields with empty
  4484. // values are omitted from API requests. However, any field with an
  4485. // empty value appearing in NullFields will be sent to the server as
  4486. // null. It is an error if a field in this list has a non-empty value.
  4487. // This may be used to include null fields in Patch requests.
  4488. NullFields []string `json:"-"`
  4489. }
  4490. func (s *Binding) MarshalJSON() ([]byte, error) {
  4491. type NoMethod Binding
  4492. raw := NoMethod(*s)
  4493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4494. }
  4495. type CacheInvalidationRule struct {
  4496. // Host: If set, this invalidation rule will only apply to requests with
  4497. // a Host header matching host.
  4498. Host string `json:"host,omitempty"`
  4499. Path string `json:"path,omitempty"`
  4500. // ForceSendFields is a list of field names (e.g. "Host") to
  4501. // unconditionally include in API requests. By default, fields with
  4502. // empty values are omitted from API requests. However, any non-pointer,
  4503. // non-interface field appearing in ForceSendFields will be sent to the
  4504. // server regardless of whether the field is empty or not. This may be
  4505. // used to include empty fields in Patch requests.
  4506. ForceSendFields []string `json:"-"`
  4507. // NullFields is a list of field names (e.g. "Host") to include in API
  4508. // requests with the JSON null value. By default, fields with empty
  4509. // values are omitted from API requests. However, any field with an
  4510. // empty value appearing in NullFields will be sent to the server as
  4511. // null. It is an error if a field in this list has a non-empty value.
  4512. // This may be used to include null fields in Patch requests.
  4513. NullFields []string `json:"-"`
  4514. }
  4515. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  4516. type NoMethod CacheInvalidationRule
  4517. raw := NoMethod(*s)
  4518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4519. }
  4520. // CacheKeyPolicy: Message containing what to include in the cache key
  4521. // for a request for Cloud CDN.
  4522. type CacheKeyPolicy struct {
  4523. // IncludeHost: If true, requests to different hosts will be cached
  4524. // separately.
  4525. IncludeHost bool `json:"includeHost,omitempty"`
  4526. // IncludeProtocol: If true, http and https requests will be cached
  4527. // separately.
  4528. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  4529. // IncludeQueryString: If true, include query string parameters in the
  4530. // cache key according to query_string_whitelist and
  4531. // query_string_blacklist. If neither is set, the entire query string
  4532. // will be included. If false, the query string will be excluded from
  4533. // the cache key entirely.
  4534. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  4535. // QueryStringBlacklist: Names of query string parameters to exclude in
  4536. // cache keys. All other parameters will be included. Either specify
  4537. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4538. // '=' will be percent encoded and not treated as delimiters.
  4539. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  4540. // QueryStringWhitelist: Names of query string parameters to include in
  4541. // cache keys. All other parameters will be excluded. Either specify
  4542. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4543. // '=' will be percent encoded and not treated as delimiters.
  4544. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  4545. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  4546. // unconditionally include in API requests. By default, fields with
  4547. // empty values are omitted from API requests. However, any non-pointer,
  4548. // non-interface field appearing in ForceSendFields will be sent to the
  4549. // server regardless of whether the field is empty or not. This may be
  4550. // used to include empty fields in Patch requests.
  4551. ForceSendFields []string `json:"-"`
  4552. // NullFields is a list of field names (e.g. "IncludeHost") to include
  4553. // in API requests with the JSON null value. By default, fields with
  4554. // empty values are omitted from API requests. However, any field with
  4555. // an empty value appearing in NullFields will be sent to the server as
  4556. // null. It is an error if a field in this list has a non-empty value.
  4557. // This may be used to include null fields in Patch requests.
  4558. NullFields []string `json:"-"`
  4559. }
  4560. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  4561. type NoMethod CacheKeyPolicy
  4562. raw := NoMethod(*s)
  4563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4564. }
  4565. // Commitment: Represents a Commitment resource. Creating a Commitment
  4566. // resource means that you are purchasing a committed use contract with
  4567. // an explicit start and end time. You can create commitments based on
  4568. // vCPUs and memory usage and receive discounted rates. For full
  4569. // details, read Signing Up for Committed Use Discounts.
  4570. //
  4571. // Committed use discounts are subject to Google Cloud Platform's
  4572. // Service Specific Terms. By purchasing a committed use discount, you
  4573. // agree to these terms. Committed use discounts will not renew, so you
  4574. // must purchase a new commitment to continue receiving discounts. (==
  4575. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  4576. type Commitment struct {
  4577. // Allocations: List of allocations for this commitment.
  4578. Allocations []*Allocation `json:"allocations,omitempty"`
  4579. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4580. // format.
  4581. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4582. // Description: An optional description of this resource. Provide this
  4583. // property when you create the resource.
  4584. Description string `json:"description,omitempty"`
  4585. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  4586. // format.
  4587. EndTimestamp string `json:"endTimestamp,omitempty"`
  4588. // Id: [Output Only] The unique identifier for the resource. This
  4589. // identifier is defined by the server.
  4590. Id uint64 `json:"id,omitempty,string"`
  4591. // Kind: [Output Only] Type of the resource. Always compute#commitment
  4592. // for commitments.
  4593. Kind string `json:"kind,omitempty"`
  4594. // Name: Name of the resource. Provided by the client when the resource
  4595. // is created. The name must be 1-63 characters long, and comply with
  4596. // RFC1035. Specifically, the name must be 1-63 characters long and
  4597. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4598. // the first character must be a lowercase letter, and all following
  4599. // characters must be a dash, lowercase letter, or digit, except the
  4600. // last character, which cannot be a dash.
  4601. Name string `json:"name,omitempty"`
  4602. // Plan: The plan for this commitment, which determines duration and
  4603. // discount rate. The currently supported plans are TWELVE_MONTH (1
  4604. // year), and THIRTY_SIX_MONTH (3 years).
  4605. //
  4606. // Possible values:
  4607. // "INVALID"
  4608. // "THIRTY_SIX_MONTH"
  4609. // "TWELVE_MONTH"
  4610. Plan string `json:"plan,omitempty"`
  4611. // Region: [Output Only] URL of the region where this commitment may be
  4612. // used.
  4613. Region string `json:"region,omitempty"`
  4614. // Resources: A list of commitment amounts for particular resources.
  4615. // Note that VCPU and MEMORY resource commitments must occur together.
  4616. Resources []*ResourceCommitment `json:"resources,omitempty"`
  4617. // SelfLink: [Output Only] Server-defined URL for the resource.
  4618. SelfLink string `json:"selfLink,omitempty"`
  4619. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  4620. // format.
  4621. StartTimestamp string `json:"startTimestamp,omitempty"`
  4622. // Status: [Output Only] Status of the commitment with regards to
  4623. // eventual expiration (each commitment has an end date defined). One of
  4624. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  4625. //
  4626. // Possible values:
  4627. // "ACTIVE"
  4628. // "CREATING"
  4629. // "EXPIRED"
  4630. // "NOT_YET_ACTIVE"
  4631. Status string `json:"status,omitempty"`
  4632. // StatusMessage: [Output Only] An optional, human-readable explanation
  4633. // of the status.
  4634. StatusMessage string `json:"statusMessage,omitempty"`
  4635. // ServerResponse contains the HTTP response code and headers from the
  4636. // server.
  4637. googleapi.ServerResponse `json:"-"`
  4638. // ForceSendFields is a list of field names (e.g. "Allocations") to
  4639. // unconditionally include in API requests. By default, fields with
  4640. // empty values are omitted from API requests. However, any non-pointer,
  4641. // non-interface field appearing in ForceSendFields will be sent to the
  4642. // server regardless of whether the field is empty or not. This may be
  4643. // used to include empty fields in Patch requests.
  4644. ForceSendFields []string `json:"-"`
  4645. // NullFields is a list of field names (e.g. "Allocations") to include
  4646. // in API requests with the JSON null value. By default, fields with
  4647. // empty values are omitted from API requests. However, any field with
  4648. // an empty value appearing in NullFields will be sent to the server as
  4649. // null. It is an error if a field in this list has a non-empty value.
  4650. // This may be used to include null fields in Patch requests.
  4651. NullFields []string `json:"-"`
  4652. }
  4653. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4654. type NoMethod Commitment
  4655. raw := NoMethod(*s)
  4656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4657. }
  4658. type CommitmentAggregatedList struct {
  4659. // Id: [Output Only] Unique identifier for the resource; defined by the
  4660. // server.
  4661. Id string `json:"id,omitempty"`
  4662. // Items: A list of CommitmentsScopedList resources.
  4663. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4664. // Kind: [Output Only] Type of resource. Always
  4665. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4666. Kind string `json:"kind,omitempty"`
  4667. // NextPageToken: [Output Only] This token allows you to get the next
  4668. // page of results for list requests. If the number of results is larger
  4669. // than maxResults, use the nextPageToken as a value for the query
  4670. // parameter pageToken in the next list request. Subsequent list
  4671. // requests will have their own nextPageToken to continue paging through
  4672. // the results.
  4673. NextPageToken string `json:"nextPageToken,omitempty"`
  4674. // SelfLink: [Output Only] Server-defined URL for this resource.
  4675. SelfLink string `json:"selfLink,omitempty"`
  4676. // Warning: [Output Only] Informational warning message.
  4677. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4678. // ServerResponse contains the HTTP response code and headers from the
  4679. // server.
  4680. googleapi.ServerResponse `json:"-"`
  4681. // ForceSendFields is a list of field names (e.g. "Id") to
  4682. // unconditionally include in API requests. By default, fields with
  4683. // empty values are omitted from API requests. However, any non-pointer,
  4684. // non-interface field appearing in ForceSendFields will be sent to the
  4685. // server regardless of whether the field is empty or not. This may be
  4686. // used to include empty fields in Patch requests.
  4687. ForceSendFields []string `json:"-"`
  4688. // NullFields is a list of field names (e.g. "Id") to include in API
  4689. // requests with the JSON null value. By default, fields with empty
  4690. // values are omitted from API requests. However, any field with an
  4691. // empty value appearing in NullFields will be sent to the server as
  4692. // null. It is an error if a field in this list has a non-empty value.
  4693. // This may be used to include null fields in Patch requests.
  4694. NullFields []string `json:"-"`
  4695. }
  4696. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4697. type NoMethod CommitmentAggregatedList
  4698. raw := NoMethod(*s)
  4699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4700. }
  4701. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4702. // message.
  4703. type CommitmentAggregatedListWarning struct {
  4704. // Code: [Output Only] A warning code, if applicable. For example,
  4705. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4706. // the response.
  4707. //
  4708. // Possible values:
  4709. // "CLEANUP_FAILED"
  4710. // "DEPRECATED_RESOURCE_USED"
  4711. // "DEPRECATED_TYPE_USED"
  4712. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4713. // "EXPERIMENTAL_TYPE_USED"
  4714. // "EXTERNAL_API_WARNING"
  4715. // "FIELD_VALUE_OVERRIDEN"
  4716. // "INJECTED_KERNELS_DEPRECATED"
  4717. // "MISSING_TYPE_DEPENDENCY"
  4718. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4719. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4720. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4721. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4722. // "NEXT_HOP_NOT_RUNNING"
  4723. // "NOT_CRITICAL_ERROR"
  4724. // "NO_RESULTS_ON_PAGE"
  4725. // "REQUIRED_TOS_AGREEMENT"
  4726. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4727. // "RESOURCE_NOT_DELETED"
  4728. // "SCHEMA_VALIDATION_IGNORED"
  4729. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4730. // "UNDECLARED_PROPERTIES"
  4731. // "UNREACHABLE"
  4732. Code string `json:"code,omitempty"`
  4733. // Data: [Output Only] Metadata about this warning in key: value format.
  4734. // For example:
  4735. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4736. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4737. // Message: [Output Only] A human-readable description of the warning
  4738. // code.
  4739. Message string `json:"message,omitempty"`
  4740. // ForceSendFields is a list of field names (e.g. "Code") to
  4741. // unconditionally include in API requests. By default, fields with
  4742. // empty values are omitted from API requests. However, any non-pointer,
  4743. // non-interface field appearing in ForceSendFields will be sent to the
  4744. // server regardless of whether the field is empty or not. This may be
  4745. // used to include empty fields in Patch requests.
  4746. ForceSendFields []string `json:"-"`
  4747. // NullFields is a list of field names (e.g. "Code") to include in API
  4748. // requests with the JSON null value. By default, fields with empty
  4749. // values are omitted from API requests. However, any field with an
  4750. // empty value appearing in NullFields will be sent to the server as
  4751. // null. It is an error if a field in this list has a non-empty value.
  4752. // This may be used to include null fields in Patch requests.
  4753. NullFields []string `json:"-"`
  4754. }
  4755. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4756. type NoMethod CommitmentAggregatedListWarning
  4757. raw := NoMethod(*s)
  4758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4759. }
  4760. type CommitmentAggregatedListWarningData struct {
  4761. // Key: [Output Only] A key that provides more detail on the warning
  4762. // being returned. For example, for warnings where there are no results
  4763. // in a list request for a particular zone, this key might be scope and
  4764. // the key value might be the zone name. Other examples might be a key
  4765. // indicating a deprecated resource and a suggested replacement, or a
  4766. // warning about invalid network settings (for example, if an instance
  4767. // attempts to perform IP forwarding but is not enabled for IP
  4768. // forwarding).
  4769. Key string `json:"key,omitempty"`
  4770. // Value: [Output Only] A warning data value corresponding to the key.
  4771. Value string `json:"value,omitempty"`
  4772. // ForceSendFields is a list of field names (e.g. "Key") to
  4773. // unconditionally include in API requests. By default, fields with
  4774. // empty values are omitted from API requests. However, any non-pointer,
  4775. // non-interface field appearing in ForceSendFields will be sent to the
  4776. // server regardless of whether the field is empty or not. This may be
  4777. // used to include empty fields in Patch requests.
  4778. ForceSendFields []string `json:"-"`
  4779. // NullFields is a list of field names (e.g. "Key") to include in API
  4780. // requests with the JSON null value. By default, fields with empty
  4781. // values are omitted from API requests. However, any field with an
  4782. // empty value appearing in NullFields will be sent to the server as
  4783. // null. It is an error if a field in this list has a non-empty value.
  4784. // This may be used to include null fields in Patch requests.
  4785. NullFields []string `json:"-"`
  4786. }
  4787. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4788. type NoMethod CommitmentAggregatedListWarningData
  4789. raw := NoMethod(*s)
  4790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4791. }
  4792. // CommitmentList: Contains a list of Commitment resources.
  4793. type CommitmentList struct {
  4794. // Id: [Output Only] Unique identifier for the resource; defined by the
  4795. // server.
  4796. Id string `json:"id,omitempty"`
  4797. // Items: A list of Commitment resources.
  4798. Items []*Commitment `json:"items,omitempty"`
  4799. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4800. // for lists of commitments.
  4801. Kind string `json:"kind,omitempty"`
  4802. // NextPageToken: [Output Only] This token allows you to get the next
  4803. // page of results for list requests. If the number of results is larger
  4804. // than maxResults, use the nextPageToken as a value for the query
  4805. // parameter pageToken in the next list request. Subsequent list
  4806. // requests will have their own nextPageToken to continue paging through
  4807. // the results.
  4808. NextPageToken string `json:"nextPageToken,omitempty"`
  4809. // SelfLink: [Output Only] Server-defined URL for this resource.
  4810. SelfLink string `json:"selfLink,omitempty"`
  4811. // Warning: [Output Only] Informational warning message.
  4812. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4813. // ServerResponse contains the HTTP response code and headers from the
  4814. // server.
  4815. googleapi.ServerResponse `json:"-"`
  4816. // ForceSendFields is a list of field names (e.g. "Id") to
  4817. // unconditionally include in API requests. By default, fields with
  4818. // empty values are omitted from API requests. However, any non-pointer,
  4819. // non-interface field appearing in ForceSendFields will be sent to the
  4820. // server regardless of whether the field is empty or not. This may be
  4821. // used to include empty fields in Patch requests.
  4822. ForceSendFields []string `json:"-"`
  4823. // NullFields is a list of field names (e.g. "Id") to include in API
  4824. // requests with the JSON null value. By default, fields with empty
  4825. // values are omitted from API requests. However, any field with an
  4826. // empty value appearing in NullFields will be sent to the server as
  4827. // null. It is an error if a field in this list has a non-empty value.
  4828. // This may be used to include null fields in Patch requests.
  4829. NullFields []string `json:"-"`
  4830. }
  4831. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  4832. type NoMethod CommitmentList
  4833. raw := NoMethod(*s)
  4834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4835. }
  4836. // CommitmentListWarning: [Output Only] Informational warning message.
  4837. type CommitmentListWarning struct {
  4838. // Code: [Output Only] A warning code, if applicable. For example,
  4839. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4840. // the response.
  4841. //
  4842. // Possible values:
  4843. // "CLEANUP_FAILED"
  4844. // "DEPRECATED_RESOURCE_USED"
  4845. // "DEPRECATED_TYPE_USED"
  4846. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4847. // "EXPERIMENTAL_TYPE_USED"
  4848. // "EXTERNAL_API_WARNING"
  4849. // "FIELD_VALUE_OVERRIDEN"
  4850. // "INJECTED_KERNELS_DEPRECATED"
  4851. // "MISSING_TYPE_DEPENDENCY"
  4852. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4853. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4854. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4855. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4856. // "NEXT_HOP_NOT_RUNNING"
  4857. // "NOT_CRITICAL_ERROR"
  4858. // "NO_RESULTS_ON_PAGE"
  4859. // "REQUIRED_TOS_AGREEMENT"
  4860. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4861. // "RESOURCE_NOT_DELETED"
  4862. // "SCHEMA_VALIDATION_IGNORED"
  4863. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4864. // "UNDECLARED_PROPERTIES"
  4865. // "UNREACHABLE"
  4866. Code string `json:"code,omitempty"`
  4867. // Data: [Output Only] Metadata about this warning in key: value format.
  4868. // For example:
  4869. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4870. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4871. // Message: [Output Only] A human-readable description of the warning
  4872. // code.
  4873. Message string `json:"message,omitempty"`
  4874. // ForceSendFields is a list of field names (e.g. "Code") to
  4875. // unconditionally include in API requests. By default, fields with
  4876. // empty values are omitted from API requests. However, any non-pointer,
  4877. // non-interface field appearing in ForceSendFields will be sent to the
  4878. // server regardless of whether the field is empty or not. This may be
  4879. // used to include empty fields in Patch requests.
  4880. ForceSendFields []string `json:"-"`
  4881. // NullFields is a list of field names (e.g. "Code") to include in API
  4882. // requests with the JSON null value. By default, fields with empty
  4883. // values are omitted from API requests. However, any field with an
  4884. // empty value appearing in NullFields will be sent to the server as
  4885. // null. It is an error if a field in this list has a non-empty value.
  4886. // This may be used to include null fields in Patch requests.
  4887. NullFields []string `json:"-"`
  4888. }
  4889. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4890. type NoMethod CommitmentListWarning
  4891. raw := NoMethod(*s)
  4892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4893. }
  4894. type CommitmentListWarningData struct {
  4895. // Key: [Output Only] A key that provides more detail on the warning
  4896. // being returned. For example, for warnings where there are no results
  4897. // in a list request for a particular zone, this key might be scope and
  4898. // the key value might be the zone name. Other examples might be a key
  4899. // indicating a deprecated resource and a suggested replacement, or a
  4900. // warning about invalid network settings (for example, if an instance
  4901. // attempts to perform IP forwarding but is not enabled for IP
  4902. // forwarding).
  4903. Key string `json:"key,omitempty"`
  4904. // Value: [Output Only] A warning data value corresponding to the key.
  4905. Value string `json:"value,omitempty"`
  4906. // ForceSendFields is a list of field names (e.g. "Key") to
  4907. // unconditionally include in API requests. By default, fields with
  4908. // empty values are omitted from API requests. However, any non-pointer,
  4909. // non-interface field appearing in ForceSendFields will be sent to the
  4910. // server regardless of whether the field is empty or not. This may be
  4911. // used to include empty fields in Patch requests.
  4912. ForceSendFields []string `json:"-"`
  4913. // NullFields is a list of field names (e.g. "Key") to include in API
  4914. // requests with the JSON null value. By default, fields with empty
  4915. // values are omitted from API requests. However, any field with an
  4916. // empty value appearing in NullFields will be sent to the server as
  4917. // null. It is an error if a field in this list has a non-empty value.
  4918. // This may be used to include null fields in Patch requests.
  4919. NullFields []string `json:"-"`
  4920. }
  4921. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4922. type NoMethod CommitmentListWarningData
  4923. raw := NoMethod(*s)
  4924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4925. }
  4926. type CommitmentsScopedList struct {
  4927. // Commitments: [Output Only] A list of commitments contained in this
  4928. // scope.
  4929. Commitments []*Commitment `json:"commitments,omitempty"`
  4930. // Warning: [Output Only] Informational warning which replaces the list
  4931. // of commitments when the list is empty.
  4932. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4933. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4934. // unconditionally include in API requests. By default, fields with
  4935. // empty values are omitted from API requests. However, any non-pointer,
  4936. // non-interface field appearing in ForceSendFields will be sent to the
  4937. // server regardless of whether the field is empty or not. This may be
  4938. // used to include empty fields in Patch requests.
  4939. ForceSendFields []string `json:"-"`
  4940. // NullFields is a list of field names (e.g. "Commitments") to include
  4941. // in API requests with the JSON null value. By default, fields with
  4942. // empty values are omitted from API requests. However, any field with
  4943. // an empty value appearing in NullFields will be sent to the server as
  4944. // null. It is an error if a field in this list has a non-empty value.
  4945. // This may be used to include null fields in Patch requests.
  4946. NullFields []string `json:"-"`
  4947. }
  4948. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4949. type NoMethod CommitmentsScopedList
  4950. raw := NoMethod(*s)
  4951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4952. }
  4953. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4954. // which replaces the list of commitments when the list is empty.
  4955. type CommitmentsScopedListWarning struct {
  4956. // Code: [Output Only] A warning code, if applicable. For example,
  4957. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4958. // the response.
  4959. //
  4960. // Possible values:
  4961. // "CLEANUP_FAILED"
  4962. // "DEPRECATED_RESOURCE_USED"
  4963. // "DEPRECATED_TYPE_USED"
  4964. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4965. // "EXPERIMENTAL_TYPE_USED"
  4966. // "EXTERNAL_API_WARNING"
  4967. // "FIELD_VALUE_OVERRIDEN"
  4968. // "INJECTED_KERNELS_DEPRECATED"
  4969. // "MISSING_TYPE_DEPENDENCY"
  4970. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4971. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4972. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4973. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4974. // "NEXT_HOP_NOT_RUNNING"
  4975. // "NOT_CRITICAL_ERROR"
  4976. // "NO_RESULTS_ON_PAGE"
  4977. // "REQUIRED_TOS_AGREEMENT"
  4978. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4979. // "RESOURCE_NOT_DELETED"
  4980. // "SCHEMA_VALIDATION_IGNORED"
  4981. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4982. // "UNDECLARED_PROPERTIES"
  4983. // "UNREACHABLE"
  4984. Code string `json:"code,omitempty"`
  4985. // Data: [Output Only] Metadata about this warning in key: value format.
  4986. // For example:
  4987. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4988. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4989. // Message: [Output Only] A human-readable description of the warning
  4990. // code.
  4991. Message string `json:"message,omitempty"`
  4992. // ForceSendFields is a list of field names (e.g. "Code") to
  4993. // unconditionally include in API requests. By default, fields with
  4994. // empty values are omitted from API requests. However, any non-pointer,
  4995. // non-interface field appearing in ForceSendFields will be sent to the
  4996. // server regardless of whether the field is empty or not. This may be
  4997. // used to include empty fields in Patch requests.
  4998. ForceSendFields []string `json:"-"`
  4999. // NullFields is a list of field names (e.g. "Code") to include in API
  5000. // requests with the JSON null value. By default, fields with empty
  5001. // values are omitted from API requests. However, any field with an
  5002. // empty value appearing in NullFields will be sent to the server as
  5003. // null. It is an error if a field in this list has a non-empty value.
  5004. // This may be used to include null fields in Patch requests.
  5005. NullFields []string `json:"-"`
  5006. }
  5007. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  5008. type NoMethod CommitmentsScopedListWarning
  5009. raw := NoMethod(*s)
  5010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5011. }
  5012. type CommitmentsScopedListWarningData struct {
  5013. // Key: [Output Only] A key that provides more detail on the warning
  5014. // being returned. For example, for warnings where there are no results
  5015. // in a list request for a particular zone, this key might be scope and
  5016. // the key value might be the zone name. Other examples might be a key
  5017. // indicating a deprecated resource and a suggested replacement, or a
  5018. // warning about invalid network settings (for example, if an instance
  5019. // attempts to perform IP forwarding but is not enabled for IP
  5020. // forwarding).
  5021. Key string `json:"key,omitempty"`
  5022. // Value: [Output Only] A warning data value corresponding to the key.
  5023. Value string `json:"value,omitempty"`
  5024. // ForceSendFields is a list of field names (e.g. "Key") to
  5025. // unconditionally include in API requests. By default, fields with
  5026. // empty values are omitted from API requests. However, any non-pointer,
  5027. // non-interface field appearing in ForceSendFields will be sent to the
  5028. // server regardless of whether the field is empty or not. This may be
  5029. // used to include empty fields in Patch requests.
  5030. ForceSendFields []string `json:"-"`
  5031. // NullFields is a list of field names (e.g. "Key") to include in API
  5032. // requests with the JSON null value. By default, fields with empty
  5033. // values are omitted from API requests. However, any field with an
  5034. // empty value appearing in NullFields will be sent to the server as
  5035. // null. It is an error if a field in this list has a non-empty value.
  5036. // This may be used to include null fields in Patch requests.
  5037. NullFields []string `json:"-"`
  5038. }
  5039. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5040. type NoMethod CommitmentsScopedListWarningData
  5041. raw := NoMethod(*s)
  5042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5043. }
  5044. // Condition: A condition to be met.
  5045. type Condition struct {
  5046. // Iam: Trusted attributes supplied by the IAM system.
  5047. //
  5048. // Possible values:
  5049. // "APPROVER"
  5050. // "ATTRIBUTION"
  5051. // "AUTHORITY"
  5052. // "CREDENTIALS_TYPE"
  5053. // "JUSTIFICATION_TYPE"
  5054. // "NO_ATTR"
  5055. // "SECURITY_REALM"
  5056. Iam string `json:"iam,omitempty"`
  5057. // Op: An operator to apply the subject with.
  5058. //
  5059. // Possible values:
  5060. // "DISCHARGED"
  5061. // "EQUALS"
  5062. // "IN"
  5063. // "NOT_EQUALS"
  5064. // "NOT_IN"
  5065. // "NO_OP"
  5066. Op string `json:"op,omitempty"`
  5067. // Svc: Trusted attributes discharged by the service.
  5068. Svc string `json:"svc,omitempty"`
  5069. // Sys: Trusted attributes supplied by any service that owns resources
  5070. // and uses the IAM system for access control.
  5071. //
  5072. // Possible values:
  5073. // "IP"
  5074. // "NAME"
  5075. // "NO_ATTR"
  5076. // "REGION"
  5077. // "SERVICE"
  5078. Sys string `json:"sys,omitempty"`
  5079. // Value: DEPRECATED. Use 'values' instead.
  5080. Value string `json:"value,omitempty"`
  5081. // Values: The objects of the condition. This is mutually exclusive with
  5082. // 'value'.
  5083. Values []string `json:"values,omitempty"`
  5084. // ForceSendFields is a list of field names (e.g. "Iam") to
  5085. // unconditionally include in API requests. By default, fields with
  5086. // empty values are omitted from API requests. However, any non-pointer,
  5087. // non-interface field appearing in ForceSendFields will be sent to the
  5088. // server regardless of whether the field is empty or not. This may be
  5089. // used to include empty fields in Patch requests.
  5090. ForceSendFields []string `json:"-"`
  5091. // NullFields is a list of field names (e.g. "Iam") to include in API
  5092. // requests with the JSON null value. By default, fields with empty
  5093. // values are omitted from API requests. However, any field with an
  5094. // empty value appearing in NullFields will be sent to the server as
  5095. // null. It is an error if a field in this list has a non-empty value.
  5096. // This may be used to include null fields in Patch requests.
  5097. NullFields []string `json:"-"`
  5098. }
  5099. func (s *Condition) MarshalJSON() ([]byte, error) {
  5100. type NoMethod Condition
  5101. raw := NoMethod(*s)
  5102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5103. }
  5104. // ConnectionDraining: Message containing connection draining
  5105. // configuration.
  5106. type ConnectionDraining struct {
  5107. // DrainingTimeoutSec: Time for which instance will be drained (not
  5108. // accept new connections, but still work to finish started).
  5109. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  5110. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  5111. // to unconditionally include in API requests. By default, fields with
  5112. // empty values are omitted from API requests. However, any non-pointer,
  5113. // non-interface field appearing in ForceSendFields will be sent to the
  5114. // server regardless of whether the field is empty or not. This may be
  5115. // used to include empty fields in Patch requests.
  5116. ForceSendFields []string `json:"-"`
  5117. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  5118. // include in API requests with the JSON null value. By default, fields
  5119. // with empty values are omitted from API requests. However, any field
  5120. // with an empty value appearing in NullFields will be sent to the
  5121. // server as null. It is an error if a field in this list has a
  5122. // non-empty value. This may be used to include null fields in Patch
  5123. // requests.
  5124. NullFields []string `json:"-"`
  5125. }
  5126. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  5127. type NoMethod ConnectionDraining
  5128. raw := NoMethod(*s)
  5129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5130. }
  5131. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  5132. type CustomerEncryptionKey struct {
  5133. // KmsKeyName: The name of the encryption key that is stored in Google
  5134. // Cloud KMS.
  5135. KmsKeyName string `json:"kmsKeyName,omitempty"`
  5136. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  5137. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  5138. RawKey string `json:"rawKey,omitempty"`
  5139. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  5140. // 2048-bit customer-supplied encryption key to either encrypt or
  5141. // decrypt this resource.
  5142. //
  5143. // The key must meet the following requirements before you can provide
  5144. // it to Compute Engine:
  5145. // - The key is wrapped using a RSA public key certificate provided by
  5146. // Google.
  5147. // - After being wrapped, the key must be encoded in RFC 4648 base64
  5148. // encoding. Gets the RSA public key certificate provided by Google
  5149. // at:
  5150. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  5151. // ss.pem
  5152. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  5153. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  5154. // customer-supplied encryption key that protects this resource.
  5155. Sha256 string `json:"sha256,omitempty"`
  5156. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  5157. // unconditionally include in API requests. By default, fields with
  5158. // empty values are omitted from API requests. However, any non-pointer,
  5159. // non-interface field appearing in ForceSendFields will be sent to the
  5160. // server regardless of whether the field is empty or not. This may be
  5161. // used to include empty fields in Patch requests.
  5162. ForceSendFields []string `json:"-"`
  5163. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  5164. // API requests with the JSON null value. By default, fields with empty
  5165. // values are omitted from API requests. However, any field with an
  5166. // empty value appearing in NullFields will be sent to the server as
  5167. // null. It is an error if a field in this list has a non-empty value.
  5168. // This may be used to include null fields in Patch requests.
  5169. NullFields []string `json:"-"`
  5170. }
  5171. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  5172. type NoMethod CustomerEncryptionKey
  5173. raw := NoMethod(*s)
  5174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5175. }
  5176. type CustomerEncryptionKeyProtectedDisk struct {
  5177. // DiskEncryptionKey: Decrypts data associated with the disk with a
  5178. // customer-supplied encryption key.
  5179. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5180. // Source: Specifies a valid partial or full URL to an existing
  5181. // Persistent Disk resource. This field is only applicable for
  5182. // persistent disks.
  5183. Source string `json:"source,omitempty"`
  5184. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  5185. // to unconditionally include in API requests. By default, fields with
  5186. // empty values are omitted from API requests. However, any non-pointer,
  5187. // non-interface field appearing in ForceSendFields will be sent to the
  5188. // server regardless of whether the field is empty or not. This may be
  5189. // used to include empty fields in Patch requests.
  5190. ForceSendFields []string `json:"-"`
  5191. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  5192. // include in API requests with the JSON null value. By default, fields
  5193. // with empty values are omitted from API requests. However, any field
  5194. // with an empty value appearing in NullFields will be sent to the
  5195. // server as null. It is an error if a field in this list has a
  5196. // non-empty value. This may be used to include null fields in Patch
  5197. // requests.
  5198. NullFields []string `json:"-"`
  5199. }
  5200. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  5201. type NoMethod CustomerEncryptionKeyProtectedDisk
  5202. raw := NoMethod(*s)
  5203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5204. }
  5205. // DeprecationStatus: Deprecation status for a public resource.
  5206. type DeprecationStatus struct {
  5207. // Deleted: An optional RFC3339 timestamp on or after which the state of
  5208. // this resource is intended to change to DELETED. This is only
  5209. // informational and the status will not change unless the client
  5210. // explicitly changes it.
  5211. Deleted string `json:"deleted,omitempty"`
  5212. // Deprecated: An optional RFC3339 timestamp on or after which the state
  5213. // of this resource is intended to change to DEPRECATED. This is only
  5214. // informational and the status will not change unless the client
  5215. // explicitly changes it.
  5216. Deprecated string `json:"deprecated,omitempty"`
  5217. // Obsolete: An optional RFC3339 timestamp on or after which the state
  5218. // of this resource is intended to change to OBSOLETE. This is only
  5219. // informational and the status will not change unless the client
  5220. // explicitly changes it.
  5221. Obsolete string `json:"obsolete,omitempty"`
  5222. // Replacement: The URL of the suggested replacement for a deprecated
  5223. // resource. The suggested replacement resource must be the same kind of
  5224. // resource as the deprecated resource.
  5225. Replacement string `json:"replacement,omitempty"`
  5226. // State: The deprecation state of this resource. This can be
  5227. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  5228. // resource using a DEPRECATED resource will return successfully, but
  5229. // with a warning indicating the deprecated resource and recommending
  5230. // its replacement. Operations which use OBSOLETE or DELETED resources
  5231. // will be rejected and result in an error.
  5232. //
  5233. // Possible values:
  5234. // "DELETED"
  5235. // "DEPRECATED"
  5236. // "OBSOLETE"
  5237. State string `json:"state,omitempty"`
  5238. // ForceSendFields is a list of field names (e.g. "Deleted") to
  5239. // unconditionally include in API requests. By default, fields with
  5240. // empty values are omitted from API requests. However, any non-pointer,
  5241. // non-interface field appearing in ForceSendFields will be sent to the
  5242. // server regardless of whether the field is empty or not. This may be
  5243. // used to include empty fields in Patch requests.
  5244. ForceSendFields []string `json:"-"`
  5245. // NullFields is a list of field names (e.g. "Deleted") to include in
  5246. // API requests with the JSON null value. By default, fields with empty
  5247. // values are omitted from API requests. However, any field with an
  5248. // empty value appearing in NullFields will be sent to the server as
  5249. // null. It is an error if a field in this list has a non-empty value.
  5250. // This may be used to include null fields in Patch requests.
  5251. NullFields []string `json:"-"`
  5252. }
  5253. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  5254. type NoMethod DeprecationStatus
  5255. raw := NoMethod(*s)
  5256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5257. }
  5258. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  5259. // resource_for v1.disks ==)
  5260. type Disk struct {
  5261. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5262. // format.
  5263. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5264. // Description: An optional description of this resource. Provide this
  5265. // property when you create the resource.
  5266. Description string `json:"description,omitempty"`
  5267. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  5268. // encryption key.
  5269. //
  5270. // After you encrypt a disk with a customer-supplied key, you must
  5271. // provide the same key if you use the disk later (e.g. to create a disk
  5272. // snapshot or an image, or to attach the disk to a virtual
  5273. // machine).
  5274. //
  5275. // Customer-supplied encryption keys do not protect access to metadata
  5276. // of the disk.
  5277. //
  5278. // If you do not provide an encryption key when creating the disk, then
  5279. // the disk will be encrypted using an automatically generated key and
  5280. // you do not need to provide a key to use the disk later.
  5281. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5282. // GuestOsFeatures: A list of features to enable on the guest operating
  5283. // system. Applicable only for bootable images. Read Enabling guest
  5284. // operating system features to see a list of available options.
  5285. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  5286. // Id: [Output Only] The unique identifier for the resource. This
  5287. // identifier is defined by the server.
  5288. Id uint64 `json:"id,omitempty,string"`
  5289. // Kind: [Output Only] Type of the resource. Always compute#disk for
  5290. // disks.
  5291. Kind string `json:"kind,omitempty"`
  5292. // LabelFingerprint: A fingerprint for the labels being applied to this
  5293. // disk, which is essentially a hash of the labels set used for
  5294. // optimistic locking. The fingerprint is initially generated by Compute
  5295. // Engine and changes after every request to modify or update labels.
  5296. // You must always provide an up-to-date fingerprint hash in order to
  5297. // update or change labels, otherwise the request will fail with error
  5298. // 412 conditionNotMet.
  5299. //
  5300. // To see the latest fingerprint, make a get() request to retrieve a
  5301. // disk.
  5302. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5303. // Labels: Labels to apply to this disk. These can be later modified by
  5304. // the setLabels method.
  5305. Labels map[string]string `json:"labels,omitempty"`
  5306. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  5307. // text format.
  5308. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  5309. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  5310. // text format.
  5311. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  5312. // LicenseCodes: Integer license codes indicating which licenses are
  5313. // attached to this disk.
  5314. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  5315. // Licenses: A list of publicly visible licenses. Reserved for Google's
  5316. // use.
  5317. Licenses []string `json:"licenses,omitempty"`
  5318. // Name: Name of the resource. Provided by the client when the resource
  5319. // is created. The name must be 1-63 characters long, and comply with
  5320. // RFC1035. Specifically, the name must be 1-63 characters long and
  5321. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5322. // the first character must be a lowercase letter, and all following
  5323. // characters must be a dash, lowercase letter, or digit, except the
  5324. // last character, which cannot be a dash.
  5325. Name string `json:"name,omitempty"`
  5326. // Options: Internal use only.
  5327. Options string `json:"options,omitempty"`
  5328. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  5329. // in bytes. If not present in a request, a default value is used.
  5330. // Currently supported sizes are 4096 and 16384, other sizes may be
  5331. // added in the future. If an unsupported value is requested, the error
  5332. // message will list the supported values for the caller's project.
  5333. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  5334. // Region: [Output Only] URL of the region where the disk resides. Only
  5335. // applicable for regional resources. You must specify this field as
  5336. // part of the HTTP request URL. It is not settable as a field in the
  5337. // request body.
  5338. Region string `json:"region,omitempty"`
  5339. // ReplicaZones: URLs of the zones where the disk should be replicated
  5340. // to. Only applicable for regional resources.
  5341. ReplicaZones []string `json:"replicaZones,omitempty"`
  5342. // ResourcePolicies: Resource policies applied to this disk for
  5343. // automatic snapshot creations.
  5344. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  5345. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5346. // resource.
  5347. SelfLink string `json:"selfLink,omitempty"`
  5348. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  5349. // this field when creating a persistent disk using the sourceImage or
  5350. // sourceSnapshot parameter, or specify it alone to create an empty
  5351. // persistent disk.
  5352. //
  5353. // If you specify this field along with sourceImage or sourceSnapshot,
  5354. // the value of sizeGb must not be less than the size of the sourceImage
  5355. // or the size of the snapshot. Acceptable values are 1 to 65536,
  5356. // inclusive.
  5357. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5358. // SourceImage: The source image used to create this disk. If the source
  5359. // image is deleted, this field will not be set.
  5360. //
  5361. // To create a disk with one of the public operating system images,
  5362. // specify the image by its family name. For example, specify
  5363. // family/debian-9 to use the latest Debian 9
  5364. // image:
  5365. // projects/debian-cloud/global/images/family/debian-9
  5366. //
  5367. //
  5368. // Alternati
  5369. // vely, use a specific version of a public operating system
  5370. // image:
  5371. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  5372. //
  5373. //
  5374. //
  5375. // To create a disk with a custom image that you created, specify the
  5376. // image name in the following
  5377. // format:
  5378. // global/images/my-custom-image
  5379. //
  5380. //
  5381. // You can also specify a custom image by its image family, which
  5382. // returns the latest version of the image in that family. Replace the
  5383. // image name with
  5384. // family/family-name:
  5385. // global/images/family/my-image-family
  5386. SourceImage string `json:"sourceImage,omitempty"`
  5387. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  5388. // source image. Required if the source image is protected by a
  5389. // customer-supplied encryption key.
  5390. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  5391. // SourceImageId: [Output Only] The ID value of the image used to create
  5392. // this disk. This value identifies the exact image that was used to
  5393. // create this persistent disk. For example, if you created the
  5394. // persistent disk from an image that was later deleted and recreated
  5395. // under the same name, the source image ID would identify the exact
  5396. // version of the image that was used.
  5397. SourceImageId string `json:"sourceImageId,omitempty"`
  5398. // SourceSnapshot: The source snapshot used to create this disk. You can
  5399. // provide this as a partial or full URL to the resource. For example,
  5400. // the following are valid values:
  5401. // -
  5402. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  5403. // - projects/project/global/snapshots/snapshot
  5404. // - global/snapshots/snapshot
  5405. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  5406. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  5407. // the source snapshot. Required if the source snapshot is protected by
  5408. // a customer-supplied encryption key.
  5409. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  5410. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  5411. // create this disk. This value identifies the exact snapshot that was
  5412. // used to create this persistent disk. For example, if you created the
  5413. // persistent disk from a snapshot that was later deleted and recreated
  5414. // under the same name, the source snapshot ID would identify the exact
  5415. // version of the snapshot that was used.
  5416. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  5417. // Status: [Output Only] The status of disk creation.
  5418. //
  5419. // Possible values:
  5420. // "CREATING"
  5421. // "FAILED"
  5422. // "READY"
  5423. // "RESTORING"
  5424. Status string `json:"status,omitempty"`
  5425. // StorageType: [Deprecated] Storage type of the persistent disk.
  5426. //
  5427. // Possible values:
  5428. // "HDD"
  5429. // "SSD"
  5430. StorageType string `json:"storageType,omitempty"`
  5431. // Type: URL of the disk type resource describing which disk type to use
  5432. // to create the disk. Provide this when creating the disk. For example:
  5433. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  5434. Type string `json:"type,omitempty"`
  5435. // Users: [Output Only] Links to the users of the disk (attached
  5436. // instances) in form: project/zones/zone/instances/instance
  5437. Users []string `json:"users,omitempty"`
  5438. // Zone: [Output Only] URL of the zone where the disk resides. You must
  5439. // specify this field as part of the HTTP request URL. It is not
  5440. // settable as a field in the request body.
  5441. Zone string `json:"zone,omitempty"`
  5442. // ServerResponse contains the HTTP response code and headers from the
  5443. // server.
  5444. googleapi.ServerResponse `json:"-"`
  5445. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5446. // to unconditionally include in API requests. By default, fields with
  5447. // empty values are omitted from API requests. However, any non-pointer,
  5448. // non-interface field appearing in ForceSendFields will be sent to the
  5449. // server regardless of whether the field is empty or not. This may be
  5450. // used to include empty fields in Patch requests.
  5451. ForceSendFields []string `json:"-"`
  5452. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5453. // include in API requests with the JSON null value. By default, fields
  5454. // with empty values are omitted from API requests. However, any field
  5455. // with an empty value appearing in NullFields will be sent to the
  5456. // server as null. It is an error if a field in this list has a
  5457. // non-empty value. This may be used to include null fields in Patch
  5458. // requests.
  5459. NullFields []string `json:"-"`
  5460. }
  5461. func (s *Disk) MarshalJSON() ([]byte, error) {
  5462. type NoMethod Disk
  5463. raw := NoMethod(*s)
  5464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5465. }
  5466. type DiskAggregatedList struct {
  5467. // Id: [Output Only] Unique identifier for the resource; defined by the
  5468. // server.
  5469. Id string `json:"id,omitempty"`
  5470. // Items: A list of DisksScopedList resources.
  5471. Items map[string]DisksScopedList `json:"items,omitempty"`
  5472. // Kind: [Output Only] Type of resource. Always
  5473. // compute#diskAggregatedList for aggregated lists of persistent disks.
  5474. Kind string `json:"kind,omitempty"`
  5475. // NextPageToken: [Output Only] This token allows you to get the next
  5476. // page of results for list requests. If the number of results is larger
  5477. // than maxResults, use the nextPageToken as a value for the query
  5478. // parameter pageToken in the next list request. Subsequent list
  5479. // requests will have their own nextPageToken to continue paging through
  5480. // the results.
  5481. NextPageToken string `json:"nextPageToken,omitempty"`
  5482. // SelfLink: [Output Only] Server-defined URL for this resource.
  5483. SelfLink string `json:"selfLink,omitempty"`
  5484. // Warning: [Output Only] Informational warning message.
  5485. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  5486. // ServerResponse contains the HTTP response code and headers from the
  5487. // server.
  5488. googleapi.ServerResponse `json:"-"`
  5489. // ForceSendFields is a list of field names (e.g. "Id") to
  5490. // unconditionally include in API requests. By default, fields with
  5491. // empty values are omitted from API requests. However, any non-pointer,
  5492. // non-interface field appearing in ForceSendFields will be sent to the
  5493. // server regardless of whether the field is empty or not. This may be
  5494. // used to include empty fields in Patch requests.
  5495. ForceSendFields []string `json:"-"`
  5496. // NullFields is a list of field names (e.g. "Id") to include in API
  5497. // requests with the JSON null value. By default, fields with empty
  5498. // values are omitted from API requests. However, any field with an
  5499. // empty value appearing in NullFields will be sent to the server as
  5500. // null. It is an error if a field in this list has a non-empty value.
  5501. // This may be used to include null fields in Patch requests.
  5502. NullFields []string `json:"-"`
  5503. }
  5504. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  5505. type NoMethod DiskAggregatedList
  5506. raw := NoMethod(*s)
  5507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5508. }
  5509. // DiskAggregatedListWarning: [Output Only] Informational warning
  5510. // message.
  5511. type DiskAggregatedListWarning struct {
  5512. // Code: [Output Only] A warning code, if applicable. For example,
  5513. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5514. // the response.
  5515. //
  5516. // Possible values:
  5517. // "CLEANUP_FAILED"
  5518. // "DEPRECATED_RESOURCE_USED"
  5519. // "DEPRECATED_TYPE_USED"
  5520. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5521. // "EXPERIMENTAL_TYPE_USED"
  5522. // "EXTERNAL_API_WARNING"
  5523. // "FIELD_VALUE_OVERRIDEN"
  5524. // "INJECTED_KERNELS_DEPRECATED"
  5525. // "MISSING_TYPE_DEPENDENCY"
  5526. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5527. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5528. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5529. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5530. // "NEXT_HOP_NOT_RUNNING"
  5531. // "NOT_CRITICAL_ERROR"
  5532. // "NO_RESULTS_ON_PAGE"
  5533. // "REQUIRED_TOS_AGREEMENT"
  5534. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5535. // "RESOURCE_NOT_DELETED"
  5536. // "SCHEMA_VALIDATION_IGNORED"
  5537. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5538. // "UNDECLARED_PROPERTIES"
  5539. // "UNREACHABLE"
  5540. Code string `json:"code,omitempty"`
  5541. // Data: [Output Only] Metadata about this warning in key: value format.
  5542. // For example:
  5543. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5544. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  5545. // Message: [Output Only] A human-readable description of the warning
  5546. // code.
  5547. Message string `json:"message,omitempty"`
  5548. // ForceSendFields is a list of field names (e.g. "Code") to
  5549. // unconditionally include in API requests. By default, fields with
  5550. // empty values are omitted from API requests. However, any non-pointer,
  5551. // non-interface field appearing in ForceSendFields will be sent to the
  5552. // server regardless of whether the field is empty or not. This may be
  5553. // used to include empty fields in Patch requests.
  5554. ForceSendFields []string `json:"-"`
  5555. // NullFields is a list of field names (e.g. "Code") to include in API
  5556. // requests with the JSON null value. By default, fields with empty
  5557. // values are omitted from API requests. However, any field with an
  5558. // empty value appearing in NullFields will be sent to the server as
  5559. // null. It is an error if a field in this list has a non-empty value.
  5560. // This may be used to include null fields in Patch requests.
  5561. NullFields []string `json:"-"`
  5562. }
  5563. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5564. type NoMethod DiskAggregatedListWarning
  5565. raw := NoMethod(*s)
  5566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5567. }
  5568. type DiskAggregatedListWarningData struct {
  5569. // Key: [Output Only] A key that provides more detail on the warning
  5570. // being returned. For example, for warnings where there are no results
  5571. // in a list request for a particular zone, this key might be scope and
  5572. // the key value might be the zone name. Other examples might be a key
  5573. // indicating a deprecated resource and a suggested replacement, or a
  5574. // warning about invalid network settings (for example, if an instance
  5575. // attempts to perform IP forwarding but is not enabled for IP
  5576. // forwarding).
  5577. Key string `json:"key,omitempty"`
  5578. // Value: [Output Only] A warning data value corresponding to the key.
  5579. Value string `json:"value,omitempty"`
  5580. // ForceSendFields is a list of field names (e.g. "Key") to
  5581. // unconditionally include in API requests. By default, fields with
  5582. // empty values are omitted from API requests. However, any non-pointer,
  5583. // non-interface field appearing in ForceSendFields will be sent to the
  5584. // server regardless of whether the field is empty or not. This may be
  5585. // used to include empty fields in Patch requests.
  5586. ForceSendFields []string `json:"-"`
  5587. // NullFields is a list of field names (e.g. "Key") to include in API
  5588. // requests with the JSON null value. By default, fields with empty
  5589. // values are omitted from API requests. However, any field with an
  5590. // empty value appearing in NullFields will be sent to the server as
  5591. // null. It is an error if a field in this list has a non-empty value.
  5592. // This may be used to include null fields in Patch requests.
  5593. NullFields []string `json:"-"`
  5594. }
  5595. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5596. type NoMethod DiskAggregatedListWarningData
  5597. raw := NoMethod(*s)
  5598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5599. }
  5600. // DiskInstantiationConfig: A specification of the desired way to
  5601. // instantiate a disk in the instance template when its created from a
  5602. // source instance.
  5603. type DiskInstantiationConfig struct {
  5604. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  5605. // instance is deleted (but not when the disk is detached from the
  5606. // instance).
  5607. AutoDelete bool `json:"autoDelete,omitempty"`
  5608. // CustomImage: The custom source image to be used to restore this disk
  5609. // when instantiating this instance template.
  5610. CustomImage string `json:"customImage,omitempty"`
  5611. // DeviceName: Specifies the device name of the disk to which the
  5612. // configurations apply to.
  5613. DeviceName string `json:"deviceName,omitempty"`
  5614. // InstantiateFrom: Specifies whether to include the disk and what image
  5615. // to use. Possible values are:
  5616. // - source-image: to use the same image that was used to create the
  5617. // source instance's corresponding disk. Applicable to the boot disk and
  5618. // additional read-write disks.
  5619. // - source-image-family: to use the same image family that was used to
  5620. // create the source instance's corresponding disk. Applicable to the
  5621. // boot disk and additional read-write disks.
  5622. // - custom-image: to use a user-provided image url for disk creation.
  5623. // Applicable to the boot disk and additional read-write disks.
  5624. // - attach-read-only: to attach a read-only disk. Applicable to
  5625. // read-only disks.
  5626. // - do-not-include: to exclude a disk from the template. Applicable to
  5627. // additional read-write disks, local SSDs, and read-only disks.
  5628. //
  5629. // Possible values:
  5630. // "ATTACH_READ_ONLY"
  5631. // "BLANK"
  5632. // "CUSTOM_IMAGE"
  5633. // "DEFAULT"
  5634. // "DO_NOT_INCLUDE"
  5635. // "SOURCE_IMAGE"
  5636. // "SOURCE_IMAGE_FAMILY"
  5637. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  5638. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  5639. // unconditionally include in API requests. By default, fields with
  5640. // empty values are omitted from API requests. However, any non-pointer,
  5641. // non-interface field appearing in ForceSendFields will be sent to the
  5642. // server regardless of whether the field is empty or not. This may be
  5643. // used to include empty fields in Patch requests.
  5644. ForceSendFields []string `json:"-"`
  5645. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  5646. // API requests with the JSON null value. By default, fields with empty
  5647. // values are omitted from API requests. However, any field with an
  5648. // empty value appearing in NullFields will be sent to the server as
  5649. // null. It is an error if a field in this list has a non-empty value.
  5650. // This may be used to include null fields in Patch requests.
  5651. NullFields []string `json:"-"`
  5652. }
  5653. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  5654. type NoMethod DiskInstantiationConfig
  5655. raw := NoMethod(*s)
  5656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5657. }
  5658. // DiskList: A list of Disk resources.
  5659. type DiskList struct {
  5660. // Id: [Output Only] Unique identifier for the resource; defined by the
  5661. // server.
  5662. Id string `json:"id,omitempty"`
  5663. // Items: A list of Disk resources.
  5664. Items []*Disk `json:"items,omitempty"`
  5665. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5666. // lists of disks.
  5667. Kind string `json:"kind,omitempty"`
  5668. // NextPageToken: [Output Only] This token allows you to get the next
  5669. // page of results for list requests. If the number of results is larger
  5670. // than maxResults, use the nextPageToken as a value for the query
  5671. // parameter pageToken in the next list request. Subsequent list
  5672. // requests will have their own nextPageToken to continue paging through
  5673. // the results.
  5674. NextPageToken string `json:"nextPageToken,omitempty"`
  5675. // SelfLink: [Output Only] Server-defined URL for this resource.
  5676. SelfLink string `json:"selfLink,omitempty"`
  5677. // Warning: [Output Only] Informational warning message.
  5678. Warning *DiskListWarning `json:"warning,omitempty"`
  5679. // ServerResponse contains the HTTP response code and headers from the
  5680. // server.
  5681. googleapi.ServerResponse `json:"-"`
  5682. // ForceSendFields is a list of field names (e.g. "Id") to
  5683. // unconditionally include in API requests. By default, fields with
  5684. // empty values are omitted from API requests. However, any non-pointer,
  5685. // non-interface field appearing in ForceSendFields will be sent to the
  5686. // server regardless of whether the field is empty or not. This may be
  5687. // used to include empty fields in Patch requests.
  5688. ForceSendFields []string `json:"-"`
  5689. // NullFields is a list of field names (e.g. "Id") to include in API
  5690. // requests with the JSON null value. By default, fields with empty
  5691. // values are omitted from API requests. However, any field with an
  5692. // empty value appearing in NullFields will be sent to the server as
  5693. // null. It is an error if a field in this list has a non-empty value.
  5694. // This may be used to include null fields in Patch requests.
  5695. NullFields []string `json:"-"`
  5696. }
  5697. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5698. type NoMethod DiskList
  5699. raw := NoMethod(*s)
  5700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5701. }
  5702. // DiskListWarning: [Output Only] Informational warning message.
  5703. type DiskListWarning struct {
  5704. // Code: [Output Only] A warning code, if applicable. For example,
  5705. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5706. // the response.
  5707. //
  5708. // Possible values:
  5709. // "CLEANUP_FAILED"
  5710. // "DEPRECATED_RESOURCE_USED"
  5711. // "DEPRECATED_TYPE_USED"
  5712. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5713. // "EXPERIMENTAL_TYPE_USED"
  5714. // "EXTERNAL_API_WARNING"
  5715. // "FIELD_VALUE_OVERRIDEN"
  5716. // "INJECTED_KERNELS_DEPRECATED"
  5717. // "MISSING_TYPE_DEPENDENCY"
  5718. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5719. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5720. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5721. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5722. // "NEXT_HOP_NOT_RUNNING"
  5723. // "NOT_CRITICAL_ERROR"
  5724. // "NO_RESULTS_ON_PAGE"
  5725. // "REQUIRED_TOS_AGREEMENT"
  5726. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5727. // "RESOURCE_NOT_DELETED"
  5728. // "SCHEMA_VALIDATION_IGNORED"
  5729. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5730. // "UNDECLARED_PROPERTIES"
  5731. // "UNREACHABLE"
  5732. Code string `json:"code,omitempty"`
  5733. // Data: [Output Only] Metadata about this warning in key: value format.
  5734. // For example:
  5735. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5736. Data []*DiskListWarningData `json:"data,omitempty"`
  5737. // Message: [Output Only] A human-readable description of the warning
  5738. // code.
  5739. Message string `json:"message,omitempty"`
  5740. // ForceSendFields is a list of field names (e.g. "Code") to
  5741. // unconditionally include in API requests. By default, fields with
  5742. // empty values are omitted from API requests. However, any non-pointer,
  5743. // non-interface field appearing in ForceSendFields will be sent to the
  5744. // server regardless of whether the field is empty or not. This may be
  5745. // used to include empty fields in Patch requests.
  5746. ForceSendFields []string `json:"-"`
  5747. // NullFields is a list of field names (e.g. "Code") to include in API
  5748. // requests with the JSON null value. By default, fields with empty
  5749. // values are omitted from API requests. However, any field with an
  5750. // empty value appearing in NullFields will be sent to the server as
  5751. // null. It is an error if a field in this list has a non-empty value.
  5752. // This may be used to include null fields in Patch requests.
  5753. NullFields []string `json:"-"`
  5754. }
  5755. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5756. type NoMethod DiskListWarning
  5757. raw := NoMethod(*s)
  5758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5759. }
  5760. type DiskListWarningData struct {
  5761. // Key: [Output Only] A key that provides more detail on the warning
  5762. // being returned. For example, for warnings where there are no results
  5763. // in a list request for a particular zone, this key might be scope and
  5764. // the key value might be the zone name. Other examples might be a key
  5765. // indicating a deprecated resource and a suggested replacement, or a
  5766. // warning about invalid network settings (for example, if an instance
  5767. // attempts to perform IP forwarding but is not enabled for IP
  5768. // forwarding).
  5769. Key string `json:"key,omitempty"`
  5770. // Value: [Output Only] A warning data value corresponding to the key.
  5771. Value string `json:"value,omitempty"`
  5772. // ForceSendFields is a list of field names (e.g. "Key") to
  5773. // unconditionally include in API requests. By default, fields with
  5774. // empty values are omitted from API requests. However, any non-pointer,
  5775. // non-interface field appearing in ForceSendFields will be sent to the
  5776. // server regardless of whether the field is empty or not. This may be
  5777. // used to include empty fields in Patch requests.
  5778. ForceSendFields []string `json:"-"`
  5779. // NullFields is a list of field names (e.g. "Key") to include in API
  5780. // requests with the JSON null value. By default, fields with empty
  5781. // values are omitted from API requests. However, any field with an
  5782. // empty value appearing in NullFields will be sent to the server as
  5783. // null. It is an error if a field in this list has a non-empty value.
  5784. // This may be used to include null fields in Patch requests.
  5785. NullFields []string `json:"-"`
  5786. }
  5787. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5788. type NoMethod DiskListWarningData
  5789. raw := NoMethod(*s)
  5790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5791. }
  5792. type DiskMoveRequest struct {
  5793. // DestinationZone: The URL of the destination zone to move the disk.
  5794. // This can be a full or partial URL. For example, the following are all
  5795. // valid URLs to a zone:
  5796. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5797. //
  5798. // - projects/project/zones/zone
  5799. // - zones/zone
  5800. DestinationZone string `json:"destinationZone,omitempty"`
  5801. // TargetDisk: The URL of the target disk to move. This can be a full or
  5802. // partial URL. For example, the following are all valid URLs to a disk:
  5803. //
  5804. // -
  5805. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5806. // - projects/project/zones/zone/disks/disk
  5807. // - zones/zone/disks/disk
  5808. TargetDisk string `json:"targetDisk,omitempty"`
  5809. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5810. // unconditionally include in API requests. By default, fields with
  5811. // empty values are omitted from API requests. However, any non-pointer,
  5812. // non-interface field appearing in ForceSendFields will be sent to the
  5813. // server regardless of whether the field is empty or not. This may be
  5814. // used to include empty fields in Patch requests.
  5815. ForceSendFields []string `json:"-"`
  5816. // NullFields is a list of field names (e.g. "DestinationZone") to
  5817. // include in API requests with the JSON null value. By default, fields
  5818. // with empty values are omitted from API requests. However, any field
  5819. // with an empty value appearing in NullFields will be sent to the
  5820. // server as null. It is an error if a field in this list has a
  5821. // non-empty value. This may be used to include null fields in Patch
  5822. // requests.
  5823. NullFields []string `json:"-"`
  5824. }
  5825. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5826. type NoMethod DiskMoveRequest
  5827. raw := NoMethod(*s)
  5828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5829. }
  5830. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5831. // (== resource_for v1.diskTypes ==)
  5832. type DiskType struct {
  5833. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5834. // format.
  5835. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5836. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5837. // GB.
  5838. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5839. // Deprecated: [Output Only] The deprecation status associated with this
  5840. // disk type.
  5841. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5842. // Description: [Output Only] An optional description of this resource.
  5843. Description string `json:"description,omitempty"`
  5844. // Id: [Output Only] The unique identifier for the resource. This
  5845. // identifier is defined by the server.
  5846. Id uint64 `json:"id,omitempty,string"`
  5847. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5848. // disk types.
  5849. Kind string `json:"kind,omitempty"`
  5850. // Name: [Output Only] Name of the resource.
  5851. Name string `json:"name,omitempty"`
  5852. // Region: [Output Only] URL of the region where the disk type resides.
  5853. // Only applicable for regional resources. You must specify this field
  5854. // as part of the HTTP request URL. It is not settable as a field in the
  5855. // request body.
  5856. Region string `json:"region,omitempty"`
  5857. // SelfLink: [Output Only] Server-defined URL for the resource.
  5858. SelfLink string `json:"selfLink,omitempty"`
  5859. // ValidDiskSize: [Output Only] An optional textual description of the
  5860. // valid disk size, such as "10GB-10TB".
  5861. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5862. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5863. // must specify this field as part of the HTTP request URL. It is not
  5864. // settable as a field in the request body.
  5865. Zone string `json:"zone,omitempty"`
  5866. // ServerResponse contains the HTTP response code and headers from the
  5867. // server.
  5868. googleapi.ServerResponse `json:"-"`
  5869. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5870. // to unconditionally include in API requests. By default, fields with
  5871. // empty values are omitted from API requests. However, any non-pointer,
  5872. // non-interface field appearing in ForceSendFields will be sent to the
  5873. // server regardless of whether the field is empty or not. This may be
  5874. // used to include empty fields in Patch requests.
  5875. ForceSendFields []string `json:"-"`
  5876. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5877. // include in API requests with the JSON null value. By default, fields
  5878. // with empty values are omitted from API requests. However, any field
  5879. // with an empty value appearing in NullFields will be sent to the
  5880. // server as null. It is an error if a field in this list has a
  5881. // non-empty value. This may be used to include null fields in Patch
  5882. // requests.
  5883. NullFields []string `json:"-"`
  5884. }
  5885. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5886. type NoMethod DiskType
  5887. raw := NoMethod(*s)
  5888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5889. }
  5890. type DiskTypeAggregatedList struct {
  5891. // Id: [Output Only] Unique identifier for the resource; defined by the
  5892. // server.
  5893. Id string `json:"id,omitempty"`
  5894. // Items: A list of DiskTypesScopedList resources.
  5895. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5896. // Kind: [Output Only] Type of resource. Always
  5897. // compute#diskTypeAggregatedList.
  5898. Kind string `json:"kind,omitempty"`
  5899. // NextPageToken: [Output Only] This token allows you to get the next
  5900. // page of results for list requests. If the number of results is larger
  5901. // than maxResults, use the nextPageToken as a value for the query
  5902. // parameter pageToken in the next list request. Subsequent list
  5903. // requests will have their own nextPageToken to continue paging through
  5904. // the results.
  5905. NextPageToken string `json:"nextPageToken,omitempty"`
  5906. // SelfLink: [Output Only] Server-defined URL for this resource.
  5907. SelfLink string `json:"selfLink,omitempty"`
  5908. // Warning: [Output Only] Informational warning message.
  5909. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5910. // ServerResponse contains the HTTP response code and headers from the
  5911. // server.
  5912. googleapi.ServerResponse `json:"-"`
  5913. // ForceSendFields is a list of field names (e.g. "Id") to
  5914. // unconditionally include in API requests. By default, fields with
  5915. // empty values are omitted from API requests. However, any non-pointer,
  5916. // non-interface field appearing in ForceSendFields will be sent to the
  5917. // server regardless of whether the field is empty or not. This may be
  5918. // used to include empty fields in Patch requests.
  5919. ForceSendFields []string `json:"-"`
  5920. // NullFields is a list of field names (e.g. "Id") to include in API
  5921. // requests with the JSON null value. By default, fields with empty
  5922. // values are omitted from API requests. However, any field with an
  5923. // empty value appearing in NullFields will be sent to the server as
  5924. // null. It is an error if a field in this list has a non-empty value.
  5925. // This may be used to include null fields in Patch requests.
  5926. NullFields []string `json:"-"`
  5927. }
  5928. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5929. type NoMethod DiskTypeAggregatedList
  5930. raw := NoMethod(*s)
  5931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5932. }
  5933. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5934. // message.
  5935. type DiskTypeAggregatedListWarning struct {
  5936. // Code: [Output Only] A warning code, if applicable. For example,
  5937. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5938. // the response.
  5939. //
  5940. // Possible values:
  5941. // "CLEANUP_FAILED"
  5942. // "DEPRECATED_RESOURCE_USED"
  5943. // "DEPRECATED_TYPE_USED"
  5944. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5945. // "EXPERIMENTAL_TYPE_USED"
  5946. // "EXTERNAL_API_WARNING"
  5947. // "FIELD_VALUE_OVERRIDEN"
  5948. // "INJECTED_KERNELS_DEPRECATED"
  5949. // "MISSING_TYPE_DEPENDENCY"
  5950. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5951. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5952. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5953. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5954. // "NEXT_HOP_NOT_RUNNING"
  5955. // "NOT_CRITICAL_ERROR"
  5956. // "NO_RESULTS_ON_PAGE"
  5957. // "REQUIRED_TOS_AGREEMENT"
  5958. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5959. // "RESOURCE_NOT_DELETED"
  5960. // "SCHEMA_VALIDATION_IGNORED"
  5961. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5962. // "UNDECLARED_PROPERTIES"
  5963. // "UNREACHABLE"
  5964. Code string `json:"code,omitempty"`
  5965. // Data: [Output Only] Metadata about this warning in key: value format.
  5966. // For example:
  5967. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5968. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5969. // Message: [Output Only] A human-readable description of the warning
  5970. // code.
  5971. Message string `json:"message,omitempty"`
  5972. // ForceSendFields is a list of field names (e.g. "Code") to
  5973. // unconditionally include in API requests. By default, fields with
  5974. // empty values are omitted from API requests. However, any non-pointer,
  5975. // non-interface field appearing in ForceSendFields will be sent to the
  5976. // server regardless of whether the field is empty or not. This may be
  5977. // used to include empty fields in Patch requests.
  5978. ForceSendFields []string `json:"-"`
  5979. // NullFields is a list of field names (e.g. "Code") to include in API
  5980. // requests with the JSON null value. By default, fields with empty
  5981. // values are omitted from API requests. However, any field with an
  5982. // empty value appearing in NullFields will be sent to the server as
  5983. // null. It is an error if a field in this list has a non-empty value.
  5984. // This may be used to include null fields in Patch requests.
  5985. NullFields []string `json:"-"`
  5986. }
  5987. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5988. type NoMethod DiskTypeAggregatedListWarning
  5989. raw := NoMethod(*s)
  5990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5991. }
  5992. type DiskTypeAggregatedListWarningData struct {
  5993. // Key: [Output Only] A key that provides more detail on the warning
  5994. // being returned. For example, for warnings where there are no results
  5995. // in a list request for a particular zone, this key might be scope and
  5996. // the key value might be the zone name. Other examples might be a key
  5997. // indicating a deprecated resource and a suggested replacement, or a
  5998. // warning about invalid network settings (for example, if an instance
  5999. // attempts to perform IP forwarding but is not enabled for IP
  6000. // forwarding).
  6001. Key string `json:"key,omitempty"`
  6002. // Value: [Output Only] A warning data value corresponding to the key.
  6003. Value string `json:"value,omitempty"`
  6004. // ForceSendFields is a list of field names (e.g. "Key") to
  6005. // unconditionally include in API requests. By default, fields with
  6006. // empty values are omitted from API requests. However, any non-pointer,
  6007. // non-interface field appearing in ForceSendFields will be sent to the
  6008. // server regardless of whether the field is empty or not. This may be
  6009. // used to include empty fields in Patch requests.
  6010. ForceSendFields []string `json:"-"`
  6011. // NullFields is a list of field names (e.g. "Key") to include in API
  6012. // requests with the JSON null value. By default, fields with empty
  6013. // values are omitted from API requests. However, any field with an
  6014. // empty value appearing in NullFields will be sent to the server as
  6015. // null. It is an error if a field in this list has a non-empty value.
  6016. // This may be used to include null fields in Patch requests.
  6017. NullFields []string `json:"-"`
  6018. }
  6019. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6020. type NoMethod DiskTypeAggregatedListWarningData
  6021. raw := NoMethod(*s)
  6022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6023. }
  6024. // DiskTypeList: Contains a list of disk types.
  6025. type DiskTypeList struct {
  6026. // Id: [Output Only] Unique identifier for the resource; defined by the
  6027. // server.
  6028. Id string `json:"id,omitempty"`
  6029. // Items: A list of DiskType resources.
  6030. Items []*DiskType `json:"items,omitempty"`
  6031. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  6032. // disk types.
  6033. Kind string `json:"kind,omitempty"`
  6034. // NextPageToken: [Output Only] This token allows you to get the next
  6035. // page of results for list requests. If the number of results is larger
  6036. // than maxResults, use the nextPageToken as a value for the query
  6037. // parameter pageToken in the next list request. Subsequent list
  6038. // requests will have their own nextPageToken to continue paging through
  6039. // the results.
  6040. NextPageToken string `json:"nextPageToken,omitempty"`
  6041. // SelfLink: [Output Only] Server-defined URL for this resource.
  6042. SelfLink string `json:"selfLink,omitempty"`
  6043. // Warning: [Output Only] Informational warning message.
  6044. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  6045. // ServerResponse contains the HTTP response code and headers from the
  6046. // server.
  6047. googleapi.ServerResponse `json:"-"`
  6048. // ForceSendFields is a list of field names (e.g. "Id") to
  6049. // unconditionally include in API requests. By default, fields with
  6050. // empty values are omitted from API requests. However, any non-pointer,
  6051. // non-interface field appearing in ForceSendFields will be sent to the
  6052. // server regardless of whether the field is empty or not. This may be
  6053. // used to include empty fields in Patch requests.
  6054. ForceSendFields []string `json:"-"`
  6055. // NullFields is a list of field names (e.g. "Id") to include in API
  6056. // requests with the JSON null value. By default, fields with empty
  6057. // values are omitted from API requests. However, any field with an
  6058. // empty value appearing in NullFields will be sent to the server as
  6059. // null. It is an error if a field in this list has a non-empty value.
  6060. // This may be used to include null fields in Patch requests.
  6061. NullFields []string `json:"-"`
  6062. }
  6063. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  6064. type NoMethod DiskTypeList
  6065. raw := NoMethod(*s)
  6066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6067. }
  6068. // DiskTypeListWarning: [Output Only] Informational warning message.
  6069. type DiskTypeListWarning struct {
  6070. // Code: [Output Only] A warning code, if applicable. For example,
  6071. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6072. // the response.
  6073. //
  6074. // Possible values:
  6075. // "CLEANUP_FAILED"
  6076. // "DEPRECATED_RESOURCE_USED"
  6077. // "DEPRECATED_TYPE_USED"
  6078. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6079. // "EXPERIMENTAL_TYPE_USED"
  6080. // "EXTERNAL_API_WARNING"
  6081. // "FIELD_VALUE_OVERRIDEN"
  6082. // "INJECTED_KERNELS_DEPRECATED"
  6083. // "MISSING_TYPE_DEPENDENCY"
  6084. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6085. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6086. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6087. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6088. // "NEXT_HOP_NOT_RUNNING"
  6089. // "NOT_CRITICAL_ERROR"
  6090. // "NO_RESULTS_ON_PAGE"
  6091. // "REQUIRED_TOS_AGREEMENT"
  6092. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6093. // "RESOURCE_NOT_DELETED"
  6094. // "SCHEMA_VALIDATION_IGNORED"
  6095. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6096. // "UNDECLARED_PROPERTIES"
  6097. // "UNREACHABLE"
  6098. Code string `json:"code,omitempty"`
  6099. // Data: [Output Only] Metadata about this warning in key: value format.
  6100. // For example:
  6101. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6102. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  6103. // Message: [Output Only] A human-readable description of the warning
  6104. // code.
  6105. Message string `json:"message,omitempty"`
  6106. // ForceSendFields is a list of field names (e.g. "Code") to
  6107. // unconditionally include in API requests. By default, fields with
  6108. // empty values are omitted from API requests. However, any non-pointer,
  6109. // non-interface field appearing in ForceSendFields will be sent to the
  6110. // server regardless of whether the field is empty or not. This may be
  6111. // used to include empty fields in Patch requests.
  6112. ForceSendFields []string `json:"-"`
  6113. // NullFields is a list of field names (e.g. "Code") to include in API
  6114. // requests with the JSON null value. By default, fields with empty
  6115. // values are omitted from API requests. However, any field with an
  6116. // empty value appearing in NullFields will be sent to the server as
  6117. // null. It is an error if a field in this list has a non-empty value.
  6118. // This may be used to include null fields in Patch requests.
  6119. NullFields []string `json:"-"`
  6120. }
  6121. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  6122. type NoMethod DiskTypeListWarning
  6123. raw := NoMethod(*s)
  6124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6125. }
  6126. type DiskTypeListWarningData struct {
  6127. // Key: [Output Only] A key that provides more detail on the warning
  6128. // being returned. For example, for warnings where there are no results
  6129. // in a list request for a particular zone, this key might be scope and
  6130. // the key value might be the zone name. Other examples might be a key
  6131. // indicating a deprecated resource and a suggested replacement, or a
  6132. // warning about invalid network settings (for example, if an instance
  6133. // attempts to perform IP forwarding but is not enabled for IP
  6134. // forwarding).
  6135. Key string `json:"key,omitempty"`
  6136. // Value: [Output Only] A warning data value corresponding to the key.
  6137. Value string `json:"value,omitempty"`
  6138. // ForceSendFields is a list of field names (e.g. "Key") to
  6139. // unconditionally include in API requests. By default, fields with
  6140. // empty values are omitted from API requests. However, any non-pointer,
  6141. // non-interface field appearing in ForceSendFields will be sent to the
  6142. // server regardless of whether the field is empty or not. This may be
  6143. // used to include empty fields in Patch requests.
  6144. ForceSendFields []string `json:"-"`
  6145. // NullFields is a list of field names (e.g. "Key") to include in API
  6146. // requests with the JSON null value. By default, fields with empty
  6147. // values are omitted from API requests. However, any field with an
  6148. // empty value appearing in NullFields will be sent to the server as
  6149. // null. It is an error if a field in this list has a non-empty value.
  6150. // This may be used to include null fields in Patch requests.
  6151. NullFields []string `json:"-"`
  6152. }
  6153. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  6154. type NoMethod DiskTypeListWarningData
  6155. raw := NoMethod(*s)
  6156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6157. }
  6158. type DiskTypesScopedList struct {
  6159. // DiskTypes: [Output Only] A list of disk types contained in this
  6160. // scope.
  6161. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  6162. // Warning: [Output Only] Informational warning which replaces the list
  6163. // of disk types when the list is empty.
  6164. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  6165. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  6166. // unconditionally include in API requests. By default, fields with
  6167. // empty values are omitted from API requests. However, any non-pointer,
  6168. // non-interface field appearing in ForceSendFields will be sent to the
  6169. // server regardless of whether the field is empty or not. This may be
  6170. // used to include empty fields in Patch requests.
  6171. ForceSendFields []string `json:"-"`
  6172. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  6173. // API requests with the JSON null value. By default, fields with empty
  6174. // values are omitted from API requests. However, any field with an
  6175. // empty value appearing in NullFields will be sent to the server as
  6176. // null. It is an error if a field in this list has a non-empty value.
  6177. // This may be used to include null fields in Patch requests.
  6178. NullFields []string `json:"-"`
  6179. }
  6180. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  6181. type NoMethod DiskTypesScopedList
  6182. raw := NoMethod(*s)
  6183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6184. }
  6185. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  6186. // replaces the list of disk types when the list is empty.
  6187. type DiskTypesScopedListWarning struct {
  6188. // Code: [Output Only] A warning code, if applicable. For example,
  6189. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6190. // the response.
  6191. //
  6192. // Possible values:
  6193. // "CLEANUP_FAILED"
  6194. // "DEPRECATED_RESOURCE_USED"
  6195. // "DEPRECATED_TYPE_USED"
  6196. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6197. // "EXPERIMENTAL_TYPE_USED"
  6198. // "EXTERNAL_API_WARNING"
  6199. // "FIELD_VALUE_OVERRIDEN"
  6200. // "INJECTED_KERNELS_DEPRECATED"
  6201. // "MISSING_TYPE_DEPENDENCY"
  6202. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6203. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6204. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6205. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6206. // "NEXT_HOP_NOT_RUNNING"
  6207. // "NOT_CRITICAL_ERROR"
  6208. // "NO_RESULTS_ON_PAGE"
  6209. // "REQUIRED_TOS_AGREEMENT"
  6210. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6211. // "RESOURCE_NOT_DELETED"
  6212. // "SCHEMA_VALIDATION_IGNORED"
  6213. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6214. // "UNDECLARED_PROPERTIES"
  6215. // "UNREACHABLE"
  6216. Code string `json:"code,omitempty"`
  6217. // Data: [Output Only] Metadata about this warning in key: value format.
  6218. // For example:
  6219. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6220. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  6221. // Message: [Output Only] A human-readable description of the warning
  6222. // code.
  6223. Message string `json:"message,omitempty"`
  6224. // ForceSendFields is a list of field names (e.g. "Code") to
  6225. // unconditionally include in API requests. By default, fields with
  6226. // empty values are omitted from API requests. However, any non-pointer,
  6227. // non-interface field appearing in ForceSendFields will be sent to the
  6228. // server regardless of whether the field is empty or not. This may be
  6229. // used to include empty fields in Patch requests.
  6230. ForceSendFields []string `json:"-"`
  6231. // NullFields is a list of field names (e.g. "Code") to include in API
  6232. // requests with the JSON null value. By default, fields with empty
  6233. // values are omitted from API requests. However, any field with an
  6234. // empty value appearing in NullFields will be sent to the server as
  6235. // null. It is an error if a field in this list has a non-empty value.
  6236. // This may be used to include null fields in Patch requests.
  6237. NullFields []string `json:"-"`
  6238. }
  6239. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6240. type NoMethod DiskTypesScopedListWarning
  6241. raw := NoMethod(*s)
  6242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6243. }
  6244. type DiskTypesScopedListWarningData struct {
  6245. // Key: [Output Only] A key that provides more detail on the warning
  6246. // being returned. For example, for warnings where there are no results
  6247. // in a list request for a particular zone, this key might be scope and
  6248. // the key value might be the zone name. Other examples might be a key
  6249. // indicating a deprecated resource and a suggested replacement, or a
  6250. // warning about invalid network settings (for example, if an instance
  6251. // attempts to perform IP forwarding but is not enabled for IP
  6252. // forwarding).
  6253. Key string `json:"key,omitempty"`
  6254. // Value: [Output Only] A warning data value corresponding to the key.
  6255. Value string `json:"value,omitempty"`
  6256. // ForceSendFields is a list of field names (e.g. "Key") to
  6257. // unconditionally include in API requests. By default, fields with
  6258. // empty values are omitted from API requests. However, any non-pointer,
  6259. // non-interface field appearing in ForceSendFields will be sent to the
  6260. // server regardless of whether the field is empty or not. This may be
  6261. // used to include empty fields in Patch requests.
  6262. ForceSendFields []string `json:"-"`
  6263. // NullFields is a list of field names (e.g. "Key") to include in API
  6264. // requests with the JSON null value. By default, fields with empty
  6265. // values are omitted from API requests. However, any field with an
  6266. // empty value appearing in NullFields will be sent to the server as
  6267. // null. It is an error if a field in this list has a non-empty value.
  6268. // This may be used to include null fields in Patch requests.
  6269. NullFields []string `json:"-"`
  6270. }
  6271. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6272. type NoMethod DiskTypesScopedListWarningData
  6273. raw := NoMethod(*s)
  6274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6275. }
  6276. type DisksAddResourcePoliciesRequest struct {
  6277. // ResourcePolicies: Resource policies to be added to this disk.
  6278. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6279. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6280. // unconditionally include in API requests. By default, fields with
  6281. // empty values are omitted from API requests. However, any non-pointer,
  6282. // non-interface field appearing in ForceSendFields will be sent to the
  6283. // server regardless of whether the field is empty or not. This may be
  6284. // used to include empty fields in Patch requests.
  6285. ForceSendFields []string `json:"-"`
  6286. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6287. // include in API requests with the JSON null value. By default, fields
  6288. // with empty values are omitted from API requests. However, any field
  6289. // with an empty value appearing in NullFields will be sent to the
  6290. // server as null. It is an error if a field in this list has a
  6291. // non-empty value. This may be used to include null fields in Patch
  6292. // requests.
  6293. NullFields []string `json:"-"`
  6294. }
  6295. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6296. type NoMethod DisksAddResourcePoliciesRequest
  6297. raw := NoMethod(*s)
  6298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6299. }
  6300. type DisksRemoveResourcePoliciesRequest struct {
  6301. // ResourcePolicies: Resource policies to be removed from this disk.
  6302. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6303. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6304. // unconditionally include in API requests. By default, fields with
  6305. // empty values are omitted from API requests. However, any non-pointer,
  6306. // non-interface field appearing in ForceSendFields will be sent to the
  6307. // server regardless of whether the field is empty or not. This may be
  6308. // used to include empty fields in Patch requests.
  6309. ForceSendFields []string `json:"-"`
  6310. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6311. // include in API requests with the JSON null value. By default, fields
  6312. // with empty values are omitted from API requests. However, any field
  6313. // with an empty value appearing in NullFields will be sent to the
  6314. // server as null. It is an error if a field in this list has a
  6315. // non-empty value. This may be used to include null fields in Patch
  6316. // requests.
  6317. NullFields []string `json:"-"`
  6318. }
  6319. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6320. type NoMethod DisksRemoveResourcePoliciesRequest
  6321. raw := NoMethod(*s)
  6322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6323. }
  6324. type DisksResizeRequest struct {
  6325. // SizeGb: The new size of the persistent disk, which is specified in
  6326. // GB.
  6327. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6328. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  6329. // unconditionally include in API requests. By default, fields with
  6330. // empty values are omitted from API requests. However, any non-pointer,
  6331. // non-interface field appearing in ForceSendFields will be sent to the
  6332. // server regardless of whether the field is empty or not. This may be
  6333. // used to include empty fields in Patch requests.
  6334. ForceSendFields []string `json:"-"`
  6335. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  6336. // requests with the JSON null value. By default, fields with empty
  6337. // values are omitted from API requests. However, any field with an
  6338. // empty value appearing in NullFields will be sent to the server as
  6339. // null. It is an error if a field in this list has a non-empty value.
  6340. // This may be used to include null fields in Patch requests.
  6341. NullFields []string `json:"-"`
  6342. }
  6343. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  6344. type NoMethod DisksResizeRequest
  6345. raw := NoMethod(*s)
  6346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6347. }
  6348. type DisksScopedList struct {
  6349. // Disks: [Output Only] A list of disks contained in this scope.
  6350. Disks []*Disk `json:"disks,omitempty"`
  6351. // Warning: [Output Only] Informational warning which replaces the list
  6352. // of disks when the list is empty.
  6353. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  6354. // ForceSendFields is a list of field names (e.g. "Disks") to
  6355. // unconditionally include in API requests. By default, fields with
  6356. // empty values are omitted from API requests. However, any non-pointer,
  6357. // non-interface field appearing in ForceSendFields will be sent to the
  6358. // server regardless of whether the field is empty or not. This may be
  6359. // used to include empty fields in Patch requests.
  6360. ForceSendFields []string `json:"-"`
  6361. // NullFields is a list of field names (e.g. "Disks") to include in API
  6362. // requests with the JSON null value. By default, fields with empty
  6363. // values are omitted from API requests. However, any field with an
  6364. // empty value appearing in NullFields will be sent to the server as
  6365. // null. It is an error if a field in this list has a non-empty value.
  6366. // This may be used to include null fields in Patch requests.
  6367. NullFields []string `json:"-"`
  6368. }
  6369. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  6370. type NoMethod DisksScopedList
  6371. raw := NoMethod(*s)
  6372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6373. }
  6374. // DisksScopedListWarning: [Output Only] Informational warning which
  6375. // replaces the list of disks when the list is empty.
  6376. type DisksScopedListWarning struct {
  6377. // Code: [Output Only] A warning code, if applicable. For example,
  6378. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6379. // the response.
  6380. //
  6381. // Possible values:
  6382. // "CLEANUP_FAILED"
  6383. // "DEPRECATED_RESOURCE_USED"
  6384. // "DEPRECATED_TYPE_USED"
  6385. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6386. // "EXPERIMENTAL_TYPE_USED"
  6387. // "EXTERNAL_API_WARNING"
  6388. // "FIELD_VALUE_OVERRIDEN"
  6389. // "INJECTED_KERNELS_DEPRECATED"
  6390. // "MISSING_TYPE_DEPENDENCY"
  6391. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6392. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6393. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6394. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6395. // "NEXT_HOP_NOT_RUNNING"
  6396. // "NOT_CRITICAL_ERROR"
  6397. // "NO_RESULTS_ON_PAGE"
  6398. // "REQUIRED_TOS_AGREEMENT"
  6399. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6400. // "RESOURCE_NOT_DELETED"
  6401. // "SCHEMA_VALIDATION_IGNORED"
  6402. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6403. // "UNDECLARED_PROPERTIES"
  6404. // "UNREACHABLE"
  6405. Code string `json:"code,omitempty"`
  6406. // Data: [Output Only] Metadata about this warning in key: value format.
  6407. // For example:
  6408. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6409. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  6410. // Message: [Output Only] A human-readable description of the warning
  6411. // code.
  6412. Message string `json:"message,omitempty"`
  6413. // ForceSendFields is a list of field names (e.g. "Code") to
  6414. // unconditionally include in API requests. By default, fields with
  6415. // empty values are omitted from API requests. However, any non-pointer,
  6416. // non-interface field appearing in ForceSendFields will be sent to the
  6417. // server regardless of whether the field is empty or not. This may be
  6418. // used to include empty fields in Patch requests.
  6419. ForceSendFields []string `json:"-"`
  6420. // NullFields is a list of field names (e.g. "Code") to include in API
  6421. // requests with the JSON null value. By default, fields with empty
  6422. // values are omitted from API requests. However, any field with an
  6423. // empty value appearing in NullFields will be sent to the server as
  6424. // null. It is an error if a field in this list has a non-empty value.
  6425. // This may be used to include null fields in Patch requests.
  6426. NullFields []string `json:"-"`
  6427. }
  6428. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  6429. type NoMethod DisksScopedListWarning
  6430. raw := NoMethod(*s)
  6431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6432. }
  6433. type DisksScopedListWarningData struct {
  6434. // Key: [Output Only] A key that provides more detail on the warning
  6435. // being returned. For example, for warnings where there are no results
  6436. // in a list request for a particular zone, this key might be scope and
  6437. // the key value might be the zone name. Other examples might be a key
  6438. // indicating a deprecated resource and a suggested replacement, or a
  6439. // warning about invalid network settings (for example, if an instance
  6440. // attempts to perform IP forwarding but is not enabled for IP
  6441. // forwarding).
  6442. Key string `json:"key,omitempty"`
  6443. // Value: [Output Only] A warning data value corresponding to the key.
  6444. Value string `json:"value,omitempty"`
  6445. // ForceSendFields is a list of field names (e.g. "Key") to
  6446. // unconditionally include in API requests. By default, fields with
  6447. // empty values are omitted from API requests. However, any non-pointer,
  6448. // non-interface field appearing in ForceSendFields will be sent to the
  6449. // server regardless of whether the field is empty or not. This may be
  6450. // used to include empty fields in Patch requests.
  6451. ForceSendFields []string `json:"-"`
  6452. // NullFields is a list of field names (e.g. "Key") to include in API
  6453. // requests with the JSON null value. By default, fields with empty
  6454. // values are omitted from API requests. However, any field with an
  6455. // empty value appearing in NullFields will be sent to the server as
  6456. // null. It is an error if a field in this list has a non-empty value.
  6457. // This may be used to include null fields in Patch requests.
  6458. NullFields []string `json:"-"`
  6459. }
  6460. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  6461. type NoMethod DisksScopedListWarningData
  6462. raw := NoMethod(*s)
  6463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6464. }
  6465. // DisplayDevice: A set of Display Device options
  6466. type DisplayDevice struct {
  6467. // EnableDisplay: Defines whether the instance has Display enabled.
  6468. EnableDisplay bool `json:"enableDisplay,omitempty"`
  6469. // ForceSendFields is a list of field names (e.g. "EnableDisplay") to
  6470. // unconditionally include in API requests. By default, fields with
  6471. // empty values are omitted from API requests. However, any non-pointer,
  6472. // non-interface field appearing in ForceSendFields will be sent to the
  6473. // server regardless of whether the field is empty or not. This may be
  6474. // used to include empty fields in Patch requests.
  6475. ForceSendFields []string `json:"-"`
  6476. // NullFields is a list of field names (e.g. "EnableDisplay") to include
  6477. // in API requests with the JSON null value. By default, fields with
  6478. // empty values are omitted from API requests. However, any field with
  6479. // an empty value appearing in NullFields will be sent to the server as
  6480. // null. It is an error if a field in this list has a non-empty value.
  6481. // This may be used to include null fields in Patch requests.
  6482. NullFields []string `json:"-"`
  6483. }
  6484. func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
  6485. type NoMethod DisplayDevice
  6486. raw := NoMethod(*s)
  6487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6488. }
  6489. type DistributionPolicy struct {
  6490. // Zones: Zones where the regional managed instance group will create
  6491. // and manage instances.
  6492. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  6493. // ForceSendFields is a list of field names (e.g. "Zones") to
  6494. // unconditionally include in API requests. By default, fields with
  6495. // empty values are omitted from API requests. However, any non-pointer,
  6496. // non-interface field appearing in ForceSendFields will be sent to the
  6497. // server regardless of whether the field is empty or not. This may be
  6498. // used to include empty fields in Patch requests.
  6499. ForceSendFields []string `json:"-"`
  6500. // NullFields is a list of field names (e.g. "Zones") to include in API
  6501. // requests with the JSON null value. By default, fields with empty
  6502. // values are omitted from API requests. However, any field with an
  6503. // empty value appearing in NullFields will be sent to the server as
  6504. // null. It is an error if a field in this list has a non-empty value.
  6505. // This may be used to include null fields in Patch requests.
  6506. NullFields []string `json:"-"`
  6507. }
  6508. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  6509. type NoMethod DistributionPolicy
  6510. raw := NoMethod(*s)
  6511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6512. }
  6513. type DistributionPolicyZoneConfiguration struct {
  6514. // Zone: The URL of the zone. The zone must exist in the region where
  6515. // the managed instance group is located.
  6516. Zone string `json:"zone,omitempty"`
  6517. // ForceSendFields is a list of field names (e.g. "Zone") to
  6518. // unconditionally include in API requests. By default, fields with
  6519. // empty values are omitted from API requests. However, any non-pointer,
  6520. // non-interface field appearing in ForceSendFields will be sent to the
  6521. // server regardless of whether the field is empty or not. This may be
  6522. // used to include empty fields in Patch requests.
  6523. ForceSendFields []string `json:"-"`
  6524. // NullFields is a list of field names (e.g. "Zone") to include in API
  6525. // requests with the JSON null value. By default, fields with empty
  6526. // values are omitted from API requests. However, any field with an
  6527. // empty value appearing in NullFields will be sent to the server as
  6528. // null. It is an error if a field in this list has a non-empty value.
  6529. // This may be used to include null fields in Patch requests.
  6530. NullFields []string `json:"-"`
  6531. }
  6532. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  6533. type NoMethod DistributionPolicyZoneConfiguration
  6534. raw := NoMethod(*s)
  6535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6536. }
  6537. type ExchangedPeeringRoute struct {
  6538. // DestRange: The destination range of the route.
  6539. DestRange string `json:"destRange,omitempty"`
  6540. // Imported: If the peering route is imported if there is no
  6541. // confliction.
  6542. Imported bool `json:"imported,omitempty"`
  6543. // NextHopRegion: The region of peering route next hop, only applies to
  6544. // dynamic routes.
  6545. NextHopRegion string `json:"nextHopRegion,omitempty"`
  6546. // Priority: The priority of the peering route.
  6547. Priority int64 `json:"priority,omitempty"`
  6548. // Type: The type of the peering route.
  6549. //
  6550. // Possible values:
  6551. // "DYNAMIC_PEERING_ROUTE"
  6552. // "STATIC_PEERING_ROUTE"
  6553. // "SUBNET_PEERING_ROUTE"
  6554. Type string `json:"type,omitempty"`
  6555. // ForceSendFields is a list of field names (e.g. "DestRange") to
  6556. // unconditionally include in API requests. By default, fields with
  6557. // empty values are omitted from API requests. However, any non-pointer,
  6558. // non-interface field appearing in ForceSendFields will be sent to the
  6559. // server regardless of whether the field is empty or not. This may be
  6560. // used to include empty fields in Patch requests.
  6561. ForceSendFields []string `json:"-"`
  6562. // NullFields is a list of field names (e.g. "DestRange") to include in
  6563. // API requests with the JSON null value. By default, fields with empty
  6564. // values are omitted from API requests. However, any field with an
  6565. // empty value appearing in NullFields will be sent to the server as
  6566. // null. It is an error if a field in this list has a non-empty value.
  6567. // This may be used to include null fields in Patch requests.
  6568. NullFields []string `json:"-"`
  6569. }
  6570. func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
  6571. type NoMethod ExchangedPeeringRoute
  6572. raw := NoMethod(*s)
  6573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6574. }
  6575. type ExchangedPeeringRoutesList struct {
  6576. // Id: [Output Only] Unique identifier for the resource; defined by the
  6577. // server.
  6578. Id string `json:"id,omitempty"`
  6579. // Items: A list of ExchangedPeeringRoute resources.
  6580. Items []*ExchangedPeeringRoute `json:"items,omitempty"`
  6581. // Kind: [Output Only] Type of resource. Always
  6582. // compute#exchangedPeeringRoutesList for exchanged peering routes
  6583. // lists.
  6584. Kind string `json:"kind,omitempty"`
  6585. // NextPageToken: [Output Only] This token allows you to get the next
  6586. // page of results for list requests. If the number of results is larger
  6587. // than maxResults, use the nextPageToken as a value for the query
  6588. // parameter pageToken in the next list request. Subsequent list
  6589. // requests will have their own nextPageToken to continue paging through
  6590. // the results.
  6591. NextPageToken string `json:"nextPageToken,omitempty"`
  6592. // SelfLink: [Output Only] Server-defined URL for this resource.
  6593. SelfLink string `json:"selfLink,omitempty"`
  6594. // Warning: [Output Only] Informational warning message.
  6595. Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
  6596. // ServerResponse contains the HTTP response code and headers from the
  6597. // server.
  6598. googleapi.ServerResponse `json:"-"`
  6599. // ForceSendFields is a list of field names (e.g. "Id") to
  6600. // unconditionally include in API requests. By default, fields with
  6601. // empty values are omitted from API requests. However, any non-pointer,
  6602. // non-interface field appearing in ForceSendFields will be sent to the
  6603. // server regardless of whether the field is empty or not. This may be
  6604. // used to include empty fields in Patch requests.
  6605. ForceSendFields []string `json:"-"`
  6606. // NullFields is a list of field names (e.g. "Id") to include in API
  6607. // requests with the JSON null value. By default, fields with empty
  6608. // values are omitted from API requests. However, any field with an
  6609. // empty value appearing in NullFields will be sent to the server as
  6610. // null. It is an error if a field in this list has a non-empty value.
  6611. // This may be used to include null fields in Patch requests.
  6612. NullFields []string `json:"-"`
  6613. }
  6614. func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
  6615. type NoMethod ExchangedPeeringRoutesList
  6616. raw := NoMethod(*s)
  6617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6618. }
  6619. // ExchangedPeeringRoutesListWarning: [Output Only] Informational
  6620. // warning message.
  6621. type ExchangedPeeringRoutesListWarning struct {
  6622. // Code: [Output Only] A warning code, if applicable. For example,
  6623. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6624. // the response.
  6625. //
  6626. // Possible values:
  6627. // "CLEANUP_FAILED"
  6628. // "DEPRECATED_RESOURCE_USED"
  6629. // "DEPRECATED_TYPE_USED"
  6630. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6631. // "EXPERIMENTAL_TYPE_USED"
  6632. // "EXTERNAL_API_WARNING"
  6633. // "FIELD_VALUE_OVERRIDEN"
  6634. // "INJECTED_KERNELS_DEPRECATED"
  6635. // "MISSING_TYPE_DEPENDENCY"
  6636. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6637. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6638. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6639. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6640. // "NEXT_HOP_NOT_RUNNING"
  6641. // "NOT_CRITICAL_ERROR"
  6642. // "NO_RESULTS_ON_PAGE"
  6643. // "REQUIRED_TOS_AGREEMENT"
  6644. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6645. // "RESOURCE_NOT_DELETED"
  6646. // "SCHEMA_VALIDATION_IGNORED"
  6647. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6648. // "UNDECLARED_PROPERTIES"
  6649. // "UNREACHABLE"
  6650. Code string `json:"code,omitempty"`
  6651. // Data: [Output Only] Metadata about this warning in key: value format.
  6652. // For example:
  6653. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6654. Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
  6655. // Message: [Output Only] A human-readable description of the warning
  6656. // code.
  6657. Message string `json:"message,omitempty"`
  6658. // ForceSendFields is a list of field names (e.g. "Code") to
  6659. // unconditionally include in API requests. By default, fields with
  6660. // empty values are omitted from API requests. However, any non-pointer,
  6661. // non-interface field appearing in ForceSendFields will be sent to the
  6662. // server regardless of whether the field is empty or not. This may be
  6663. // used to include empty fields in Patch requests.
  6664. ForceSendFields []string `json:"-"`
  6665. // NullFields is a list of field names (e.g. "Code") to include in API
  6666. // requests with the JSON null value. By default, fields with empty
  6667. // values are omitted from API requests. However, any field with an
  6668. // empty value appearing in NullFields will be sent to the server as
  6669. // null. It is an error if a field in this list has a non-empty value.
  6670. // This may be used to include null fields in Patch requests.
  6671. NullFields []string `json:"-"`
  6672. }
  6673. func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
  6674. type NoMethod ExchangedPeeringRoutesListWarning
  6675. raw := NoMethod(*s)
  6676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6677. }
  6678. type ExchangedPeeringRoutesListWarningData struct {
  6679. // Key: [Output Only] A key that provides more detail on the warning
  6680. // being returned. For example, for warnings where there are no results
  6681. // in a list request for a particular zone, this key might be scope and
  6682. // the key value might be the zone name. Other examples might be a key
  6683. // indicating a deprecated resource and a suggested replacement, or a
  6684. // warning about invalid network settings (for example, if an instance
  6685. // attempts to perform IP forwarding but is not enabled for IP
  6686. // forwarding).
  6687. Key string `json:"key,omitempty"`
  6688. // Value: [Output Only] A warning data value corresponding to the key.
  6689. Value string `json:"value,omitempty"`
  6690. // ForceSendFields is a list of field names (e.g. "Key") to
  6691. // unconditionally include in API requests. By default, fields with
  6692. // empty values are omitted from API requests. However, any non-pointer,
  6693. // non-interface field appearing in ForceSendFields will be sent to the
  6694. // server regardless of whether the field is empty or not. This may be
  6695. // used to include empty fields in Patch requests.
  6696. ForceSendFields []string `json:"-"`
  6697. // NullFields is a list of field names (e.g. "Key") to include in API
  6698. // requests with the JSON null value. By default, fields with empty
  6699. // values are omitted from API requests. However, any field with an
  6700. // empty value appearing in NullFields will be sent to the server as
  6701. // null. It is an error if a field in this list has a non-empty value.
  6702. // This may be used to include null fields in Patch requests.
  6703. NullFields []string `json:"-"`
  6704. }
  6705. func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
  6706. type NoMethod ExchangedPeeringRoutesListWarningData
  6707. raw := NoMethod(*s)
  6708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6709. }
  6710. // Expr: Represents an expression text. Example:
  6711. //
  6712. // title: "User account presence" description: "Determines whether the
  6713. // request has a user account" expression: "size(request.user) > 0"
  6714. type Expr struct {
  6715. // Description: An optional description of the expression. This is a
  6716. // longer text which describes the expression, e.g. when hovered over it
  6717. // in a UI.
  6718. Description string `json:"description,omitempty"`
  6719. // Expression: Textual representation of an expression in Common
  6720. // Expression Language syntax.
  6721. //
  6722. // The application context of the containing message determines which
  6723. // well-known feature set of CEL is supported.
  6724. Expression string `json:"expression,omitempty"`
  6725. // Location: An optional string indicating the location of the
  6726. // expression for error reporting, e.g. a file name and a position in
  6727. // the file.
  6728. Location string `json:"location,omitempty"`
  6729. // Title: An optional title for the expression, i.e. a short string
  6730. // describing its purpose. This can be used e.g. in UIs which allow to
  6731. // enter the expression.
  6732. Title string `json:"title,omitempty"`
  6733. // ForceSendFields is a list of field names (e.g. "Description") to
  6734. // unconditionally include in API requests. By default, fields with
  6735. // empty values are omitted from API requests. However, any non-pointer,
  6736. // non-interface field appearing in ForceSendFields will be sent to the
  6737. // server regardless of whether the field is empty or not. This may be
  6738. // used to include empty fields in Patch requests.
  6739. ForceSendFields []string `json:"-"`
  6740. // NullFields is a list of field names (e.g. "Description") to include
  6741. // in API requests with the JSON null value. By default, fields with
  6742. // empty values are omitted from API requests. However, any field with
  6743. // an empty value appearing in NullFields will be sent to the server as
  6744. // null. It is an error if a field in this list has a non-empty value.
  6745. // This may be used to include null fields in Patch requests.
  6746. NullFields []string `json:"-"`
  6747. }
  6748. func (s *Expr) MarshalJSON() ([]byte, error) {
  6749. type NoMethod Expr
  6750. raw := NoMethod(*s)
  6751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6752. }
  6753. // Firewall: Represents a Firewall resource.
  6754. type Firewall struct {
  6755. // Allowed: The list of ALLOW rules specified by this firewall. Each
  6756. // rule specifies a protocol and port-range tuple that describes a
  6757. // permitted connection.
  6758. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  6759. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6760. // format.
  6761. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6762. // Denied: The list of DENY rules specified by this firewall. Each rule
  6763. // specifies a protocol and port-range tuple that describes a denied
  6764. // connection.
  6765. Denied []*FirewallDenied `json:"denied,omitempty"`
  6766. // Description: An optional description of this resource. Provide this
  6767. // property when you create the resource.
  6768. Description string `json:"description,omitempty"`
  6769. // DestinationRanges: If destination ranges are specified, the firewall
  6770. // will apply only to traffic that has destination IP address in these
  6771. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  6772. // supported.
  6773. DestinationRanges []string `json:"destinationRanges,omitempty"`
  6774. // Direction: Direction of traffic to which this firewall applies;
  6775. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  6776. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  6777. // specify sourceRanges OR sourceTags.
  6778. //
  6779. // Possible values:
  6780. // "EGRESS"
  6781. // "INGRESS"
  6782. Direction string `json:"direction,omitempty"`
  6783. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  6784. // applied to the network it is associated with. When set to true, the
  6785. // firewall rule is not enforced and the network behaves as if it did
  6786. // not exist. If this is unspecified, the firewall rule will be enabled.
  6787. Disabled bool `json:"disabled,omitempty"`
  6788. // EnableLogging: Deprecated in favor of enable in LogConfig. This field
  6789. // denotes whether to enable logging for a particular firewall rule. If
  6790. // logging is enabled, logs will be exported to Stackdriver.
  6791. EnableLogging bool `json:"enableLogging,omitempty"`
  6792. // Id: [Output Only] The unique identifier for the resource. This
  6793. // identifier is defined by the server.
  6794. Id uint64 `json:"id,omitempty,string"`
  6795. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  6796. // firewall rules.
  6797. Kind string `json:"kind,omitempty"`
  6798. // LogConfig: This field denotes the logging options for a particular
  6799. // firewall rule. If logging is enabled, logs will be exported to
  6800. // Stackdriver.
  6801. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  6802. // Name: Name of the resource; provided by the client when the resource
  6803. // is created. The name must be 1-63 characters long, and comply with
  6804. // RFC1035. Specifically, the name must be 1-63 characters long and
  6805. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6806. // the first character must be a lowercase letter, and all following
  6807. // characters must be a dash, lowercase letter, or digit, except the
  6808. // last character, which cannot be a dash.
  6809. Name string `json:"name,omitempty"`
  6810. // Network: URL of the network resource for this firewall rule. If not
  6811. // specified when creating a firewall rule, the default network is
  6812. // used:
  6813. // global/networks/default
  6814. // If you choose to specify this property, you can specify the network
  6815. // as a full or partial URL. For example, the following are all valid
  6816. // URLs:
  6817. // -
  6818. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  6819. // - projects/myproject/global/networks/my-network
  6820. // - global/networks/default
  6821. Network string `json:"network,omitempty"`
  6822. // Priority: Priority for this rule. This is an integer between 0 and
  6823. // 65535, both inclusive. When not specified, the value assumed is 1000.
  6824. // Relative priorities determine precedence of conflicting rules. Lower
  6825. // value of priority implies higher precedence (eg, a rule with priority
  6826. // 0 has higher precedence than a rule with priority 1). DENY rules take
  6827. // precedence over ALLOW rules having equal priority.
  6828. Priority int64 `json:"priority,omitempty"`
  6829. // SelfLink: [Output Only] Server-defined URL for the resource.
  6830. SelfLink string `json:"selfLink,omitempty"`
  6831. // SourceRanges: If source ranges are specified, the firewall will apply
  6832. // only to traffic that has source IP address in these ranges. These
  6833. // ranges must be expressed in CIDR format. One or both of sourceRanges
  6834. // and sourceTags may be set. If both properties are set, the firewall
  6835. // will apply to traffic that has source IP address within sourceRanges
  6836. // OR the source IP that belongs to a tag listed in the sourceTags
  6837. // property. The connection does not need to match both properties for
  6838. // the firewall to apply. Only IPv4 is supported.
  6839. SourceRanges []string `json:"sourceRanges,omitempty"`
  6840. // SourceServiceAccounts: If source service accounts are specified, the
  6841. // firewall will apply only to traffic originating from an instance with
  6842. // a service account in this list. Source service accounts cannot be
  6843. // used to control traffic to an instance's external IP address because
  6844. // service accounts are associated with an instance, not an IP address.
  6845. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  6846. // both are set, the firewall will apply to traffic that has source IP
  6847. // address within sourceRanges OR the source IP belongs to an instance
  6848. // with service account listed in sourceServiceAccount. The connection
  6849. // does not need to match both properties for the firewall to apply.
  6850. // sourceServiceAccounts cannot be used at the same time as sourceTags
  6851. // or targetTags.
  6852. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  6853. // SourceTags: If source tags are specified, the firewall rule applies
  6854. // only to traffic with source IPs that match the primary network
  6855. // interfaces of VM instances that have the tag and are in the same VPC
  6856. // network. Source tags cannot be used to control traffic to an
  6857. // instance's external IP address, it only applies to traffic between
  6858. // instances in the same virtual network. Because tags are associated
  6859. // with instances, not IP addresses. One or both of sourceRanges and
  6860. // sourceTags may be set. If both properties are set, the firewall will
  6861. // apply to traffic that has source IP address within sourceRanges OR
  6862. // the source IP that belongs to a tag listed in the sourceTags
  6863. // property. The connection does not need to match both properties for
  6864. // the firewall to apply.
  6865. SourceTags []string `json:"sourceTags,omitempty"`
  6866. // TargetServiceAccounts: A list of service accounts indicating sets of
  6867. // instances located in the network that may make network connections as
  6868. // specified in allowed[]. targetServiceAccounts cannot be used at the
  6869. // same time as targetTags or sourceTags. If neither
  6870. // targetServiceAccounts nor targetTags are specified, the firewall rule
  6871. // applies to all instances on the specified network.
  6872. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  6873. // TargetTags: A list of tags that controls which instances the firewall
  6874. // rule applies to. If targetTags are specified, then the firewall rule
  6875. // applies only to instances in the VPC network that have one of those
  6876. // tags. If no targetTags are specified, the firewall rule applies to
  6877. // all instances on the specified network.
  6878. TargetTags []string `json:"targetTags,omitempty"`
  6879. // ServerResponse contains the HTTP response code and headers from the
  6880. // server.
  6881. googleapi.ServerResponse `json:"-"`
  6882. // ForceSendFields is a list of field names (e.g. "Allowed") to
  6883. // unconditionally include in API requests. By default, fields with
  6884. // empty values are omitted from API requests. However, any non-pointer,
  6885. // non-interface field appearing in ForceSendFields will be sent to the
  6886. // server regardless of whether the field is empty or not. This may be
  6887. // used to include empty fields in Patch requests.
  6888. ForceSendFields []string `json:"-"`
  6889. // NullFields is a list of field names (e.g. "Allowed") to include in
  6890. // API requests with the JSON null value. By default, fields with empty
  6891. // values are omitted from API requests. However, any field with an
  6892. // empty value appearing in NullFields will be sent to the server as
  6893. // null. It is an error if a field in this list has a non-empty value.
  6894. // This may be used to include null fields in Patch requests.
  6895. NullFields []string `json:"-"`
  6896. }
  6897. func (s *Firewall) MarshalJSON() ([]byte, error) {
  6898. type NoMethod Firewall
  6899. raw := NoMethod(*s)
  6900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6901. }
  6902. type FirewallAllowed struct {
  6903. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6904. // type is required when creating a firewall rule. This value can either
  6905. // be one of the following well known protocol strings (tcp, udp, icmp,
  6906. // esp, ah, ipip, sctp), or the IP protocol number.
  6907. IPProtocol string `json:"IPProtocol,omitempty"`
  6908. // Ports: An optional list of ports to which this rule applies. This
  6909. // field is only applicable for UDP or TCP protocol. Each entry must be
  6910. // either an integer or a range. If not specified, this rule applies to
  6911. // connections through any port.
  6912. //
  6913. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6914. Ports []string `json:"ports,omitempty"`
  6915. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6916. // unconditionally include in API requests. By default, fields with
  6917. // empty values are omitted from API requests. However, any non-pointer,
  6918. // non-interface field appearing in ForceSendFields will be sent to the
  6919. // server regardless of whether the field is empty or not. This may be
  6920. // used to include empty fields in Patch requests.
  6921. ForceSendFields []string `json:"-"`
  6922. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6923. // API requests with the JSON null value. By default, fields with empty
  6924. // values are omitted from API requests. However, any field with an
  6925. // empty value appearing in NullFields will be sent to the server as
  6926. // null. It is an error if a field in this list has a non-empty value.
  6927. // This may be used to include null fields in Patch requests.
  6928. NullFields []string `json:"-"`
  6929. }
  6930. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  6931. type NoMethod FirewallAllowed
  6932. raw := NoMethod(*s)
  6933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6934. }
  6935. type FirewallDenied struct {
  6936. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6937. // type is required when creating a firewall rule. This value can either
  6938. // be one of the following well known protocol strings (tcp, udp, icmp,
  6939. // esp, ah, ipip, sctp), or the IP protocol number.
  6940. IPProtocol string `json:"IPProtocol,omitempty"`
  6941. // Ports: An optional list of ports to which this rule applies. This
  6942. // field is only applicable for UDP or TCP protocol. Each entry must be
  6943. // either an integer or a range. If not specified, this rule applies to
  6944. // connections through any port.
  6945. //
  6946. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6947. Ports []string `json:"ports,omitempty"`
  6948. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6949. // unconditionally include in API requests. By default, fields with
  6950. // empty values are omitted from API requests. However, any non-pointer,
  6951. // non-interface field appearing in ForceSendFields will be sent to the
  6952. // server regardless of whether the field is empty or not. This may be
  6953. // used to include empty fields in Patch requests.
  6954. ForceSendFields []string `json:"-"`
  6955. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6956. // API requests with the JSON null value. By default, fields with empty
  6957. // values are omitted from API requests. However, any field with an
  6958. // empty value appearing in NullFields will be sent to the server as
  6959. // null. It is an error if a field in this list has a non-empty value.
  6960. // This may be used to include null fields in Patch requests.
  6961. NullFields []string `json:"-"`
  6962. }
  6963. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  6964. type NoMethod FirewallDenied
  6965. raw := NoMethod(*s)
  6966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6967. }
  6968. // FirewallList: Contains a list of firewalls.
  6969. type FirewallList struct {
  6970. // Id: [Output Only] Unique identifier for the resource; defined by the
  6971. // server.
  6972. Id string `json:"id,omitempty"`
  6973. // Items: A list of Firewall resources.
  6974. Items []*Firewall `json:"items,omitempty"`
  6975. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  6976. // lists of firewalls.
  6977. Kind string `json:"kind,omitempty"`
  6978. // NextPageToken: [Output Only] This token allows you to get the next
  6979. // page of results for list requests. If the number of results is larger
  6980. // than maxResults, use the nextPageToken as a value for the query
  6981. // parameter pageToken in the next list request. Subsequent list
  6982. // requests will have their own nextPageToken to continue paging through
  6983. // the results.
  6984. NextPageToken string `json:"nextPageToken,omitempty"`
  6985. // SelfLink: [Output Only] Server-defined URL for this resource.
  6986. SelfLink string `json:"selfLink,omitempty"`
  6987. // Warning: [Output Only] Informational warning message.
  6988. Warning *FirewallListWarning `json:"warning,omitempty"`
  6989. // ServerResponse contains the HTTP response code and headers from the
  6990. // server.
  6991. googleapi.ServerResponse `json:"-"`
  6992. // ForceSendFields is a list of field names (e.g. "Id") to
  6993. // unconditionally include in API requests. By default, fields with
  6994. // empty values are omitted from API requests. However, any non-pointer,
  6995. // non-interface field appearing in ForceSendFields will be sent to the
  6996. // server regardless of whether the field is empty or not. This may be
  6997. // used to include empty fields in Patch requests.
  6998. ForceSendFields []string `json:"-"`
  6999. // NullFields is a list of field names (e.g. "Id") to include in API
  7000. // requests with the JSON null value. By default, fields with empty
  7001. // values are omitted from API requests. However, any field with an
  7002. // empty value appearing in NullFields will be sent to the server as
  7003. // null. It is an error if a field in this list has a non-empty value.
  7004. // This may be used to include null fields in Patch requests.
  7005. NullFields []string `json:"-"`
  7006. }
  7007. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  7008. type NoMethod FirewallList
  7009. raw := NoMethod(*s)
  7010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7011. }
  7012. // FirewallListWarning: [Output Only] Informational warning message.
  7013. type FirewallListWarning struct {
  7014. // Code: [Output Only] A warning code, if applicable. For example,
  7015. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7016. // the response.
  7017. //
  7018. // Possible values:
  7019. // "CLEANUP_FAILED"
  7020. // "DEPRECATED_RESOURCE_USED"
  7021. // "DEPRECATED_TYPE_USED"
  7022. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7023. // "EXPERIMENTAL_TYPE_USED"
  7024. // "EXTERNAL_API_WARNING"
  7025. // "FIELD_VALUE_OVERRIDEN"
  7026. // "INJECTED_KERNELS_DEPRECATED"
  7027. // "MISSING_TYPE_DEPENDENCY"
  7028. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7029. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7030. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7031. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7032. // "NEXT_HOP_NOT_RUNNING"
  7033. // "NOT_CRITICAL_ERROR"
  7034. // "NO_RESULTS_ON_PAGE"
  7035. // "REQUIRED_TOS_AGREEMENT"
  7036. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7037. // "RESOURCE_NOT_DELETED"
  7038. // "SCHEMA_VALIDATION_IGNORED"
  7039. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7040. // "UNDECLARED_PROPERTIES"
  7041. // "UNREACHABLE"
  7042. Code string `json:"code,omitempty"`
  7043. // Data: [Output Only] Metadata about this warning in key: value format.
  7044. // For example:
  7045. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7046. Data []*FirewallListWarningData `json:"data,omitempty"`
  7047. // Message: [Output Only] A human-readable description of the warning
  7048. // code.
  7049. Message string `json:"message,omitempty"`
  7050. // ForceSendFields is a list of field names (e.g. "Code") to
  7051. // unconditionally include in API requests. By default, fields with
  7052. // empty values are omitted from API requests. However, any non-pointer,
  7053. // non-interface field appearing in ForceSendFields will be sent to the
  7054. // server regardless of whether the field is empty or not. This may be
  7055. // used to include empty fields in Patch requests.
  7056. ForceSendFields []string `json:"-"`
  7057. // NullFields is a list of field names (e.g. "Code") to include in API
  7058. // requests with the JSON null value. By default, fields with empty
  7059. // values are omitted from API requests. However, any field with an
  7060. // empty value appearing in NullFields will be sent to the server as
  7061. // null. It is an error if a field in this list has a non-empty value.
  7062. // This may be used to include null fields in Patch requests.
  7063. NullFields []string `json:"-"`
  7064. }
  7065. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  7066. type NoMethod FirewallListWarning
  7067. raw := NoMethod(*s)
  7068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7069. }
  7070. type FirewallListWarningData struct {
  7071. // Key: [Output Only] A key that provides more detail on the warning
  7072. // being returned. For example, for warnings where there are no results
  7073. // in a list request for a particular zone, this key might be scope and
  7074. // the key value might be the zone name. Other examples might be a key
  7075. // indicating a deprecated resource and a suggested replacement, or a
  7076. // warning about invalid network settings (for example, if an instance
  7077. // attempts to perform IP forwarding but is not enabled for IP
  7078. // forwarding).
  7079. Key string `json:"key,omitempty"`
  7080. // Value: [Output Only] A warning data value corresponding to the key.
  7081. Value string `json:"value,omitempty"`
  7082. // ForceSendFields is a list of field names (e.g. "Key") to
  7083. // unconditionally include in API requests. By default, fields with
  7084. // empty values are omitted from API requests. However, any non-pointer,
  7085. // non-interface field appearing in ForceSendFields will be sent to the
  7086. // server regardless of whether the field is empty or not. This may be
  7087. // used to include empty fields in Patch requests.
  7088. ForceSendFields []string `json:"-"`
  7089. // NullFields is a list of field names (e.g. "Key") to include in API
  7090. // requests with the JSON null value. By default, fields with empty
  7091. // values are omitted from API requests. However, any field with an
  7092. // empty value appearing in NullFields will be sent to the server as
  7093. // null. It is an error if a field in this list has a non-empty value.
  7094. // This may be used to include null fields in Patch requests.
  7095. NullFields []string `json:"-"`
  7096. }
  7097. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  7098. type NoMethod FirewallListWarningData
  7099. raw := NoMethod(*s)
  7100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7101. }
  7102. // FirewallLogConfig: The available logging options for a firewall rule.
  7103. type FirewallLogConfig struct {
  7104. // Enable: This field denotes whether to enable logging for a particular
  7105. // firewall rule.
  7106. Enable bool `json:"enable,omitempty"`
  7107. // ForceSendFields is a list of field names (e.g. "Enable") to
  7108. // unconditionally include in API requests. By default, fields with
  7109. // empty values are omitted from API requests. However, any non-pointer,
  7110. // non-interface field appearing in ForceSendFields will be sent to the
  7111. // server regardless of whether the field is empty or not. This may be
  7112. // used to include empty fields in Patch requests.
  7113. ForceSendFields []string `json:"-"`
  7114. // NullFields is a list of field names (e.g. "Enable") to include in API
  7115. // requests with the JSON null value. By default, fields with empty
  7116. // values are omitted from API requests. However, any field with an
  7117. // empty value appearing in NullFields will be sent to the server as
  7118. // null. It is an error if a field in this list has a non-empty value.
  7119. // This may be used to include null fields in Patch requests.
  7120. NullFields []string `json:"-"`
  7121. }
  7122. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  7123. type NoMethod FirewallLogConfig
  7124. raw := NoMethod(*s)
  7125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7126. }
  7127. // FixedOrPercent: Encapsulates numeric value that can be either
  7128. // absolute or relative.
  7129. type FixedOrPercent struct {
  7130. // Calculated: [Output Only] Absolute value of VM instances calculated
  7131. // based on the specific mode.
  7132. //
  7133. //
  7134. // - If the value is fixed, then the caculated value is equal to the
  7135. // fixed value.
  7136. // - If the value is a percent, then the calculated value is percent/100
  7137. // * targetSize. For example, the calculated value of a 80% of a managed
  7138. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  7139. // instances. If there is a remainder, the number is rounded up.
  7140. Calculated int64 `json:"calculated,omitempty"`
  7141. // Fixed: Specifies a fixed number of VM instances. This must be a
  7142. // positive integer.
  7143. Fixed int64 `json:"fixed,omitempty"`
  7144. // Percent: Specifies a percentage of instances between 0 to 100%,
  7145. // inclusive. For example, specify 80 for 80%.
  7146. Percent int64 `json:"percent,omitempty"`
  7147. // ForceSendFields is a list of field names (e.g. "Calculated") to
  7148. // unconditionally include in API requests. By default, fields with
  7149. // empty values are omitted from API requests. However, any non-pointer,
  7150. // non-interface field appearing in ForceSendFields will be sent to the
  7151. // server regardless of whether the field is empty or not. This may be
  7152. // used to include empty fields in Patch requests.
  7153. ForceSendFields []string `json:"-"`
  7154. // NullFields is a list of field names (e.g. "Calculated") to include in
  7155. // API requests with the JSON null value. By default, fields with empty
  7156. // values are omitted from API requests. However, any field with an
  7157. // empty value appearing in NullFields will be sent to the server as
  7158. // null. It is an error if a field in this list has a non-empty value.
  7159. // This may be used to include null fields in Patch requests.
  7160. NullFields []string `json:"-"`
  7161. }
  7162. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  7163. type NoMethod FixedOrPercent
  7164. raw := NoMethod(*s)
  7165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7166. }
  7167. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  7168. // specifies which pool of target virtual machines to forward a packet
  7169. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  7170. // resource_for beta.forwardingRules ==) (== resource_for
  7171. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  7172. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  7173. // beta.regionForwardingRules ==) (== resource_for
  7174. // v1.regionForwardingRules ==)
  7175. type ForwardingRule struct {
  7176. // IPAddress: The IP address that this forwarding rule is serving on
  7177. // behalf of.
  7178. //
  7179. // Addresses are restricted based on the forwarding rule's load
  7180. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  7181. // regional).
  7182. //
  7183. // When the load balancing scheme is EXTERNAL, for global forwarding
  7184. // rules, the address must be a global IP, and for regional forwarding
  7185. // rules, the address must live in the same region as the forwarding
  7186. // rule. If this field is empty, an ephemeral IPv4 address from the same
  7187. // scope (global or regional) will be assigned. A regional forwarding
  7188. // rule supports IPv4 only. A global forwarding rule supports either
  7189. // IPv4 or IPv6.
  7190. //
  7191. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  7192. // a URL reference to an existing Address resource ( internal regional
  7193. // static IP address), with a purpose of GCE_END_POINT and address_type
  7194. // of INTERNAL.
  7195. //
  7196. // When the load balancing scheme is INTERNAL, this can only be an RFC
  7197. // 1918 IP address belonging to the network/subnet configured for the
  7198. // forwarding rule. By default, if this field is empty, an ephemeral
  7199. // internal IP address will be automatically allocated from the IP range
  7200. // of the subnet or network configured for this forwarding rule.
  7201. //
  7202. // An address can be specified either by a literal IP address or a URL
  7203. // reference to an existing Address resource. The following examples are
  7204. // all valid:
  7205. // - 100.1.2.3
  7206. // -
  7207. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  7208. // - projects/project/regions/region/addresses/address
  7209. // - regions/region/addresses/address
  7210. // - global/addresses/address
  7211. // - address
  7212. IPAddress string `json:"IPAddress,omitempty"`
  7213. // IPProtocol: The IP protocol to which this rule applies. Valid options
  7214. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  7215. //
  7216. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  7217. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  7218. // TCPis valid.
  7219. //
  7220. // Possible values:
  7221. // "AH"
  7222. // "ESP"
  7223. // "ICMP"
  7224. // "SCTP"
  7225. // "TCP"
  7226. // "UDP"
  7227. IPProtocol string `json:"IPProtocol,omitempty"`
  7228. // AllPorts: This field is used along with the backend_service field for
  7229. // internal load balancing or with the target field for internal
  7230. // TargetInstance. This field cannot be used with port or portRange
  7231. // fields.
  7232. //
  7233. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  7234. // specify this field to allow packets addressed to any ports will be
  7235. // forwarded to the backends configured with this forwarding rule.
  7236. AllPorts bool `json:"allPorts,omitempty"`
  7237. // BackendService: This field is only used for INTERNAL load
  7238. // balancing.
  7239. //
  7240. // For internal load balancing, this field identifies the BackendService
  7241. // resource to receive the matched traffic.
  7242. BackendService string `json:"backendService,omitempty"`
  7243. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7244. // format.
  7245. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7246. // Description: An optional description of this resource. Provide this
  7247. // property when you create the resource.
  7248. Description string `json:"description,omitempty"`
  7249. // Id: [Output Only] The unique identifier for the resource. This
  7250. // identifier is defined by the server.
  7251. Id uint64 `json:"id,omitempty,string"`
  7252. // IpVersion: The IP Version that will be used by this forwarding rule.
  7253. // Valid options are IPV4 or IPV6. This can only be specified for an
  7254. // external global forwarding rule.
  7255. //
  7256. // Possible values:
  7257. // "IPV4"
  7258. // "IPV6"
  7259. // "UNSPECIFIED_VERSION"
  7260. IpVersion string `json:"ipVersion,omitempty"`
  7261. // Kind: [Output Only] Type of the resource. Always
  7262. // compute#forwardingRule for Forwarding Rule resources.
  7263. Kind string `json:"kind,omitempty"`
  7264. // LabelFingerprint: A fingerprint for the labels being applied to this
  7265. // resource, which is essentially a hash of the labels set used for
  7266. // optimistic locking. The fingerprint is initially generated by Compute
  7267. // Engine and changes after every request to modify or update labels.
  7268. // You must always provide an up-to-date fingerprint hash in order to
  7269. // update or change labels, otherwise the request will fail with error
  7270. // 412 conditionNotMet.
  7271. //
  7272. // To see the latest fingerprint, make a get() request to retrieve a
  7273. // ForwardingRule.
  7274. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7275. // Labels: Labels to apply to this resource. These can be later modified
  7276. // by the setLabels method. Each label key/value pair must comply with
  7277. // RFC1035. Label values may be empty.
  7278. Labels map[string]string `json:"labels,omitempty"`
  7279. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  7280. // used for and can only take the following values: INTERNAL,
  7281. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  7282. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  7283. // value of INTERNAL_SELF_MANAGED means that this will be used for
  7284. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  7285. // will be used for External Load Balancing (HTTP(S) LB, External
  7286. // TCP/UDP LB, SSL Proxy)
  7287. //
  7288. // Possible values:
  7289. // "EXTERNAL"
  7290. // "INTERNAL"
  7291. // "INVALID"
  7292. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  7293. // Name: Name of the resource; provided by the client when the resource
  7294. // is created. The name must be 1-63 characters long, and comply with
  7295. // RFC1035. Specifically, the name must be 1-63 characters long and
  7296. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7297. // the first character must be a lowercase letter, and all following
  7298. // characters must be a dash, lowercase letter, or digit, except the
  7299. // last character, which cannot be a dash.
  7300. Name string `json:"name,omitempty"`
  7301. // Network: This field is not used for external load balancing.
  7302. //
  7303. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  7304. // identifies the network that the load balanced IP should belong to for
  7305. // this Forwarding Rule. If this field is not specified, the default
  7306. // network will be used.
  7307. Network string `json:"network,omitempty"`
  7308. // NetworkTier: This signifies the networking tier used for configuring
  7309. // this load balancer and can only take the following values: PREMIUM ,
  7310. // STANDARD.
  7311. //
  7312. // For regional ForwardingRule, the valid values are PREMIUM and
  7313. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  7314. //
  7315. // If this field is not specified, it is assumed to be PREMIUM. If
  7316. // IPAddress is specified, this value must be equal to the networkTier
  7317. // of the Address.
  7318. //
  7319. // Possible values:
  7320. // "PREMIUM"
  7321. // "STANDARD"
  7322. NetworkTier string `json:"networkTier,omitempty"`
  7323. // PortRange: This field is used along with the target field for
  7324. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  7325. // TargetVpnGateway, TargetPool, TargetInstance.
  7326. //
  7327. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  7328. // addressed to ports in the specified range will be forwarded to
  7329. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  7330. // must have disjoint port ranges.
  7331. //
  7332. // Some types of forwarding target have constraints on the acceptable
  7333. // ports:
  7334. // - TargetHttpProxy: 80, 8080
  7335. // - TargetHttpsProxy: 443
  7336. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7337. // 995, 1688, 1883, 5222
  7338. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7339. // 995, 1688, 1883, 5222
  7340. // - TargetVpnGateway: 500, 4500
  7341. PortRange string `json:"portRange,omitempty"`
  7342. // Ports: This field is used along with the backend_service field for
  7343. // internal load balancing.
  7344. //
  7345. // When the load balancing scheme is INTERNAL, a list of ports can be
  7346. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  7347. // addressed to these ports will be forwarded to the backends configured
  7348. // with this forwarding rule.
  7349. //
  7350. // You may specify a maximum of up to 5 ports.
  7351. Ports []string `json:"ports,omitempty"`
  7352. // Region: [Output Only] URL of the region where the regional forwarding
  7353. // rule resides. This field is not applicable to global forwarding
  7354. // rules. You must specify this field as part of the HTTP request URL.
  7355. // It is not settable as a field in the request body.
  7356. Region string `json:"region,omitempty"`
  7357. // SelfLink: [Output Only] Server-defined URL for the resource.
  7358. SelfLink string `json:"selfLink,omitempty"`
  7359. // ServiceLabel: An optional prefix to the service name for this
  7360. // Forwarding Rule. If specified, will be the first label of the fully
  7361. // qualified service name.
  7362. //
  7363. // The label must be 1-63 characters long, and comply with RFC1035.
  7364. // Specifically, the label must be 1-63 characters long and match the
  7365. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  7366. // character must be a lowercase letter, and all following characters
  7367. // must be a dash, lowercase letter, or digit, except the last
  7368. // character, which cannot be a dash.
  7369. //
  7370. // This field is only used for internal load balancing.
  7371. ServiceLabel string `json:"serviceLabel,omitempty"`
  7372. // ServiceName: [Output Only] The internal fully qualified service name
  7373. // for this Forwarding Rule.
  7374. //
  7375. // This field is only used for internal load balancing.
  7376. ServiceName string `json:"serviceName,omitempty"`
  7377. // Subnetwork: This field is only used for INTERNAL load balancing.
  7378. //
  7379. // For internal load balancing, this field identifies the subnetwork
  7380. // that the load balanced IP should belong to for this Forwarding
  7381. // Rule.
  7382. //
  7383. // If the network specified is in auto subnet mode, this field is
  7384. // optional. However, if the network is in custom subnet mode, a
  7385. // subnetwork must be specified.
  7386. Subnetwork string `json:"subnetwork,omitempty"`
  7387. // Target: The URL of the target resource to receive the matched
  7388. // traffic. For regional forwarding rules, this target must live in the
  7389. // same region as the forwarding rule. For global forwarding rules, this
  7390. // target must be a global load balancing resource. The forwarded
  7391. // traffic must be of a type appropriate to the target object. For
  7392. // INTERNAL_SELF_MANAGED" load balancing, only HTTP and HTTPS targets
  7393. // are valid.
  7394. Target string `json:"target,omitempty"`
  7395. // ServerResponse contains the HTTP response code and headers from the
  7396. // server.
  7397. googleapi.ServerResponse `json:"-"`
  7398. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  7399. // unconditionally include in API requests. By default, fields with
  7400. // empty values are omitted from API requests. However, any non-pointer,
  7401. // non-interface field appearing in ForceSendFields will be sent to the
  7402. // server regardless of whether the field is empty or not. This may be
  7403. // used to include empty fields in Patch requests.
  7404. ForceSendFields []string `json:"-"`
  7405. // NullFields is a list of field names (e.g. "IPAddress") to include in
  7406. // API requests with the JSON null value. By default, fields with empty
  7407. // values are omitted from API requests. However, any field with an
  7408. // empty value appearing in NullFields will be sent to the server as
  7409. // null. It is an error if a field in this list has a non-empty value.
  7410. // This may be used to include null fields in Patch requests.
  7411. NullFields []string `json:"-"`
  7412. }
  7413. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  7414. type NoMethod ForwardingRule
  7415. raw := NoMethod(*s)
  7416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7417. }
  7418. type ForwardingRuleAggregatedList struct {
  7419. // Id: [Output Only] Unique identifier for the resource; defined by the
  7420. // server.
  7421. Id string `json:"id,omitempty"`
  7422. // Items: A list of ForwardingRulesScopedList resources.
  7423. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  7424. // Kind: [Output Only] Type of resource. Always
  7425. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  7426. Kind string `json:"kind,omitempty"`
  7427. // NextPageToken: [Output Only] This token allows you to get the next
  7428. // page of results for list requests. If the number of results is larger
  7429. // than maxResults, use the nextPageToken as a value for the query
  7430. // parameter pageToken in the next list request. Subsequent list
  7431. // requests will have their own nextPageToken to continue paging through
  7432. // the results.
  7433. NextPageToken string `json:"nextPageToken,omitempty"`
  7434. // SelfLink: [Output Only] Server-defined URL for this resource.
  7435. SelfLink string `json:"selfLink,omitempty"`
  7436. // Warning: [Output Only] Informational warning message.
  7437. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  7438. // ServerResponse contains the HTTP response code and headers from the
  7439. // server.
  7440. googleapi.ServerResponse `json:"-"`
  7441. // ForceSendFields is a list of field names (e.g. "Id") to
  7442. // unconditionally include in API requests. By default, fields with
  7443. // empty values are omitted from API requests. However, any non-pointer,
  7444. // non-interface field appearing in ForceSendFields will be sent to the
  7445. // server regardless of whether the field is empty or not. This may be
  7446. // used to include empty fields in Patch requests.
  7447. ForceSendFields []string `json:"-"`
  7448. // NullFields is a list of field names (e.g. "Id") to include in API
  7449. // requests with the JSON null value. By default, fields with empty
  7450. // values are omitted from API requests. However, any field with an
  7451. // empty value appearing in NullFields will be sent to the server as
  7452. // null. It is an error if a field in this list has a non-empty value.
  7453. // This may be used to include null fields in Patch requests.
  7454. NullFields []string `json:"-"`
  7455. }
  7456. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  7457. type NoMethod ForwardingRuleAggregatedList
  7458. raw := NoMethod(*s)
  7459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7460. }
  7461. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  7462. // warning message.
  7463. type ForwardingRuleAggregatedListWarning struct {
  7464. // Code: [Output Only] A warning code, if applicable. For example,
  7465. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7466. // the response.
  7467. //
  7468. // Possible values:
  7469. // "CLEANUP_FAILED"
  7470. // "DEPRECATED_RESOURCE_USED"
  7471. // "DEPRECATED_TYPE_USED"
  7472. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7473. // "EXPERIMENTAL_TYPE_USED"
  7474. // "EXTERNAL_API_WARNING"
  7475. // "FIELD_VALUE_OVERRIDEN"
  7476. // "INJECTED_KERNELS_DEPRECATED"
  7477. // "MISSING_TYPE_DEPENDENCY"
  7478. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7479. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7480. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7481. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7482. // "NEXT_HOP_NOT_RUNNING"
  7483. // "NOT_CRITICAL_ERROR"
  7484. // "NO_RESULTS_ON_PAGE"
  7485. // "REQUIRED_TOS_AGREEMENT"
  7486. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7487. // "RESOURCE_NOT_DELETED"
  7488. // "SCHEMA_VALIDATION_IGNORED"
  7489. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7490. // "UNDECLARED_PROPERTIES"
  7491. // "UNREACHABLE"
  7492. Code string `json:"code,omitempty"`
  7493. // Data: [Output Only] Metadata about this warning in key: value format.
  7494. // For example:
  7495. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7496. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  7497. // Message: [Output Only] A human-readable description of the warning
  7498. // code.
  7499. Message string `json:"message,omitempty"`
  7500. // ForceSendFields is a list of field names (e.g. "Code") to
  7501. // unconditionally include in API requests. By default, fields with
  7502. // empty values are omitted from API requests. However, any non-pointer,
  7503. // non-interface field appearing in ForceSendFields will be sent to the
  7504. // server regardless of whether the field is empty or not. This may be
  7505. // used to include empty fields in Patch requests.
  7506. ForceSendFields []string `json:"-"`
  7507. // NullFields is a list of field names (e.g. "Code") to include in API
  7508. // requests with the JSON null value. By default, fields with empty
  7509. // values are omitted from API requests. However, any field with an
  7510. // empty value appearing in NullFields will be sent to the server as
  7511. // null. It is an error if a field in this list has a non-empty value.
  7512. // This may be used to include null fields in Patch requests.
  7513. NullFields []string `json:"-"`
  7514. }
  7515. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7516. type NoMethod ForwardingRuleAggregatedListWarning
  7517. raw := NoMethod(*s)
  7518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7519. }
  7520. type ForwardingRuleAggregatedListWarningData struct {
  7521. // Key: [Output Only] A key that provides more detail on the warning
  7522. // being returned. For example, for warnings where there are no results
  7523. // in a list request for a particular zone, this key might be scope and
  7524. // the key value might be the zone name. Other examples might be a key
  7525. // indicating a deprecated resource and a suggested replacement, or a
  7526. // warning about invalid network settings (for example, if an instance
  7527. // attempts to perform IP forwarding but is not enabled for IP
  7528. // forwarding).
  7529. Key string `json:"key,omitempty"`
  7530. // Value: [Output Only] A warning data value corresponding to the key.
  7531. Value string `json:"value,omitempty"`
  7532. // ForceSendFields is a list of field names (e.g. "Key") to
  7533. // unconditionally include in API requests. By default, fields with
  7534. // empty values are omitted from API requests. However, any non-pointer,
  7535. // non-interface field appearing in ForceSendFields will be sent to the
  7536. // server regardless of whether the field is empty or not. This may be
  7537. // used to include empty fields in Patch requests.
  7538. ForceSendFields []string `json:"-"`
  7539. // NullFields is a list of field names (e.g. "Key") to include in API
  7540. // requests with the JSON null value. By default, fields with empty
  7541. // values are omitted from API requests. However, any field with an
  7542. // empty value appearing in NullFields will be sent to the server as
  7543. // null. It is an error if a field in this list has a non-empty value.
  7544. // This may be used to include null fields in Patch requests.
  7545. NullFields []string `json:"-"`
  7546. }
  7547. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7548. type NoMethod ForwardingRuleAggregatedListWarningData
  7549. raw := NoMethod(*s)
  7550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7551. }
  7552. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  7553. type ForwardingRuleList struct {
  7554. // Id: [Output Only] Unique identifier for the resource; defined by the
  7555. // server.
  7556. Id string `json:"id,omitempty"`
  7557. // Items: A list of ForwardingRule resources.
  7558. Items []*ForwardingRule `json:"items,omitempty"`
  7559. // Kind: Type of resource.
  7560. Kind string `json:"kind,omitempty"`
  7561. // NextPageToken: [Output Only] This token allows you to get the next
  7562. // page of results for list requests. If the number of results is larger
  7563. // than maxResults, use the nextPageToken as a value for the query
  7564. // parameter pageToken in the next list request. Subsequent list
  7565. // requests will have their own nextPageToken to continue paging through
  7566. // the results.
  7567. NextPageToken string `json:"nextPageToken,omitempty"`
  7568. // SelfLink: [Output Only] Server-defined URL for this resource.
  7569. SelfLink string `json:"selfLink,omitempty"`
  7570. // Warning: [Output Only] Informational warning message.
  7571. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  7572. // ServerResponse contains the HTTP response code and headers from the
  7573. // server.
  7574. googleapi.ServerResponse `json:"-"`
  7575. // ForceSendFields is a list of field names (e.g. "Id") to
  7576. // unconditionally include in API requests. By default, fields with
  7577. // empty values are omitted from API requests. However, any non-pointer,
  7578. // non-interface field appearing in ForceSendFields will be sent to the
  7579. // server regardless of whether the field is empty or not. This may be
  7580. // used to include empty fields in Patch requests.
  7581. ForceSendFields []string `json:"-"`
  7582. // NullFields is a list of field names (e.g. "Id") to include in API
  7583. // requests with the JSON null value. By default, fields with empty
  7584. // values are omitted from API requests. However, any field with an
  7585. // empty value appearing in NullFields will be sent to the server as
  7586. // null. It is an error if a field in this list has a non-empty value.
  7587. // This may be used to include null fields in Patch requests.
  7588. NullFields []string `json:"-"`
  7589. }
  7590. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  7591. type NoMethod ForwardingRuleList
  7592. raw := NoMethod(*s)
  7593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7594. }
  7595. // ForwardingRuleListWarning: [Output Only] Informational warning
  7596. // message.
  7597. type ForwardingRuleListWarning struct {
  7598. // Code: [Output Only] A warning code, if applicable. For example,
  7599. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7600. // the response.
  7601. //
  7602. // Possible values:
  7603. // "CLEANUP_FAILED"
  7604. // "DEPRECATED_RESOURCE_USED"
  7605. // "DEPRECATED_TYPE_USED"
  7606. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7607. // "EXPERIMENTAL_TYPE_USED"
  7608. // "EXTERNAL_API_WARNING"
  7609. // "FIELD_VALUE_OVERRIDEN"
  7610. // "INJECTED_KERNELS_DEPRECATED"
  7611. // "MISSING_TYPE_DEPENDENCY"
  7612. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7613. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7614. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7615. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7616. // "NEXT_HOP_NOT_RUNNING"
  7617. // "NOT_CRITICAL_ERROR"
  7618. // "NO_RESULTS_ON_PAGE"
  7619. // "REQUIRED_TOS_AGREEMENT"
  7620. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7621. // "RESOURCE_NOT_DELETED"
  7622. // "SCHEMA_VALIDATION_IGNORED"
  7623. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7624. // "UNDECLARED_PROPERTIES"
  7625. // "UNREACHABLE"
  7626. Code string `json:"code,omitempty"`
  7627. // Data: [Output Only] Metadata about this warning in key: value format.
  7628. // For example:
  7629. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7630. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  7631. // Message: [Output Only] A human-readable description of the warning
  7632. // code.
  7633. Message string `json:"message,omitempty"`
  7634. // ForceSendFields is a list of field names (e.g. "Code") to
  7635. // unconditionally include in API requests. By default, fields with
  7636. // empty values are omitted from API requests. However, any non-pointer,
  7637. // non-interface field appearing in ForceSendFields will be sent to the
  7638. // server regardless of whether the field is empty or not. This may be
  7639. // used to include empty fields in Patch requests.
  7640. ForceSendFields []string `json:"-"`
  7641. // NullFields is a list of field names (e.g. "Code") to include in API
  7642. // requests with the JSON null value. By default, fields with empty
  7643. // values are omitted from API requests. However, any field with an
  7644. // empty value appearing in NullFields will be sent to the server as
  7645. // null. It is an error if a field in this list has a non-empty value.
  7646. // This may be used to include null fields in Patch requests.
  7647. NullFields []string `json:"-"`
  7648. }
  7649. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  7650. type NoMethod ForwardingRuleListWarning
  7651. raw := NoMethod(*s)
  7652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7653. }
  7654. type ForwardingRuleListWarningData struct {
  7655. // Key: [Output Only] A key that provides more detail on the warning
  7656. // being returned. For example, for warnings where there are no results
  7657. // in a list request for a particular zone, this key might be scope and
  7658. // the key value might be the zone name. Other examples might be a key
  7659. // indicating a deprecated resource and a suggested replacement, or a
  7660. // warning about invalid network settings (for example, if an instance
  7661. // attempts to perform IP forwarding but is not enabled for IP
  7662. // forwarding).
  7663. Key string `json:"key,omitempty"`
  7664. // Value: [Output Only] A warning data value corresponding to the key.
  7665. Value string `json:"value,omitempty"`
  7666. // ForceSendFields is a list of field names (e.g. "Key") to
  7667. // unconditionally include in API requests. By default, fields with
  7668. // empty values are omitted from API requests. However, any non-pointer,
  7669. // non-interface field appearing in ForceSendFields will be sent to the
  7670. // server regardless of whether the field is empty or not. This may be
  7671. // used to include empty fields in Patch requests.
  7672. ForceSendFields []string `json:"-"`
  7673. // NullFields is a list of field names (e.g. "Key") to include in API
  7674. // requests with the JSON null value. By default, fields with empty
  7675. // values are omitted from API requests. However, any field with an
  7676. // empty value appearing in NullFields will be sent to the server as
  7677. // null. It is an error if a field in this list has a non-empty value.
  7678. // This may be used to include null fields in Patch requests.
  7679. NullFields []string `json:"-"`
  7680. }
  7681. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  7682. type NoMethod ForwardingRuleListWarningData
  7683. raw := NoMethod(*s)
  7684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7685. }
  7686. type ForwardingRuleReference struct {
  7687. ForwardingRule string `json:"forwardingRule,omitempty"`
  7688. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  7689. // unconditionally include in API requests. By default, fields with
  7690. // empty values are omitted from API requests. However, any non-pointer,
  7691. // non-interface field appearing in ForceSendFields will be sent to the
  7692. // server regardless of whether the field is empty or not. This may be
  7693. // used to include empty fields in Patch requests.
  7694. ForceSendFields []string `json:"-"`
  7695. // NullFields is a list of field names (e.g. "ForwardingRule") to
  7696. // include in API requests with the JSON null value. By default, fields
  7697. // with empty values are omitted from API requests. However, any field
  7698. // with an empty value appearing in NullFields will be sent to the
  7699. // server as null. It is an error if a field in this list has a
  7700. // non-empty value. This may be used to include null fields in Patch
  7701. // requests.
  7702. NullFields []string `json:"-"`
  7703. }
  7704. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  7705. type NoMethod ForwardingRuleReference
  7706. raw := NoMethod(*s)
  7707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7708. }
  7709. type ForwardingRulesScopedList struct {
  7710. // ForwardingRules: A list of forwarding rules contained in this scope.
  7711. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  7712. // Warning: Informational warning which replaces the list of forwarding
  7713. // rules when the list is empty.
  7714. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  7715. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  7716. // unconditionally include in API requests. By default, fields with
  7717. // empty values are omitted from API requests. However, any non-pointer,
  7718. // non-interface field appearing in ForceSendFields will be sent to the
  7719. // server regardless of whether the field is empty or not. This may be
  7720. // used to include empty fields in Patch requests.
  7721. ForceSendFields []string `json:"-"`
  7722. // NullFields is a list of field names (e.g. "ForwardingRules") to
  7723. // include in API requests with the JSON null value. By default, fields
  7724. // with empty values are omitted from API requests. However, any field
  7725. // with an empty value appearing in NullFields will be sent to the
  7726. // server as null. It is an error if a field in this list has a
  7727. // non-empty value. This may be used to include null fields in Patch
  7728. // requests.
  7729. NullFields []string `json:"-"`
  7730. }
  7731. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  7732. type NoMethod ForwardingRulesScopedList
  7733. raw := NoMethod(*s)
  7734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7735. }
  7736. // ForwardingRulesScopedListWarning: Informational warning which
  7737. // replaces the list of forwarding rules when the list is empty.
  7738. type ForwardingRulesScopedListWarning struct {
  7739. // Code: [Output Only] A warning code, if applicable. For example,
  7740. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7741. // the response.
  7742. //
  7743. // Possible values:
  7744. // "CLEANUP_FAILED"
  7745. // "DEPRECATED_RESOURCE_USED"
  7746. // "DEPRECATED_TYPE_USED"
  7747. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7748. // "EXPERIMENTAL_TYPE_USED"
  7749. // "EXTERNAL_API_WARNING"
  7750. // "FIELD_VALUE_OVERRIDEN"
  7751. // "INJECTED_KERNELS_DEPRECATED"
  7752. // "MISSING_TYPE_DEPENDENCY"
  7753. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7754. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7755. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7756. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7757. // "NEXT_HOP_NOT_RUNNING"
  7758. // "NOT_CRITICAL_ERROR"
  7759. // "NO_RESULTS_ON_PAGE"
  7760. // "REQUIRED_TOS_AGREEMENT"
  7761. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7762. // "RESOURCE_NOT_DELETED"
  7763. // "SCHEMA_VALIDATION_IGNORED"
  7764. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7765. // "UNDECLARED_PROPERTIES"
  7766. // "UNREACHABLE"
  7767. Code string `json:"code,omitempty"`
  7768. // Data: [Output Only] Metadata about this warning in key: value format.
  7769. // For example:
  7770. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7771. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  7772. // Message: [Output Only] A human-readable description of the warning
  7773. // code.
  7774. Message string `json:"message,omitempty"`
  7775. // ForceSendFields is a list of field names (e.g. "Code") to
  7776. // unconditionally include in API requests. By default, fields with
  7777. // empty values are omitted from API requests. However, any non-pointer,
  7778. // non-interface field appearing in ForceSendFields will be sent to the
  7779. // server regardless of whether the field is empty or not. This may be
  7780. // used to include empty fields in Patch requests.
  7781. ForceSendFields []string `json:"-"`
  7782. // NullFields is a list of field names (e.g. "Code") to include in API
  7783. // requests with the JSON null value. By default, fields with empty
  7784. // values are omitted from API requests. However, any field with an
  7785. // empty value appearing in NullFields will be sent to the server as
  7786. // null. It is an error if a field in this list has a non-empty value.
  7787. // This may be used to include null fields in Patch requests.
  7788. NullFields []string `json:"-"`
  7789. }
  7790. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  7791. type NoMethod ForwardingRulesScopedListWarning
  7792. raw := NoMethod(*s)
  7793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7794. }
  7795. type ForwardingRulesScopedListWarningData struct {
  7796. // Key: [Output Only] A key that provides more detail on the warning
  7797. // being returned. For example, for warnings where there are no results
  7798. // in a list request for a particular zone, this key might be scope and
  7799. // the key value might be the zone name. Other examples might be a key
  7800. // indicating a deprecated resource and a suggested replacement, or a
  7801. // warning about invalid network settings (for example, if an instance
  7802. // attempts to perform IP forwarding but is not enabled for IP
  7803. // forwarding).
  7804. Key string `json:"key,omitempty"`
  7805. // Value: [Output Only] A warning data value corresponding to the key.
  7806. Value string `json:"value,omitempty"`
  7807. // ForceSendFields is a list of field names (e.g. "Key") to
  7808. // unconditionally include in API requests. By default, fields with
  7809. // empty values are omitted from API requests. However, any non-pointer,
  7810. // non-interface field appearing in ForceSendFields will be sent to the
  7811. // server regardless of whether the field is empty or not. This may be
  7812. // used to include empty fields in Patch requests.
  7813. ForceSendFields []string `json:"-"`
  7814. // NullFields is a list of field names (e.g. "Key") to include in API
  7815. // requests with the JSON null value. By default, fields with empty
  7816. // values are omitted from API requests. However, any field with an
  7817. // empty value appearing in NullFields will be sent to the server as
  7818. // null. It is an error if a field in this list has a non-empty value.
  7819. // This may be used to include null fields in Patch requests.
  7820. NullFields []string `json:"-"`
  7821. }
  7822. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  7823. type NoMethod ForwardingRulesScopedListWarningData
  7824. raw := NoMethod(*s)
  7825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7826. }
  7827. type GlobalSetLabelsRequest struct {
  7828. // LabelFingerprint: The fingerprint of the previous set of labels for
  7829. // this resource, used to detect conflicts. The fingerprint is initially
  7830. // generated by Compute Engine and changes after every request to modify
  7831. // or update labels. You must always provide an up-to-date fingerprint
  7832. // hash when updating or changing labels, otherwise the request will
  7833. // fail with error 412 conditionNotMet. Make a get() request to the
  7834. // resource to get the latest fingerprint.
  7835. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7836. // Labels: A list of labels to apply for this resource. Each label key &
  7837. // value must comply with RFC1035. Specifically, the name must be 1-63
  7838. // characters long and match the regular expression
  7839. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  7840. // a lowercase letter, and all following characters must be a dash,
  7841. // lowercase letter, or digit, except the last character, which cannot
  7842. // be a dash. For example, "webserver-frontend": "images". A label value
  7843. // can also be empty (e.g. "my-label": "").
  7844. Labels map[string]string `json:"labels,omitempty"`
  7845. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  7846. // unconditionally include in API requests. By default, fields with
  7847. // empty values are omitted from API requests. However, any non-pointer,
  7848. // non-interface field appearing in ForceSendFields will be sent to the
  7849. // server regardless of whether the field is empty or not. This may be
  7850. // used to include empty fields in Patch requests.
  7851. ForceSendFields []string `json:"-"`
  7852. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  7853. // include in API requests with the JSON null value. By default, fields
  7854. // with empty values are omitted from API requests. However, any field
  7855. // with an empty value appearing in NullFields will be sent to the
  7856. // server as null. It is an error if a field in this list has a
  7857. // non-empty value. This may be used to include null fields in Patch
  7858. // requests.
  7859. NullFields []string `json:"-"`
  7860. }
  7861. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  7862. type NoMethod GlobalSetLabelsRequest
  7863. raw := NoMethod(*s)
  7864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7865. }
  7866. type GlobalSetPolicyRequest struct {
  7867. // Bindings: Flatten Policy to create a backward compatible wire-format.
  7868. // Deprecated. Use 'policy' to specify bindings.
  7869. Bindings []*Binding `json:"bindings,omitempty"`
  7870. // Etag: Flatten Policy to create a backward compatible wire-format.
  7871. // Deprecated. Use 'policy' to specify the etag.
  7872. Etag string `json:"etag,omitempty"`
  7873. // Policy: REQUIRED: The complete policy to be applied to the
  7874. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  7875. // empty policy is in general a valid policy but certain services (like
  7876. // Projects) might reject them.
  7877. Policy *Policy `json:"policy,omitempty"`
  7878. // ForceSendFields is a list of field names (e.g. "Bindings") to
  7879. // unconditionally include in API requests. By default, fields with
  7880. // empty values are omitted from API requests. However, any non-pointer,
  7881. // non-interface field appearing in ForceSendFields will be sent to the
  7882. // server regardless of whether the field is empty or not. This may be
  7883. // used to include empty fields in Patch requests.
  7884. ForceSendFields []string `json:"-"`
  7885. // NullFields is a list of field names (e.g. "Bindings") to include in
  7886. // API requests with the JSON null value. By default, fields with empty
  7887. // values are omitted from API requests. However, any field with an
  7888. // empty value appearing in NullFields will be sent to the server as
  7889. // null. It is an error if a field in this list has a non-empty value.
  7890. // This may be used to include null fields in Patch requests.
  7891. NullFields []string `json:"-"`
  7892. }
  7893. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  7894. type NoMethod GlobalSetPolicyRequest
  7895. raw := NoMethod(*s)
  7896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7897. }
  7898. // GuestAttributes: A guest attributes entry.
  7899. type GuestAttributes struct {
  7900. // Kind: [Output Only] Type of the resource. Always
  7901. // compute#guestAttributes for guest attributes entry.
  7902. Kind string `json:"kind,omitempty"`
  7903. // QueryPath: The path to be queried. This can be the default namespace
  7904. // ('/') or a nested namespace ('//') or a specified key ('//')
  7905. QueryPath string `json:"queryPath,omitempty"`
  7906. // QueryValue: [Output Only] The value of the requested queried path.
  7907. QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
  7908. // SelfLink: [Output Only] Server-defined URL for this resource.
  7909. SelfLink string `json:"selfLink,omitempty"`
  7910. // VariableKey: The key to search for.
  7911. VariableKey string `json:"variableKey,omitempty"`
  7912. // VariableValue: [Output Only] The value found for the requested key.
  7913. VariableValue string `json:"variableValue,omitempty"`
  7914. // ServerResponse contains the HTTP response code and headers from the
  7915. // server.
  7916. googleapi.ServerResponse `json:"-"`
  7917. // ForceSendFields is a list of field names (e.g. "Kind") to
  7918. // unconditionally include in API requests. By default, fields with
  7919. // empty values are omitted from API requests. However, any non-pointer,
  7920. // non-interface field appearing in ForceSendFields will be sent to the
  7921. // server regardless of whether the field is empty or not. This may be
  7922. // used to include empty fields in Patch requests.
  7923. ForceSendFields []string `json:"-"`
  7924. // NullFields is a list of field names (e.g. "Kind") to include in API
  7925. // requests with the JSON null value. By default, fields with empty
  7926. // values are omitted from API requests. However, any field with an
  7927. // empty value appearing in NullFields will be sent to the server as
  7928. // null. It is an error if a field in this list has a non-empty value.
  7929. // This may be used to include null fields in Patch requests.
  7930. NullFields []string `json:"-"`
  7931. }
  7932. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  7933. type NoMethod GuestAttributes
  7934. raw := NoMethod(*s)
  7935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7936. }
  7937. // GuestAttributesEntry: A guest attributes namespace/key/value entry.
  7938. type GuestAttributesEntry struct {
  7939. // Key: Key for the guest attribute entry.
  7940. Key string `json:"key,omitempty"`
  7941. // Namespace: Namespace for the guest attribute entry.
  7942. Namespace string `json:"namespace,omitempty"`
  7943. // Value: Value for the guest attribute entry.
  7944. Value string `json:"value,omitempty"`
  7945. // ForceSendFields is a list of field names (e.g. "Key") to
  7946. // unconditionally include in API requests. By default, fields with
  7947. // empty values are omitted from API requests. However, any non-pointer,
  7948. // non-interface field appearing in ForceSendFields will be sent to the
  7949. // server regardless of whether the field is empty or not. This may be
  7950. // used to include empty fields in Patch requests.
  7951. ForceSendFields []string `json:"-"`
  7952. // NullFields is a list of field names (e.g. "Key") to include in API
  7953. // requests with the JSON null value. By default, fields with empty
  7954. // values are omitted from API requests. However, any field with an
  7955. // empty value appearing in NullFields will be sent to the server as
  7956. // null. It is an error if a field in this list has a non-empty value.
  7957. // This may be used to include null fields in Patch requests.
  7958. NullFields []string `json:"-"`
  7959. }
  7960. func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
  7961. type NoMethod GuestAttributesEntry
  7962. raw := NoMethod(*s)
  7963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7964. }
  7965. // GuestAttributesValue: Array of guest attribute namespace/key/value
  7966. // tuples.
  7967. type GuestAttributesValue struct {
  7968. Items []*GuestAttributesEntry `json:"items,omitempty"`
  7969. // ForceSendFields is a list of field names (e.g. "Items") to
  7970. // unconditionally include in API requests. By default, fields with
  7971. // empty values are omitted from API requests. However, any non-pointer,
  7972. // non-interface field appearing in ForceSendFields will be sent to the
  7973. // server regardless of whether the field is empty or not. This may be
  7974. // used to include empty fields in Patch requests.
  7975. ForceSendFields []string `json:"-"`
  7976. // NullFields is a list of field names (e.g. "Items") to include in API
  7977. // requests with the JSON null value. By default, fields with empty
  7978. // values are omitted from API requests. However, any field with an
  7979. // empty value appearing in NullFields will be sent to the server as
  7980. // null. It is an error if a field in this list has a non-empty value.
  7981. // This may be used to include null fields in Patch requests.
  7982. NullFields []string `json:"-"`
  7983. }
  7984. func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
  7985. type NoMethod GuestAttributesValue
  7986. raw := NoMethod(*s)
  7987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7988. }
  7989. // GuestOsFeature: Guest OS features.
  7990. type GuestOsFeature struct {
  7991. // Type: The ID of a supported feature. Read Enabling guest operating
  7992. // system features to see a list of available options.
  7993. //
  7994. // Possible values:
  7995. // "FEATURE_TYPE_UNSPECIFIED"
  7996. // "MULTI_IP_SUBNET"
  7997. // "SECURE_BOOT"
  7998. // "UEFI_COMPATIBLE"
  7999. // "VIRTIO_SCSI_MULTIQUEUE"
  8000. // "WINDOWS"
  8001. Type string `json:"type,omitempty"`
  8002. // ForceSendFields is a list of field names (e.g. "Type") to
  8003. // unconditionally include in API requests. By default, fields with
  8004. // empty values are omitted from API requests. However, any non-pointer,
  8005. // non-interface field appearing in ForceSendFields will be sent to the
  8006. // server regardless of whether the field is empty or not. This may be
  8007. // used to include empty fields in Patch requests.
  8008. ForceSendFields []string `json:"-"`
  8009. // NullFields is a list of field names (e.g. "Type") to include in API
  8010. // requests with the JSON null value. By default, fields with empty
  8011. // values are omitted from API requests. However, any field with an
  8012. // empty value appearing in NullFields will be sent to the server as
  8013. // null. It is an error if a field in this list has a non-empty value.
  8014. // This may be used to include null fields in Patch requests.
  8015. NullFields []string `json:"-"`
  8016. }
  8017. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  8018. type NoMethod GuestOsFeature
  8019. raw := NoMethod(*s)
  8020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8021. }
  8022. type HTTP2HealthCheck struct {
  8023. // Host: The value of the host header in the HTTP/2 health check
  8024. // request. If left empty (default value), the IP on behalf of which
  8025. // this health check is performed will be used.
  8026. Host string `json:"host,omitempty"`
  8027. // Port: The TCP port number for the health check request. The default
  8028. // value is 443. Valid values are 1 through 65535.
  8029. Port int64 `json:"port,omitempty"`
  8030. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8031. // both port and port_name are defined, port takes precedence.
  8032. PortName string `json:"portName,omitempty"`
  8033. // PortSpecification: Specifies how port is selected for health
  8034. // checking, can be one of following values:
  8035. // USE_FIXED_PORT: The port number in
  8036. // port
  8037. // is used for health checking.
  8038. // USE_NAMED_PORT: The
  8039. // portName
  8040. // is used for health checking.
  8041. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8042. // each network endpoint is used for health checking. For other
  8043. // backends, the port or named port specified in the Backend Service is
  8044. // used for health checking.
  8045. //
  8046. //
  8047. // If not specified, HTTP2 health check follows behavior specified
  8048. // in
  8049. // port
  8050. // and
  8051. // portName
  8052. // fields.
  8053. //
  8054. // Possible values:
  8055. // "USE_FIXED_PORT"
  8056. // "USE_NAMED_PORT"
  8057. // "USE_SERVING_PORT"
  8058. PortSpecification string `json:"portSpecification,omitempty"`
  8059. // ProxyHeader: Specifies the type of proxy header to append before
  8060. // sending data to the backend, either NONE or PROXY_V1. The default is
  8061. // NONE.
  8062. //
  8063. // Possible values:
  8064. // "NONE"
  8065. // "PROXY_V1"
  8066. ProxyHeader string `json:"proxyHeader,omitempty"`
  8067. // RequestPath: The request path of the HTTP/2 health check request. The
  8068. // default value is /.
  8069. RequestPath string `json:"requestPath,omitempty"`
  8070. // Response: The string to match anywhere in the first 1024 bytes of the
  8071. // response body. If left empty (the default value), the status code
  8072. // determines health. The response data can only be ASCII.
  8073. Response string `json:"response,omitempty"`
  8074. // ForceSendFields is a list of field names (e.g. "Host") to
  8075. // unconditionally include in API requests. By default, fields with
  8076. // empty values are omitted from API requests. However, any non-pointer,
  8077. // non-interface field appearing in ForceSendFields will be sent to the
  8078. // server regardless of whether the field is empty or not. This may be
  8079. // used to include empty fields in Patch requests.
  8080. ForceSendFields []string `json:"-"`
  8081. // NullFields is a list of field names (e.g. "Host") to include in API
  8082. // requests with the JSON null value. By default, fields with empty
  8083. // values are omitted from API requests. However, any field with an
  8084. // empty value appearing in NullFields will be sent to the server as
  8085. // null. It is an error if a field in this list has a non-empty value.
  8086. // This may be used to include null fields in Patch requests.
  8087. NullFields []string `json:"-"`
  8088. }
  8089. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  8090. type NoMethod HTTP2HealthCheck
  8091. raw := NoMethod(*s)
  8092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8093. }
  8094. type HTTPHealthCheck struct {
  8095. // Host: The value of the host header in the HTTP health check request.
  8096. // If left empty (default value), the IP on behalf of which this health
  8097. // check is performed will be used.
  8098. Host string `json:"host,omitempty"`
  8099. // Port: The TCP port number for the health check request. The default
  8100. // value is 80. Valid values are 1 through 65535.
  8101. Port int64 `json:"port,omitempty"`
  8102. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8103. // both port and port_name are defined, port takes precedence.
  8104. PortName string `json:"portName,omitempty"`
  8105. // PortSpecification: Specifies how port is selected for health
  8106. // checking, can be one of following values:
  8107. // USE_FIXED_PORT: The port number in
  8108. // port
  8109. // is used for health checking.
  8110. // USE_NAMED_PORT: The
  8111. // portName
  8112. // is used for health checking.
  8113. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8114. // each network endpoint is used for health checking. For other
  8115. // backends, the port or named port specified in the Backend Service is
  8116. // used for health checking.
  8117. //
  8118. //
  8119. // If not specified, HTTP health check follows behavior specified
  8120. // in
  8121. // port
  8122. // and
  8123. // portName
  8124. // fields.
  8125. //
  8126. // Possible values:
  8127. // "USE_FIXED_PORT"
  8128. // "USE_NAMED_PORT"
  8129. // "USE_SERVING_PORT"
  8130. PortSpecification string `json:"portSpecification,omitempty"`
  8131. // ProxyHeader: Specifies the type of proxy header to append before
  8132. // sending data to the backend, either NONE or PROXY_V1. The default is
  8133. // NONE.
  8134. //
  8135. // Possible values:
  8136. // "NONE"
  8137. // "PROXY_V1"
  8138. ProxyHeader string `json:"proxyHeader,omitempty"`
  8139. // RequestPath: The request path of the HTTP health check request. The
  8140. // default value is /.
  8141. RequestPath string `json:"requestPath,omitempty"`
  8142. // Response: The string to match anywhere in the first 1024 bytes of the
  8143. // response body. If left empty (the default value), the status code
  8144. // determines health. The response data can only be ASCII.
  8145. Response string `json:"response,omitempty"`
  8146. // ForceSendFields is a list of field names (e.g. "Host") to
  8147. // unconditionally include in API requests. By default, fields with
  8148. // empty values are omitted from API requests. However, any non-pointer,
  8149. // non-interface field appearing in ForceSendFields will be sent to the
  8150. // server regardless of whether the field is empty or not. This may be
  8151. // used to include empty fields in Patch requests.
  8152. ForceSendFields []string `json:"-"`
  8153. // NullFields is a list of field names (e.g. "Host") to include in API
  8154. // requests with the JSON null value. By default, fields with empty
  8155. // values are omitted from API requests. However, any field with an
  8156. // empty value appearing in NullFields will be sent to the server as
  8157. // null. It is an error if a field in this list has a non-empty value.
  8158. // This may be used to include null fields in Patch requests.
  8159. NullFields []string `json:"-"`
  8160. }
  8161. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  8162. type NoMethod HTTPHealthCheck
  8163. raw := NoMethod(*s)
  8164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8165. }
  8166. type HTTPSHealthCheck struct {
  8167. // Host: The value of the host header in the HTTPS health check request.
  8168. // If left empty (default value), the IP on behalf of which this health
  8169. // check is performed will be used.
  8170. Host string `json:"host,omitempty"`
  8171. // Port: The TCP port number for the health check request. The default
  8172. // value is 443. Valid values are 1 through 65535.
  8173. Port int64 `json:"port,omitempty"`
  8174. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8175. // both port and port_name are defined, port takes precedence.
  8176. PortName string `json:"portName,omitempty"`
  8177. // PortSpecification: Specifies how port is selected for health
  8178. // checking, can be one of following values:
  8179. // USE_FIXED_PORT: The port number in
  8180. // port
  8181. // is used for health checking.
  8182. // USE_NAMED_PORT: The
  8183. // portName
  8184. // is used for health checking.
  8185. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8186. // each network endpoint is used for health checking. For other
  8187. // backends, the port or named port specified in the Backend Service is
  8188. // used for health checking.
  8189. //
  8190. //
  8191. // If not specified, HTTPS health check follows behavior specified
  8192. // in
  8193. // port
  8194. // and
  8195. // portName
  8196. // fields.
  8197. //
  8198. // Possible values:
  8199. // "USE_FIXED_PORT"
  8200. // "USE_NAMED_PORT"
  8201. // "USE_SERVING_PORT"
  8202. PortSpecification string `json:"portSpecification,omitempty"`
  8203. // ProxyHeader: Specifies the type of proxy header to append before
  8204. // sending data to the backend, either NONE or PROXY_V1. The default is
  8205. // NONE.
  8206. //
  8207. // Possible values:
  8208. // "NONE"
  8209. // "PROXY_V1"
  8210. ProxyHeader string `json:"proxyHeader,omitempty"`
  8211. // RequestPath: The request path of the HTTPS health check request. The
  8212. // default value is /.
  8213. RequestPath string `json:"requestPath,omitempty"`
  8214. // Response: The string to match anywhere in the first 1024 bytes of the
  8215. // response body. If left empty (the default value), the status code
  8216. // determines health. The response data can only be ASCII.
  8217. Response string `json:"response,omitempty"`
  8218. // ForceSendFields is a list of field names (e.g. "Host") to
  8219. // unconditionally include in API requests. By default, fields with
  8220. // empty values are omitted from API requests. However, any non-pointer,
  8221. // non-interface field appearing in ForceSendFields will be sent to the
  8222. // server regardless of whether the field is empty or not. This may be
  8223. // used to include empty fields in Patch requests.
  8224. ForceSendFields []string `json:"-"`
  8225. // NullFields is a list of field names (e.g. "Host") to include in API
  8226. // requests with the JSON null value. By default, fields with empty
  8227. // values are omitted from API requests. However, any field with an
  8228. // empty value appearing in NullFields will be sent to the server as
  8229. // null. It is an error if a field in this list has a non-empty value.
  8230. // This may be used to include null fields in Patch requests.
  8231. NullFields []string `json:"-"`
  8232. }
  8233. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  8234. type NoMethod HTTPSHealthCheck
  8235. raw := NoMethod(*s)
  8236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8237. }
  8238. // HealthCheck: An HealthCheck resource. This resource defines a
  8239. // template for how individual virtual machines should be checked for
  8240. // health, via one of the supported protocols.
  8241. type HealthCheck struct {
  8242. // CheckIntervalSec: How often (in seconds) to send a health check. The
  8243. // default value is 5 seconds.
  8244. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  8245. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  8246. // format.
  8247. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8248. // Description: An optional description of this resource. Provide this
  8249. // property when you create the resource.
  8250. Description string `json:"description,omitempty"`
  8251. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  8252. // after this many consecutive successes. The default value is 2.
  8253. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  8254. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  8255. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  8256. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  8257. // Id: [Output Only] The unique identifier for the resource. This
  8258. // identifier is defined by the server.
  8259. Id uint64 `json:"id,omitempty,string"`
  8260. // Kind: Type of the resource.
  8261. Kind string `json:"kind,omitempty"`
  8262. // Name: Name of the resource. Provided by the client when the resource
  8263. // is created. The name must be 1-63 characters long, and comply with
  8264. // RFC1035. Specifically, the name must be 1-63 characters long and
  8265. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8266. // the first character must be a lowercase letter, and all following
  8267. // characters must be a dash, lowercase letter, or digit, except the
  8268. // last character, which cannot be a dash.
  8269. Name string `json:"name,omitempty"`
  8270. // SelfLink: [Output Only] Server-defined URL for the resource.
  8271. SelfLink string `json:"selfLink,omitempty"`
  8272. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  8273. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  8274. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  8275. // The default value is 5 seconds. It is invalid for timeoutSec to have
  8276. // greater value than checkIntervalSec.
  8277. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  8278. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  8279. // HTTPS. If not specified, the default is TCP. Exactly one of the
  8280. // protocol-specific health check field must be specified, which must
  8281. // match type field.
  8282. //
  8283. // Possible values:
  8284. // "HTTP"
  8285. // "HTTP2"
  8286. // "HTTPS"
  8287. // "INVALID"
  8288. // "SSL"
  8289. // "TCP"
  8290. Type string `json:"type,omitempty"`
  8291. // UnhealthyThreshold: A so-far healthy instance will be marked
  8292. // unhealthy after this many consecutive failures. The default value is
  8293. // 2.
  8294. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  8295. // ServerResponse contains the HTTP response code and headers from the
  8296. // server.
  8297. googleapi.ServerResponse `json:"-"`
  8298. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  8299. // unconditionally include in API requests. By default, fields with
  8300. // empty values are omitted from API requests. However, any non-pointer,
  8301. // non-interface field appearing in ForceSendFields will be sent to the
  8302. // server regardless of whether the field is empty or not. This may be
  8303. // used to include empty fields in Patch requests.
  8304. ForceSendFields []string `json:"-"`
  8305. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  8306. // include in API requests with the JSON null value. By default, fields
  8307. // with empty values are omitted from API requests. However, any field
  8308. // with an empty value appearing in NullFields will be sent to the
  8309. // server as null. It is an error if a field in this list has a
  8310. // non-empty value. This may be used to include null fields in Patch
  8311. // requests.
  8312. NullFields []string `json:"-"`
  8313. }
  8314. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  8315. type NoMethod HealthCheck
  8316. raw := NoMethod(*s)
  8317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8318. }
  8319. // HealthCheckList: Contains a list of HealthCheck resources.
  8320. type HealthCheckList struct {
  8321. // Id: [Output Only] Unique identifier for the resource; defined by the
  8322. // server.
  8323. Id string `json:"id,omitempty"`
  8324. // Items: A list of HealthCheck resources.
  8325. Items []*HealthCheck `json:"items,omitempty"`
  8326. // Kind: Type of resource.
  8327. Kind string `json:"kind,omitempty"`
  8328. // NextPageToken: [Output Only] This token allows you to get the next
  8329. // page of results for list requests. If the number of results is larger
  8330. // than maxResults, use the nextPageToken as a value for the query
  8331. // parameter pageToken in the next list request. Subsequent list
  8332. // requests will have their own nextPageToken to continue paging through
  8333. // the results.
  8334. NextPageToken string `json:"nextPageToken,omitempty"`
  8335. // SelfLink: [Output Only] Server-defined URL for this resource.
  8336. SelfLink string `json:"selfLink,omitempty"`
  8337. // Warning: [Output Only] Informational warning message.
  8338. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  8339. // ServerResponse contains the HTTP response code and headers from the
  8340. // server.
  8341. googleapi.ServerResponse `json:"-"`
  8342. // ForceSendFields is a list of field names (e.g. "Id") to
  8343. // unconditionally include in API requests. By default, fields with
  8344. // empty values are omitted from API requests. However, any non-pointer,
  8345. // non-interface field appearing in ForceSendFields will be sent to the
  8346. // server regardless of whether the field is empty or not. This may be
  8347. // used to include empty fields in Patch requests.
  8348. ForceSendFields []string `json:"-"`
  8349. // NullFields is a list of field names (e.g. "Id") to include in API
  8350. // requests with the JSON null value. By default, fields with empty
  8351. // values are omitted from API requests. However, any field with an
  8352. // empty value appearing in NullFields will be sent to the server as
  8353. // null. It is an error if a field in this list has a non-empty value.
  8354. // This may be used to include null fields in Patch requests.
  8355. NullFields []string `json:"-"`
  8356. }
  8357. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  8358. type NoMethod HealthCheckList
  8359. raw := NoMethod(*s)
  8360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8361. }
  8362. // HealthCheckListWarning: [Output Only] Informational warning message.
  8363. type HealthCheckListWarning struct {
  8364. // Code: [Output Only] A warning code, if applicable. For example,
  8365. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8366. // the response.
  8367. //
  8368. // Possible values:
  8369. // "CLEANUP_FAILED"
  8370. // "DEPRECATED_RESOURCE_USED"
  8371. // "DEPRECATED_TYPE_USED"
  8372. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8373. // "EXPERIMENTAL_TYPE_USED"
  8374. // "EXTERNAL_API_WARNING"
  8375. // "FIELD_VALUE_OVERRIDEN"
  8376. // "INJECTED_KERNELS_DEPRECATED"
  8377. // "MISSING_TYPE_DEPENDENCY"
  8378. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8379. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8380. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8381. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8382. // "NEXT_HOP_NOT_RUNNING"
  8383. // "NOT_CRITICAL_ERROR"
  8384. // "NO_RESULTS_ON_PAGE"
  8385. // "REQUIRED_TOS_AGREEMENT"
  8386. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8387. // "RESOURCE_NOT_DELETED"
  8388. // "SCHEMA_VALIDATION_IGNORED"
  8389. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8390. // "UNDECLARED_PROPERTIES"
  8391. // "UNREACHABLE"
  8392. Code string `json:"code,omitempty"`
  8393. // Data: [Output Only] Metadata about this warning in key: value format.
  8394. // For example:
  8395. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8396. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  8397. // Message: [Output Only] A human-readable description of the warning
  8398. // code.
  8399. Message string `json:"message,omitempty"`
  8400. // ForceSendFields is a list of field names (e.g. "Code") to
  8401. // unconditionally include in API requests. By default, fields with
  8402. // empty values are omitted from API requests. However, any non-pointer,
  8403. // non-interface field appearing in ForceSendFields will be sent to the
  8404. // server regardless of whether the field is empty or not. This may be
  8405. // used to include empty fields in Patch requests.
  8406. ForceSendFields []string `json:"-"`
  8407. // NullFields is a list of field names (e.g. "Code") to include in API
  8408. // requests with the JSON null value. By default, fields with empty
  8409. // values are omitted from API requests. However, any field with an
  8410. // empty value appearing in NullFields will be sent to the server as
  8411. // null. It is an error if a field in this list has a non-empty value.
  8412. // This may be used to include null fields in Patch requests.
  8413. NullFields []string `json:"-"`
  8414. }
  8415. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8416. type NoMethod HealthCheckListWarning
  8417. raw := NoMethod(*s)
  8418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8419. }
  8420. type HealthCheckListWarningData struct {
  8421. // Key: [Output Only] A key that provides more detail on the warning
  8422. // being returned. For example, for warnings where there are no results
  8423. // in a list request for a particular zone, this key might be scope and
  8424. // the key value might be the zone name. Other examples might be a key
  8425. // indicating a deprecated resource and a suggested replacement, or a
  8426. // warning about invalid network settings (for example, if an instance
  8427. // attempts to perform IP forwarding but is not enabled for IP
  8428. // forwarding).
  8429. Key string `json:"key,omitempty"`
  8430. // Value: [Output Only] A warning data value corresponding to the key.
  8431. Value string `json:"value,omitempty"`
  8432. // ForceSendFields is a list of field names (e.g. "Key") to
  8433. // unconditionally include in API requests. By default, fields with
  8434. // empty values are omitted from API requests. However, any non-pointer,
  8435. // non-interface field appearing in ForceSendFields will be sent to the
  8436. // server regardless of whether the field is empty or not. This may be
  8437. // used to include empty fields in Patch requests.
  8438. ForceSendFields []string `json:"-"`
  8439. // NullFields is a list of field names (e.g. "Key") to include in API
  8440. // requests with the JSON null value. By default, fields with empty
  8441. // values are omitted from API requests. However, any field with an
  8442. // empty value appearing in NullFields will be sent to the server as
  8443. // null. It is an error if a field in this list has a non-empty value.
  8444. // This may be used to include null fields in Patch requests.
  8445. NullFields []string `json:"-"`
  8446. }
  8447. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8448. type NoMethod HealthCheckListWarningData
  8449. raw := NoMethod(*s)
  8450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8451. }
  8452. // HealthCheckReference: A full or valid partial URL to a health check.
  8453. // For example, the following are valid URLs:
  8454. // -
  8455. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  8456. // - projects/project-id/global/httpHealthChecks/health-check
  8457. // - global/httpHealthChecks/health-check
  8458. type HealthCheckReference struct {
  8459. HealthCheck string `json:"healthCheck,omitempty"`
  8460. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  8461. // unconditionally include in API requests. By default, fields with
  8462. // empty values are omitted from API requests. However, any non-pointer,
  8463. // non-interface field appearing in ForceSendFields will be sent to the
  8464. // server regardless of whether the field is empty or not. This may be
  8465. // used to include empty fields in Patch requests.
  8466. ForceSendFields []string `json:"-"`
  8467. // NullFields is a list of field names (e.g. "HealthCheck") to include
  8468. // in API requests with the JSON null value. By default, fields with
  8469. // empty values are omitted from API requests. However, any field with
  8470. // an empty value appearing in NullFields will be sent to the server as
  8471. // null. It is an error if a field in this list has a non-empty value.
  8472. // This may be used to include null fields in Patch requests.
  8473. NullFields []string `json:"-"`
  8474. }
  8475. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  8476. type NoMethod HealthCheckReference
  8477. raw := NoMethod(*s)
  8478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8479. }
  8480. type HealthStatus struct {
  8481. // HealthState: Health state of the instance.
  8482. //
  8483. // Possible values:
  8484. // "HEALTHY"
  8485. // "UNHEALTHY"
  8486. HealthState string `json:"healthState,omitempty"`
  8487. // Instance: URL of the instance resource.
  8488. Instance string `json:"instance,omitempty"`
  8489. // IpAddress: The IP address represented by this resource.
  8490. IpAddress string `json:"ipAddress,omitempty"`
  8491. // Port: The port on the instance.
  8492. Port int64 `json:"port,omitempty"`
  8493. // ForceSendFields is a list of field names (e.g. "HealthState") to
  8494. // unconditionally include in API requests. By default, fields with
  8495. // empty values are omitted from API requests. However, any non-pointer,
  8496. // non-interface field appearing in ForceSendFields will be sent to the
  8497. // server regardless of whether the field is empty or not. This may be
  8498. // used to include empty fields in Patch requests.
  8499. ForceSendFields []string `json:"-"`
  8500. // NullFields is a list of field names (e.g. "HealthState") to include
  8501. // in API requests with the JSON null value. By default, fields with
  8502. // empty values are omitted from API requests. However, any field with
  8503. // an empty value appearing in NullFields will be sent to the server as
  8504. // null. It is an error if a field in this list has a non-empty value.
  8505. // This may be used to include null fields in Patch requests.
  8506. NullFields []string `json:"-"`
  8507. }
  8508. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  8509. type NoMethod HealthStatus
  8510. raw := NoMethod(*s)
  8511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8512. }
  8513. type HealthStatusForNetworkEndpoint struct {
  8514. // BackendService: URL of the backend service associated with the health
  8515. // state of the network endpoint.
  8516. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  8517. // ForwardingRule: URL of the forwarding rule associated with the health
  8518. // state of the network endpoint.
  8519. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  8520. // HealthCheck: URL of the health check associated with the health state
  8521. // of the network endpoint.
  8522. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  8523. // HealthState: Health state of the network endpoint determined based on
  8524. // the health checks configured.
  8525. //
  8526. // Possible values:
  8527. // "DRAINING"
  8528. // "HEALTHY"
  8529. // "UNHEALTHY"
  8530. // "UNKNOWN"
  8531. HealthState string `json:"healthState,omitempty"`
  8532. // ForceSendFields is a list of field names (e.g. "BackendService") to
  8533. // unconditionally include in API requests. By default, fields with
  8534. // empty values are omitted from API requests. However, any non-pointer,
  8535. // non-interface field appearing in ForceSendFields will be sent to the
  8536. // server regardless of whether the field is empty or not. This may be
  8537. // used to include empty fields in Patch requests.
  8538. ForceSendFields []string `json:"-"`
  8539. // NullFields is a list of field names (e.g. "BackendService") to
  8540. // include in API requests with the JSON null value. By default, fields
  8541. // with empty values are omitted from API requests. However, any field
  8542. // with an empty value appearing in NullFields will be sent to the
  8543. // server as null. It is an error if a field in this list has a
  8544. // non-empty value. This may be used to include null fields in Patch
  8545. // requests.
  8546. NullFields []string `json:"-"`
  8547. }
  8548. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  8549. type NoMethod HealthStatusForNetworkEndpoint
  8550. raw := NoMethod(*s)
  8551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8552. }
  8553. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  8554. // use the named PathMatcher to select the BackendService.
  8555. type HostRule struct {
  8556. // Description: An optional description of this resource. Provide this
  8557. // property when you create the resource.
  8558. Description string `json:"description,omitempty"`
  8559. // Hosts: The list of host patterns to match. They must be valid
  8560. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  8561. // case, * must be the first character and must be followed in the
  8562. // pattern by either - or ..
  8563. Hosts []string `json:"hosts,omitempty"`
  8564. // PathMatcher: The name of the PathMatcher to use to match the path
  8565. // portion of the URL if the hostRule matches the URL's host portion.
  8566. PathMatcher string `json:"pathMatcher,omitempty"`
  8567. // ForceSendFields is a list of field names (e.g. "Description") to
  8568. // unconditionally include in API requests. By default, fields with
  8569. // empty values are omitted from API requests. However, any non-pointer,
  8570. // non-interface field appearing in ForceSendFields will be sent to the
  8571. // server regardless of whether the field is empty or not. This may be
  8572. // used to include empty fields in Patch requests.
  8573. ForceSendFields []string `json:"-"`
  8574. // NullFields is a list of field names (e.g. "Description") to include
  8575. // in API requests with the JSON null value. By default, fields with
  8576. // empty values are omitted from API requests. However, any field with
  8577. // an empty value appearing in NullFields will be sent to the server as
  8578. // null. It is an error if a field in this list has a non-empty value.
  8579. // This may be used to include null fields in Patch requests.
  8580. NullFields []string `json:"-"`
  8581. }
  8582. func (s *HostRule) MarshalJSON() ([]byte, error) {
  8583. type NoMethod HostRule
  8584. raw := NoMethod(*s)
  8585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8586. }
  8587. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  8588. // template for how individual instances should be checked for health,
  8589. // via HTTP.
  8590. type HttpHealthCheck struct {
  8591. // CheckIntervalSec: How often (in seconds) to send a health check. The
  8592. // default value is 5 seconds.
  8593. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  8594. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8595. // format.
  8596. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8597. // Description: An optional description of this resource. Provide this
  8598. // property when you create the resource.
  8599. Description string `json:"description,omitempty"`
  8600. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  8601. // after this many consecutive successes. The default value is 2.
  8602. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  8603. // Host: The value of the host header in the HTTP health check request.
  8604. // If left empty (default value), the public IP on behalf of which this
  8605. // health check is performed will be used.
  8606. Host string `json:"host,omitempty"`
  8607. // Id: [Output Only] The unique identifier for the resource. This
  8608. // identifier is defined by the server.
  8609. Id uint64 `json:"id,omitempty,string"`
  8610. // Kind: [Output Only] Type of the resource. Always
  8611. // compute#httpHealthCheck for HTTP health checks.
  8612. Kind string `json:"kind,omitempty"`
  8613. // Name: Name of the resource. Provided by the client when the resource
  8614. // is created. The name must be 1-63 characters long, and comply with
  8615. // RFC1035. Specifically, the name must be 1-63 characters long and
  8616. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8617. // the first character must be a lowercase letter, and all following
  8618. // characters must be a dash, lowercase letter, or digit, except the
  8619. // last character, which cannot be a dash.
  8620. Name string `json:"name,omitempty"`
  8621. // Port: The TCP port number for the HTTP health check request. The
  8622. // default value is 80.
  8623. Port int64 `json:"port,omitempty"`
  8624. // RequestPath: The request path of the HTTP health check request. The
  8625. // default value is /.
  8626. RequestPath string `json:"requestPath,omitempty"`
  8627. // SelfLink: [Output Only] Server-defined URL for the resource.
  8628. SelfLink string `json:"selfLink,omitempty"`
  8629. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  8630. // The default value is 5 seconds. It is invalid for timeoutSec to have
  8631. // greater value than checkIntervalSec.
  8632. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  8633. // UnhealthyThreshold: A so-far healthy instance will be marked
  8634. // unhealthy after this many consecutive failures. The default value is
  8635. // 2.
  8636. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  8637. // ServerResponse contains the HTTP response code and headers from the
  8638. // server.
  8639. googleapi.ServerResponse `json:"-"`
  8640. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  8641. // unconditionally include in API requests. By default, fields with
  8642. // empty values are omitted from API requests. However, any non-pointer,
  8643. // non-interface field appearing in ForceSendFields will be sent to the
  8644. // server regardless of whether the field is empty or not. This may be
  8645. // used to include empty fields in Patch requests.
  8646. ForceSendFields []string `json:"-"`
  8647. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  8648. // include in API requests with the JSON null value. By default, fields
  8649. // with empty values are omitted from API requests. However, any field
  8650. // with an empty value appearing in NullFields will be sent to the
  8651. // server as null. It is an error if a field in this list has a
  8652. // non-empty value. This may be used to include null fields in Patch
  8653. // requests.
  8654. NullFields []string `json:"-"`
  8655. }
  8656. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  8657. type NoMethod HttpHealthCheck
  8658. raw := NoMethod(*s)
  8659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8660. }
  8661. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  8662. type HttpHealthCheckList struct {
  8663. // Id: [Output Only] Unique identifier for the resource; defined by the
  8664. // server.
  8665. Id string `json:"id,omitempty"`
  8666. // Items: A list of HttpHealthCheck resources.
  8667. Items []*HttpHealthCheck `json:"items,omitempty"`
  8668. // Kind: Type of resource.
  8669. Kind string `json:"kind,omitempty"`
  8670. // NextPageToken: [Output Only] This token allows you to get the next
  8671. // page of results for list requests. If the number of results is larger
  8672. // than maxResults, use the nextPageToken as a value for the query
  8673. // parameter pageToken in the next list request. Subsequent list
  8674. // requests will have their own nextPageToken to continue paging through
  8675. // the results.
  8676. NextPageToken string `json:"nextPageToken,omitempty"`
  8677. // SelfLink: [Output Only] Server-defined URL for this resource.
  8678. SelfLink string `json:"selfLink,omitempty"`
  8679. // Warning: [Output Only] Informational warning message.
  8680. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  8681. // ServerResponse contains the HTTP response code and headers from the
  8682. // server.
  8683. googleapi.ServerResponse `json:"-"`
  8684. // ForceSendFields is a list of field names (e.g. "Id") to
  8685. // unconditionally include in API requests. By default, fields with
  8686. // empty values are omitted from API requests. However, any non-pointer,
  8687. // non-interface field appearing in ForceSendFields will be sent to the
  8688. // server regardless of whether the field is empty or not. This may be
  8689. // used to include empty fields in Patch requests.
  8690. ForceSendFields []string `json:"-"`
  8691. // NullFields is a list of field names (e.g. "Id") to include in API
  8692. // requests with the JSON null value. By default, fields with empty
  8693. // values are omitted from API requests. However, any field with an
  8694. // empty value appearing in NullFields will be sent to the server as
  8695. // null. It is an error if a field in this list has a non-empty value.
  8696. // This may be used to include null fields in Patch requests.
  8697. NullFields []string `json:"-"`
  8698. }
  8699. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  8700. type NoMethod HttpHealthCheckList
  8701. raw := NoMethod(*s)
  8702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8703. }
  8704. // HttpHealthCheckListWarning: [Output Only] Informational warning
  8705. // message.
  8706. type HttpHealthCheckListWarning struct {
  8707. // Code: [Output Only] A warning code, if applicable. For example,
  8708. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8709. // the response.
  8710. //
  8711. // Possible values:
  8712. // "CLEANUP_FAILED"
  8713. // "DEPRECATED_RESOURCE_USED"
  8714. // "DEPRECATED_TYPE_USED"
  8715. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8716. // "EXPERIMENTAL_TYPE_USED"
  8717. // "EXTERNAL_API_WARNING"
  8718. // "FIELD_VALUE_OVERRIDEN"
  8719. // "INJECTED_KERNELS_DEPRECATED"
  8720. // "MISSING_TYPE_DEPENDENCY"
  8721. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8722. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8723. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8724. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8725. // "NEXT_HOP_NOT_RUNNING"
  8726. // "NOT_CRITICAL_ERROR"
  8727. // "NO_RESULTS_ON_PAGE"
  8728. // "REQUIRED_TOS_AGREEMENT"
  8729. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8730. // "RESOURCE_NOT_DELETED"
  8731. // "SCHEMA_VALIDATION_IGNORED"
  8732. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8733. // "UNDECLARED_PROPERTIES"
  8734. // "UNREACHABLE"
  8735. Code string `json:"code,omitempty"`
  8736. // Data: [Output Only] Metadata about this warning in key: value format.
  8737. // For example:
  8738. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8739. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  8740. // Message: [Output Only] A human-readable description of the warning
  8741. // code.
  8742. Message string `json:"message,omitempty"`
  8743. // ForceSendFields is a list of field names (e.g. "Code") to
  8744. // unconditionally include in API requests. By default, fields with
  8745. // empty values are omitted from API requests. However, any non-pointer,
  8746. // non-interface field appearing in ForceSendFields will be sent to the
  8747. // server regardless of whether the field is empty or not. This may be
  8748. // used to include empty fields in Patch requests.
  8749. ForceSendFields []string `json:"-"`
  8750. // NullFields is a list of field names (e.g. "Code") to include in API
  8751. // requests with the JSON null value. By default, fields with empty
  8752. // values are omitted from API requests. However, any field with an
  8753. // empty value appearing in NullFields will be sent to the server as
  8754. // null. It is an error if a field in this list has a non-empty value.
  8755. // This may be used to include null fields in Patch requests.
  8756. NullFields []string `json:"-"`
  8757. }
  8758. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8759. type NoMethod HttpHealthCheckListWarning
  8760. raw := NoMethod(*s)
  8761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8762. }
  8763. type HttpHealthCheckListWarningData struct {
  8764. // Key: [Output Only] A key that provides more detail on the warning
  8765. // being returned. For example, for warnings where there are no results
  8766. // in a list request for a particular zone, this key might be scope and
  8767. // the key value might be the zone name. Other examples might be a key
  8768. // indicating a deprecated resource and a suggested replacement, or a
  8769. // warning about invalid network settings (for example, if an instance
  8770. // attempts to perform IP forwarding but is not enabled for IP
  8771. // forwarding).
  8772. Key string `json:"key,omitempty"`
  8773. // Value: [Output Only] A warning data value corresponding to the key.
  8774. Value string `json:"value,omitempty"`
  8775. // ForceSendFields is a list of field names (e.g. "Key") to
  8776. // unconditionally include in API requests. By default, fields with
  8777. // empty values are omitted from API requests. However, any non-pointer,
  8778. // non-interface field appearing in ForceSendFields will be sent to the
  8779. // server regardless of whether the field is empty or not. This may be
  8780. // used to include empty fields in Patch requests.
  8781. ForceSendFields []string `json:"-"`
  8782. // NullFields is a list of field names (e.g. "Key") to include in API
  8783. // requests with the JSON null value. By default, fields with empty
  8784. // values are omitted from API requests. However, any field with an
  8785. // empty value appearing in NullFields will be sent to the server as
  8786. // null. It is an error if a field in this list has a non-empty value.
  8787. // This may be used to include null fields in Patch requests.
  8788. NullFields []string `json:"-"`
  8789. }
  8790. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8791. type NoMethod HttpHealthCheckListWarningData
  8792. raw := NoMethod(*s)
  8793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8794. }
  8795. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  8796. // a template for how individual instances should be checked for health,
  8797. // via HTTPS.
  8798. type HttpsHealthCheck struct {
  8799. // CheckIntervalSec: How often (in seconds) to send a health check. The
  8800. // default value is 5 seconds.
  8801. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  8802. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8803. // format.
  8804. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8805. // Description: An optional description of this resource. Provide this
  8806. // property when you create the resource.
  8807. Description string `json:"description,omitempty"`
  8808. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  8809. // after this many consecutive successes. The default value is 2.
  8810. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  8811. // Host: The value of the host header in the HTTPS health check request.
  8812. // If left empty (default value), the public IP on behalf of which this
  8813. // health check is performed will be used.
  8814. Host string `json:"host,omitempty"`
  8815. // Id: [Output Only] The unique identifier for the resource. This
  8816. // identifier is defined by the server.
  8817. Id uint64 `json:"id,omitempty,string"`
  8818. // Kind: Type of the resource.
  8819. Kind string `json:"kind,omitempty"`
  8820. // Name: Name of the resource. Provided by the client when the resource
  8821. // is created. The name must be 1-63 characters long, and comply with
  8822. // RFC1035. Specifically, the name must be 1-63 characters long and
  8823. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8824. // the first character must be a lowercase letter, and all following
  8825. // characters must be a dash, lowercase letter, or digit, except the
  8826. // last character, which cannot be a dash.
  8827. Name string `json:"name,omitempty"`
  8828. // Port: The TCP port number for the HTTPS health check request. The
  8829. // default value is 443.
  8830. Port int64 `json:"port,omitempty"`
  8831. // RequestPath: The request path of the HTTPS health check request. The
  8832. // default value is "/".
  8833. RequestPath string `json:"requestPath,omitempty"`
  8834. // SelfLink: [Output Only] Server-defined URL for the resource.
  8835. SelfLink string `json:"selfLink,omitempty"`
  8836. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  8837. // The default value is 5 seconds. It is invalid for timeoutSec to have
  8838. // a greater value than checkIntervalSec.
  8839. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  8840. // UnhealthyThreshold: A so-far healthy instance will be marked
  8841. // unhealthy after this many consecutive failures. The default value is
  8842. // 2.
  8843. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  8844. // ServerResponse contains the HTTP response code and headers from the
  8845. // server.
  8846. googleapi.ServerResponse `json:"-"`
  8847. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  8848. // unconditionally include in API requests. By default, fields with
  8849. // empty values are omitted from API requests. However, any non-pointer,
  8850. // non-interface field appearing in ForceSendFields will be sent to the
  8851. // server regardless of whether the field is empty or not. This may be
  8852. // used to include empty fields in Patch requests.
  8853. ForceSendFields []string `json:"-"`
  8854. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  8855. // include in API requests with the JSON null value. By default, fields
  8856. // with empty values are omitted from API requests. However, any field
  8857. // with an empty value appearing in NullFields will be sent to the
  8858. // server as null. It is an error if a field in this list has a
  8859. // non-empty value. This may be used to include null fields in Patch
  8860. // requests.
  8861. NullFields []string `json:"-"`
  8862. }
  8863. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  8864. type NoMethod HttpsHealthCheck
  8865. raw := NoMethod(*s)
  8866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8867. }
  8868. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  8869. type HttpsHealthCheckList struct {
  8870. // Id: [Output Only] Unique identifier for the resource; defined by the
  8871. // server.
  8872. Id string `json:"id,omitempty"`
  8873. // Items: A list of HttpsHealthCheck resources.
  8874. Items []*HttpsHealthCheck `json:"items,omitempty"`
  8875. // Kind: Type of resource.
  8876. Kind string `json:"kind,omitempty"`
  8877. // NextPageToken: [Output Only] This token allows you to get the next
  8878. // page of results for list requests. If the number of results is larger
  8879. // than maxResults, use the nextPageToken as a value for the query
  8880. // parameter pageToken in the next list request. Subsequent list
  8881. // requests will have their own nextPageToken to continue paging through
  8882. // the results.
  8883. NextPageToken string `json:"nextPageToken,omitempty"`
  8884. // SelfLink: [Output Only] Server-defined URL for this resource.
  8885. SelfLink string `json:"selfLink,omitempty"`
  8886. // Warning: [Output Only] Informational warning message.
  8887. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  8888. // ServerResponse contains the HTTP response code and headers from the
  8889. // server.
  8890. googleapi.ServerResponse `json:"-"`
  8891. // ForceSendFields is a list of field names (e.g. "Id") to
  8892. // unconditionally include in API requests. By default, fields with
  8893. // empty values are omitted from API requests. However, any non-pointer,
  8894. // non-interface field appearing in ForceSendFields will be sent to the
  8895. // server regardless of whether the field is empty or not. This may be
  8896. // used to include empty fields in Patch requests.
  8897. ForceSendFields []string `json:"-"`
  8898. // NullFields is a list of field names (e.g. "Id") to include in API
  8899. // requests with the JSON null value. By default, fields with empty
  8900. // values are omitted from API requests. However, any field with an
  8901. // empty value appearing in NullFields will be sent to the server as
  8902. // null. It is an error if a field in this list has a non-empty value.
  8903. // This may be used to include null fields in Patch requests.
  8904. NullFields []string `json:"-"`
  8905. }
  8906. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  8907. type NoMethod HttpsHealthCheckList
  8908. raw := NoMethod(*s)
  8909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8910. }
  8911. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  8912. // message.
  8913. type HttpsHealthCheckListWarning struct {
  8914. // Code: [Output Only] A warning code, if applicable. For example,
  8915. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8916. // the response.
  8917. //
  8918. // Possible values:
  8919. // "CLEANUP_FAILED"
  8920. // "DEPRECATED_RESOURCE_USED"
  8921. // "DEPRECATED_TYPE_USED"
  8922. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8923. // "EXPERIMENTAL_TYPE_USED"
  8924. // "EXTERNAL_API_WARNING"
  8925. // "FIELD_VALUE_OVERRIDEN"
  8926. // "INJECTED_KERNELS_DEPRECATED"
  8927. // "MISSING_TYPE_DEPENDENCY"
  8928. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8929. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8930. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8931. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8932. // "NEXT_HOP_NOT_RUNNING"
  8933. // "NOT_CRITICAL_ERROR"
  8934. // "NO_RESULTS_ON_PAGE"
  8935. // "REQUIRED_TOS_AGREEMENT"
  8936. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8937. // "RESOURCE_NOT_DELETED"
  8938. // "SCHEMA_VALIDATION_IGNORED"
  8939. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8940. // "UNDECLARED_PROPERTIES"
  8941. // "UNREACHABLE"
  8942. Code string `json:"code,omitempty"`
  8943. // Data: [Output Only] Metadata about this warning in key: value format.
  8944. // For example:
  8945. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8946. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  8947. // Message: [Output Only] A human-readable description of the warning
  8948. // code.
  8949. Message string `json:"message,omitempty"`
  8950. // ForceSendFields is a list of field names (e.g. "Code") to
  8951. // unconditionally include in API requests. By default, fields with
  8952. // empty values are omitted from API requests. However, any non-pointer,
  8953. // non-interface field appearing in ForceSendFields will be sent to the
  8954. // server regardless of whether the field is empty or not. This may be
  8955. // used to include empty fields in Patch requests.
  8956. ForceSendFields []string `json:"-"`
  8957. // NullFields is a list of field names (e.g. "Code") to include in API
  8958. // requests with the JSON null value. By default, fields with empty
  8959. // values are omitted from API requests. However, any field with an
  8960. // empty value appearing in NullFields will be sent to the server as
  8961. // null. It is an error if a field in this list has a non-empty value.
  8962. // This may be used to include null fields in Patch requests.
  8963. NullFields []string `json:"-"`
  8964. }
  8965. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8966. type NoMethod HttpsHealthCheckListWarning
  8967. raw := NoMethod(*s)
  8968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8969. }
  8970. type HttpsHealthCheckListWarningData struct {
  8971. // Key: [Output Only] A key that provides more detail on the warning
  8972. // being returned. For example, for warnings where there are no results
  8973. // in a list request for a particular zone, this key might be scope and
  8974. // the key value might be the zone name. Other examples might be a key
  8975. // indicating a deprecated resource and a suggested replacement, or a
  8976. // warning about invalid network settings (for example, if an instance
  8977. // attempts to perform IP forwarding but is not enabled for IP
  8978. // forwarding).
  8979. Key string `json:"key,omitempty"`
  8980. // Value: [Output Only] A warning data value corresponding to the key.
  8981. Value string `json:"value,omitempty"`
  8982. // ForceSendFields is a list of field names (e.g. "Key") to
  8983. // unconditionally include in API requests. By default, fields with
  8984. // empty values are omitted from API requests. However, any non-pointer,
  8985. // non-interface field appearing in ForceSendFields will be sent to the
  8986. // server regardless of whether the field is empty or not. This may be
  8987. // used to include empty fields in Patch requests.
  8988. ForceSendFields []string `json:"-"`
  8989. // NullFields is a list of field names (e.g. "Key") to include in API
  8990. // requests with the JSON null value. By default, fields with empty
  8991. // values are omitted from API requests. However, any field with an
  8992. // empty value appearing in NullFields will be sent to the server as
  8993. // null. It is an error if a field in this list has a non-empty value.
  8994. // This may be used to include null fields in Patch requests.
  8995. NullFields []string `json:"-"`
  8996. }
  8997. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8998. type NoMethod HttpsHealthCheckListWarningData
  8999. raw := NoMethod(*s)
  9000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9001. }
  9002. // Image: An Image resource. (== resource_for beta.images ==) (==
  9003. // resource_for v1.images ==)
  9004. type Image struct {
  9005. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  9006. // Cloud Storage (in bytes).
  9007. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  9008. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9009. // format.
  9010. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9011. // Deprecated: The deprecation status associated with this image.
  9012. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  9013. // Description: An optional description of this resource. Provide this
  9014. // property when you create the resource.
  9015. Description string `json:"description,omitempty"`
  9016. // DiskSizeGb: Size of the image when restored onto a persistent disk
  9017. // (in GB).
  9018. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  9019. // Family: The name of the image family to which this image belongs. You
  9020. // can create disks by specifying an image family instead of a specific
  9021. // image name. The image family always returns its latest image that is
  9022. // not deprecated. The name of the image family must comply with
  9023. // RFC1035.
  9024. Family string `json:"family,omitempty"`
  9025. // GuestOsFeatures: A list of features to enable on the guest operating
  9026. // system. Applicable only for bootable images. Read Enabling guest
  9027. // operating system features to see a list of available options.
  9028. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  9029. // Id: [Output Only] The unique identifier for the resource. This
  9030. // identifier is defined by the server.
  9031. Id uint64 `json:"id,omitempty,string"`
  9032. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  9033. // encryption key.
  9034. //
  9035. // After you encrypt an image with a customer-supplied key, you must
  9036. // provide the same key if you use the image later (e.g. to create a
  9037. // disk from the image).
  9038. //
  9039. // Customer-supplied encryption keys do not protect access to metadata
  9040. // of the disk.
  9041. //
  9042. // If you do not provide an encryption key when creating the image, then
  9043. // the disk will be encrypted using an automatically generated key and
  9044. // you do not need to provide a key to use the image later.
  9045. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  9046. // Kind: [Output Only] Type of the resource. Always compute#image for
  9047. // images.
  9048. Kind string `json:"kind,omitempty"`
  9049. // LabelFingerprint: A fingerprint for the labels being applied to this
  9050. // image, which is essentially a hash of the labels used for optimistic
  9051. // locking. The fingerprint is initially generated by Compute Engine and
  9052. // changes after every request to modify or update labels. You must
  9053. // always provide an up-to-date fingerprint hash in order to update or
  9054. // change labels, otherwise the request will fail with error 412
  9055. // conditionNotMet.
  9056. //
  9057. // To see the latest fingerprint, make a get() request to retrieve an
  9058. // image.
  9059. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9060. // Labels: Labels to apply to this image. These can be later modified by
  9061. // the setLabels method.
  9062. Labels map[string]string `json:"labels,omitempty"`
  9063. // LicenseCodes: Integer license codes indicating which licenses are
  9064. // attached to this image.
  9065. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  9066. // Licenses: Any applicable license URI.
  9067. Licenses []string `json:"licenses,omitempty"`
  9068. // Name: Name of the resource; provided by the client when the resource
  9069. // is created. The name must be 1-63 characters long, and comply with
  9070. // RFC1035. Specifically, the name must be 1-63 characters long and
  9071. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9072. // the first character must be a lowercase letter, and all following
  9073. // characters must be a dash, lowercase letter, or digit, except the
  9074. // last character, which cannot be a dash.
  9075. Name string `json:"name,omitempty"`
  9076. // RawDisk: The parameters of the raw disk image.
  9077. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  9078. // SelfLink: [Output Only] Server-defined URL for the resource.
  9079. SelfLink string `json:"selfLink,omitempty"`
  9080. // SourceDisk: URL of the source disk used to create this image. This
  9081. // can be a full or valid partial URL. You must provide either this
  9082. // property or the rawDisk.source property but not both to create an
  9083. // image. For example, the following are valid values:
  9084. // -
  9085. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  9086. // - projects/project/zones/zone/disks/disk
  9087. // - zones/zone/disks/disk
  9088. SourceDisk string `json:"sourceDisk,omitempty"`
  9089. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  9090. // source disk. Required if the source disk is protected by a
  9091. // customer-supplied encryption key.
  9092. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  9093. // SourceDiskId: [Output Only] The ID value of the disk used to create
  9094. // this image. This value may be used to determine whether the image was
  9095. // taken from the current or a previous instance of a given disk name.
  9096. SourceDiskId string `json:"sourceDiskId,omitempty"`
  9097. // SourceImage: URL of the source image used to create this image. This
  9098. // can be a full or valid partial URL. You must provide exactly one of:
  9099. //
  9100. // - this property, or
  9101. // - the rawDisk.source property, or
  9102. // - the sourceDisk property in order to create an image.
  9103. SourceImage string `json:"sourceImage,omitempty"`
  9104. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  9105. // source image. Required if the source image is protected by a
  9106. // customer-supplied encryption key.
  9107. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  9108. // SourceImageId: [Output Only] The ID value of the image used to create
  9109. // this image. This value may be used to determine whether the image was
  9110. // taken from the current or a previous instance of a given image name.
  9111. SourceImageId string `json:"sourceImageId,omitempty"`
  9112. // SourceSnapshot: URL of the source snapshot used to create this image.
  9113. // This can be a full or valid partial URL. You must provide exactly one
  9114. // of:
  9115. // - this property, or
  9116. // - the sourceImage property, or
  9117. // - the rawDisk.source property, or
  9118. // - the sourceDisk property in order to create an image.
  9119. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  9120. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  9121. // the source snapshot. Required if the source snapshot is protected by
  9122. // a customer-supplied encryption key.
  9123. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  9124. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  9125. // create this image. This value may be used to determine whether the
  9126. // snapshot was taken from the current or a previous instance of a given
  9127. // snapshot name.
  9128. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  9129. // SourceType: The type of the image used to create this disk. The
  9130. // default and only value is RAW
  9131. //
  9132. // Possible values:
  9133. // "RAW" (default)
  9134. SourceType string `json:"sourceType,omitempty"`
  9135. // Status: [Output Only] The status of the image. An image can be used
  9136. // to create other resources, such as instances, only after the image
  9137. // has been successfully created and the status is set to READY.
  9138. // Possible values are FAILED, PENDING, or READY.
  9139. //
  9140. // Possible values:
  9141. // "FAILED"
  9142. // "PENDING"
  9143. // "READY"
  9144. Status string `json:"status,omitempty"`
  9145. // ServerResponse contains the HTTP response code and headers from the
  9146. // server.
  9147. googleapi.ServerResponse `json:"-"`
  9148. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9149. // unconditionally include in API requests. By default, fields with
  9150. // empty values are omitted from API requests. However, any non-pointer,
  9151. // non-interface field appearing in ForceSendFields will be sent to the
  9152. // server regardless of whether the field is empty or not. This may be
  9153. // used to include empty fields in Patch requests.
  9154. ForceSendFields []string `json:"-"`
  9155. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9156. // include in API requests with the JSON null value. By default, fields
  9157. // with empty values are omitted from API requests. However, any field
  9158. // with an empty value appearing in NullFields will be sent to the
  9159. // server as null. It is an error if a field in this list has a
  9160. // non-empty value. This may be used to include null fields in Patch
  9161. // requests.
  9162. NullFields []string `json:"-"`
  9163. }
  9164. func (s *Image) MarshalJSON() ([]byte, error) {
  9165. type NoMethod Image
  9166. raw := NoMethod(*s)
  9167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9168. }
  9169. // ImageRawDisk: The parameters of the raw disk image.
  9170. type ImageRawDisk struct {
  9171. // ContainerType: The format used to encode and transmit the block
  9172. // device, which should be TAR. This is just a container and
  9173. // transmission format and not a runtime format. Provided by the client
  9174. // when the disk image is created.
  9175. //
  9176. // Possible values:
  9177. // "TAR"
  9178. ContainerType string `json:"containerType,omitempty"`
  9179. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  9180. // unpackaging; provided by the client when the disk image is created.
  9181. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  9182. // Source: The full Google Cloud Storage URL where the disk image is
  9183. // stored. You must provide either this property or the sourceDisk
  9184. // property but not both.
  9185. Source string `json:"source,omitempty"`
  9186. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  9187. // unconditionally include in API requests. By default, fields with
  9188. // empty values are omitted from API requests. However, any non-pointer,
  9189. // non-interface field appearing in ForceSendFields will be sent to the
  9190. // server regardless of whether the field is empty or not. This may be
  9191. // used to include empty fields in Patch requests.
  9192. ForceSendFields []string `json:"-"`
  9193. // NullFields is a list of field names (e.g. "ContainerType") to include
  9194. // in API requests with the JSON null value. By default, fields with
  9195. // empty values are omitted from API requests. However, any field with
  9196. // an empty value appearing in NullFields will be sent to the server as
  9197. // null. It is an error if a field in this list has a non-empty value.
  9198. // This may be used to include null fields in Patch requests.
  9199. NullFields []string `json:"-"`
  9200. }
  9201. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  9202. type NoMethod ImageRawDisk
  9203. raw := NoMethod(*s)
  9204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9205. }
  9206. // ImageList: Contains a list of images.
  9207. type ImageList struct {
  9208. // Id: [Output Only] Unique identifier for the resource; defined by the
  9209. // server.
  9210. Id string `json:"id,omitempty"`
  9211. // Items: A list of Image resources.
  9212. Items []*Image `json:"items,omitempty"`
  9213. // Kind: Type of resource.
  9214. Kind string `json:"kind,omitempty"`
  9215. // NextPageToken: [Output Only] This token allows you to get the next
  9216. // page of results for list requests. If the number of results is larger
  9217. // than maxResults, use the nextPageToken as a value for the query
  9218. // parameter pageToken in the next list request. Subsequent list
  9219. // requests will have their own nextPageToken to continue paging through
  9220. // the results.
  9221. NextPageToken string `json:"nextPageToken,omitempty"`
  9222. // SelfLink: [Output Only] Server-defined URL for this resource.
  9223. SelfLink string `json:"selfLink,omitempty"`
  9224. // Warning: [Output Only] Informational warning message.
  9225. Warning *ImageListWarning `json:"warning,omitempty"`
  9226. // ServerResponse contains the HTTP response code and headers from the
  9227. // server.
  9228. googleapi.ServerResponse `json:"-"`
  9229. // ForceSendFields is a list of field names (e.g. "Id") to
  9230. // unconditionally include in API requests. By default, fields with
  9231. // empty values are omitted from API requests. However, any non-pointer,
  9232. // non-interface field appearing in ForceSendFields will be sent to the
  9233. // server regardless of whether the field is empty or not. This may be
  9234. // used to include empty fields in Patch requests.
  9235. ForceSendFields []string `json:"-"`
  9236. // NullFields is a list of field names (e.g. "Id") to include in API
  9237. // requests with the JSON null value. By default, fields with empty
  9238. // values are omitted from API requests. However, any field with an
  9239. // empty value appearing in NullFields will be sent to the server as
  9240. // null. It is an error if a field in this list has a non-empty value.
  9241. // This may be used to include null fields in Patch requests.
  9242. NullFields []string `json:"-"`
  9243. }
  9244. func (s *ImageList) MarshalJSON() ([]byte, error) {
  9245. type NoMethod ImageList
  9246. raw := NoMethod(*s)
  9247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9248. }
  9249. // ImageListWarning: [Output Only] Informational warning message.
  9250. type ImageListWarning struct {
  9251. // Code: [Output Only] A warning code, if applicable. For example,
  9252. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9253. // the response.
  9254. //
  9255. // Possible values:
  9256. // "CLEANUP_FAILED"
  9257. // "DEPRECATED_RESOURCE_USED"
  9258. // "DEPRECATED_TYPE_USED"
  9259. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9260. // "EXPERIMENTAL_TYPE_USED"
  9261. // "EXTERNAL_API_WARNING"
  9262. // "FIELD_VALUE_OVERRIDEN"
  9263. // "INJECTED_KERNELS_DEPRECATED"
  9264. // "MISSING_TYPE_DEPENDENCY"
  9265. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9266. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9267. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9268. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9269. // "NEXT_HOP_NOT_RUNNING"
  9270. // "NOT_CRITICAL_ERROR"
  9271. // "NO_RESULTS_ON_PAGE"
  9272. // "REQUIRED_TOS_AGREEMENT"
  9273. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9274. // "RESOURCE_NOT_DELETED"
  9275. // "SCHEMA_VALIDATION_IGNORED"
  9276. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9277. // "UNDECLARED_PROPERTIES"
  9278. // "UNREACHABLE"
  9279. Code string `json:"code,omitempty"`
  9280. // Data: [Output Only] Metadata about this warning in key: value format.
  9281. // For example:
  9282. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9283. Data []*ImageListWarningData `json:"data,omitempty"`
  9284. // Message: [Output Only] A human-readable description of the warning
  9285. // code.
  9286. Message string `json:"message,omitempty"`
  9287. // ForceSendFields is a list of field names (e.g. "Code") to
  9288. // unconditionally include in API requests. By default, fields with
  9289. // empty values are omitted from API requests. However, any non-pointer,
  9290. // non-interface field appearing in ForceSendFields will be sent to the
  9291. // server regardless of whether the field is empty or not. This may be
  9292. // used to include empty fields in Patch requests.
  9293. ForceSendFields []string `json:"-"`
  9294. // NullFields is a list of field names (e.g. "Code") to include in API
  9295. // requests with the JSON null value. By default, fields with empty
  9296. // values are omitted from API requests. However, any field with an
  9297. // empty value appearing in NullFields will be sent to the server as
  9298. // null. It is an error if a field in this list has a non-empty value.
  9299. // This may be used to include null fields in Patch requests.
  9300. NullFields []string `json:"-"`
  9301. }
  9302. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  9303. type NoMethod ImageListWarning
  9304. raw := NoMethod(*s)
  9305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9306. }
  9307. type ImageListWarningData struct {
  9308. // Key: [Output Only] A key that provides more detail on the warning
  9309. // being returned. For example, for warnings where there are no results
  9310. // in a list request for a particular zone, this key might be scope and
  9311. // the key value might be the zone name. Other examples might be a key
  9312. // indicating a deprecated resource and a suggested replacement, or a
  9313. // warning about invalid network settings (for example, if an instance
  9314. // attempts to perform IP forwarding but is not enabled for IP
  9315. // forwarding).
  9316. Key string `json:"key,omitempty"`
  9317. // Value: [Output Only] A warning data value corresponding to the key.
  9318. Value string `json:"value,omitempty"`
  9319. // ForceSendFields is a list of field names (e.g. "Key") to
  9320. // unconditionally include in API requests. By default, fields with
  9321. // empty values are omitted from API requests. However, any non-pointer,
  9322. // non-interface field appearing in ForceSendFields will be sent to the
  9323. // server regardless of whether the field is empty or not. This may be
  9324. // used to include empty fields in Patch requests.
  9325. ForceSendFields []string `json:"-"`
  9326. // NullFields is a list of field names (e.g. "Key") to include in API
  9327. // requests with the JSON null value. By default, fields with empty
  9328. // values are omitted from API requests. However, any field with an
  9329. // empty value appearing in NullFields will be sent to the server as
  9330. // null. It is an error if a field in this list has a non-empty value.
  9331. // This may be used to include null fields in Patch requests.
  9332. NullFields []string `json:"-"`
  9333. }
  9334. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  9335. type NoMethod ImageListWarningData
  9336. raw := NoMethod(*s)
  9337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9338. }
  9339. // Instance: An Instance resource. (== resource_for beta.instances ==)
  9340. // (== resource_for v1.instances ==)
  9341. type Instance struct {
  9342. // AllocationAffinity: The configuration of desired allocations which
  9343. // this Instance could consume capacity from.
  9344. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  9345. // CanIpForward: Allows this instance to send and receive packets with
  9346. // non-matching destination or source IPs. This is required if you plan
  9347. // to use this instance to forward routes. For more information, see
  9348. // Enabling IP Forwarding.
  9349. CanIpForward bool `json:"canIpForward,omitempty"`
  9350. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  9351. CpuPlatform string `json:"cpuPlatform,omitempty"`
  9352. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9353. // format.
  9354. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9355. // DeletionProtection: Whether the resource should be protected against
  9356. // deletion.
  9357. DeletionProtection bool `json:"deletionProtection,omitempty"`
  9358. // Description: An optional description of this resource. Provide this
  9359. // property when you create the resource.
  9360. Description string `json:"description,omitempty"`
  9361. // Disks: Array of disks associated with this instance. Persistent disks
  9362. // must be created before you can assign them.
  9363. Disks []*AttachedDisk `json:"disks,omitempty"`
  9364. // DisplayDevice: Enables display device for the instance.
  9365. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  9366. // GuestAccelerators: A list of the type and count of accelerator cards
  9367. // attached to the instance.
  9368. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  9369. Hostname string `json:"hostname,omitempty"`
  9370. // Id: [Output Only] The unique identifier for the resource. This
  9371. // identifier is defined by the server.
  9372. Id uint64 `json:"id,omitempty,string"`
  9373. // Kind: [Output Only] Type of the resource. Always compute#instance for
  9374. // instances.
  9375. Kind string `json:"kind,omitempty"`
  9376. // LabelFingerprint: A fingerprint for this request, which is
  9377. // essentially a hash of the label's contents and used for optimistic
  9378. // locking. The fingerprint is initially generated by Compute Engine and
  9379. // changes after every request to modify or update labels. You must
  9380. // always provide an up-to-date fingerprint hash in order to update or
  9381. // change labels.
  9382. //
  9383. // To see the latest fingerprint, make get() request to the instance.
  9384. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9385. // Labels: Labels to apply to this instance. These can be later modified
  9386. // by the setLabels method.
  9387. Labels map[string]string `json:"labels,omitempty"`
  9388. // MachineType: Full or partial URL of the machine type resource to use
  9389. // for this instance, in the format:
  9390. // zones/zone/machineTypes/machine-type. This is provided by the client
  9391. // when the instance is created. For example, the following is a valid
  9392. // partial url to a predefined machine
  9393. // type:
  9394. // zones/us-central1-f/machineTypes/n1-standard-1
  9395. //
  9396. //
  9397. // To create a custom machine type, provide a URL to a machine type in
  9398. // the following format, where CPUS is 1 or an even number up to 32 (2,
  9399. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  9400. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  9401. // 5 GB of memory is 5120
  9402. // MB):
  9403. // zones/zone/machineTypes/custom-CPUS-MEMORY
  9404. //
  9405. //
  9406. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  9407. //
  9408. // For a full list of restrictions, read the Specifications for custom
  9409. // machine types.
  9410. MachineType string `json:"machineType,omitempty"`
  9411. // Metadata: The metadata key/value pairs assigned to this instance.
  9412. // This includes custom metadata and predefined keys.
  9413. Metadata *Metadata `json:"metadata,omitempty"`
  9414. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  9415. // Applicable values are the friendly names of CPU platforms, such as
  9416. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  9417. // Bridge".
  9418. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  9419. // Name: The name of the resource, provided by the client when initially
  9420. // creating the resource. The resource name must be 1-63 characters
  9421. // long, and comply with RFC1035. Specifically, the name must be 1-63
  9422. // characters long and match the regular expression
  9423. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  9424. // a lowercase letter, and all following characters must be a dash,
  9425. // lowercase letter, or digit, except the last character, which cannot
  9426. // be a dash.
  9427. Name string `json:"name,omitempty"`
  9428. // NetworkInterfaces: An array of network configurations for this
  9429. // instance. These specify how interfaces are configured to interact
  9430. // with other network services, such as connecting to the internet.
  9431. // Multiple interfaces are supported per instance.
  9432. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  9433. // Scheduling: Sets the scheduling options for this instance.
  9434. Scheduling *Scheduling `json:"scheduling,omitempty"`
  9435. // SelfLink: [Output Only] Server-defined URL for this resource.
  9436. SelfLink string `json:"selfLink,omitempty"`
  9437. // ServiceAccounts: A list of service accounts, with their specified
  9438. // scopes, authorized for this instance. Only one service account per VM
  9439. // instance is supported.
  9440. //
  9441. // Service accounts generate access tokens that can be accessed through
  9442. // the metadata server and used to authenticate applications on the
  9443. // instance. See Service Accounts for more information.
  9444. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  9445. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  9446. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  9447. // StartRestricted: [Output Only] Whether a VM has been restricted for
  9448. // start because Compute Engine has detected suspicious activity.
  9449. StartRestricted bool `json:"startRestricted,omitempty"`
  9450. // Status: [Output Only] The status of the instance. One of the
  9451. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  9452. // SUSPENDING, SUSPENDED, and TERMINATED.
  9453. //
  9454. // Possible values:
  9455. // "PROVISIONING"
  9456. // "RUNNING"
  9457. // "STAGING"
  9458. // "STOPPED"
  9459. // "STOPPING"
  9460. // "SUSPENDED"
  9461. // "SUSPENDING"
  9462. // "TERMINATED"
  9463. Status string `json:"status,omitempty"`
  9464. // StatusMessage: [Output Only] An optional, human-readable explanation
  9465. // of the status.
  9466. StatusMessage string `json:"statusMessage,omitempty"`
  9467. // Tags: Tags to apply to this instance. Tags are used to identify valid
  9468. // sources or targets for network firewalls and are specified by the
  9469. // client during instance creation. The tags can be later modified by
  9470. // the setTags method. Each tag within the list must comply with
  9471. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  9472. Tags *Tags `json:"tags,omitempty"`
  9473. // Zone: [Output Only] URL of the zone where the instance resides. You
  9474. // must specify this field as part of the HTTP request URL. It is not
  9475. // settable as a field in the request body.
  9476. Zone string `json:"zone,omitempty"`
  9477. // ServerResponse contains the HTTP response code and headers from the
  9478. // server.
  9479. googleapi.ServerResponse `json:"-"`
  9480. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  9481. // to unconditionally include in API requests. By default, fields with
  9482. // empty values are omitted from API requests. However, any non-pointer,
  9483. // non-interface field appearing in ForceSendFields will be sent to the
  9484. // server regardless of whether the field is empty or not. This may be
  9485. // used to include empty fields in Patch requests.
  9486. ForceSendFields []string `json:"-"`
  9487. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  9488. // include in API requests with the JSON null value. By default, fields
  9489. // with empty values are omitted from API requests. However, any field
  9490. // with an empty value appearing in NullFields will be sent to the
  9491. // server as null. It is an error if a field in this list has a
  9492. // non-empty value. This may be used to include null fields in Patch
  9493. // requests.
  9494. NullFields []string `json:"-"`
  9495. }
  9496. func (s *Instance) MarshalJSON() ([]byte, error) {
  9497. type NoMethod Instance
  9498. raw := NoMethod(*s)
  9499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9500. }
  9501. type InstanceAggregatedList struct {
  9502. // Id: [Output Only] Unique identifier for the resource; defined by the
  9503. // server.
  9504. Id string `json:"id,omitempty"`
  9505. // Items: A list of InstancesScopedList resources.
  9506. Items map[string]InstancesScopedList `json:"items,omitempty"`
  9507. // Kind: [Output Only] Type of resource. Always
  9508. // compute#instanceAggregatedList for aggregated lists of Instance
  9509. // resources.
  9510. Kind string `json:"kind,omitempty"`
  9511. // NextPageToken: [Output Only] This token allows you to get the next
  9512. // page of results for list requests. If the number of results is larger
  9513. // than maxResults, use the nextPageToken as a value for the query
  9514. // parameter pageToken in the next list request. Subsequent list
  9515. // requests will have their own nextPageToken to continue paging through
  9516. // the results.
  9517. NextPageToken string `json:"nextPageToken,omitempty"`
  9518. // SelfLink: [Output Only] Server-defined URL for this resource.
  9519. SelfLink string `json:"selfLink,omitempty"`
  9520. // Warning: [Output Only] Informational warning message.
  9521. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  9522. // ServerResponse contains the HTTP response code and headers from the
  9523. // server.
  9524. googleapi.ServerResponse `json:"-"`
  9525. // ForceSendFields is a list of field names (e.g. "Id") to
  9526. // unconditionally include in API requests. By default, fields with
  9527. // empty values are omitted from API requests. However, any non-pointer,
  9528. // non-interface field appearing in ForceSendFields will be sent to the
  9529. // server regardless of whether the field is empty or not. This may be
  9530. // used to include empty fields in Patch requests.
  9531. ForceSendFields []string `json:"-"`
  9532. // NullFields is a list of field names (e.g. "Id") to include in API
  9533. // requests with the JSON null value. By default, fields with empty
  9534. // values are omitted from API requests. However, any field with an
  9535. // empty value appearing in NullFields will be sent to the server as
  9536. // null. It is an error if a field in this list has a non-empty value.
  9537. // This may be used to include null fields in Patch requests.
  9538. NullFields []string `json:"-"`
  9539. }
  9540. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  9541. type NoMethod InstanceAggregatedList
  9542. raw := NoMethod(*s)
  9543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9544. }
  9545. // InstanceAggregatedListWarning: [Output Only] Informational warning
  9546. // message.
  9547. type InstanceAggregatedListWarning struct {
  9548. // Code: [Output Only] A warning code, if applicable. For example,
  9549. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9550. // the response.
  9551. //
  9552. // Possible values:
  9553. // "CLEANUP_FAILED"
  9554. // "DEPRECATED_RESOURCE_USED"
  9555. // "DEPRECATED_TYPE_USED"
  9556. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9557. // "EXPERIMENTAL_TYPE_USED"
  9558. // "EXTERNAL_API_WARNING"
  9559. // "FIELD_VALUE_OVERRIDEN"
  9560. // "INJECTED_KERNELS_DEPRECATED"
  9561. // "MISSING_TYPE_DEPENDENCY"
  9562. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9563. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9564. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9565. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9566. // "NEXT_HOP_NOT_RUNNING"
  9567. // "NOT_CRITICAL_ERROR"
  9568. // "NO_RESULTS_ON_PAGE"
  9569. // "REQUIRED_TOS_AGREEMENT"
  9570. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9571. // "RESOURCE_NOT_DELETED"
  9572. // "SCHEMA_VALIDATION_IGNORED"
  9573. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9574. // "UNDECLARED_PROPERTIES"
  9575. // "UNREACHABLE"
  9576. Code string `json:"code,omitempty"`
  9577. // Data: [Output Only] Metadata about this warning in key: value format.
  9578. // For example:
  9579. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9580. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  9581. // Message: [Output Only] A human-readable description of the warning
  9582. // code.
  9583. Message string `json:"message,omitempty"`
  9584. // ForceSendFields is a list of field names (e.g. "Code") to
  9585. // unconditionally include in API requests. By default, fields with
  9586. // empty values are omitted from API requests. However, any non-pointer,
  9587. // non-interface field appearing in ForceSendFields will be sent to the
  9588. // server regardless of whether the field is empty or not. This may be
  9589. // used to include empty fields in Patch requests.
  9590. ForceSendFields []string `json:"-"`
  9591. // NullFields is a list of field names (e.g. "Code") to include in API
  9592. // requests with the JSON null value. By default, fields with empty
  9593. // values are omitted from API requests. However, any field with an
  9594. // empty value appearing in NullFields will be sent to the server as
  9595. // null. It is an error if a field in this list has a non-empty value.
  9596. // This may be used to include null fields in Patch requests.
  9597. NullFields []string `json:"-"`
  9598. }
  9599. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9600. type NoMethod InstanceAggregatedListWarning
  9601. raw := NoMethod(*s)
  9602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9603. }
  9604. type InstanceAggregatedListWarningData struct {
  9605. // Key: [Output Only] A key that provides more detail on the warning
  9606. // being returned. For example, for warnings where there are no results
  9607. // in a list request for a particular zone, this key might be scope and
  9608. // the key value might be the zone name. Other examples might be a key
  9609. // indicating a deprecated resource and a suggested replacement, or a
  9610. // warning about invalid network settings (for example, if an instance
  9611. // attempts to perform IP forwarding but is not enabled for IP
  9612. // forwarding).
  9613. Key string `json:"key,omitempty"`
  9614. // Value: [Output Only] A warning data value corresponding to the key.
  9615. Value string `json:"value,omitempty"`
  9616. // ForceSendFields is a list of field names (e.g. "Key") to
  9617. // unconditionally include in API requests. By default, fields with
  9618. // empty values are omitted from API requests. However, any non-pointer,
  9619. // non-interface field appearing in ForceSendFields will be sent to the
  9620. // server regardless of whether the field is empty or not. This may be
  9621. // used to include empty fields in Patch requests.
  9622. ForceSendFields []string `json:"-"`
  9623. // NullFields is a list of field names (e.g. "Key") to include in API
  9624. // requests with the JSON null value. By default, fields with empty
  9625. // values are omitted from API requests. However, any field with an
  9626. // empty value appearing in NullFields will be sent to the server as
  9627. // null. It is an error if a field in this list has a non-empty value.
  9628. // This may be used to include null fields in Patch requests.
  9629. NullFields []string `json:"-"`
  9630. }
  9631. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9632. type NoMethod InstanceAggregatedListWarningData
  9633. raw := NoMethod(*s)
  9634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9635. }
  9636. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  9637. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  9638. // beta.regionInstanceGroups ==) (== resource_for
  9639. // v1.regionInstanceGroups ==)
  9640. type InstanceGroup struct {
  9641. // CreationTimestamp: [Output Only] The creation timestamp for this
  9642. // instance group in RFC3339 text format.
  9643. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9644. // Description: An optional description of this resource. Provide this
  9645. // property when you create the resource.
  9646. Description string `json:"description,omitempty"`
  9647. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  9648. // system uses this fingerprint to detect conflicts when multiple users
  9649. // change the named ports concurrently.
  9650. Fingerprint string `json:"fingerprint,omitempty"`
  9651. // Id: [Output Only] A unique identifier for this instance group,
  9652. // generated by the server.
  9653. Id uint64 `json:"id,omitempty,string"`
  9654. // Kind: [Output Only] The resource type, which is always
  9655. // compute#instanceGroup for instance groups.
  9656. Kind string `json:"kind,omitempty"`
  9657. // Name: The name of the instance group. The name must be 1-63
  9658. // characters long, and comply with RFC1035.
  9659. Name string `json:"name,omitempty"`
  9660. // NamedPorts: Assigns a name to a port number. For example: {name:
  9661. // "http", port: 80}
  9662. //
  9663. // This allows the system to reference ports by the assigned name
  9664. // instead of a port number. Named ports can also contain multiple
  9665. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  9666. // 8080}]
  9667. //
  9668. // Named ports apply to all instances in this instance group.
  9669. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  9670. // Network: The URL of the network to which all instances in the
  9671. // instance group belong.
  9672. Network string `json:"network,omitempty"`
  9673. // Region: [Output Only] The URL of the region where the instance group
  9674. // is located (for regional resources).
  9675. Region string `json:"region,omitempty"`
  9676. // SelfLink: [Output Only] The URL for this instance group. The server
  9677. // generates this URL.
  9678. SelfLink string `json:"selfLink,omitempty"`
  9679. // Size: [Output Only] The total number of instances in the instance
  9680. // group.
  9681. Size int64 `json:"size,omitempty"`
  9682. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  9683. // instances in the instance group belong.
  9684. Subnetwork string `json:"subnetwork,omitempty"`
  9685. // Zone: [Output Only] The URL of the zone where the instance group is
  9686. // located (for zonal resources).
  9687. Zone string `json:"zone,omitempty"`
  9688. // ServerResponse contains the HTTP response code and headers from the
  9689. // server.
  9690. googleapi.ServerResponse `json:"-"`
  9691. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9692. // to unconditionally include in API requests. By default, fields with
  9693. // empty values are omitted from API requests. However, any non-pointer,
  9694. // non-interface field appearing in ForceSendFields will be sent to the
  9695. // server regardless of whether the field is empty or not. This may be
  9696. // used to include empty fields in Patch requests.
  9697. ForceSendFields []string `json:"-"`
  9698. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9699. // include in API requests with the JSON null value. By default, fields
  9700. // with empty values are omitted from API requests. However, any field
  9701. // with an empty value appearing in NullFields will be sent to the
  9702. // server as null. It is an error if a field in this list has a
  9703. // non-empty value. This may be used to include null fields in Patch
  9704. // requests.
  9705. NullFields []string `json:"-"`
  9706. }
  9707. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  9708. type NoMethod InstanceGroup
  9709. raw := NoMethod(*s)
  9710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9711. }
  9712. type InstanceGroupAggregatedList struct {
  9713. // Id: [Output Only] Unique identifier for the resource; defined by the
  9714. // server.
  9715. Id string `json:"id,omitempty"`
  9716. // Items: A list of InstanceGroupsScopedList resources.
  9717. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  9718. // Kind: [Output Only] The resource type, which is always
  9719. // compute#instanceGroupAggregatedList for aggregated lists of instance
  9720. // groups.
  9721. Kind string `json:"kind,omitempty"`
  9722. // NextPageToken: [Output Only] This token allows you to get the next
  9723. // page of results for list requests. If the number of results is larger
  9724. // than maxResults, use the nextPageToken as a value for the query
  9725. // parameter pageToken in the next list request. Subsequent list
  9726. // requests will have their own nextPageToken to continue paging through
  9727. // the results.
  9728. NextPageToken string `json:"nextPageToken,omitempty"`
  9729. // SelfLink: [Output Only] Server-defined URL for this resource.
  9730. SelfLink string `json:"selfLink,omitempty"`
  9731. // Warning: [Output Only] Informational warning message.
  9732. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  9733. // ServerResponse contains the HTTP response code and headers from the
  9734. // server.
  9735. googleapi.ServerResponse `json:"-"`
  9736. // ForceSendFields is a list of field names (e.g. "Id") to
  9737. // unconditionally include in API requests. By default, fields with
  9738. // empty values are omitted from API requests. However, any non-pointer,
  9739. // non-interface field appearing in ForceSendFields will be sent to the
  9740. // server regardless of whether the field is empty or not. This may be
  9741. // used to include empty fields in Patch requests.
  9742. ForceSendFields []string `json:"-"`
  9743. // NullFields is a list of field names (e.g. "Id") to include in API
  9744. // requests with the JSON null value. By default, fields with empty
  9745. // values are omitted from API requests. However, any field with an
  9746. // empty value appearing in NullFields will be sent to the server as
  9747. // null. It is an error if a field in this list has a non-empty value.
  9748. // This may be used to include null fields in Patch requests.
  9749. NullFields []string `json:"-"`
  9750. }
  9751. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  9752. type NoMethod InstanceGroupAggregatedList
  9753. raw := NoMethod(*s)
  9754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9755. }
  9756. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  9757. // warning message.
  9758. type InstanceGroupAggregatedListWarning struct {
  9759. // Code: [Output Only] A warning code, if applicable. For example,
  9760. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9761. // the response.
  9762. //
  9763. // Possible values:
  9764. // "CLEANUP_FAILED"
  9765. // "DEPRECATED_RESOURCE_USED"
  9766. // "DEPRECATED_TYPE_USED"
  9767. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9768. // "EXPERIMENTAL_TYPE_USED"
  9769. // "EXTERNAL_API_WARNING"
  9770. // "FIELD_VALUE_OVERRIDEN"
  9771. // "INJECTED_KERNELS_DEPRECATED"
  9772. // "MISSING_TYPE_DEPENDENCY"
  9773. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9774. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9775. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9776. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9777. // "NEXT_HOP_NOT_RUNNING"
  9778. // "NOT_CRITICAL_ERROR"
  9779. // "NO_RESULTS_ON_PAGE"
  9780. // "REQUIRED_TOS_AGREEMENT"
  9781. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9782. // "RESOURCE_NOT_DELETED"
  9783. // "SCHEMA_VALIDATION_IGNORED"
  9784. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9785. // "UNDECLARED_PROPERTIES"
  9786. // "UNREACHABLE"
  9787. Code string `json:"code,omitempty"`
  9788. // Data: [Output Only] Metadata about this warning in key: value format.
  9789. // For example:
  9790. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9791. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  9792. // Message: [Output Only] A human-readable description of the warning
  9793. // code.
  9794. Message string `json:"message,omitempty"`
  9795. // ForceSendFields is a list of field names (e.g. "Code") to
  9796. // unconditionally include in API requests. By default, fields with
  9797. // empty values are omitted from API requests. However, any non-pointer,
  9798. // non-interface field appearing in ForceSendFields will be sent to the
  9799. // server regardless of whether the field is empty or not. This may be
  9800. // used to include empty fields in Patch requests.
  9801. ForceSendFields []string `json:"-"`
  9802. // NullFields is a list of field names (e.g. "Code") to include in API
  9803. // requests with the JSON null value. By default, fields with empty
  9804. // values are omitted from API requests. However, any field with an
  9805. // empty value appearing in NullFields will be sent to the server as
  9806. // null. It is an error if a field in this list has a non-empty value.
  9807. // This may be used to include null fields in Patch requests.
  9808. NullFields []string `json:"-"`
  9809. }
  9810. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9811. type NoMethod InstanceGroupAggregatedListWarning
  9812. raw := NoMethod(*s)
  9813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9814. }
  9815. type InstanceGroupAggregatedListWarningData struct {
  9816. // Key: [Output Only] A key that provides more detail on the warning
  9817. // being returned. For example, for warnings where there are no results
  9818. // in a list request for a particular zone, this key might be scope and
  9819. // the key value might be the zone name. Other examples might be a key
  9820. // indicating a deprecated resource and a suggested replacement, or a
  9821. // warning about invalid network settings (for example, if an instance
  9822. // attempts to perform IP forwarding but is not enabled for IP
  9823. // forwarding).
  9824. Key string `json:"key,omitempty"`
  9825. // Value: [Output Only] A warning data value corresponding to the key.
  9826. Value string `json:"value,omitempty"`
  9827. // ForceSendFields is a list of field names (e.g. "Key") to
  9828. // unconditionally include in API requests. By default, fields with
  9829. // empty values are omitted from API requests. However, any non-pointer,
  9830. // non-interface field appearing in ForceSendFields will be sent to the
  9831. // server regardless of whether the field is empty or not. This may be
  9832. // used to include empty fields in Patch requests.
  9833. ForceSendFields []string `json:"-"`
  9834. // NullFields is a list of field names (e.g. "Key") to include in API
  9835. // requests with the JSON null value. By default, fields with empty
  9836. // values are omitted from API requests. However, any field with an
  9837. // empty value appearing in NullFields will be sent to the server as
  9838. // null. It is an error if a field in this list has a non-empty value.
  9839. // This may be used to include null fields in Patch requests.
  9840. NullFields []string `json:"-"`
  9841. }
  9842. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9843. type NoMethod InstanceGroupAggregatedListWarningData
  9844. raw := NoMethod(*s)
  9845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9846. }
  9847. // InstanceGroupList: A list of InstanceGroup resources.
  9848. type InstanceGroupList struct {
  9849. // Id: [Output Only] Unique identifier for the resource; defined by the
  9850. // server.
  9851. Id string `json:"id,omitempty"`
  9852. // Items: A list of InstanceGroup resources.
  9853. Items []*InstanceGroup `json:"items,omitempty"`
  9854. // Kind: [Output Only] The resource type, which is always
  9855. // compute#instanceGroupList for instance group lists.
  9856. Kind string `json:"kind,omitempty"`
  9857. // NextPageToken: [Output Only] This token allows you to get the next
  9858. // page of results for list requests. If the number of results is larger
  9859. // than maxResults, use the nextPageToken as a value for the query
  9860. // parameter pageToken in the next list request. Subsequent list
  9861. // requests will have their own nextPageToken to continue paging through
  9862. // the results.
  9863. NextPageToken string `json:"nextPageToken,omitempty"`
  9864. // SelfLink: [Output Only] Server-defined URL for this resource.
  9865. SelfLink string `json:"selfLink,omitempty"`
  9866. // Warning: [Output Only] Informational warning message.
  9867. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  9868. // ServerResponse contains the HTTP response code and headers from the
  9869. // server.
  9870. googleapi.ServerResponse `json:"-"`
  9871. // ForceSendFields is a list of field names (e.g. "Id") to
  9872. // unconditionally include in API requests. By default, fields with
  9873. // empty values are omitted from API requests. However, any non-pointer,
  9874. // non-interface field appearing in ForceSendFields will be sent to the
  9875. // server regardless of whether the field is empty or not. This may be
  9876. // used to include empty fields in Patch requests.
  9877. ForceSendFields []string `json:"-"`
  9878. // NullFields is a list of field names (e.g. "Id") to include in API
  9879. // requests with the JSON null value. By default, fields with empty
  9880. // values are omitted from API requests. However, any field with an
  9881. // empty value appearing in NullFields will be sent to the server as
  9882. // null. It is an error if a field in this list has a non-empty value.
  9883. // This may be used to include null fields in Patch requests.
  9884. NullFields []string `json:"-"`
  9885. }
  9886. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  9887. type NoMethod InstanceGroupList
  9888. raw := NoMethod(*s)
  9889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9890. }
  9891. // InstanceGroupListWarning: [Output Only] Informational warning
  9892. // message.
  9893. type InstanceGroupListWarning struct {
  9894. // Code: [Output Only] A warning code, if applicable. For example,
  9895. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9896. // the response.
  9897. //
  9898. // Possible values:
  9899. // "CLEANUP_FAILED"
  9900. // "DEPRECATED_RESOURCE_USED"
  9901. // "DEPRECATED_TYPE_USED"
  9902. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9903. // "EXPERIMENTAL_TYPE_USED"
  9904. // "EXTERNAL_API_WARNING"
  9905. // "FIELD_VALUE_OVERRIDEN"
  9906. // "INJECTED_KERNELS_DEPRECATED"
  9907. // "MISSING_TYPE_DEPENDENCY"
  9908. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9909. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9910. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9911. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9912. // "NEXT_HOP_NOT_RUNNING"
  9913. // "NOT_CRITICAL_ERROR"
  9914. // "NO_RESULTS_ON_PAGE"
  9915. // "REQUIRED_TOS_AGREEMENT"
  9916. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9917. // "RESOURCE_NOT_DELETED"
  9918. // "SCHEMA_VALIDATION_IGNORED"
  9919. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9920. // "UNDECLARED_PROPERTIES"
  9921. // "UNREACHABLE"
  9922. Code string `json:"code,omitempty"`
  9923. // Data: [Output Only] Metadata about this warning in key: value format.
  9924. // For example:
  9925. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9926. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  9927. // Message: [Output Only] A human-readable description of the warning
  9928. // code.
  9929. Message string `json:"message,omitempty"`
  9930. // ForceSendFields is a list of field names (e.g. "Code") to
  9931. // unconditionally include in API requests. By default, fields with
  9932. // empty values are omitted from API requests. However, any non-pointer,
  9933. // non-interface field appearing in ForceSendFields will be sent to the
  9934. // server regardless of whether the field is empty or not. This may be
  9935. // used to include empty fields in Patch requests.
  9936. ForceSendFields []string `json:"-"`
  9937. // NullFields is a list of field names (e.g. "Code") to include in API
  9938. // requests with the JSON null value. By default, fields with empty
  9939. // values are omitted from API requests. However, any field with an
  9940. // empty value appearing in NullFields will be sent to the server as
  9941. // null. It is an error if a field in this list has a non-empty value.
  9942. // This may be used to include null fields in Patch requests.
  9943. NullFields []string `json:"-"`
  9944. }
  9945. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  9946. type NoMethod InstanceGroupListWarning
  9947. raw := NoMethod(*s)
  9948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9949. }
  9950. type InstanceGroupListWarningData struct {
  9951. // Key: [Output Only] A key that provides more detail on the warning
  9952. // being returned. For example, for warnings where there are no results
  9953. // in a list request for a particular zone, this key might be scope and
  9954. // the key value might be the zone name. Other examples might be a key
  9955. // indicating a deprecated resource and a suggested replacement, or a
  9956. // warning about invalid network settings (for example, if an instance
  9957. // attempts to perform IP forwarding but is not enabled for IP
  9958. // forwarding).
  9959. Key string `json:"key,omitempty"`
  9960. // Value: [Output Only] A warning data value corresponding to the key.
  9961. Value string `json:"value,omitempty"`
  9962. // ForceSendFields is a list of field names (e.g. "Key") to
  9963. // unconditionally include in API requests. By default, fields with
  9964. // empty values are omitted from API requests. However, any non-pointer,
  9965. // non-interface field appearing in ForceSendFields will be sent to the
  9966. // server regardless of whether the field is empty or not. This may be
  9967. // used to include empty fields in Patch requests.
  9968. ForceSendFields []string `json:"-"`
  9969. // NullFields is a list of field names (e.g. "Key") to include in API
  9970. // requests with the JSON null value. By default, fields with empty
  9971. // values are omitted from API requests. However, any field with an
  9972. // empty value appearing in NullFields will be sent to the server as
  9973. // null. It is an error if a field in this list has a non-empty value.
  9974. // This may be used to include null fields in Patch requests.
  9975. NullFields []string `json:"-"`
  9976. }
  9977. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  9978. type NoMethod InstanceGroupListWarningData
  9979. raw := NoMethod(*s)
  9980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9981. }
  9982. // InstanceGroupManager: An Instance Group Manager resource. (==
  9983. // resource_for beta.instanceGroupManagers ==) (== resource_for
  9984. // v1.instanceGroupManagers ==) (== resource_for
  9985. // beta.regionInstanceGroupManagers ==) (== resource_for
  9986. // v1.regionInstanceGroupManagers ==)
  9987. type InstanceGroupManager struct {
  9988. // AutoHealingPolicies: The autohealing policy for this managed instance
  9989. // group. You can specify only one value.
  9990. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  9991. // BaseInstanceName: The base instance name to use for instances in this
  9992. // group. The value must be 1-58 characters long. Instances are named by
  9993. // appending a hyphen and a random four-character string to the base
  9994. // instance name. The base instance name must comply with RFC1035.
  9995. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  9996. // CreationTimestamp: [Output Only] The creation timestamp for this
  9997. // managed instance group in RFC3339 text format.
  9998. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9999. // CurrentActions: [Output Only] The list of instance actions and the
  10000. // number of instances in this managed instance group that are scheduled
  10001. // for each of those actions.
  10002. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  10003. // Description: An optional description of this resource. Provide this
  10004. // property when you create the resource.
  10005. Description string `json:"description,omitempty"`
  10006. // DistributionPolicy: Policy specifying intended distribution of
  10007. // instances in regional managed instance group.
  10008. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  10009. // FailoverAction: The action to perform in case of zone failure. Only
  10010. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  10011. //
  10012. // Possible values:
  10013. // "NO_FAILOVER"
  10014. // "UNKNOWN"
  10015. FailoverAction string `json:"failoverAction,omitempty"`
  10016. // Fingerprint: Fingerprint of this resource. This field may be used in
  10017. // optimistic locking. It will be ignored when inserting an
  10018. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  10019. // order to update the InstanceGroupManager, otherwise the request will
  10020. // fail with error 412 conditionNotMet.
  10021. //
  10022. // To see the latest fingerprint, make a get() request to retrieve an
  10023. // InstanceGroupManager.
  10024. Fingerprint string `json:"fingerprint,omitempty"`
  10025. // Id: [Output Only] A unique identifier for this resource type. The
  10026. // server generates this identifier.
  10027. Id uint64 `json:"id,omitempty,string"`
  10028. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  10029. InstanceGroup string `json:"instanceGroup,omitempty"`
  10030. // InstanceTemplate: The URL of the instance template that is specified
  10031. // for this managed instance group. The group uses this template to
  10032. // create all new instances in the managed instance group.
  10033. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10034. // Kind: [Output Only] The resource type, which is always
  10035. // compute#instanceGroupManager for managed instance groups.
  10036. Kind string `json:"kind,omitempty"`
  10037. // Name: The name of the managed instance group. The name must be 1-63
  10038. // characters long, and comply with RFC1035.
  10039. Name string `json:"name,omitempty"`
  10040. // NamedPorts: Named ports configured for the Instance Groups
  10041. // complementary to this Instance Group Manager.
  10042. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10043. // PendingActions: [Output Only] The list of instance actions and the
  10044. // number of instances in this managed instance group that are pending
  10045. // for each of those actions.
  10046. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  10047. // Region: [Output Only] The URL of the region where the managed
  10048. // instance group resides (for regional resources).
  10049. Region string `json:"region,omitempty"`
  10050. // SelfLink: [Output Only] The URL for this managed instance group. The
  10051. // server defines this URL.
  10052. SelfLink string `json:"selfLink,omitempty"`
  10053. // ServiceAccount: The service account to be used as credentials for all
  10054. // operations performed by the managed instance group on instances. The
  10055. // service accounts needs all permissions required to create and delete
  10056. // instances. By default, the service account
  10057. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  10058. ServiceAccount string `json:"serviceAccount,omitempty"`
  10059. // Status: [Output Only] The status of this managed instance group.
  10060. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  10061. // TargetPools: The URLs for all TargetPool resources to which instances
  10062. // in the instanceGroup field are added. The target pools automatically
  10063. // apply to all of the instances in the managed instance group.
  10064. TargetPools []string `json:"targetPools,omitempty"`
  10065. // TargetSize: The target number of running instances for this managed
  10066. // instance group. Deleting or abandoning instances reduces this number.
  10067. // Resizing the group changes this number.
  10068. TargetSize int64 `json:"targetSize,omitempty"`
  10069. // UpdatePolicy: The update policy for this managed instance group.
  10070. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  10071. // Versions: Specifies the instance templates used by this managed
  10072. // instance group to create instances.
  10073. //
  10074. // Each version is defined by an instanceTemplate. Every template can
  10075. // appear at most once per instance group. This field overrides the
  10076. // top-level instanceTemplate field. Read more about the relationships
  10077. // between these fields. Exactly one version must leave the targetSize
  10078. // field unset. That version will be applied to all remaining instances.
  10079. // For more information, read about canary updates.
  10080. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  10081. // Zone: [Output Only] The URL of the zone where the managed instance
  10082. // group is located (for zonal resources).
  10083. Zone string `json:"zone,omitempty"`
  10084. // ServerResponse contains the HTTP response code and headers from the
  10085. // server.
  10086. googleapi.ServerResponse `json:"-"`
  10087. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  10088. // to unconditionally include in API requests. By default, fields with
  10089. // empty values are omitted from API requests. However, any non-pointer,
  10090. // non-interface field appearing in ForceSendFields will be sent to the
  10091. // server regardless of whether the field is empty or not. This may be
  10092. // used to include empty fields in Patch requests.
  10093. ForceSendFields []string `json:"-"`
  10094. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  10095. // include in API requests with the JSON null value. By default, fields
  10096. // with empty values are omitted from API requests. However, any field
  10097. // with an empty value appearing in NullFields will be sent to the
  10098. // server as null. It is an error if a field in this list has a
  10099. // non-empty value. This may be used to include null fields in Patch
  10100. // requests.
  10101. NullFields []string `json:"-"`
  10102. }
  10103. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  10104. type NoMethod InstanceGroupManager
  10105. raw := NoMethod(*s)
  10106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10107. }
  10108. type InstanceGroupManagerActionsSummary struct {
  10109. // Abandoning: [Output Only] The total number of instances in the
  10110. // managed instance group that are scheduled to be abandoned. Abandoning
  10111. // an instance removes it from the managed instance group without
  10112. // deleting it.
  10113. Abandoning int64 `json:"abandoning,omitempty"`
  10114. // Creating: [Output Only] The number of instances in the managed
  10115. // instance group that are scheduled to be created or are currently
  10116. // being created. If the group fails to create any of these instances,
  10117. // it tries again until it creates the instance successfully.
  10118. //
  10119. // If you have disabled creation retries, this field will not be
  10120. // populated; instead, the creatingWithoutRetries field will be
  10121. // populated.
  10122. Creating int64 `json:"creating,omitempty"`
  10123. // CreatingWithoutRetries: [Output Only] The number of instances that
  10124. // the managed instance group will attempt to create. The group attempts
  10125. // to create each instance only once. If the group fails to create any
  10126. // of these instances, it decreases the group's targetSize value
  10127. // accordingly.
  10128. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  10129. // Deleting: [Output Only] The number of instances in the managed
  10130. // instance group that are scheduled to be deleted or are currently
  10131. // being deleted.
  10132. Deleting int64 `json:"deleting,omitempty"`
  10133. // None: [Output Only] The number of instances in the managed instance
  10134. // group that are running and have no scheduled actions.
  10135. None int64 `json:"none,omitempty"`
  10136. // Recreating: [Output Only] The number of instances in the managed
  10137. // instance group that are scheduled to be recreated or are currently
  10138. // being being recreated. Recreating an instance deletes the existing
  10139. // root persistent disk and creates a new disk from the image that is
  10140. // defined in the instance template.
  10141. Recreating int64 `json:"recreating,omitempty"`
  10142. // Refreshing: [Output Only] The number of instances in the managed
  10143. // instance group that are being reconfigured with properties that do
  10144. // not require a restart or a recreate action. For example, setting or
  10145. // removing target pools for the instance.
  10146. Refreshing int64 `json:"refreshing,omitempty"`
  10147. // Restarting: [Output Only] The number of instances in the managed
  10148. // instance group that are scheduled to be restarted or are currently
  10149. // being restarted.
  10150. Restarting int64 `json:"restarting,omitempty"`
  10151. // Verifying: [Output Only] The number of instances in the managed
  10152. // instance group that are being verified. See the
  10153. // managedInstances[].currentAction property in the listManagedInstances
  10154. // method documentation.
  10155. Verifying int64 `json:"verifying,omitempty"`
  10156. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  10157. // unconditionally include in API requests. By default, fields with
  10158. // empty values are omitted from API requests. However, any non-pointer,
  10159. // non-interface field appearing in ForceSendFields will be sent to the
  10160. // server regardless of whether the field is empty or not. This may be
  10161. // used to include empty fields in Patch requests.
  10162. ForceSendFields []string `json:"-"`
  10163. // NullFields is a list of field names (e.g. "Abandoning") to include in
  10164. // API requests with the JSON null value. By default, fields with empty
  10165. // values are omitted from API requests. However, any field with an
  10166. // empty value appearing in NullFields will be sent to the server as
  10167. // null. It is an error if a field in this list has a non-empty value.
  10168. // This may be used to include null fields in Patch requests.
  10169. NullFields []string `json:"-"`
  10170. }
  10171. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  10172. type NoMethod InstanceGroupManagerActionsSummary
  10173. raw := NoMethod(*s)
  10174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10175. }
  10176. type InstanceGroupManagerAggregatedList struct {
  10177. // Id: [Output Only] Unique identifier for the resource; defined by the
  10178. // server.
  10179. Id string `json:"id,omitempty"`
  10180. // Items: A list of InstanceGroupManagersScopedList resources.
  10181. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  10182. // Kind: [Output Only] The resource type, which is always
  10183. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  10184. // managed instance groups.
  10185. Kind string `json:"kind,omitempty"`
  10186. // NextPageToken: [Output Only] This token allows you to get the next
  10187. // page of results for list requests. If the number of results is larger
  10188. // than maxResults, use the nextPageToken as a value for the query
  10189. // parameter pageToken in the next list request. Subsequent list
  10190. // requests will have their own nextPageToken to continue paging through
  10191. // the results.
  10192. NextPageToken string `json:"nextPageToken,omitempty"`
  10193. // SelfLink: [Output Only] Server-defined URL for this resource.
  10194. SelfLink string `json:"selfLink,omitempty"`
  10195. // Warning: [Output Only] Informational warning message.
  10196. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  10197. // ServerResponse contains the HTTP response code and headers from the
  10198. // server.
  10199. googleapi.ServerResponse `json:"-"`
  10200. // ForceSendFields is a list of field names (e.g. "Id") to
  10201. // unconditionally include in API requests. By default, fields with
  10202. // empty values are omitted from API requests. However, any non-pointer,
  10203. // non-interface field appearing in ForceSendFields will be sent to the
  10204. // server regardless of whether the field is empty or not. This may be
  10205. // used to include empty fields in Patch requests.
  10206. ForceSendFields []string `json:"-"`
  10207. // NullFields is a list of field names (e.g. "Id") to include in API
  10208. // requests with the JSON null value. By default, fields with empty
  10209. // values are omitted from API requests. However, any field with an
  10210. // empty value appearing in NullFields will be sent to the server as
  10211. // null. It is an error if a field in this list has a non-empty value.
  10212. // This may be used to include null fields in Patch requests.
  10213. NullFields []string `json:"-"`
  10214. }
  10215. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  10216. type NoMethod InstanceGroupManagerAggregatedList
  10217. raw := NoMethod(*s)
  10218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10219. }
  10220. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  10221. // Informational warning message.
  10222. type InstanceGroupManagerAggregatedListWarning struct {
  10223. // Code: [Output Only] A warning code, if applicable. For example,
  10224. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10225. // the response.
  10226. //
  10227. // Possible values:
  10228. // "CLEANUP_FAILED"
  10229. // "DEPRECATED_RESOURCE_USED"
  10230. // "DEPRECATED_TYPE_USED"
  10231. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10232. // "EXPERIMENTAL_TYPE_USED"
  10233. // "EXTERNAL_API_WARNING"
  10234. // "FIELD_VALUE_OVERRIDEN"
  10235. // "INJECTED_KERNELS_DEPRECATED"
  10236. // "MISSING_TYPE_DEPENDENCY"
  10237. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10238. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10239. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10240. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10241. // "NEXT_HOP_NOT_RUNNING"
  10242. // "NOT_CRITICAL_ERROR"
  10243. // "NO_RESULTS_ON_PAGE"
  10244. // "REQUIRED_TOS_AGREEMENT"
  10245. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10246. // "RESOURCE_NOT_DELETED"
  10247. // "SCHEMA_VALIDATION_IGNORED"
  10248. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10249. // "UNDECLARED_PROPERTIES"
  10250. // "UNREACHABLE"
  10251. Code string `json:"code,omitempty"`
  10252. // Data: [Output Only] Metadata about this warning in key: value format.
  10253. // For example:
  10254. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10255. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  10256. // Message: [Output Only] A human-readable description of the warning
  10257. // code.
  10258. Message string `json:"message,omitempty"`
  10259. // ForceSendFields is a list of field names (e.g. "Code") to
  10260. // unconditionally include in API requests. By default, fields with
  10261. // empty values are omitted from API requests. However, any non-pointer,
  10262. // non-interface field appearing in ForceSendFields will be sent to the
  10263. // server regardless of whether the field is empty or not. This may be
  10264. // used to include empty fields in Patch requests.
  10265. ForceSendFields []string `json:"-"`
  10266. // NullFields is a list of field names (e.g. "Code") to include in API
  10267. // requests with the JSON null value. By default, fields with empty
  10268. // values are omitted from API requests. However, any field with an
  10269. // empty value appearing in NullFields will be sent to the server as
  10270. // null. It is an error if a field in this list has a non-empty value.
  10271. // This may be used to include null fields in Patch requests.
  10272. NullFields []string `json:"-"`
  10273. }
  10274. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10275. type NoMethod InstanceGroupManagerAggregatedListWarning
  10276. raw := NoMethod(*s)
  10277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10278. }
  10279. type InstanceGroupManagerAggregatedListWarningData struct {
  10280. // Key: [Output Only] A key that provides more detail on the warning
  10281. // being returned. For example, for warnings where there are no results
  10282. // in a list request for a particular zone, this key might be scope and
  10283. // the key value might be the zone name. Other examples might be a key
  10284. // indicating a deprecated resource and a suggested replacement, or a
  10285. // warning about invalid network settings (for example, if an instance
  10286. // attempts to perform IP forwarding but is not enabled for IP
  10287. // forwarding).
  10288. Key string `json:"key,omitempty"`
  10289. // Value: [Output Only] A warning data value corresponding to the key.
  10290. Value string `json:"value,omitempty"`
  10291. // ForceSendFields is a list of field names (e.g. "Key") to
  10292. // unconditionally include in API requests. By default, fields with
  10293. // empty values are omitted from API requests. However, any non-pointer,
  10294. // non-interface field appearing in ForceSendFields will be sent to the
  10295. // server regardless of whether the field is empty or not. This may be
  10296. // used to include empty fields in Patch requests.
  10297. ForceSendFields []string `json:"-"`
  10298. // NullFields is a list of field names (e.g. "Key") to include in API
  10299. // requests with the JSON null value. By default, fields with empty
  10300. // values are omitted from API requests. However, any field with an
  10301. // empty value appearing in NullFields will be sent to the server as
  10302. // null. It is an error if a field in this list has a non-empty value.
  10303. // This may be used to include null fields in Patch requests.
  10304. NullFields []string `json:"-"`
  10305. }
  10306. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10307. type NoMethod InstanceGroupManagerAggregatedListWarningData
  10308. raw := NoMethod(*s)
  10309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10310. }
  10311. type InstanceGroupManagerAutoHealingPolicy struct {
  10312. // HealthCheck: The URL for the health check that signals autohealing.
  10313. HealthCheck string `json:"healthCheck,omitempty"`
  10314. // InitialDelaySec: The number of seconds that the managed instance
  10315. // group waits before it applies autohealing policies to new instances
  10316. // or recently recreated instances. This initial delay allows instances
  10317. // to initialize and run their startup scripts before the instance group
  10318. // determines that they are UNHEALTHY. This prevents the managed
  10319. // instance group from recreating its instances prematurely. This value
  10320. // must be from range [0, 3600].
  10321. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  10322. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  10323. // unconditionally include in API requests. By default, fields with
  10324. // empty values are omitted from API requests. However, any non-pointer,
  10325. // non-interface field appearing in ForceSendFields will be sent to the
  10326. // server regardless of whether the field is empty or not. This may be
  10327. // used to include empty fields in Patch requests.
  10328. ForceSendFields []string `json:"-"`
  10329. // NullFields is a list of field names (e.g. "HealthCheck") to include
  10330. // in API requests with the JSON null value. By default, fields with
  10331. // empty values are omitted from API requests. However, any field with
  10332. // an empty value appearing in NullFields will be sent to the server as
  10333. // null. It is an error if a field in this list has a non-empty value.
  10334. // This may be used to include null fields in Patch requests.
  10335. NullFields []string `json:"-"`
  10336. }
  10337. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  10338. type NoMethod InstanceGroupManagerAutoHealingPolicy
  10339. raw := NoMethod(*s)
  10340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10341. }
  10342. // InstanceGroupManagerList: [Output Only] A list of managed instance
  10343. // groups.
  10344. type InstanceGroupManagerList struct {
  10345. // Id: [Output Only] Unique identifier for the resource; defined by the
  10346. // server.
  10347. Id string `json:"id,omitempty"`
  10348. // Items: A list of InstanceGroupManager resources.
  10349. Items []*InstanceGroupManager `json:"items,omitempty"`
  10350. // Kind: [Output Only] The resource type, which is always
  10351. // compute#instanceGroupManagerList for a list of managed instance
  10352. // groups.
  10353. Kind string `json:"kind,omitempty"`
  10354. // NextPageToken: [Output Only] This token allows you to get the next
  10355. // page of results for list requests. If the number of results is larger
  10356. // than maxResults, use the nextPageToken as a value for the query
  10357. // parameter pageToken in the next list request. Subsequent list
  10358. // requests will have their own nextPageToken to continue paging through
  10359. // the results.
  10360. NextPageToken string `json:"nextPageToken,omitempty"`
  10361. // SelfLink: [Output Only] Server-defined URL for this resource.
  10362. SelfLink string `json:"selfLink,omitempty"`
  10363. // Warning: [Output Only] Informational warning message.
  10364. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  10365. // ServerResponse contains the HTTP response code and headers from the
  10366. // server.
  10367. googleapi.ServerResponse `json:"-"`
  10368. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  10384. type NoMethod InstanceGroupManagerList
  10385. raw := NoMethod(*s)
  10386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10387. }
  10388. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  10389. // message.
  10390. type InstanceGroupManagerListWarning struct {
  10391. // Code: [Output Only] A warning code, if applicable. For example,
  10392. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10393. // the response.
  10394. //
  10395. // Possible values:
  10396. // "CLEANUP_FAILED"
  10397. // "DEPRECATED_RESOURCE_USED"
  10398. // "DEPRECATED_TYPE_USED"
  10399. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10400. // "EXPERIMENTAL_TYPE_USED"
  10401. // "EXTERNAL_API_WARNING"
  10402. // "FIELD_VALUE_OVERRIDEN"
  10403. // "INJECTED_KERNELS_DEPRECATED"
  10404. // "MISSING_TYPE_DEPENDENCY"
  10405. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10406. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10407. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10408. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10409. // "NEXT_HOP_NOT_RUNNING"
  10410. // "NOT_CRITICAL_ERROR"
  10411. // "NO_RESULTS_ON_PAGE"
  10412. // "REQUIRED_TOS_AGREEMENT"
  10413. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10414. // "RESOURCE_NOT_DELETED"
  10415. // "SCHEMA_VALIDATION_IGNORED"
  10416. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10417. // "UNDECLARED_PROPERTIES"
  10418. // "UNREACHABLE"
  10419. Code string `json:"code,omitempty"`
  10420. // Data: [Output Only] Metadata about this warning in key: value format.
  10421. // For example:
  10422. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10423. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  10424. // Message: [Output Only] A human-readable description of the warning
  10425. // code.
  10426. Message string `json:"message,omitempty"`
  10427. // ForceSendFields is a list of field names (e.g. "Code") to
  10428. // unconditionally include in API requests. By default, fields with
  10429. // empty values are omitted from API requests. However, any non-pointer,
  10430. // non-interface field appearing in ForceSendFields will be sent to the
  10431. // server regardless of whether the field is empty or not. This may be
  10432. // used to include empty fields in Patch requests.
  10433. ForceSendFields []string `json:"-"`
  10434. // NullFields is a list of field names (e.g. "Code") to include in API
  10435. // requests with the JSON null value. By default, fields with empty
  10436. // values are omitted from API requests. However, any field with an
  10437. // empty value appearing in NullFields will be sent to the server as
  10438. // null. It is an error if a field in this list has a non-empty value.
  10439. // This may be used to include null fields in Patch requests.
  10440. NullFields []string `json:"-"`
  10441. }
  10442. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  10443. type NoMethod InstanceGroupManagerListWarning
  10444. raw := NoMethod(*s)
  10445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10446. }
  10447. type InstanceGroupManagerListWarningData struct {
  10448. // Key: [Output Only] A key that provides more detail on the warning
  10449. // being returned. For example, for warnings where there are no results
  10450. // in a list request for a particular zone, this key might be scope and
  10451. // the key value might be the zone name. Other examples might be a key
  10452. // indicating a deprecated resource and a suggested replacement, or a
  10453. // warning about invalid network settings (for example, if an instance
  10454. // attempts to perform IP forwarding but is not enabled for IP
  10455. // forwarding).
  10456. Key string `json:"key,omitempty"`
  10457. // Value: [Output Only] A warning data value corresponding to the key.
  10458. Value string `json:"value,omitempty"`
  10459. // ForceSendFields is a list of field names (e.g. "Key") to
  10460. // unconditionally include in API requests. By default, fields with
  10461. // empty values are omitted from API requests. However, any non-pointer,
  10462. // non-interface field appearing in ForceSendFields will be sent to the
  10463. // server regardless of whether the field is empty or not. This may be
  10464. // used to include empty fields in Patch requests.
  10465. ForceSendFields []string `json:"-"`
  10466. // NullFields is a list of field names (e.g. "Key") to include in API
  10467. // requests with the JSON null value. By default, fields with empty
  10468. // values are omitted from API requests. However, any field with an
  10469. // empty value appearing in NullFields will be sent to the server as
  10470. // null. It is an error if a field in this list has a non-empty value.
  10471. // This may be used to include null fields in Patch requests.
  10472. NullFields []string `json:"-"`
  10473. }
  10474. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  10475. type NoMethod InstanceGroupManagerListWarningData
  10476. raw := NoMethod(*s)
  10477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10478. }
  10479. type InstanceGroupManagerPendingActionsSummary struct {
  10480. // Creating: [Output Only] The number of instances in the managed
  10481. // instance group that are pending to be created.
  10482. Creating int64 `json:"creating,omitempty"`
  10483. // Deleting: [Output Only] The number of instances in the managed
  10484. // instance group that are pending to be deleted.
  10485. Deleting int64 `json:"deleting,omitempty"`
  10486. // Recreating: [Output Only] The number of instances in the managed
  10487. // instance group that are pending to be recreated.
  10488. Recreating int64 `json:"recreating,omitempty"`
  10489. // Restarting: [Output Only] The number of instances in the managed
  10490. // instance group that are pending to be restarted.
  10491. Restarting int64 `json:"restarting,omitempty"`
  10492. // ForceSendFields is a list of field names (e.g. "Creating") to
  10493. // unconditionally include in API requests. By default, fields with
  10494. // empty values are omitted from API requests. However, any non-pointer,
  10495. // non-interface field appearing in ForceSendFields will be sent to the
  10496. // server regardless of whether the field is empty or not. This may be
  10497. // used to include empty fields in Patch requests.
  10498. ForceSendFields []string `json:"-"`
  10499. // NullFields is a list of field names (e.g. "Creating") to include in
  10500. // API requests with the JSON null value. By default, fields with empty
  10501. // values are omitted from API requests. However, any field with an
  10502. // empty value appearing in NullFields will be sent to the server as
  10503. // null. It is an error if a field in this list has a non-empty value.
  10504. // This may be used to include null fields in Patch requests.
  10505. NullFields []string `json:"-"`
  10506. }
  10507. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  10508. type NoMethod InstanceGroupManagerPendingActionsSummary
  10509. raw := NoMethod(*s)
  10510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10511. }
  10512. type InstanceGroupManagerStatus struct {
  10513. // IsStable: [Output Only] A bit indicating whether the managed instance
  10514. // group is in a stable state. A stable state means that: none of the
  10515. // instances in the managed instance group is currently undergoing any
  10516. // type of change (for example, creation, restart, or deletion); no
  10517. // future changes are scheduled for instances in the managed instance
  10518. // group; and the managed instance group itself is not being modified.
  10519. IsStable bool `json:"isStable,omitempty"`
  10520. // ForceSendFields is a list of field names (e.g. "IsStable") to
  10521. // unconditionally include in API requests. By default, fields with
  10522. // empty values are omitted from API requests. However, any non-pointer,
  10523. // non-interface field appearing in ForceSendFields will be sent to the
  10524. // server regardless of whether the field is empty or not. This may be
  10525. // used to include empty fields in Patch requests.
  10526. ForceSendFields []string `json:"-"`
  10527. // NullFields is a list of field names (e.g. "IsStable") to include in
  10528. // API requests with the JSON null value. By default, fields with empty
  10529. // values are omitted from API requests. However, any field with an
  10530. // empty value appearing in NullFields will be sent to the server as
  10531. // null. It is an error if a field in this list has a non-empty value.
  10532. // This may be used to include null fields in Patch requests.
  10533. NullFields []string `json:"-"`
  10534. }
  10535. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  10536. type NoMethod InstanceGroupManagerStatus
  10537. raw := NoMethod(*s)
  10538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10539. }
  10540. type InstanceGroupManagerUpdatePolicy struct {
  10541. // MaxSurge: The maximum number of instances that can be created above
  10542. // the specified targetSize during the update process. By default, a
  10543. // fixed value of 1 is used. This value can be either a fixed number or
  10544. // a percentage if the instance group has 10 or more instances. If you
  10545. // set a percentage, the number of instances will be rounded up if
  10546. // necessary.
  10547. //
  10548. // At least one of either maxSurge or maxUnavailable must be greater
  10549. // than 0. Learn more about maxSurge.
  10550. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  10551. // MaxUnavailable: The maximum number of instances that can be
  10552. // unavailable during the update process. An instance is considered
  10553. // available if all of the following conditions are satisfied:
  10554. //
  10555. //
  10556. // - The instance's status is RUNNING.
  10557. // - If there is a health check on the instance group, the instance's
  10558. // liveness health check result must be HEALTHY at least once. If there
  10559. // is no health check on the group, then the instance only needs to have
  10560. // a status of RUNNING to be considered available. By default, a fixed
  10561. // value of 1 is used. This value can be either a fixed number or a
  10562. // percentage if the instance group has 10 or more instances. If you set
  10563. // a percentage, the number of instances will be rounded up if
  10564. // necessary.
  10565. //
  10566. // At least one of either maxSurge or maxUnavailable must be greater
  10567. // than 0. Learn more about maxUnavailable.
  10568. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  10569. // MinReadySec: Minimum number of seconds to wait for after a newly
  10570. // created instance becomes available. This value must be from range [0,
  10571. // 3600].
  10572. MinReadySec int64 `json:"minReadySec,omitempty"`
  10573. // MinimalAction: Minimal action to be taken on an instance. You can
  10574. // specify either RESTART to restart existing instances or REPLACE to
  10575. // delete and create new instances from the target template. If you
  10576. // specify a RESTART, the Updater will attempt to perform that action
  10577. // only. However, if the Updater determines that the minimal action you
  10578. // specify is not enough to perform the update, it might perform a more
  10579. // disruptive action.
  10580. //
  10581. // Possible values:
  10582. // "REPLACE"
  10583. // "RESTART"
  10584. MinimalAction string `json:"minimalAction,omitempty"`
  10585. // Possible values:
  10586. // "OPPORTUNISTIC"
  10587. // "PROACTIVE"
  10588. Type string `json:"type,omitempty"`
  10589. // ForceSendFields is a list of field names (e.g. "MaxSurge") to
  10590. // unconditionally include in API requests. By default, fields with
  10591. // empty values are omitted from API requests. However, any non-pointer,
  10592. // non-interface field appearing in ForceSendFields will be sent to the
  10593. // server regardless of whether the field is empty or not. This may be
  10594. // used to include empty fields in Patch requests.
  10595. ForceSendFields []string `json:"-"`
  10596. // NullFields is a list of field names (e.g. "MaxSurge") to include in
  10597. // API requests with the JSON null value. By default, fields with empty
  10598. // values are omitted from API requests. However, any field with an
  10599. // empty value appearing in NullFields will be sent to the server as
  10600. // null. It is an error if a field in this list has a non-empty value.
  10601. // This may be used to include null fields in Patch requests.
  10602. NullFields []string `json:"-"`
  10603. }
  10604. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  10605. type NoMethod InstanceGroupManagerUpdatePolicy
  10606. raw := NoMethod(*s)
  10607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10608. }
  10609. type InstanceGroupManagerVersion struct {
  10610. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10611. // Name: Name of the version. Unique among all versions in the scope of
  10612. // this managed instance group.
  10613. Name string `json:"name,omitempty"`
  10614. // TargetSize: Specifies the intended number of instances to be created
  10615. // from the instanceTemplate. The final number of instances created from
  10616. // the template will be equal to:
  10617. // - If expressed as a fixed number, the minimum of either
  10618. // targetSize.fixed or instanceGroupManager.targetSize is used.
  10619. // - if expressed as a percent, the targetSize would be
  10620. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  10621. // is a remainder, the number is rounded up. If unset, this version
  10622. // will update any remaining instances not updated by another version.
  10623. // Read Starting a canary update for more information.
  10624. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  10625. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  10626. // unconditionally include in API requests. By default, fields with
  10627. // empty values are omitted from API requests. However, any non-pointer,
  10628. // non-interface field appearing in ForceSendFields will be sent to the
  10629. // server regardless of whether the field is empty or not. This may be
  10630. // used to include empty fields in Patch requests.
  10631. ForceSendFields []string `json:"-"`
  10632. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  10633. // include in API requests with the JSON null value. By default, fields
  10634. // with empty values are omitted from API requests. However, any field
  10635. // with an empty value appearing in NullFields will be sent to the
  10636. // server as null. It is an error if a field in this list has a
  10637. // non-empty value. This may be used to include null fields in Patch
  10638. // requests.
  10639. NullFields []string `json:"-"`
  10640. }
  10641. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  10642. type NoMethod InstanceGroupManagerVersion
  10643. raw := NoMethod(*s)
  10644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10645. }
  10646. type InstanceGroupManagersAbandonInstancesRequest struct {
  10647. // Instances: The URLs of one or more instances to abandon. This can be
  10648. // a full URL or a partial URL, such as
  10649. // zones/[ZONE]/instances/[INSTANCE_NAME].
  10650. Instances []string `json:"instances,omitempty"`
  10651. // ForceSendFields is a list of field names (e.g. "Instances") to
  10652. // unconditionally include in API requests. By default, fields with
  10653. // empty values are omitted from API requests. However, any non-pointer,
  10654. // non-interface field appearing in ForceSendFields will be sent to the
  10655. // server regardless of whether the field is empty or not. This may be
  10656. // used to include empty fields in Patch requests.
  10657. ForceSendFields []string `json:"-"`
  10658. // NullFields is a list of field names (e.g. "Instances") to include in
  10659. // API requests with the JSON null value. By default, fields with empty
  10660. // values are omitted from API requests. However, any field with an
  10661. // empty value appearing in NullFields will be sent to the server as
  10662. // null. It is an error if a field in this list has a non-empty value.
  10663. // This may be used to include null fields in Patch requests.
  10664. NullFields []string `json:"-"`
  10665. }
  10666. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  10667. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  10668. raw := NoMethod(*s)
  10669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10670. }
  10671. type InstanceGroupManagersDeleteInstancesRequest struct {
  10672. // Instances: The URLs of one or more instances to delete. This can be a
  10673. // full URL or a partial URL, such as
  10674. // zones/[ZONE]/instances/[INSTANCE_NAME].
  10675. Instances []string `json:"instances,omitempty"`
  10676. // ForceSendFields is a list of field names (e.g. "Instances") to
  10677. // unconditionally include in API requests. By default, fields with
  10678. // empty values are omitted from API requests. However, any non-pointer,
  10679. // non-interface field appearing in ForceSendFields will be sent to the
  10680. // server regardless of whether the field is empty or not. This may be
  10681. // used to include empty fields in Patch requests.
  10682. ForceSendFields []string `json:"-"`
  10683. // NullFields is a list of field names (e.g. "Instances") to include in
  10684. // API requests with the JSON null value. By default, fields with empty
  10685. // values are omitted from API requests. However, any field with an
  10686. // empty value appearing in NullFields will be sent to the server as
  10687. // null. It is an error if a field in this list has a non-empty value.
  10688. // This may be used to include null fields in Patch requests.
  10689. NullFields []string `json:"-"`
  10690. }
  10691. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  10692. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  10693. raw := NoMethod(*s)
  10694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10695. }
  10696. type InstanceGroupManagersListManagedInstancesResponse struct {
  10697. // ManagedInstances: [Output Only] The list of instances in the managed
  10698. // instance group.
  10699. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  10700. // NextPageToken: [Output Only] This token allows you to get the next
  10701. // page of results for list requests. If the number of results is larger
  10702. // than maxResults, use the nextPageToken as a value for the query
  10703. // parameter pageToken in the next list request. Subsequent list
  10704. // requests will have their own nextPageToken to continue paging through
  10705. // the results.
  10706. NextPageToken string `json:"nextPageToken,omitempty"`
  10707. // ServerResponse contains the HTTP response code and headers from the
  10708. // server.
  10709. googleapi.ServerResponse `json:"-"`
  10710. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  10711. // unconditionally include in API requests. By default, fields with
  10712. // empty values are omitted from API requests. However, any non-pointer,
  10713. // non-interface field appearing in ForceSendFields will be sent to the
  10714. // server regardless of whether the field is empty or not. This may be
  10715. // used to include empty fields in Patch requests.
  10716. ForceSendFields []string `json:"-"`
  10717. // NullFields is a list of field names (e.g. "ManagedInstances") to
  10718. // include in API requests with the JSON null value. By default, fields
  10719. // with empty values are omitted from API requests. However, any field
  10720. // with an empty value appearing in NullFields will be sent to the
  10721. // server as null. It is an error if a field in this list has a
  10722. // non-empty value. This may be used to include null fields in Patch
  10723. // requests.
  10724. NullFields []string `json:"-"`
  10725. }
  10726. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  10727. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  10728. raw := NoMethod(*s)
  10729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10730. }
  10731. type InstanceGroupManagersRecreateInstancesRequest struct {
  10732. // Instances: The URLs of one or more instances to recreate. This can be
  10733. // a full URL or a partial URL, such as
  10734. // zones/[ZONE]/instances/[INSTANCE_NAME].
  10735. Instances []string `json:"instances,omitempty"`
  10736. // ForceSendFields is a list of field names (e.g. "Instances") to
  10737. // unconditionally include in API requests. By default, fields with
  10738. // empty values are omitted from API requests. However, any non-pointer,
  10739. // non-interface field appearing in ForceSendFields will be sent to the
  10740. // server regardless of whether the field is empty or not. This may be
  10741. // used to include empty fields in Patch requests.
  10742. ForceSendFields []string `json:"-"`
  10743. // NullFields is a list of field names (e.g. "Instances") to include in
  10744. // API requests with the JSON null value. By default, fields with empty
  10745. // values are omitted from API requests. However, any field with an
  10746. // empty value appearing in NullFields will be sent to the server as
  10747. // null. It is an error if a field in this list has a non-empty value.
  10748. // This may be used to include null fields in Patch requests.
  10749. NullFields []string `json:"-"`
  10750. }
  10751. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  10752. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  10753. raw := NoMethod(*s)
  10754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10755. }
  10756. type InstanceGroupManagersResizeAdvancedRequest struct {
  10757. // NoCreationRetries: If this flag is true, the managed instance group
  10758. // attempts to create all instances initiated by this resize request
  10759. // only once. If there is an error during creation, the managed instance
  10760. // group does not retry create this instance, and we will decrease the
  10761. // targetSize of the request instead. If the flag is false, the group
  10762. // attempts to recreate each instance continuously until it
  10763. // succeeds.
  10764. //
  10765. // This flag matters only in the first attempt of creation of an
  10766. // instance. After an instance is successfully created while this flag
  10767. // is enabled, the instance behaves the same way as all the other
  10768. // instances created with a regular resize request. In particular, if a
  10769. // running instance dies unexpectedly at a later time and needs to be
  10770. // recreated, this mode does not affect the recreation behavior in that
  10771. // scenario.
  10772. //
  10773. // This flag is applicable only to the current resize request. It does
  10774. // not influence other resize requests in any way.
  10775. //
  10776. // You can see which instances is being creating in which mode by
  10777. // calling the get or listManagedInstances API.
  10778. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  10779. // TargetSize: The number of running instances that the managed instance
  10780. // group should maintain at any given time. The group automatically adds
  10781. // or removes instances to maintain the number of instances specified by
  10782. // this parameter.
  10783. TargetSize int64 `json:"targetSize,omitempty"`
  10784. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  10785. // to unconditionally include in API requests. By default, fields with
  10786. // empty values are omitted from API requests. However, any non-pointer,
  10787. // non-interface field appearing in ForceSendFields will be sent to the
  10788. // server regardless of whether the field is empty or not. This may be
  10789. // used to include empty fields in Patch requests.
  10790. ForceSendFields []string `json:"-"`
  10791. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  10792. // include in API requests with the JSON null value. By default, fields
  10793. // with empty values are omitted from API requests. However, any field
  10794. // with an empty value appearing in NullFields will be sent to the
  10795. // server as null. It is an error if a field in this list has a
  10796. // non-empty value. This may be used to include null fields in Patch
  10797. // requests.
  10798. NullFields []string `json:"-"`
  10799. }
  10800. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  10801. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  10802. raw := NoMethod(*s)
  10803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10804. }
  10805. type InstanceGroupManagersScopedList struct {
  10806. // InstanceGroupManagers: [Output Only] The list of managed instance
  10807. // groups that are contained in the specified project and zone.
  10808. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  10809. // Warning: [Output Only] The warning that replaces the list of managed
  10810. // instance groups when the list is empty.
  10811. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  10812. // ForceSendFields is a list of field names (e.g.
  10813. // "InstanceGroupManagers") to unconditionally include in API requests.
  10814. // By default, fields with empty values are omitted from API requests.
  10815. // However, any non-pointer, non-interface field appearing in
  10816. // ForceSendFields will be sent to the server regardless of whether the
  10817. // field is empty or not. This may be used to include empty fields in
  10818. // Patch requests.
  10819. ForceSendFields []string `json:"-"`
  10820. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  10821. // include in API requests with the JSON null value. By default, fields
  10822. // with empty values are omitted from API requests. However, any field
  10823. // with an empty value appearing in NullFields will be sent to the
  10824. // server as null. It is an error if a field in this list has a
  10825. // non-empty value. This may be used to include null fields in Patch
  10826. // requests.
  10827. NullFields []string `json:"-"`
  10828. }
  10829. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  10830. type NoMethod InstanceGroupManagersScopedList
  10831. raw := NoMethod(*s)
  10832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10833. }
  10834. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  10835. // that replaces the list of managed instance groups when the list is
  10836. // empty.
  10837. type InstanceGroupManagersScopedListWarning struct {
  10838. // Code: [Output Only] A warning code, if applicable. For example,
  10839. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10840. // the response.
  10841. //
  10842. // Possible values:
  10843. // "CLEANUP_FAILED"
  10844. // "DEPRECATED_RESOURCE_USED"
  10845. // "DEPRECATED_TYPE_USED"
  10846. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10847. // "EXPERIMENTAL_TYPE_USED"
  10848. // "EXTERNAL_API_WARNING"
  10849. // "FIELD_VALUE_OVERRIDEN"
  10850. // "INJECTED_KERNELS_DEPRECATED"
  10851. // "MISSING_TYPE_DEPENDENCY"
  10852. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10853. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10854. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10855. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10856. // "NEXT_HOP_NOT_RUNNING"
  10857. // "NOT_CRITICAL_ERROR"
  10858. // "NO_RESULTS_ON_PAGE"
  10859. // "REQUIRED_TOS_AGREEMENT"
  10860. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10861. // "RESOURCE_NOT_DELETED"
  10862. // "SCHEMA_VALIDATION_IGNORED"
  10863. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10864. // "UNDECLARED_PROPERTIES"
  10865. // "UNREACHABLE"
  10866. Code string `json:"code,omitempty"`
  10867. // Data: [Output Only] Metadata about this warning in key: value format.
  10868. // For example:
  10869. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10870. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  10871. // Message: [Output Only] A human-readable description of the warning
  10872. // code.
  10873. Message string `json:"message,omitempty"`
  10874. // ForceSendFields is a list of field names (e.g. "Code") to
  10875. // unconditionally include in API requests. By default, fields with
  10876. // empty values are omitted from API requests. However, any non-pointer,
  10877. // non-interface field appearing in ForceSendFields will be sent to the
  10878. // server regardless of whether the field is empty or not. This may be
  10879. // used to include empty fields in Patch requests.
  10880. ForceSendFields []string `json:"-"`
  10881. // NullFields is a list of field names (e.g. "Code") to include in API
  10882. // requests with the JSON null value. By default, fields with empty
  10883. // values are omitted from API requests. However, any field with an
  10884. // empty value appearing in NullFields will be sent to the server as
  10885. // null. It is an error if a field in this list has a non-empty value.
  10886. // This may be used to include null fields in Patch requests.
  10887. NullFields []string `json:"-"`
  10888. }
  10889. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  10890. type NoMethod InstanceGroupManagersScopedListWarning
  10891. raw := NoMethod(*s)
  10892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10893. }
  10894. type InstanceGroupManagersScopedListWarningData struct {
  10895. // Key: [Output Only] A key that provides more detail on the warning
  10896. // being returned. For example, for warnings where there are no results
  10897. // in a list request for a particular zone, this key might be scope and
  10898. // the key value might be the zone name. Other examples might be a key
  10899. // indicating a deprecated resource and a suggested replacement, or a
  10900. // warning about invalid network settings (for example, if an instance
  10901. // attempts to perform IP forwarding but is not enabled for IP
  10902. // forwarding).
  10903. Key string `json:"key,omitempty"`
  10904. // Value: [Output Only] A warning data value corresponding to the key.
  10905. Value string `json:"value,omitempty"`
  10906. // ForceSendFields is a list of field names (e.g. "Key") to
  10907. // unconditionally include in API requests. By default, fields with
  10908. // empty values are omitted from API requests. However, any non-pointer,
  10909. // non-interface field appearing in ForceSendFields will be sent to the
  10910. // server regardless of whether the field is empty or not. This may be
  10911. // used to include empty fields in Patch requests.
  10912. ForceSendFields []string `json:"-"`
  10913. // NullFields is a list of field names (e.g. "Key") to include in API
  10914. // requests with the JSON null value. By default, fields with empty
  10915. // values are omitted from API requests. However, any field with an
  10916. // empty value appearing in NullFields will be sent to the server as
  10917. // null. It is an error if a field in this list has a non-empty value.
  10918. // This may be used to include null fields in Patch requests.
  10919. NullFields []string `json:"-"`
  10920. }
  10921. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  10922. type NoMethod InstanceGroupManagersScopedListWarningData
  10923. raw := NoMethod(*s)
  10924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10925. }
  10926. type InstanceGroupManagersSetAutoHealingRequest struct {
  10927. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  10928. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  10929. // to unconditionally include in API requests. By default, fields with
  10930. // empty values are omitted from API requests. However, any non-pointer,
  10931. // non-interface field appearing in ForceSendFields will be sent to the
  10932. // server regardless of whether the field is empty or not. This may be
  10933. // used to include empty fields in Patch requests.
  10934. ForceSendFields []string `json:"-"`
  10935. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  10936. // include in API requests with the JSON null value. By default, fields
  10937. // with empty values are omitted from API requests. However, any field
  10938. // with an empty value appearing in NullFields will be sent to the
  10939. // server as null. It is an error if a field in this list has a
  10940. // non-empty value. This may be used to include null fields in Patch
  10941. // requests.
  10942. NullFields []string `json:"-"`
  10943. }
  10944. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  10945. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  10946. raw := NoMethod(*s)
  10947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10948. }
  10949. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  10950. // InstanceTemplate: The URL of the instance template that is specified
  10951. // for this managed instance group. The group uses this template to
  10952. // create all new instances in the managed instance group.
  10953. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10954. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  10955. // unconditionally include in API requests. By default, fields with
  10956. // empty values are omitted from API requests. However, any non-pointer,
  10957. // non-interface field appearing in ForceSendFields will be sent to the
  10958. // server regardless of whether the field is empty or not. This may be
  10959. // used to include empty fields in Patch requests.
  10960. ForceSendFields []string `json:"-"`
  10961. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  10962. // include in API requests with the JSON null value. By default, fields
  10963. // with empty values are omitted from API requests. However, any field
  10964. // with an empty value appearing in NullFields will be sent to the
  10965. // server as null. It is an error if a field in this list has a
  10966. // non-empty value. This may be used to include null fields in Patch
  10967. // requests.
  10968. NullFields []string `json:"-"`
  10969. }
  10970. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  10971. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  10972. raw := NoMethod(*s)
  10973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10974. }
  10975. type InstanceGroupManagersSetTargetPoolsRequest struct {
  10976. // Fingerprint: The fingerprint of the target pools information. Use
  10977. // this optional property to prevent conflicts when multiple users
  10978. // change the target pools settings concurrently. Obtain the fingerprint
  10979. // with the instanceGroupManagers.get method. Then, include the
  10980. // fingerprint in your request to ensure that you do not overwrite
  10981. // changes that were applied from another concurrent request.
  10982. Fingerprint string `json:"fingerprint,omitempty"`
  10983. // TargetPools: The list of target pool URLs that instances in this
  10984. // managed instance group belong to. The managed instance group applies
  10985. // these target pools to all of the instances in the group. Existing
  10986. // instances and new instances in the group all receive these target
  10987. // pool settings.
  10988. TargetPools []string `json:"targetPools,omitempty"`
  10989. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  10990. // unconditionally include in API requests. By default, fields with
  10991. // empty values are omitted from API requests. However, any non-pointer,
  10992. // non-interface field appearing in ForceSendFields will be sent to the
  10993. // server regardless of whether the field is empty or not. This may be
  10994. // used to include empty fields in Patch requests.
  10995. ForceSendFields []string `json:"-"`
  10996. // NullFields is a list of field names (e.g. "Fingerprint") to include
  10997. // in API requests with the JSON null value. By default, fields with
  10998. // empty values are omitted from API requests. However, any field with
  10999. // an empty value appearing in NullFields will be sent to the server as
  11000. // null. It is an error if a field in this list has a non-empty value.
  11001. // This may be used to include null fields in Patch requests.
  11002. NullFields []string `json:"-"`
  11003. }
  11004. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  11005. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  11006. raw := NoMethod(*s)
  11007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11008. }
  11009. type InstanceGroupsAddInstancesRequest struct {
  11010. // Instances: The list of instances to add to the instance group.
  11011. Instances []*InstanceReference `json:"instances,omitempty"`
  11012. // ForceSendFields is a list of field names (e.g. "Instances") to
  11013. // unconditionally include in API requests. By default, fields with
  11014. // empty values are omitted from API requests. However, any non-pointer,
  11015. // non-interface field appearing in ForceSendFields will be sent to the
  11016. // server regardless of whether the field is empty or not. This may be
  11017. // used to include empty fields in Patch requests.
  11018. ForceSendFields []string `json:"-"`
  11019. // NullFields is a list of field names (e.g. "Instances") to include in
  11020. // API requests with the JSON null value. By default, fields with empty
  11021. // values are omitted from API requests. However, any field with an
  11022. // empty value appearing in NullFields will be sent to the server as
  11023. // null. It is an error if a field in this list has a non-empty value.
  11024. // This may be used to include null fields in Patch requests.
  11025. NullFields []string `json:"-"`
  11026. }
  11027. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  11028. type NoMethod InstanceGroupsAddInstancesRequest
  11029. raw := NoMethod(*s)
  11030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11031. }
  11032. type InstanceGroupsListInstances struct {
  11033. // Id: [Output Only] Unique identifier for the resource; defined by the
  11034. // server.
  11035. Id string `json:"id,omitempty"`
  11036. // Items: A list of InstanceWithNamedPorts resources.
  11037. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  11038. // Kind: [Output Only] The resource type, which is always
  11039. // compute#instanceGroupsListInstances for the list of instances in the
  11040. // specified instance group.
  11041. Kind string `json:"kind,omitempty"`
  11042. // NextPageToken: [Output Only] This token allows you to get the next
  11043. // page of results for list requests. If the number of results is larger
  11044. // than maxResults, use the nextPageToken as a value for the query
  11045. // parameter pageToken in the next list request. Subsequent list
  11046. // requests will have their own nextPageToken to continue paging through
  11047. // the results.
  11048. NextPageToken string `json:"nextPageToken,omitempty"`
  11049. // SelfLink: [Output Only] Server-defined URL for this resource.
  11050. SelfLink string `json:"selfLink,omitempty"`
  11051. // Warning: [Output Only] Informational warning message.
  11052. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  11053. // ServerResponse contains the HTTP response code and headers from the
  11054. // server.
  11055. googleapi.ServerResponse `json:"-"`
  11056. // ForceSendFields is a list of field names (e.g. "Id") to
  11057. // unconditionally include in API requests. By default, fields with
  11058. // empty values are omitted from API requests. However, any non-pointer,
  11059. // non-interface field appearing in ForceSendFields will be sent to the
  11060. // server regardless of whether the field is empty or not. This may be
  11061. // used to include empty fields in Patch requests.
  11062. ForceSendFields []string `json:"-"`
  11063. // NullFields is a list of field names (e.g. "Id") to include in API
  11064. // requests with the JSON null value. By default, fields with empty
  11065. // values are omitted from API requests. However, any field with an
  11066. // empty value appearing in NullFields will be sent to the server as
  11067. // null. It is an error if a field in this list has a non-empty value.
  11068. // This may be used to include null fields in Patch requests.
  11069. NullFields []string `json:"-"`
  11070. }
  11071. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  11072. type NoMethod InstanceGroupsListInstances
  11073. raw := NoMethod(*s)
  11074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11075. }
  11076. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  11077. // warning message.
  11078. type InstanceGroupsListInstancesWarning struct {
  11079. // Code: [Output Only] A warning code, if applicable. For example,
  11080. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11081. // the response.
  11082. //
  11083. // Possible values:
  11084. // "CLEANUP_FAILED"
  11085. // "DEPRECATED_RESOURCE_USED"
  11086. // "DEPRECATED_TYPE_USED"
  11087. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11088. // "EXPERIMENTAL_TYPE_USED"
  11089. // "EXTERNAL_API_WARNING"
  11090. // "FIELD_VALUE_OVERRIDEN"
  11091. // "INJECTED_KERNELS_DEPRECATED"
  11092. // "MISSING_TYPE_DEPENDENCY"
  11093. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11094. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11095. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11096. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11097. // "NEXT_HOP_NOT_RUNNING"
  11098. // "NOT_CRITICAL_ERROR"
  11099. // "NO_RESULTS_ON_PAGE"
  11100. // "REQUIRED_TOS_AGREEMENT"
  11101. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11102. // "RESOURCE_NOT_DELETED"
  11103. // "SCHEMA_VALIDATION_IGNORED"
  11104. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11105. // "UNDECLARED_PROPERTIES"
  11106. // "UNREACHABLE"
  11107. Code string `json:"code,omitempty"`
  11108. // Data: [Output Only] Metadata about this warning in key: value format.
  11109. // For example:
  11110. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11111. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  11112. // Message: [Output Only] A human-readable description of the warning
  11113. // code.
  11114. Message string `json:"message,omitempty"`
  11115. // ForceSendFields is a list of field names (e.g. "Code") to
  11116. // unconditionally include in API requests. By default, fields with
  11117. // empty values are omitted from API requests. However, any non-pointer,
  11118. // non-interface field appearing in ForceSendFields will be sent to the
  11119. // server regardless of whether the field is empty or not. This may be
  11120. // used to include empty fields in Patch requests.
  11121. ForceSendFields []string `json:"-"`
  11122. // NullFields is a list of field names (e.g. "Code") to include in API
  11123. // requests with the JSON null value. By default, fields with empty
  11124. // values are omitted from API requests. However, any field with an
  11125. // empty value appearing in NullFields will be sent to the server as
  11126. // null. It is an error if a field in this list has a non-empty value.
  11127. // This may be used to include null fields in Patch requests.
  11128. NullFields []string `json:"-"`
  11129. }
  11130. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  11131. type NoMethod InstanceGroupsListInstancesWarning
  11132. raw := NoMethod(*s)
  11133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11134. }
  11135. type InstanceGroupsListInstancesWarningData struct {
  11136. // Key: [Output Only] A key that provides more detail on the warning
  11137. // being returned. For example, for warnings where there are no results
  11138. // in a list request for a particular zone, this key might be scope and
  11139. // the key value might be the zone name. Other examples might be a key
  11140. // indicating a deprecated resource and a suggested replacement, or a
  11141. // warning about invalid network settings (for example, if an instance
  11142. // attempts to perform IP forwarding but is not enabled for IP
  11143. // forwarding).
  11144. Key string `json:"key,omitempty"`
  11145. // Value: [Output Only] A warning data value corresponding to the key.
  11146. Value string `json:"value,omitempty"`
  11147. // ForceSendFields is a list of field names (e.g. "Key") to
  11148. // unconditionally include in API requests. By default, fields with
  11149. // empty values are omitted from API requests. However, any non-pointer,
  11150. // non-interface field appearing in ForceSendFields will be sent to the
  11151. // server regardless of whether the field is empty or not. This may be
  11152. // used to include empty fields in Patch requests.
  11153. ForceSendFields []string `json:"-"`
  11154. // NullFields is a list of field names (e.g. "Key") to include in API
  11155. // requests with the JSON null value. By default, fields with empty
  11156. // values are omitted from API requests. However, any field with an
  11157. // empty value appearing in NullFields will be sent to the server as
  11158. // null. It is an error if a field in this list has a non-empty value.
  11159. // This may be used to include null fields in Patch requests.
  11160. NullFields []string `json:"-"`
  11161. }
  11162. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  11163. type NoMethod InstanceGroupsListInstancesWarningData
  11164. raw := NoMethod(*s)
  11165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11166. }
  11167. type InstanceGroupsListInstancesRequest struct {
  11168. // InstanceState: A filter for the state of the instances in the
  11169. // instance group. Valid options are ALL or RUNNING. If you do not
  11170. // specify this parameter the list includes all instances regardless of
  11171. // their state.
  11172. //
  11173. // Possible values:
  11174. // "ALL"
  11175. // "RUNNING"
  11176. InstanceState string `json:"instanceState,omitempty"`
  11177. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  11178. // unconditionally include in API requests. By default, fields with
  11179. // empty values are omitted from API requests. However, any non-pointer,
  11180. // non-interface field appearing in ForceSendFields will be sent to the
  11181. // server regardless of whether the field is empty or not. This may be
  11182. // used to include empty fields in Patch requests.
  11183. ForceSendFields []string `json:"-"`
  11184. // NullFields is a list of field names (e.g. "InstanceState") to include
  11185. // in API requests with the JSON null value. By default, fields with
  11186. // empty values are omitted from API requests. However, any field with
  11187. // an empty value appearing in NullFields will be sent to the server as
  11188. // null. It is an error if a field in this list has a non-empty value.
  11189. // This may be used to include null fields in Patch requests.
  11190. NullFields []string `json:"-"`
  11191. }
  11192. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  11193. type NoMethod InstanceGroupsListInstancesRequest
  11194. raw := NoMethod(*s)
  11195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11196. }
  11197. type InstanceGroupsRemoveInstancesRequest struct {
  11198. // Instances: The list of instances to remove from the instance group.
  11199. Instances []*InstanceReference `json:"instances,omitempty"`
  11200. // ForceSendFields is a list of field names (e.g. "Instances") to
  11201. // unconditionally include in API requests. By default, fields with
  11202. // empty values are omitted from API requests. However, any non-pointer,
  11203. // non-interface field appearing in ForceSendFields will be sent to the
  11204. // server regardless of whether the field is empty or not. This may be
  11205. // used to include empty fields in Patch requests.
  11206. ForceSendFields []string `json:"-"`
  11207. // NullFields is a list of field names (e.g. "Instances") to include in
  11208. // API requests with the JSON null value. By default, fields with empty
  11209. // values are omitted from API requests. However, any field with an
  11210. // empty value appearing in NullFields will be sent to the server as
  11211. // null. It is an error if a field in this list has a non-empty value.
  11212. // This may be used to include null fields in Patch requests.
  11213. NullFields []string `json:"-"`
  11214. }
  11215. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  11216. type NoMethod InstanceGroupsRemoveInstancesRequest
  11217. raw := NoMethod(*s)
  11218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11219. }
  11220. type InstanceGroupsScopedList struct {
  11221. // InstanceGroups: [Output Only] The list of instance groups that are
  11222. // contained in this scope.
  11223. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  11224. // Warning: [Output Only] An informational warning that replaces the
  11225. // list of instance groups when the list is empty.
  11226. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  11227. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  11228. // unconditionally include in API requests. By default, fields with
  11229. // empty values are omitted from API requests. However, any non-pointer,
  11230. // non-interface field appearing in ForceSendFields will be sent to the
  11231. // server regardless of whether the field is empty or not. This may be
  11232. // used to include empty fields in Patch requests.
  11233. ForceSendFields []string `json:"-"`
  11234. // NullFields is a list of field names (e.g. "InstanceGroups") to
  11235. // include in API requests with the JSON null value. By default, fields
  11236. // with empty values are omitted from API requests. However, any field
  11237. // with an empty value appearing in NullFields will be sent to the
  11238. // server as null. It is an error if a field in this list has a
  11239. // non-empty value. This may be used to include null fields in Patch
  11240. // requests.
  11241. NullFields []string `json:"-"`
  11242. }
  11243. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  11244. type NoMethod InstanceGroupsScopedList
  11245. raw := NoMethod(*s)
  11246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11247. }
  11248. // InstanceGroupsScopedListWarning: [Output Only] An informational
  11249. // warning that replaces the list of instance groups when the list is
  11250. // empty.
  11251. type InstanceGroupsScopedListWarning struct {
  11252. // Code: [Output Only] A warning code, if applicable. For example,
  11253. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11254. // the response.
  11255. //
  11256. // Possible values:
  11257. // "CLEANUP_FAILED"
  11258. // "DEPRECATED_RESOURCE_USED"
  11259. // "DEPRECATED_TYPE_USED"
  11260. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11261. // "EXPERIMENTAL_TYPE_USED"
  11262. // "EXTERNAL_API_WARNING"
  11263. // "FIELD_VALUE_OVERRIDEN"
  11264. // "INJECTED_KERNELS_DEPRECATED"
  11265. // "MISSING_TYPE_DEPENDENCY"
  11266. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11267. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11268. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11269. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11270. // "NEXT_HOP_NOT_RUNNING"
  11271. // "NOT_CRITICAL_ERROR"
  11272. // "NO_RESULTS_ON_PAGE"
  11273. // "REQUIRED_TOS_AGREEMENT"
  11274. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11275. // "RESOURCE_NOT_DELETED"
  11276. // "SCHEMA_VALIDATION_IGNORED"
  11277. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11278. // "UNDECLARED_PROPERTIES"
  11279. // "UNREACHABLE"
  11280. Code string `json:"code,omitempty"`
  11281. // Data: [Output Only] Metadata about this warning in key: value format.
  11282. // For example:
  11283. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11284. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  11285. // Message: [Output Only] A human-readable description of the warning
  11286. // code.
  11287. Message string `json:"message,omitempty"`
  11288. // ForceSendFields is a list of field names (e.g. "Code") to
  11289. // unconditionally include in API requests. By default, fields with
  11290. // empty values are omitted from API requests. However, any non-pointer,
  11291. // non-interface field appearing in ForceSendFields will be sent to the
  11292. // server regardless of whether the field is empty or not. This may be
  11293. // used to include empty fields in Patch requests.
  11294. ForceSendFields []string `json:"-"`
  11295. // NullFields is a list of field names (e.g. "Code") to include in API
  11296. // requests with the JSON null value. By default, fields with empty
  11297. // values are omitted from API requests. However, any field with an
  11298. // empty value appearing in NullFields will be sent to the server as
  11299. // null. It is an error if a field in this list has a non-empty value.
  11300. // This may be used to include null fields in Patch requests.
  11301. NullFields []string `json:"-"`
  11302. }
  11303. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  11304. type NoMethod InstanceGroupsScopedListWarning
  11305. raw := NoMethod(*s)
  11306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11307. }
  11308. type InstanceGroupsScopedListWarningData struct {
  11309. // Key: [Output Only] A key that provides more detail on the warning
  11310. // being returned. For example, for warnings where there are no results
  11311. // in a list request for a particular zone, this key might be scope and
  11312. // the key value might be the zone name. Other examples might be a key
  11313. // indicating a deprecated resource and a suggested replacement, or a
  11314. // warning about invalid network settings (for example, if an instance
  11315. // attempts to perform IP forwarding but is not enabled for IP
  11316. // forwarding).
  11317. Key string `json:"key,omitempty"`
  11318. // Value: [Output Only] A warning data value corresponding to the key.
  11319. Value string `json:"value,omitempty"`
  11320. // ForceSendFields is a list of field names (e.g. "Key") to
  11321. // unconditionally include in API requests. By default, fields with
  11322. // empty values are omitted from API requests. However, any non-pointer,
  11323. // non-interface field appearing in ForceSendFields will be sent to the
  11324. // server regardless of whether the field is empty or not. This may be
  11325. // used to include empty fields in Patch requests.
  11326. ForceSendFields []string `json:"-"`
  11327. // NullFields is a list of field names (e.g. "Key") to include in API
  11328. // requests with the JSON null value. By default, fields with empty
  11329. // values are omitted from API requests. However, any field with an
  11330. // empty value appearing in NullFields will be sent to the server as
  11331. // null. It is an error if a field in this list has a non-empty value.
  11332. // This may be used to include null fields in Patch requests.
  11333. NullFields []string `json:"-"`
  11334. }
  11335. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11336. type NoMethod InstanceGroupsScopedListWarningData
  11337. raw := NoMethod(*s)
  11338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11339. }
  11340. type InstanceGroupsSetNamedPortsRequest struct {
  11341. // Fingerprint: The fingerprint of the named ports information for this
  11342. // instance group. Use this optional property to prevent conflicts when
  11343. // multiple users change the named ports settings concurrently. Obtain
  11344. // the fingerprint with the instanceGroups.get method. Then, include the
  11345. // fingerprint in your request to ensure that you do not overwrite
  11346. // changes that were applied from another concurrent request. A request
  11347. // with an incorrect fingerprint will fail with error 412
  11348. // conditionNotMet.
  11349. Fingerprint string `json:"fingerprint,omitempty"`
  11350. // NamedPorts: The list of named ports to set for this instance group.
  11351. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  11352. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  11353. // unconditionally include in API requests. By default, fields with
  11354. // empty values are omitted from API requests. However, any non-pointer,
  11355. // non-interface field appearing in ForceSendFields will be sent to the
  11356. // server regardless of whether the field is empty or not. This may be
  11357. // used to include empty fields in Patch requests.
  11358. ForceSendFields []string `json:"-"`
  11359. // NullFields is a list of field names (e.g. "Fingerprint") to include
  11360. // in API requests with the JSON null value. By default, fields with
  11361. // empty values are omitted from API requests. However, any field with
  11362. // an empty value appearing in NullFields will be sent to the server as
  11363. // null. It is an error if a field in this list has a non-empty value.
  11364. // This may be used to include null fields in Patch requests.
  11365. NullFields []string `json:"-"`
  11366. }
  11367. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  11368. type NoMethod InstanceGroupsSetNamedPortsRequest
  11369. raw := NoMethod(*s)
  11370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11371. }
  11372. // InstanceList: Contains a list of instances.
  11373. type InstanceList struct {
  11374. // Id: [Output Only] Unique identifier for the resource; defined by the
  11375. // server.
  11376. Id string `json:"id,omitempty"`
  11377. // Items: A list of Instance resources.
  11378. Items []*Instance `json:"items,omitempty"`
  11379. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  11380. // lists of Instance resources.
  11381. Kind string `json:"kind,omitempty"`
  11382. // NextPageToken: [Output Only] This token allows you to get the next
  11383. // page of results for list requests. If the number of results is larger
  11384. // than maxResults, use the nextPageToken as a value for the query
  11385. // parameter pageToken in the next list request. Subsequent list
  11386. // requests will have their own nextPageToken to continue paging through
  11387. // the results.
  11388. NextPageToken string `json:"nextPageToken,omitempty"`
  11389. // SelfLink: [Output Only] Server-defined URL for this resource.
  11390. SelfLink string `json:"selfLink,omitempty"`
  11391. // Warning: [Output Only] Informational warning message.
  11392. Warning *InstanceListWarning `json:"warning,omitempty"`
  11393. // ServerResponse contains the HTTP response code and headers from the
  11394. // server.
  11395. googleapi.ServerResponse `json:"-"`
  11396. // ForceSendFields is a list of field names (e.g. "Id") to
  11397. // unconditionally include in API requests. By default, fields with
  11398. // empty values are omitted from API requests. However, any non-pointer,
  11399. // non-interface field appearing in ForceSendFields will be sent to the
  11400. // server regardless of whether the field is empty or not. This may be
  11401. // used to include empty fields in Patch requests.
  11402. ForceSendFields []string `json:"-"`
  11403. // NullFields is a list of field names (e.g. "Id") to include in API
  11404. // requests with the JSON null value. By default, fields with empty
  11405. // values are omitted from API requests. However, any field with an
  11406. // empty value appearing in NullFields will be sent to the server as
  11407. // null. It is an error if a field in this list has a non-empty value.
  11408. // This may be used to include null fields in Patch requests.
  11409. NullFields []string `json:"-"`
  11410. }
  11411. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  11412. type NoMethod InstanceList
  11413. raw := NoMethod(*s)
  11414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11415. }
  11416. // InstanceListWarning: [Output Only] Informational warning message.
  11417. type InstanceListWarning struct {
  11418. // Code: [Output Only] A warning code, if applicable. For example,
  11419. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11420. // the response.
  11421. //
  11422. // Possible values:
  11423. // "CLEANUP_FAILED"
  11424. // "DEPRECATED_RESOURCE_USED"
  11425. // "DEPRECATED_TYPE_USED"
  11426. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11427. // "EXPERIMENTAL_TYPE_USED"
  11428. // "EXTERNAL_API_WARNING"
  11429. // "FIELD_VALUE_OVERRIDEN"
  11430. // "INJECTED_KERNELS_DEPRECATED"
  11431. // "MISSING_TYPE_DEPENDENCY"
  11432. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11433. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11434. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11435. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11436. // "NEXT_HOP_NOT_RUNNING"
  11437. // "NOT_CRITICAL_ERROR"
  11438. // "NO_RESULTS_ON_PAGE"
  11439. // "REQUIRED_TOS_AGREEMENT"
  11440. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11441. // "RESOURCE_NOT_DELETED"
  11442. // "SCHEMA_VALIDATION_IGNORED"
  11443. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11444. // "UNDECLARED_PROPERTIES"
  11445. // "UNREACHABLE"
  11446. Code string `json:"code,omitempty"`
  11447. // Data: [Output Only] Metadata about this warning in key: value format.
  11448. // For example:
  11449. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11450. Data []*InstanceListWarningData `json:"data,omitempty"`
  11451. // Message: [Output Only] A human-readable description of the warning
  11452. // code.
  11453. Message string `json:"message,omitempty"`
  11454. // ForceSendFields is a list of field names (e.g. "Code") to
  11455. // unconditionally include in API requests. By default, fields with
  11456. // empty values are omitted from API requests. However, any non-pointer,
  11457. // non-interface field appearing in ForceSendFields will be sent to the
  11458. // server regardless of whether the field is empty or not. This may be
  11459. // used to include empty fields in Patch requests.
  11460. ForceSendFields []string `json:"-"`
  11461. // NullFields is a list of field names (e.g. "Code") to include in API
  11462. // requests with the JSON null value. By default, fields with empty
  11463. // values are omitted from API requests. However, any field with an
  11464. // empty value appearing in NullFields will be sent to the server as
  11465. // null. It is an error if a field in this list has a non-empty value.
  11466. // This may be used to include null fields in Patch requests.
  11467. NullFields []string `json:"-"`
  11468. }
  11469. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  11470. type NoMethod InstanceListWarning
  11471. raw := NoMethod(*s)
  11472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11473. }
  11474. type InstanceListWarningData struct {
  11475. // Key: [Output Only] A key that provides more detail on the warning
  11476. // being returned. For example, for warnings where there are no results
  11477. // in a list request for a particular zone, this key might be scope and
  11478. // the key value might be the zone name. Other examples might be a key
  11479. // indicating a deprecated resource and a suggested replacement, or a
  11480. // warning about invalid network settings (for example, if an instance
  11481. // attempts to perform IP forwarding but is not enabled for IP
  11482. // forwarding).
  11483. Key string `json:"key,omitempty"`
  11484. // Value: [Output Only] A warning data value corresponding to the key.
  11485. Value string `json:"value,omitempty"`
  11486. // ForceSendFields is a list of field names (e.g. "Key") to
  11487. // unconditionally include in API requests. By default, fields with
  11488. // empty values are omitted from API requests. However, any non-pointer,
  11489. // non-interface field appearing in ForceSendFields will be sent to the
  11490. // server regardless of whether the field is empty or not. This may be
  11491. // used to include empty fields in Patch requests.
  11492. ForceSendFields []string `json:"-"`
  11493. // NullFields is a list of field names (e.g. "Key") to include in API
  11494. // requests with the JSON null value. By default, fields with empty
  11495. // values are omitted from API requests. However, any field with an
  11496. // empty value appearing in NullFields will be sent to the server as
  11497. // null. It is an error if a field in this list has a non-empty value.
  11498. // This may be used to include null fields in Patch requests.
  11499. NullFields []string `json:"-"`
  11500. }
  11501. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  11502. type NoMethod InstanceListWarningData
  11503. raw := NoMethod(*s)
  11504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11505. }
  11506. // InstanceListReferrers: Contains a list of instance referrers.
  11507. type InstanceListReferrers struct {
  11508. // Id: [Output Only] Unique identifier for the resource; defined by the
  11509. // server.
  11510. Id string `json:"id,omitempty"`
  11511. // Items: A list of Reference resources.
  11512. Items []*Reference `json:"items,omitempty"`
  11513. // Kind: [Output Only] Type of resource. Always
  11514. // compute#instanceListReferrers for lists of Instance referrers.
  11515. Kind string `json:"kind,omitempty"`
  11516. // NextPageToken: [Output Only] This token allows you to get the next
  11517. // page of results for list requests. If the number of results is larger
  11518. // than maxResults, use the nextPageToken as a value for the query
  11519. // parameter pageToken in the next list request. Subsequent list
  11520. // requests will have their own nextPageToken to continue paging through
  11521. // the results.
  11522. NextPageToken string `json:"nextPageToken,omitempty"`
  11523. // SelfLink: [Output Only] Server-defined URL for this resource.
  11524. SelfLink string `json:"selfLink,omitempty"`
  11525. // Warning: [Output Only] Informational warning message.
  11526. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  11527. // ServerResponse contains the HTTP response code and headers from the
  11528. // server.
  11529. googleapi.ServerResponse `json:"-"`
  11530. // ForceSendFields is a list of field names (e.g. "Id") to
  11531. // unconditionally include in API requests. By default, fields with
  11532. // empty values are omitted from API requests. However, any non-pointer,
  11533. // non-interface field appearing in ForceSendFields will be sent to the
  11534. // server regardless of whether the field is empty or not. This may be
  11535. // used to include empty fields in Patch requests.
  11536. ForceSendFields []string `json:"-"`
  11537. // NullFields is a list of field names (e.g. "Id") to include in API
  11538. // requests with the JSON null value. By default, fields with empty
  11539. // values are omitted from API requests. However, any field with an
  11540. // empty value appearing in NullFields will be sent to the server as
  11541. // null. It is an error if a field in this list has a non-empty value.
  11542. // This may be used to include null fields in Patch requests.
  11543. NullFields []string `json:"-"`
  11544. }
  11545. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  11546. type NoMethod InstanceListReferrers
  11547. raw := NoMethod(*s)
  11548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11549. }
  11550. // InstanceListReferrersWarning: [Output Only] Informational warning
  11551. // message.
  11552. type InstanceListReferrersWarning struct {
  11553. // Code: [Output Only] A warning code, if applicable. For example,
  11554. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11555. // the response.
  11556. //
  11557. // Possible values:
  11558. // "CLEANUP_FAILED"
  11559. // "DEPRECATED_RESOURCE_USED"
  11560. // "DEPRECATED_TYPE_USED"
  11561. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11562. // "EXPERIMENTAL_TYPE_USED"
  11563. // "EXTERNAL_API_WARNING"
  11564. // "FIELD_VALUE_OVERRIDEN"
  11565. // "INJECTED_KERNELS_DEPRECATED"
  11566. // "MISSING_TYPE_DEPENDENCY"
  11567. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11568. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11569. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11570. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11571. // "NEXT_HOP_NOT_RUNNING"
  11572. // "NOT_CRITICAL_ERROR"
  11573. // "NO_RESULTS_ON_PAGE"
  11574. // "REQUIRED_TOS_AGREEMENT"
  11575. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11576. // "RESOURCE_NOT_DELETED"
  11577. // "SCHEMA_VALIDATION_IGNORED"
  11578. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11579. // "UNDECLARED_PROPERTIES"
  11580. // "UNREACHABLE"
  11581. Code string `json:"code,omitempty"`
  11582. // Data: [Output Only] Metadata about this warning in key: value format.
  11583. // For example:
  11584. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11585. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  11586. // Message: [Output Only] A human-readable description of the warning
  11587. // code.
  11588. Message string `json:"message,omitempty"`
  11589. // ForceSendFields is a list of field names (e.g. "Code") to
  11590. // unconditionally include in API requests. By default, fields with
  11591. // empty values are omitted from API requests. However, any non-pointer,
  11592. // non-interface field appearing in ForceSendFields will be sent to the
  11593. // server regardless of whether the field is empty or not. This may be
  11594. // used to include empty fields in Patch requests.
  11595. ForceSendFields []string `json:"-"`
  11596. // NullFields is a list of field names (e.g. "Code") to include in API
  11597. // requests with the JSON null value. By default, fields with empty
  11598. // values are omitted from API requests. However, any field with an
  11599. // empty value appearing in NullFields will be sent to the server as
  11600. // null. It is an error if a field in this list has a non-empty value.
  11601. // This may be used to include null fields in Patch requests.
  11602. NullFields []string `json:"-"`
  11603. }
  11604. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  11605. type NoMethod InstanceListReferrersWarning
  11606. raw := NoMethod(*s)
  11607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11608. }
  11609. type InstanceListReferrersWarningData struct {
  11610. // Key: [Output Only] A key that provides more detail on the warning
  11611. // being returned. For example, for warnings where there are no results
  11612. // in a list request for a particular zone, this key might be scope and
  11613. // the key value might be the zone name. Other examples might be a key
  11614. // indicating a deprecated resource and a suggested replacement, or a
  11615. // warning about invalid network settings (for example, if an instance
  11616. // attempts to perform IP forwarding but is not enabled for IP
  11617. // forwarding).
  11618. Key string `json:"key,omitempty"`
  11619. // Value: [Output Only] A warning data value corresponding to the key.
  11620. Value string `json:"value,omitempty"`
  11621. // ForceSendFields is a list of field names (e.g. "Key") to
  11622. // unconditionally include in API requests. By default, fields with
  11623. // empty values are omitted from API requests. However, any non-pointer,
  11624. // non-interface field appearing in ForceSendFields will be sent to the
  11625. // server regardless of whether the field is empty or not. This may be
  11626. // used to include empty fields in Patch requests.
  11627. ForceSendFields []string `json:"-"`
  11628. // NullFields is a list of field names (e.g. "Key") to include in API
  11629. // requests with the JSON null value. By default, fields with empty
  11630. // values are omitted from API requests. However, any field with an
  11631. // empty value appearing in NullFields will be sent to the server as
  11632. // null. It is an error if a field in this list has a non-empty value.
  11633. // This may be used to include null fields in Patch requests.
  11634. NullFields []string `json:"-"`
  11635. }
  11636. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  11637. type NoMethod InstanceListReferrersWarningData
  11638. raw := NoMethod(*s)
  11639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11640. }
  11641. type InstanceMoveRequest struct {
  11642. // DestinationZone: The URL of the destination zone to move the
  11643. // instance. This can be a full or partial URL. For example, the
  11644. // following are all valid URLs to a zone:
  11645. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  11646. //
  11647. // - projects/project/zones/zone
  11648. // - zones/zone
  11649. DestinationZone string `json:"destinationZone,omitempty"`
  11650. // TargetInstance: The URL of the target instance to move. This can be a
  11651. // full or partial URL. For example, the following are all valid URLs to
  11652. // an instance:
  11653. // -
  11654. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  11655. // - projects/project/zones/zone/instances/instance
  11656. // - zones/zone/instances/instance
  11657. TargetInstance string `json:"targetInstance,omitempty"`
  11658. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  11659. // unconditionally include in API requests. By default, fields with
  11660. // empty values are omitted from API requests. However, any non-pointer,
  11661. // non-interface field appearing in ForceSendFields will be sent to the
  11662. // server regardless of whether the field is empty or not. This may be
  11663. // used to include empty fields in Patch requests.
  11664. ForceSendFields []string `json:"-"`
  11665. // NullFields is a list of field names (e.g. "DestinationZone") to
  11666. // include in API requests with the JSON null value. By default, fields
  11667. // with empty values are omitted from API requests. However, any field
  11668. // with an empty value appearing in NullFields will be sent to the
  11669. // server as null. It is an error if a field in this list has a
  11670. // non-empty value. This may be used to include null fields in Patch
  11671. // requests.
  11672. NullFields []string `json:"-"`
  11673. }
  11674. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  11675. type NoMethod InstanceMoveRequest
  11676. raw := NoMethod(*s)
  11677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11678. }
  11679. type InstanceProperties struct {
  11680. // AllocationAffinity: The configuration of desired allocations which
  11681. // this Instance could consume capacity from.
  11682. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  11683. // CanIpForward: Enables instances created based on this template to
  11684. // send packets with source IP addresses other than their own and
  11685. // receive packets with destination IP addresses other than their own.
  11686. // If these instances will be used as an IP gateway or it will be set as
  11687. // the next-hop in a Route resource, specify true. If unsure, leave this
  11688. // set to false. See the Enable IP forwarding documentation for more
  11689. // information.
  11690. CanIpForward bool `json:"canIpForward,omitempty"`
  11691. // Description: An optional text description for the instances that are
  11692. // created from this instance template.
  11693. Description string `json:"description,omitempty"`
  11694. // Disks: An array of disks that are associated with the instances that
  11695. // are created from this template.
  11696. Disks []*AttachedDisk `json:"disks,omitempty"`
  11697. // GuestAccelerators: A list of guest accelerator cards' type and count
  11698. // to use for instances created from the instance template.
  11699. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  11700. // Labels: Labels to apply to instances that are created from this
  11701. // template.
  11702. Labels map[string]string `json:"labels,omitempty"`
  11703. // MachineType: The machine type to use for instances that are created
  11704. // from this template.
  11705. MachineType string `json:"machineType,omitempty"`
  11706. // Metadata: The metadata key/value pairs to assign to instances that
  11707. // are created from this template. These pairs can consist of custom
  11708. // metadata or predefined keys. See Project and instance metadata for
  11709. // more information.
  11710. Metadata *Metadata `json:"metadata,omitempty"`
  11711. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  11712. // instance may be scheduled on the specified or newer cpu/platform.
  11713. // Applicable values are the friendly names of CPU platforms, such as
  11714. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  11715. // Bridge". For more information, read Specifying a Minimum CPU
  11716. // Platform.
  11717. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  11718. // NetworkInterfaces: An array of network access configurations for this
  11719. // interface.
  11720. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  11721. // Scheduling: Specifies the scheduling options for the instances that
  11722. // are created from this template.
  11723. Scheduling *Scheduling `json:"scheduling,omitempty"`
  11724. // ServiceAccounts: A list of service accounts with specified scopes.
  11725. // Access tokens for these service accounts are available to the
  11726. // instances that are created from this template. Use metadata queries
  11727. // to obtain the access tokens for these instances.
  11728. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  11729. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  11730. // that are created from this template.
  11731. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  11732. // Tags: A list of tags to apply to the instances that are created from
  11733. // this template. The tags identify valid sources or targets for network
  11734. // firewalls. The setTags method can modify this list of tags. Each tag
  11735. // within the list must comply with RFC1035.
  11736. Tags *Tags `json:"tags,omitempty"`
  11737. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  11738. // to unconditionally include in API requests. By default, fields with
  11739. // empty values are omitted from API requests. However, any non-pointer,
  11740. // non-interface field appearing in ForceSendFields will be sent to the
  11741. // server regardless of whether the field is empty or not. This may be
  11742. // used to include empty fields in Patch requests.
  11743. ForceSendFields []string `json:"-"`
  11744. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  11745. // include in API requests with the JSON null value. By default, fields
  11746. // with empty values are omitted from API requests. However, any field
  11747. // with an empty value appearing in NullFields will be sent to the
  11748. // server as null. It is an error if a field in this list has a
  11749. // non-empty value. This may be used to include null fields in Patch
  11750. // requests.
  11751. NullFields []string `json:"-"`
  11752. }
  11753. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  11754. type NoMethod InstanceProperties
  11755. raw := NoMethod(*s)
  11756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11757. }
  11758. type InstanceReference struct {
  11759. // Instance: The URL for a specific instance.
  11760. Instance string `json:"instance,omitempty"`
  11761. // ForceSendFields is a list of field names (e.g. "Instance") to
  11762. // unconditionally include in API requests. By default, fields with
  11763. // empty values are omitted from API requests. However, any non-pointer,
  11764. // non-interface field appearing in ForceSendFields will be sent to the
  11765. // server regardless of whether the field is empty or not. This may be
  11766. // used to include empty fields in Patch requests.
  11767. ForceSendFields []string `json:"-"`
  11768. // NullFields is a list of field names (e.g. "Instance") to include in
  11769. // API requests with the JSON null value. By default, fields with empty
  11770. // values are omitted from API requests. However, any field with an
  11771. // empty value appearing in NullFields will be sent to the server as
  11772. // null. It is an error if a field in this list has a non-empty value.
  11773. // This may be used to include null fields in Patch requests.
  11774. NullFields []string `json:"-"`
  11775. }
  11776. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  11777. type NoMethod InstanceReference
  11778. raw := NoMethod(*s)
  11779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11780. }
  11781. // InstanceTemplate: An Instance Template resource. (== resource_for
  11782. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  11783. type InstanceTemplate struct {
  11784. // CreationTimestamp: [Output Only] The creation timestamp for this
  11785. // instance template in RFC3339 text format.
  11786. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11787. // Description: An optional description of this resource. Provide this
  11788. // property when you create the resource.
  11789. Description string `json:"description,omitempty"`
  11790. // Id: [Output Only] A unique identifier for this instance template. The
  11791. // server defines this identifier.
  11792. Id uint64 `json:"id,omitempty,string"`
  11793. // Kind: [Output Only] The resource type, which is always
  11794. // compute#instanceTemplate for instance templates.
  11795. Kind string `json:"kind,omitempty"`
  11796. // Name: Name of the resource; provided by the client when the resource
  11797. // is created. The name must be 1-63 characters long, and comply with
  11798. // RFC1035. Specifically, the name must be 1-63 characters long and
  11799. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11800. // the first character must be a lowercase letter, and all following
  11801. // characters must be a dash, lowercase letter, or digit, except the
  11802. // last character, which cannot be a dash.
  11803. Name string `json:"name,omitempty"`
  11804. // Properties: The instance properties for this instance template.
  11805. Properties *InstanceProperties `json:"properties,omitempty"`
  11806. // SelfLink: [Output Only] The URL for this instance template. The
  11807. // server defines this URL.
  11808. SelfLink string `json:"selfLink,omitempty"`
  11809. // SourceInstance: The source instance used to create the template. You
  11810. // can provide this as a partial or full URL to the resource. For
  11811. // example, the following are valid values:
  11812. // -
  11813. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  11814. // - projects/project/zones/zone/instances/instance
  11815. SourceInstance string `json:"sourceInstance,omitempty"`
  11816. // SourceInstanceParams: The source instance params to use to create
  11817. // this instance template.
  11818. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  11819. // ServerResponse contains the HTTP response code and headers from the
  11820. // server.
  11821. googleapi.ServerResponse `json:"-"`
  11822. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11823. // to unconditionally include in API requests. By default, fields with
  11824. // empty values are omitted from API requests. However, any non-pointer,
  11825. // non-interface field appearing in ForceSendFields will be sent to the
  11826. // server regardless of whether the field is empty or not. This may be
  11827. // used to include empty fields in Patch requests.
  11828. ForceSendFields []string `json:"-"`
  11829. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11830. // include in API requests with the JSON null value. By default, fields
  11831. // with empty values are omitted from API requests. However, any field
  11832. // with an empty value appearing in NullFields will be sent to the
  11833. // server as null. It is an error if a field in this list has a
  11834. // non-empty value. This may be used to include null fields in Patch
  11835. // requests.
  11836. NullFields []string `json:"-"`
  11837. }
  11838. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  11839. type NoMethod InstanceTemplate
  11840. raw := NoMethod(*s)
  11841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11842. }
  11843. // InstanceTemplateList: A list of instance templates.
  11844. type InstanceTemplateList struct {
  11845. // Id: [Output Only] Unique identifier for the resource; defined by the
  11846. // server.
  11847. Id string `json:"id,omitempty"`
  11848. // Items: A list of InstanceTemplate resources.
  11849. Items []*InstanceTemplate `json:"items,omitempty"`
  11850. // Kind: [Output Only] The resource type, which is always
  11851. // compute#instanceTemplatesListResponse for instance template lists.
  11852. Kind string `json:"kind,omitempty"`
  11853. // NextPageToken: [Output Only] This token allows you to get the next
  11854. // page of results for list requests. If the number of results is larger
  11855. // than maxResults, use the nextPageToken as a value for the query
  11856. // parameter pageToken in the next list request. Subsequent list
  11857. // requests will have their own nextPageToken to continue paging through
  11858. // the results.
  11859. NextPageToken string `json:"nextPageToken,omitempty"`
  11860. // SelfLink: [Output Only] Server-defined URL for this resource.
  11861. SelfLink string `json:"selfLink,omitempty"`
  11862. // Warning: [Output Only] Informational warning message.
  11863. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  11864. // ServerResponse contains the HTTP response code and headers from the
  11865. // server.
  11866. googleapi.ServerResponse `json:"-"`
  11867. // ForceSendFields is a list of field names (e.g. "Id") to
  11868. // unconditionally include in API requests. By default, fields with
  11869. // empty values are omitted from API requests. However, any non-pointer,
  11870. // non-interface field appearing in ForceSendFields will be sent to the
  11871. // server regardless of whether the field is empty or not. This may be
  11872. // used to include empty fields in Patch requests.
  11873. ForceSendFields []string `json:"-"`
  11874. // NullFields is a list of field names (e.g. "Id") to include in API
  11875. // requests with the JSON null value. By default, fields with empty
  11876. // values are omitted from API requests. However, any field with an
  11877. // empty value appearing in NullFields will be sent to the server as
  11878. // null. It is an error if a field in this list has a non-empty value.
  11879. // This may be used to include null fields in Patch requests.
  11880. NullFields []string `json:"-"`
  11881. }
  11882. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  11883. type NoMethod InstanceTemplateList
  11884. raw := NoMethod(*s)
  11885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11886. }
  11887. // InstanceTemplateListWarning: [Output Only] Informational warning
  11888. // message.
  11889. type InstanceTemplateListWarning struct {
  11890. // Code: [Output Only] A warning code, if applicable. For example,
  11891. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11892. // the response.
  11893. //
  11894. // Possible values:
  11895. // "CLEANUP_FAILED"
  11896. // "DEPRECATED_RESOURCE_USED"
  11897. // "DEPRECATED_TYPE_USED"
  11898. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11899. // "EXPERIMENTAL_TYPE_USED"
  11900. // "EXTERNAL_API_WARNING"
  11901. // "FIELD_VALUE_OVERRIDEN"
  11902. // "INJECTED_KERNELS_DEPRECATED"
  11903. // "MISSING_TYPE_DEPENDENCY"
  11904. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11905. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11906. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11907. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11908. // "NEXT_HOP_NOT_RUNNING"
  11909. // "NOT_CRITICAL_ERROR"
  11910. // "NO_RESULTS_ON_PAGE"
  11911. // "REQUIRED_TOS_AGREEMENT"
  11912. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11913. // "RESOURCE_NOT_DELETED"
  11914. // "SCHEMA_VALIDATION_IGNORED"
  11915. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11916. // "UNDECLARED_PROPERTIES"
  11917. // "UNREACHABLE"
  11918. Code string `json:"code,omitempty"`
  11919. // Data: [Output Only] Metadata about this warning in key: value format.
  11920. // For example:
  11921. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11922. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  11923. // Message: [Output Only] A human-readable description of the warning
  11924. // code.
  11925. Message string `json:"message,omitempty"`
  11926. // ForceSendFields is a list of field names (e.g. "Code") to
  11927. // unconditionally include in API requests. By default, fields with
  11928. // empty values are omitted from API requests. However, any non-pointer,
  11929. // non-interface field appearing in ForceSendFields will be sent to the
  11930. // server regardless of whether the field is empty or not. This may be
  11931. // used to include empty fields in Patch requests.
  11932. ForceSendFields []string `json:"-"`
  11933. // NullFields is a list of field names (e.g. "Code") to include in API
  11934. // requests with the JSON null value. By default, fields with empty
  11935. // values are omitted from API requests. However, any field with an
  11936. // empty value appearing in NullFields will be sent to the server as
  11937. // null. It is an error if a field in this list has a non-empty value.
  11938. // This may be used to include null fields in Patch requests.
  11939. NullFields []string `json:"-"`
  11940. }
  11941. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  11942. type NoMethod InstanceTemplateListWarning
  11943. raw := NoMethod(*s)
  11944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11945. }
  11946. type InstanceTemplateListWarningData struct {
  11947. // Key: [Output Only] A key that provides more detail on the warning
  11948. // being returned. For example, for warnings where there are no results
  11949. // in a list request for a particular zone, this key might be scope and
  11950. // the key value might be the zone name. Other examples might be a key
  11951. // indicating a deprecated resource and a suggested replacement, or a
  11952. // warning about invalid network settings (for example, if an instance
  11953. // attempts to perform IP forwarding but is not enabled for IP
  11954. // forwarding).
  11955. Key string `json:"key,omitempty"`
  11956. // Value: [Output Only] A warning data value corresponding to the key.
  11957. Value string `json:"value,omitempty"`
  11958. // ForceSendFields is a list of field names (e.g. "Key") to
  11959. // unconditionally include in API requests. By default, fields with
  11960. // empty values are omitted from API requests. However, any non-pointer,
  11961. // non-interface field appearing in ForceSendFields will be sent to the
  11962. // server regardless of whether the field is empty or not. This may be
  11963. // used to include empty fields in Patch requests.
  11964. ForceSendFields []string `json:"-"`
  11965. // NullFields is a list of field names (e.g. "Key") to include in API
  11966. // requests with the JSON null value. By default, fields with empty
  11967. // values are omitted from API requests. However, any field with an
  11968. // empty value appearing in NullFields will be sent to the server as
  11969. // null. It is an error if a field in this list has a non-empty value.
  11970. // This may be used to include null fields in Patch requests.
  11971. NullFields []string `json:"-"`
  11972. }
  11973. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  11974. type NoMethod InstanceTemplateListWarningData
  11975. raw := NoMethod(*s)
  11976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11977. }
  11978. type InstanceWithNamedPorts struct {
  11979. // Instance: [Output Only] The URL of the instance.
  11980. Instance string `json:"instance,omitempty"`
  11981. // NamedPorts: [Output Only] The named ports that belong to this
  11982. // instance group.
  11983. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  11984. // Status: [Output Only] The status of the instance.
  11985. //
  11986. // Possible values:
  11987. // "PROVISIONING"
  11988. // "RUNNING"
  11989. // "STAGING"
  11990. // "STOPPED"
  11991. // "STOPPING"
  11992. // "SUSPENDED"
  11993. // "SUSPENDING"
  11994. // "TERMINATED"
  11995. Status string `json:"status,omitempty"`
  11996. // ForceSendFields is a list of field names (e.g. "Instance") 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. "Instance") to include in
  12004. // API 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 *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  12012. type NoMethod InstanceWithNamedPorts
  12013. raw := NoMethod(*s)
  12014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12015. }
  12016. type InstancesResumeRequest struct {
  12017. // Disks: Array of disks associated with this instance that are
  12018. // protected with a customer-supplied encryption key.
  12019. //
  12020. // In order to resume the instance, the disk url and its corresponding
  12021. // key must be provided.
  12022. //
  12023. // If the disk is not protected with a customer-supplied encryption key
  12024. // it should not be specified.
  12025. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  12026. // InstanceEncryptionKey: Decrypts data associated with an instance that
  12027. // is protected with a customer-supplied encryption key.
  12028. //
  12029. // If the instance you are starting is protected with a
  12030. // customer-supplied encryption key, the correct key must be provided
  12031. // otherwise the instance resume will not succeed.
  12032. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  12033. // ForceSendFields is a list of field names (e.g. "Disks") to
  12034. // unconditionally include in API requests. By default, fields with
  12035. // empty values are omitted from API requests. However, any non-pointer,
  12036. // non-interface field appearing in ForceSendFields will be sent to the
  12037. // server regardless of whether the field is empty or not. This may be
  12038. // used to include empty fields in Patch requests.
  12039. ForceSendFields []string `json:"-"`
  12040. // NullFields is a list of field names (e.g. "Disks") to include in API
  12041. // requests with the JSON null value. By default, fields with empty
  12042. // values are omitted from API requests. However, any field with an
  12043. // empty value appearing in NullFields will be sent to the server as
  12044. // null. It is an error if a field in this list has a non-empty value.
  12045. // This may be used to include null fields in Patch requests.
  12046. NullFields []string `json:"-"`
  12047. }
  12048. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  12049. type NoMethod InstancesResumeRequest
  12050. raw := NoMethod(*s)
  12051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12052. }
  12053. type InstancesScopedList struct {
  12054. // Instances: [Output Only] A list of instances contained in this scope.
  12055. Instances []*Instance `json:"instances,omitempty"`
  12056. // Warning: [Output Only] Informational warning which replaces the list
  12057. // of instances when the list is empty.
  12058. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  12059. // ForceSendFields is a list of field names (e.g. "Instances") to
  12060. // unconditionally include in API requests. By default, fields with
  12061. // empty values are omitted from API requests. However, any non-pointer,
  12062. // non-interface field appearing in ForceSendFields will be sent to the
  12063. // server regardless of whether the field is empty or not. This may be
  12064. // used to include empty fields in Patch requests.
  12065. ForceSendFields []string `json:"-"`
  12066. // NullFields is a list of field names (e.g. "Instances") to include in
  12067. // API requests with the JSON null value. By default, fields with empty
  12068. // values are omitted from API requests. However, any field with an
  12069. // empty value appearing in NullFields will be sent to the server as
  12070. // null. It is an error if a field in this list has a non-empty value.
  12071. // This may be used to include null fields in Patch requests.
  12072. NullFields []string `json:"-"`
  12073. }
  12074. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  12075. type NoMethod InstancesScopedList
  12076. raw := NoMethod(*s)
  12077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12078. }
  12079. // InstancesScopedListWarning: [Output Only] Informational warning which
  12080. // replaces the list of instances when the list is empty.
  12081. type InstancesScopedListWarning struct {
  12082. // Code: [Output Only] A warning code, if applicable. For example,
  12083. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12084. // the response.
  12085. //
  12086. // Possible values:
  12087. // "CLEANUP_FAILED"
  12088. // "DEPRECATED_RESOURCE_USED"
  12089. // "DEPRECATED_TYPE_USED"
  12090. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12091. // "EXPERIMENTAL_TYPE_USED"
  12092. // "EXTERNAL_API_WARNING"
  12093. // "FIELD_VALUE_OVERRIDEN"
  12094. // "INJECTED_KERNELS_DEPRECATED"
  12095. // "MISSING_TYPE_DEPENDENCY"
  12096. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12097. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12098. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12099. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12100. // "NEXT_HOP_NOT_RUNNING"
  12101. // "NOT_CRITICAL_ERROR"
  12102. // "NO_RESULTS_ON_PAGE"
  12103. // "REQUIRED_TOS_AGREEMENT"
  12104. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12105. // "RESOURCE_NOT_DELETED"
  12106. // "SCHEMA_VALIDATION_IGNORED"
  12107. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12108. // "UNDECLARED_PROPERTIES"
  12109. // "UNREACHABLE"
  12110. Code string `json:"code,omitempty"`
  12111. // Data: [Output Only] Metadata about this warning in key: value format.
  12112. // For example:
  12113. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12114. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  12115. // Message: [Output Only] A human-readable description of the warning
  12116. // code.
  12117. Message string `json:"message,omitempty"`
  12118. // ForceSendFields is a list of field names (e.g. "Code") to
  12119. // unconditionally include in API requests. By default, fields with
  12120. // empty values are omitted from API requests. However, any non-pointer,
  12121. // non-interface field appearing in ForceSendFields will be sent to the
  12122. // server regardless of whether the field is empty or not. This may be
  12123. // used to include empty fields in Patch requests.
  12124. ForceSendFields []string `json:"-"`
  12125. // NullFields is a list of field names (e.g. "Code") to include in API
  12126. // requests with the JSON null value. By default, fields with empty
  12127. // values are omitted from API requests. However, any field with an
  12128. // empty value appearing in NullFields will be sent to the server as
  12129. // null. It is an error if a field in this list has a non-empty value.
  12130. // This may be used to include null fields in Patch requests.
  12131. NullFields []string `json:"-"`
  12132. }
  12133. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  12134. type NoMethod InstancesScopedListWarning
  12135. raw := NoMethod(*s)
  12136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12137. }
  12138. type InstancesScopedListWarningData struct {
  12139. // Key: [Output Only] A key that provides more detail on the warning
  12140. // being returned. For example, for warnings where there are no results
  12141. // in a list request for a particular zone, this key might be scope and
  12142. // the key value might be the zone name. Other examples might be a key
  12143. // indicating a deprecated resource and a suggested replacement, or a
  12144. // warning about invalid network settings (for example, if an instance
  12145. // attempts to perform IP forwarding but is not enabled for IP
  12146. // forwarding).
  12147. Key string `json:"key,omitempty"`
  12148. // Value: [Output Only] A warning data value corresponding to the key.
  12149. Value string `json:"value,omitempty"`
  12150. // ForceSendFields is a list of field names (e.g. "Key") to
  12151. // unconditionally include in API requests. By default, fields with
  12152. // empty values are omitted from API requests. However, any non-pointer,
  12153. // non-interface field appearing in ForceSendFields will be sent to the
  12154. // server regardless of whether the field is empty or not. This may be
  12155. // used to include empty fields in Patch requests.
  12156. ForceSendFields []string `json:"-"`
  12157. // NullFields is a list of field names (e.g. "Key") to include in API
  12158. // requests with the JSON null value. By default, fields with empty
  12159. // values are omitted from API requests. However, any field with an
  12160. // empty value appearing in NullFields will be sent to the server as
  12161. // null. It is an error if a field in this list has a non-empty value.
  12162. // This may be used to include null fields in Patch requests.
  12163. NullFields []string `json:"-"`
  12164. }
  12165. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  12166. type NoMethod InstancesScopedListWarningData
  12167. raw := NoMethod(*s)
  12168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12169. }
  12170. type InstancesSetLabelsRequest struct {
  12171. // LabelFingerprint: Fingerprint of the previous set of labels for this
  12172. // resource, used to prevent conflicts. Provide the latest fingerprint
  12173. // value when making a request to add or change labels.
  12174. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  12175. Labels map[string]string `json:"labels,omitempty"`
  12176. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  12177. // unconditionally include in API requests. By default, fields with
  12178. // empty values are omitted from API requests. However, any non-pointer,
  12179. // non-interface field appearing in ForceSendFields will be sent to the
  12180. // server regardless of whether the field is empty or not. This may be
  12181. // used to include empty fields in Patch requests.
  12182. ForceSendFields []string `json:"-"`
  12183. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  12184. // include in API requests with the JSON null value. By default, fields
  12185. // with empty values are omitted from API requests. However, any field
  12186. // with an empty value appearing in NullFields will be sent to the
  12187. // server as null. It is an error if a field in this list has a
  12188. // non-empty value. This may be used to include null fields in Patch
  12189. // requests.
  12190. NullFields []string `json:"-"`
  12191. }
  12192. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  12193. type NoMethod InstancesSetLabelsRequest
  12194. raw := NoMethod(*s)
  12195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12196. }
  12197. type InstancesSetMachineResourcesRequest struct {
  12198. // GuestAccelerators: A list of the type and count of accelerator cards
  12199. // attached to the instance.
  12200. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  12201. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  12202. // to unconditionally include in API requests. By default, fields with
  12203. // empty values are omitted from API requests. However, any non-pointer,
  12204. // non-interface field appearing in ForceSendFields will be sent to the
  12205. // server regardless of whether the field is empty or not. This may be
  12206. // used to include empty fields in Patch requests.
  12207. ForceSendFields []string `json:"-"`
  12208. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  12209. // include in API requests with the JSON null value. By default, fields
  12210. // with empty values are omitted from API requests. However, any field
  12211. // with an empty value appearing in NullFields will be sent to the
  12212. // server as null. It is an error if a field in this list has a
  12213. // non-empty value. This may be used to include null fields in Patch
  12214. // requests.
  12215. NullFields []string `json:"-"`
  12216. }
  12217. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  12218. type NoMethod InstancesSetMachineResourcesRequest
  12219. raw := NoMethod(*s)
  12220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12221. }
  12222. type InstancesSetMachineTypeRequest struct {
  12223. // MachineType: Full or partial URL of the machine type resource. See
  12224. // Machine Types for a full list of machine types. For example:
  12225. // zones/us-central1-f/machineTypes/n1-standard-1
  12226. MachineType string `json:"machineType,omitempty"`
  12227. // ForceSendFields is a list of field names (e.g. "MachineType") to
  12228. // unconditionally include in API requests. By default, fields with
  12229. // empty values are omitted from API requests. However, any non-pointer,
  12230. // non-interface field appearing in ForceSendFields will be sent to the
  12231. // server regardless of whether the field is empty or not. This may be
  12232. // used to include empty fields in Patch requests.
  12233. ForceSendFields []string `json:"-"`
  12234. // NullFields is a list of field names (e.g. "MachineType") to include
  12235. // in API requests with the JSON null value. By default, fields with
  12236. // empty values are omitted from API requests. However, any field with
  12237. // an empty value appearing in NullFields will be sent to the server as
  12238. // null. It is an error if a field in this list has a non-empty value.
  12239. // This may be used to include null fields in Patch requests.
  12240. NullFields []string `json:"-"`
  12241. }
  12242. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  12243. type NoMethod InstancesSetMachineTypeRequest
  12244. raw := NoMethod(*s)
  12245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12246. }
  12247. type InstancesSetMinCpuPlatformRequest struct {
  12248. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  12249. // at.
  12250. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  12251. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  12252. // unconditionally include in API requests. By default, fields with
  12253. // empty values are omitted from API requests. However, any non-pointer,
  12254. // non-interface field appearing in ForceSendFields will be sent to the
  12255. // server regardless of whether the field is empty or not. This may be
  12256. // used to include empty fields in Patch requests.
  12257. ForceSendFields []string `json:"-"`
  12258. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  12259. // include in API requests with the JSON null value. By default, fields
  12260. // with empty values are omitted from API requests. However, any field
  12261. // with an empty value appearing in NullFields will be sent to the
  12262. // server as null. It is an error if a field in this list has a
  12263. // non-empty value. This may be used to include null fields in Patch
  12264. // requests.
  12265. NullFields []string `json:"-"`
  12266. }
  12267. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  12268. type NoMethod InstancesSetMinCpuPlatformRequest
  12269. raw := NoMethod(*s)
  12270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12271. }
  12272. type InstancesSetServiceAccountRequest struct {
  12273. // Email: Email address of the service account.
  12274. Email string `json:"email,omitempty"`
  12275. // Scopes: The list of scopes to be made available for this service
  12276. // account.
  12277. Scopes []string `json:"scopes,omitempty"`
  12278. // ForceSendFields is a list of field names (e.g. "Email") to
  12279. // unconditionally include in API requests. By default, fields with
  12280. // empty values are omitted from API requests. However, any non-pointer,
  12281. // non-interface field appearing in ForceSendFields will be sent to the
  12282. // server regardless of whether the field is empty or not. This may be
  12283. // used to include empty fields in Patch requests.
  12284. ForceSendFields []string `json:"-"`
  12285. // NullFields is a list of field names (e.g. "Email") to include in API
  12286. // requests with the JSON null value. By default, fields with empty
  12287. // values are omitted from API requests. However, any field with an
  12288. // empty value appearing in NullFields will be sent to the server as
  12289. // null. It is an error if a field in this list has a non-empty value.
  12290. // This may be used to include null fields in Patch requests.
  12291. NullFields []string `json:"-"`
  12292. }
  12293. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  12294. type NoMethod InstancesSetServiceAccountRequest
  12295. raw := NoMethod(*s)
  12296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12297. }
  12298. type InstancesStartWithEncryptionKeyRequest struct {
  12299. // Disks: Array of disks associated with this instance that are
  12300. // protected with a customer-supplied encryption key.
  12301. //
  12302. // In order to start the instance, the disk url and its corresponding
  12303. // key must be provided.
  12304. //
  12305. // If the disk is not protected with a customer-supplied encryption key
  12306. // it should not be specified.
  12307. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  12308. // ForceSendFields is a list of field names (e.g. "Disks") to
  12309. // unconditionally include in API requests. By default, fields with
  12310. // empty values are omitted from API requests. However, any non-pointer,
  12311. // non-interface field appearing in ForceSendFields will be sent to the
  12312. // server regardless of whether the field is empty or not. This may be
  12313. // used to include empty fields in Patch requests.
  12314. ForceSendFields []string `json:"-"`
  12315. // NullFields is a list of field names (e.g. "Disks") to include in API
  12316. // requests with the JSON null value. By default, fields with empty
  12317. // values are omitted from API requests. However, any field with an
  12318. // empty value appearing in NullFields will be sent to the server as
  12319. // null. It is an error if a field in this list has a non-empty value.
  12320. // This may be used to include null fields in Patch requests.
  12321. NullFields []string `json:"-"`
  12322. }
  12323. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  12324. type NoMethod InstancesStartWithEncryptionKeyRequest
  12325. raw := NoMethod(*s)
  12326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12327. }
  12328. // Interconnect: Represents an Interconnects resource. The Interconnects
  12329. // resource is a dedicated connection between Google's network and your
  12330. // on-premises network. For more information, see the Dedicated
  12331. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  12332. // beta.interconnects ==)
  12333. type Interconnect struct {
  12334. // AdminEnabled: Administrative status of the interconnect. When this is
  12335. // set to true, the Interconnect is functional and can carry traffic.
  12336. // When set to false, no packets can be carried over the interconnect
  12337. // and no BGP routes are exchanged over it. By default, the status is
  12338. // set to true.
  12339. AdminEnabled bool `json:"adminEnabled,omitempty"`
  12340. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  12341. // describe the individual circuits in this LAG.
  12342. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  12343. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12344. // format.
  12345. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12346. // CustomerName: Customer name, to put in the Letter of Authorization as
  12347. // the party authorized to request a crossconnect.
  12348. CustomerName string `json:"customerName,omitempty"`
  12349. // Description: An optional description of this resource. Provide this
  12350. // property when you create the resource.
  12351. Description string `json:"description,omitempty"`
  12352. // ExpectedOutages: [Output Only] A list of outages expected for this
  12353. // Interconnect.
  12354. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  12355. // GoogleIpAddress: [Output Only] IP address configured on the Google
  12356. // side of the Interconnect link. This can be used only for ping tests.
  12357. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  12358. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  12359. // raising support tickets with Google or otherwise to debug backend
  12360. // connectivity issues.
  12361. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  12362. // Id: [Output Only] The unique identifier for the resource. This
  12363. // identifier is defined by the server.
  12364. Id uint64 `json:"id,omitempty,string"`
  12365. // InterconnectAttachments: [Output Only] A list of the URLs of all
  12366. // InterconnectAttachments configured to use this Interconnect.
  12367. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  12368. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  12369. // been deprecated in favor of "DEDICATED"
  12370. //
  12371. // Possible values:
  12372. // "DEDICATED"
  12373. // "IT_PRIVATE"
  12374. // "PARTNER"
  12375. InterconnectType string `json:"interconnectType,omitempty"`
  12376. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  12377. // for interconnects.
  12378. Kind string `json:"kind,omitempty"`
  12379. // LabelFingerprint: A fingerprint for the labels being applied to this
  12380. // Interconnect, which is essentially a hash of the labels set used for
  12381. // optimistic locking. The fingerprint is initially generated by Compute
  12382. // Engine and changes after every request to modify or update labels.
  12383. // You must always provide an up-to-date fingerprint hash in order to
  12384. // update or change labels, otherwise the request will fail with error
  12385. // 412 conditionNotMet.
  12386. //
  12387. // To see the latest fingerprint, make a get() request to retrieve an
  12388. // Interconnect.
  12389. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  12390. // Labels: Labels to apply to this Interconnect resource. These can be
  12391. // later modified by the setLabels method. Each label key/value must
  12392. // comply with RFC1035. Label values may be empty.
  12393. Labels map[string]string `json:"labels,omitempty"`
  12394. // LinkType: Type of link requested. This field indicates speed of each
  12395. // of the links in the bundle, not the entire bundle. Only 10G per link
  12396. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  12397. //
  12398. // Possible values:
  12399. // "LINK_TYPE_ETHERNET_10G_LR"
  12400. LinkType string `json:"linkType,omitempty"`
  12401. // Location: URL of the InterconnectLocation object that represents
  12402. // where this connection is to be provisioned.
  12403. Location string `json:"location,omitempty"`
  12404. // Name: Name of the resource. Provided by the client when the resource
  12405. // is created. The name must be 1-63 characters long, and comply with
  12406. // RFC1035. Specifically, the name must be 1-63 characters long and
  12407. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12408. // the first character must be a lowercase letter, and all following
  12409. // characters must be a dash, lowercase letter, or digit, except the
  12410. // last character, which cannot be a dash.
  12411. Name string `json:"name,omitempty"`
  12412. // NocContactEmail: Email address to contact the customer NOC for
  12413. // operations and maintenance notifications regarding this Interconnect.
  12414. // If specified, this will be used for notifications in addition to all
  12415. // other forms described, such as Stackdriver logs alerting and Cloud
  12416. // Notifications.
  12417. NocContactEmail string `json:"nocContactEmail,omitempty"`
  12418. // OperationalStatus: [Output Only] The current status of whether or not
  12419. // this Interconnect is functional.
  12420. //
  12421. // Possible values:
  12422. // "OS_ACTIVE"
  12423. // "OS_UNPROVISIONED"
  12424. OperationalStatus string `json:"operationalStatus,omitempty"`
  12425. // PeerIpAddress: [Output Only] IP address configured on the customer
  12426. // side of the Interconnect link. The customer should configure this IP
  12427. // address during turnup when prompted by Google NOC. This can be used
  12428. // only for ping tests.
  12429. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  12430. // ProvisionedLinkCount: [Output Only] Number of links actually
  12431. // provisioned in this interconnect.
  12432. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  12433. // RequestedLinkCount: Target number of physical links in the link
  12434. // bundle, as requested by the customer.
  12435. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  12436. // SelfLink: [Output Only] Server-defined URL for the resource.
  12437. SelfLink string `json:"selfLink,omitempty"`
  12438. // State: [Output Only] The current state of whether or not this
  12439. // Interconnect is functional.
  12440. //
  12441. // Possible values:
  12442. // "ACTIVE"
  12443. // "UNPROVISIONED"
  12444. State string `json:"state,omitempty"`
  12445. // ServerResponse contains the HTTP response code and headers from the
  12446. // server.
  12447. googleapi.ServerResponse `json:"-"`
  12448. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  12449. // unconditionally include in API requests. By default, fields with
  12450. // empty values are omitted from API requests. However, any non-pointer,
  12451. // non-interface field appearing in ForceSendFields will be sent to the
  12452. // server regardless of whether the field is empty or not. This may be
  12453. // used to include empty fields in Patch requests.
  12454. ForceSendFields []string `json:"-"`
  12455. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  12456. // in API requests with the JSON null value. By default, fields with
  12457. // empty values are omitted from API requests. However, any field with
  12458. // an empty value appearing in NullFields will be sent to the server as
  12459. // null. It is an error if a field in this list has a non-empty value.
  12460. // This may be used to include null fields in Patch requests.
  12461. NullFields []string `json:"-"`
  12462. }
  12463. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  12464. type NoMethod Interconnect
  12465. raw := NoMethod(*s)
  12466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12467. }
  12468. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  12469. // attachment) resource. For more information, see Creating VLAN
  12470. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  12471. // resource_for v1.interconnectAttachments ==)
  12472. type InterconnectAttachment struct {
  12473. // AdminEnabled: Determines whether this Attachment will carry packets.
  12474. // Not present for PARTNER_PROVIDER.
  12475. AdminEnabled bool `json:"adminEnabled,omitempty"`
  12476. // Bandwidth: Provisioned bandwidth capacity for the
  12477. // interconnectAttachment. Can be set by the partner to update the
  12478. // customer's provisioned bandwidth. Output only for PARTNER type,
  12479. // mutable for PARTNER_PROVIDER and DEDICATED.
  12480. //
  12481. // Possible values:
  12482. // "BPS_100M"
  12483. // "BPS_10G"
  12484. // "BPS_1G"
  12485. // "BPS_200M"
  12486. // "BPS_2G"
  12487. // "BPS_300M"
  12488. // "BPS_400M"
  12489. // "BPS_500M"
  12490. // "BPS_50M"
  12491. // "BPS_5G"
  12492. Bandwidth string `json:"bandwidth,omitempty"`
  12493. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  12494. // restrict the allocation of cloudRouterIpAddress and
  12495. // customerRouterIpAddress for this attachment. All prefixes must be
  12496. // within link-local address space (169.254.0.0/16) and must be /29 or
  12497. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  12498. // from the supplied candidate prefix(es). The request will fail if all
  12499. // possible /29s are in use on Google?s edge. If not supplied, Google
  12500. // will randomly select an unused /29 from all of link-local space.
  12501. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  12502. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  12503. // be configured on Cloud Router Interface for this interconnect
  12504. // attachment.
  12505. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  12506. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12507. // format.
  12508. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12509. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  12510. // to be configured on the customer router subinterface for this
  12511. // interconnect attachment.
  12512. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  12513. // Description: An optional description of this resource.
  12514. Description string `json:"description,omitempty"`
  12515. // EdgeAvailabilityDomain: Desired availability domain for the
  12516. // attachment. Only available for type PARTNER, at creation time. For
  12517. // improved reliability, customers should configure a pair of
  12518. // attachments with one per availability domain. The selected
  12519. // availability domain will be provided to the Partner via the pairing
  12520. // key so that the provisioned circuit will lie in the specified domain.
  12521. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  12522. //
  12523. // Possible values:
  12524. // "AVAILABILITY_DOMAIN_1"
  12525. // "AVAILABILITY_DOMAIN_2"
  12526. // "AVAILABILITY_DOMAIN_ANY"
  12527. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  12528. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  12529. // raising support tickets with Google or otherwise to debug backend
  12530. // connectivity issues.
  12531. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  12532. // Id: [Output Only] The unique identifier for the resource. This
  12533. // identifier is defined by the server.
  12534. Id uint64 `json:"id,omitempty,string"`
  12535. // Interconnect: URL of the underlying Interconnect object that this
  12536. // attachment's traffic will traverse through.
  12537. Interconnect string `json:"interconnect,omitempty"`
  12538. // Kind: [Output Only] Type of the resource. Always
  12539. // compute#interconnectAttachment for interconnect attachments.
  12540. Kind string `json:"kind,omitempty"`
  12541. // LabelFingerprint: A fingerprint for the labels being applied to this
  12542. // InterconnectAttachment, which is essentially a hash of the labels set
  12543. // used for optimistic locking. The fingerprint is initially generated
  12544. // by Compute Engine and changes after every request to modify or update
  12545. // labels. You must always provide an up-to-date fingerprint hash in
  12546. // order to update or change labels, otherwise the request will fail
  12547. // with error 412 conditionNotMet.
  12548. //
  12549. // To see the latest fingerprint, make a get() request to retrieve an
  12550. // InterconnectAttachment.
  12551. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  12552. // Labels: Labels to apply to this InterconnectAttachment resource.
  12553. // These can be later modified by the setLabels method. Each label
  12554. // key/value must comply with RFC1035. Label values may be empty.
  12555. Labels map[string]string `json:"labels,omitempty"`
  12556. // Name: Name of the resource. Provided by the client when the resource
  12557. // is created. The name must be 1-63 characters long, and comply with
  12558. // RFC1035. Specifically, the name must be 1-63 characters long and
  12559. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12560. // the first character must be a lowercase letter, and all following
  12561. // characters must be a dash, lowercase letter, or digit, except the
  12562. // last character, which cannot be a dash.
  12563. Name string `json:"name,omitempty"`
  12564. // OperationalStatus: [Output Only] The current status of whether or not
  12565. // this interconnect attachment is functional.
  12566. //
  12567. // Possible values:
  12568. // "OS_ACTIVE"
  12569. // "OS_UNPROVISIONED"
  12570. OperationalStatus string `json:"operationalStatus,omitempty"`
  12571. // PairingKey: [Output only for type PARTNER. Input only for
  12572. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  12573. // of an PARTNER attachment used to initiate provisioning with a
  12574. // selected partner. Of the form "XXXXX/region/domain"
  12575. PairingKey string `json:"pairingKey,omitempty"`
  12576. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  12577. // by a layer 3 Partner if they configured BGP on behalf of the
  12578. // customer. Output only for PARTNER type, input only for
  12579. // PARTNER_PROVIDER, not available for DEDICATED.
  12580. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  12581. // PartnerMetadata: Informational metadata about Partner attachments
  12582. // from Partners to display to customers. Output only for for PARTNER
  12583. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  12584. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  12585. // PrivateInterconnectInfo: [Output Only] Information specific to an
  12586. // InterconnectAttachment. This property is populated if the
  12587. // interconnect that this is attached to is of type DEDICATED.
  12588. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  12589. // Region: [Output Only] URL of the region where the regional
  12590. // interconnect attachment resides. You must specify this field as part
  12591. // of the HTTP request URL. It is not settable as a field in the request
  12592. // body.
  12593. Region string `json:"region,omitempty"`
  12594. // Router: URL of the Cloud Router to be used for dynamic routing. This
  12595. // router must be in the same region as this InterconnectAttachment. The
  12596. // InterconnectAttachment will automatically connect the Interconnect to
  12597. // the network & region within which the Cloud Router is configured.
  12598. Router string `json:"router,omitempty"`
  12599. // SelfLink: [Output Only] Server-defined URL for the resource.
  12600. SelfLink string `json:"selfLink,omitempty"`
  12601. // State: [Output Only] The current state of this attachment's
  12602. // functionality.
  12603. //
  12604. // Possible values:
  12605. // "ACTIVE"
  12606. // "DEFUNCT"
  12607. // "PARTNER_REQUEST_RECEIVED"
  12608. // "PENDING_CUSTOMER"
  12609. // "PENDING_PARTNER"
  12610. // "STATE_UNSPECIFIED"
  12611. // "UNPROVISIONED"
  12612. State string `json:"state,omitempty"`
  12613. // Possible values:
  12614. // "DEDICATED"
  12615. // "PARTNER"
  12616. // "PARTNER_PROVIDER"
  12617. Type string `json:"type,omitempty"`
  12618. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  12619. // range 2-4094. Only specified at creation time.
  12620. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  12621. // ServerResponse contains the HTTP response code and headers from the
  12622. // server.
  12623. googleapi.ServerResponse `json:"-"`
  12624. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  12625. // unconditionally include in API requests. By default, fields with
  12626. // empty values are omitted from API requests. However, any non-pointer,
  12627. // non-interface field appearing in ForceSendFields will be sent to the
  12628. // server regardless of whether the field is empty or not. This may be
  12629. // used to include empty fields in Patch requests.
  12630. ForceSendFields []string `json:"-"`
  12631. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  12632. // in API requests with the JSON null value. By default, fields with
  12633. // empty values are omitted from API requests. However, any field with
  12634. // an empty value appearing in NullFields will be sent to the server as
  12635. // null. It is an error if a field in this list has a non-empty value.
  12636. // This may be used to include null fields in Patch requests.
  12637. NullFields []string `json:"-"`
  12638. }
  12639. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  12640. type NoMethod InterconnectAttachment
  12641. raw := NoMethod(*s)
  12642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12643. }
  12644. type InterconnectAttachmentAggregatedList struct {
  12645. // Id: [Output Only] Unique identifier for the resource; defined by the
  12646. // server.
  12647. Id string `json:"id,omitempty"`
  12648. // Items: A list of InterconnectAttachmentsScopedList resources.
  12649. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  12650. // Kind: [Output Only] Type of resource. Always
  12651. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  12652. // interconnect attachments.
  12653. Kind string `json:"kind,omitempty"`
  12654. // NextPageToken: [Output Only] This token allows you to get the next
  12655. // page of results for list requests. If the number of results is larger
  12656. // than maxResults, use the nextPageToken as a value for the query
  12657. // parameter pageToken in the next list request. Subsequent list
  12658. // requests will have their own nextPageToken to continue paging through
  12659. // the results.
  12660. NextPageToken string `json:"nextPageToken,omitempty"`
  12661. // SelfLink: [Output Only] Server-defined URL for this resource.
  12662. SelfLink string `json:"selfLink,omitempty"`
  12663. // Warning: [Output Only] Informational warning message.
  12664. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  12665. // ServerResponse contains the HTTP response code and headers from the
  12666. // server.
  12667. googleapi.ServerResponse `json:"-"`
  12668. // ForceSendFields is a list of field names (e.g. "Id") to
  12669. // unconditionally include in API requests. By default, fields with
  12670. // empty values are omitted from API requests. However, any non-pointer,
  12671. // non-interface field appearing in ForceSendFields will be sent to the
  12672. // server regardless of whether the field is empty or not. This may be
  12673. // used to include empty fields in Patch requests.
  12674. ForceSendFields []string `json:"-"`
  12675. // NullFields is a list of field names (e.g. "Id") to include in API
  12676. // requests with the JSON null value. By default, fields with empty
  12677. // values are omitted from API requests. However, any field with an
  12678. // empty value appearing in NullFields will be sent to the server as
  12679. // null. It is an error if a field in this list has a non-empty value.
  12680. // This may be used to include null fields in Patch requests.
  12681. NullFields []string `json:"-"`
  12682. }
  12683. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  12684. type NoMethod InterconnectAttachmentAggregatedList
  12685. raw := NoMethod(*s)
  12686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12687. }
  12688. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  12689. // Informational warning message.
  12690. type InterconnectAttachmentAggregatedListWarning struct {
  12691. // Code: [Output Only] A warning code, if applicable. For example,
  12692. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12693. // the response.
  12694. //
  12695. // Possible values:
  12696. // "CLEANUP_FAILED"
  12697. // "DEPRECATED_RESOURCE_USED"
  12698. // "DEPRECATED_TYPE_USED"
  12699. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12700. // "EXPERIMENTAL_TYPE_USED"
  12701. // "EXTERNAL_API_WARNING"
  12702. // "FIELD_VALUE_OVERRIDEN"
  12703. // "INJECTED_KERNELS_DEPRECATED"
  12704. // "MISSING_TYPE_DEPENDENCY"
  12705. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12706. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12707. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12708. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12709. // "NEXT_HOP_NOT_RUNNING"
  12710. // "NOT_CRITICAL_ERROR"
  12711. // "NO_RESULTS_ON_PAGE"
  12712. // "REQUIRED_TOS_AGREEMENT"
  12713. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12714. // "RESOURCE_NOT_DELETED"
  12715. // "SCHEMA_VALIDATION_IGNORED"
  12716. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12717. // "UNDECLARED_PROPERTIES"
  12718. // "UNREACHABLE"
  12719. Code string `json:"code,omitempty"`
  12720. // Data: [Output Only] Metadata about this warning in key: value format.
  12721. // For example:
  12722. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12723. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  12724. // Message: [Output Only] A human-readable description of the warning
  12725. // code.
  12726. Message string `json:"message,omitempty"`
  12727. // ForceSendFields is a list of field names (e.g. "Code") to
  12728. // unconditionally include in API requests. By default, fields with
  12729. // empty values are omitted from API requests. However, any non-pointer,
  12730. // non-interface field appearing in ForceSendFields will be sent to the
  12731. // server regardless of whether the field is empty or not. This may be
  12732. // used to include empty fields in Patch requests.
  12733. ForceSendFields []string `json:"-"`
  12734. // NullFields is a list of field names (e.g. "Code") to include in API
  12735. // requests with the JSON null value. By default, fields with empty
  12736. // values are omitted from API requests. However, any field with an
  12737. // empty value appearing in NullFields will be sent to the server as
  12738. // null. It is an error if a field in this list has a non-empty value.
  12739. // This may be used to include null fields in Patch requests.
  12740. NullFields []string `json:"-"`
  12741. }
  12742. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12743. type NoMethod InterconnectAttachmentAggregatedListWarning
  12744. raw := NoMethod(*s)
  12745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12746. }
  12747. type InterconnectAttachmentAggregatedListWarningData struct {
  12748. // Key: [Output Only] A key that provides more detail on the warning
  12749. // being returned. For example, for warnings where there are no results
  12750. // in a list request for a particular zone, this key might be scope and
  12751. // the key value might be the zone name. Other examples might be a key
  12752. // indicating a deprecated resource and a suggested replacement, or a
  12753. // warning about invalid network settings (for example, if an instance
  12754. // attempts to perform IP forwarding but is not enabled for IP
  12755. // forwarding).
  12756. Key string `json:"key,omitempty"`
  12757. // Value: [Output Only] A warning data value corresponding to the key.
  12758. Value string `json:"value,omitempty"`
  12759. // ForceSendFields is a list of field names (e.g. "Key") to
  12760. // unconditionally include in API requests. By default, fields with
  12761. // empty values are omitted from API requests. However, any non-pointer,
  12762. // non-interface field appearing in ForceSendFields will be sent to the
  12763. // server regardless of whether the field is empty or not. This may be
  12764. // used to include empty fields in Patch requests.
  12765. ForceSendFields []string `json:"-"`
  12766. // NullFields is a list of field names (e.g. "Key") to include in API
  12767. // requests with the JSON null value. By default, fields with empty
  12768. // values are omitted from API requests. However, any field with an
  12769. // empty value appearing in NullFields will be sent to the server as
  12770. // null. It is an error if a field in this list has a non-empty value.
  12771. // This may be used to include null fields in Patch requests.
  12772. NullFields []string `json:"-"`
  12773. }
  12774. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12775. type NoMethod InterconnectAttachmentAggregatedListWarningData
  12776. raw := NoMethod(*s)
  12777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12778. }
  12779. // InterconnectAttachmentList: Response to the list request, and
  12780. // contains a list of interconnect attachments.
  12781. type InterconnectAttachmentList struct {
  12782. // Id: [Output Only] Unique identifier for the resource; defined by the
  12783. // server.
  12784. Id string `json:"id,omitempty"`
  12785. // Items: A list of InterconnectAttachment resources.
  12786. Items []*InterconnectAttachment `json:"items,omitempty"`
  12787. // Kind: [Output Only] Type of resource. Always
  12788. // compute#interconnectAttachmentList for lists of interconnect
  12789. // attachments.
  12790. Kind string `json:"kind,omitempty"`
  12791. // NextPageToken: [Output Only] This token allows you to get the next
  12792. // page of results for list requests. If the number of results is larger
  12793. // than maxResults, use the nextPageToken as a value for the query
  12794. // parameter pageToken in the next list request. Subsequent list
  12795. // requests will have their own nextPageToken to continue paging through
  12796. // the results.
  12797. NextPageToken string `json:"nextPageToken,omitempty"`
  12798. // SelfLink: [Output Only] Server-defined URL for this resource.
  12799. SelfLink string `json:"selfLink,omitempty"`
  12800. // Warning: [Output Only] Informational warning message.
  12801. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  12802. // ServerResponse contains the HTTP response code and headers from the
  12803. // server.
  12804. googleapi.ServerResponse `json:"-"`
  12805. // ForceSendFields is a list of field names (e.g. "Id") to
  12806. // unconditionally include in API requests. By default, fields with
  12807. // empty values are omitted from API requests. However, any non-pointer,
  12808. // non-interface field appearing in ForceSendFields will be sent to the
  12809. // server regardless of whether the field is empty or not. This may be
  12810. // used to include empty fields in Patch requests.
  12811. ForceSendFields []string `json:"-"`
  12812. // NullFields is a list of field names (e.g. "Id") to include in API
  12813. // requests with the JSON null value. By default, fields with empty
  12814. // values are omitted from API requests. However, any field with an
  12815. // empty value appearing in NullFields will be sent to the server as
  12816. // null. It is an error if a field in this list has a non-empty value.
  12817. // This may be used to include null fields in Patch requests.
  12818. NullFields []string `json:"-"`
  12819. }
  12820. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  12821. type NoMethod InterconnectAttachmentList
  12822. raw := NoMethod(*s)
  12823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12824. }
  12825. // InterconnectAttachmentListWarning: [Output Only] Informational
  12826. // warning message.
  12827. type InterconnectAttachmentListWarning struct {
  12828. // Code: [Output Only] A warning code, if applicable. For example,
  12829. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12830. // the response.
  12831. //
  12832. // Possible values:
  12833. // "CLEANUP_FAILED"
  12834. // "DEPRECATED_RESOURCE_USED"
  12835. // "DEPRECATED_TYPE_USED"
  12836. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12837. // "EXPERIMENTAL_TYPE_USED"
  12838. // "EXTERNAL_API_WARNING"
  12839. // "FIELD_VALUE_OVERRIDEN"
  12840. // "INJECTED_KERNELS_DEPRECATED"
  12841. // "MISSING_TYPE_DEPENDENCY"
  12842. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12843. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12844. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12845. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12846. // "NEXT_HOP_NOT_RUNNING"
  12847. // "NOT_CRITICAL_ERROR"
  12848. // "NO_RESULTS_ON_PAGE"
  12849. // "REQUIRED_TOS_AGREEMENT"
  12850. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12851. // "RESOURCE_NOT_DELETED"
  12852. // "SCHEMA_VALIDATION_IGNORED"
  12853. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12854. // "UNDECLARED_PROPERTIES"
  12855. // "UNREACHABLE"
  12856. Code string `json:"code,omitempty"`
  12857. // Data: [Output Only] Metadata about this warning in key: value format.
  12858. // For example:
  12859. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12860. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  12861. // Message: [Output Only] A human-readable description of the warning
  12862. // code.
  12863. Message string `json:"message,omitempty"`
  12864. // ForceSendFields is a list of field names (e.g. "Code") to
  12865. // unconditionally include in API requests. By default, fields with
  12866. // empty values are omitted from API requests. However, any non-pointer,
  12867. // non-interface field appearing in ForceSendFields will be sent to the
  12868. // server regardless of whether the field is empty or not. This may be
  12869. // used to include empty fields in Patch requests.
  12870. ForceSendFields []string `json:"-"`
  12871. // NullFields is a list of field names (e.g. "Code") to include in API
  12872. // requests with the JSON null value. By default, fields with empty
  12873. // values are omitted from API requests. However, any field with an
  12874. // empty value appearing in NullFields will be sent to the server as
  12875. // null. It is an error if a field in this list has a non-empty value.
  12876. // This may be used to include null fields in Patch requests.
  12877. NullFields []string `json:"-"`
  12878. }
  12879. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  12880. type NoMethod InterconnectAttachmentListWarning
  12881. raw := NoMethod(*s)
  12882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12883. }
  12884. type InterconnectAttachmentListWarningData struct {
  12885. // Key: [Output Only] A key that provides more detail on the warning
  12886. // being returned. For example, for warnings where there are no results
  12887. // in a list request for a particular zone, this key might be scope and
  12888. // the key value might be the zone name. Other examples might be a key
  12889. // indicating a deprecated resource and a suggested replacement, or a
  12890. // warning about invalid network settings (for example, if an instance
  12891. // attempts to perform IP forwarding but is not enabled for IP
  12892. // forwarding).
  12893. Key string `json:"key,omitempty"`
  12894. // Value: [Output Only] A warning data value corresponding to the key.
  12895. Value string `json:"value,omitempty"`
  12896. // ForceSendFields is a list of field names (e.g. "Key") to
  12897. // unconditionally include in API requests. By default, fields with
  12898. // empty values are omitted from API requests. However, any non-pointer,
  12899. // non-interface field appearing in ForceSendFields will be sent to the
  12900. // server regardless of whether the field is empty or not. This may be
  12901. // used to include empty fields in Patch requests.
  12902. ForceSendFields []string `json:"-"`
  12903. // NullFields is a list of field names (e.g. "Key") to include in API
  12904. // requests with the JSON null value. By default, fields with empty
  12905. // values are omitted from API requests. However, any field with an
  12906. // empty value appearing in NullFields will be sent to the server as
  12907. // null. It is an error if a field in this list has a non-empty value.
  12908. // This may be used to include null fields in Patch requests.
  12909. NullFields []string `json:"-"`
  12910. }
  12911. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  12912. type NoMethod InterconnectAttachmentListWarningData
  12913. raw := NoMethod(*s)
  12914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12915. }
  12916. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  12917. // Partner attachments from Partners to display to customers. These
  12918. // fields are propagated from PARTNER_PROVIDER attachments to their
  12919. // corresponding PARTNER attachments.
  12920. type InterconnectAttachmentPartnerMetadata struct {
  12921. // InterconnectName: Plain text name of the Interconnect this attachment
  12922. // is connected to, as displayed in the Partner?s portal. For instance
  12923. // "Chicago 1". This value may be validated to match approved Partner
  12924. // values.
  12925. InterconnectName string `json:"interconnectName,omitempty"`
  12926. // PartnerName: Plain text name of the Partner providing this
  12927. // attachment. This value may be validated to match approved Partner
  12928. // values.
  12929. PartnerName string `json:"partnerName,omitempty"`
  12930. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  12931. // may customise this to be a deep-link to the specific resource on the
  12932. // Partner portal. This value may be validated to match approved Partner
  12933. // values.
  12934. PortalUrl string `json:"portalUrl,omitempty"`
  12935. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  12936. // unconditionally include in API requests. By default, fields with
  12937. // empty values are omitted from API requests. However, any non-pointer,
  12938. // non-interface field appearing in ForceSendFields will be sent to the
  12939. // server regardless of whether the field is empty or not. This may be
  12940. // used to include empty fields in Patch requests.
  12941. ForceSendFields []string `json:"-"`
  12942. // NullFields is a list of field names (e.g. "InterconnectName") to
  12943. // include in API requests with the JSON null value. By default, fields
  12944. // with empty values are omitted from API requests. However, any field
  12945. // with an empty value appearing in NullFields will be sent to the
  12946. // server as null. It is an error if a field in this list has a
  12947. // non-empty value. This may be used to include null fields in Patch
  12948. // requests.
  12949. NullFields []string `json:"-"`
  12950. }
  12951. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  12952. type NoMethod InterconnectAttachmentPartnerMetadata
  12953. raw := NoMethod(*s)
  12954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12955. }
  12956. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  12957. // attachment when this belongs to an interconnect of type DEDICATED.
  12958. type InterconnectAttachmentPrivateInfo struct {
  12959. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  12960. // traffic between Google and the customer, going to and from this
  12961. // network and region.
  12962. Tag8021q int64 `json:"tag8021q,omitempty"`
  12963. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  12964. // unconditionally include in API requests. By default, fields with
  12965. // empty values are omitted from API requests. However, any non-pointer,
  12966. // non-interface field appearing in ForceSendFields will be sent to the
  12967. // server regardless of whether the field is empty or not. This may be
  12968. // used to include empty fields in Patch requests.
  12969. ForceSendFields []string `json:"-"`
  12970. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  12971. // API requests with the JSON null value. By default, fields with empty
  12972. // values are omitted from API requests. However, any field with an
  12973. // empty value appearing in NullFields will be sent to the server as
  12974. // null. It is an error if a field in this list has a non-empty value.
  12975. // This may be used to include null fields in Patch requests.
  12976. NullFields []string `json:"-"`
  12977. }
  12978. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  12979. type NoMethod InterconnectAttachmentPrivateInfo
  12980. raw := NoMethod(*s)
  12981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12982. }
  12983. type InterconnectAttachmentsScopedList struct {
  12984. // InterconnectAttachments: A list of interconnect attachments contained
  12985. // in this scope.
  12986. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  12987. // Warning: Informational warning which replaces the list of addresses
  12988. // when the list is empty.
  12989. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  12990. // ForceSendFields is a list of field names (e.g.
  12991. // "InterconnectAttachments") to unconditionally include in API
  12992. // requests. By default, fields with empty values are omitted from API
  12993. // requests. However, any non-pointer, non-interface field appearing in
  12994. // ForceSendFields will be sent to the server regardless of whether the
  12995. // field is empty or not. This may be used to include empty fields in
  12996. // Patch requests.
  12997. ForceSendFields []string `json:"-"`
  12998. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  12999. // to include in API requests with the JSON null value. By default,
  13000. // fields with empty values are omitted from API requests. However, any
  13001. // field with an empty value appearing in NullFields will be sent to the
  13002. // server as null. It is an error if a field in this list has a
  13003. // non-empty value. This may be used to include null fields in Patch
  13004. // requests.
  13005. NullFields []string `json:"-"`
  13006. }
  13007. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  13008. type NoMethod InterconnectAttachmentsScopedList
  13009. raw := NoMethod(*s)
  13010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13011. }
  13012. // InterconnectAttachmentsScopedListWarning: Informational warning which
  13013. // replaces the list of addresses when the list is empty.
  13014. type InterconnectAttachmentsScopedListWarning struct {
  13015. // Code: [Output Only] A warning code, if applicable. For example,
  13016. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13017. // the response.
  13018. //
  13019. // Possible values:
  13020. // "CLEANUP_FAILED"
  13021. // "DEPRECATED_RESOURCE_USED"
  13022. // "DEPRECATED_TYPE_USED"
  13023. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13024. // "EXPERIMENTAL_TYPE_USED"
  13025. // "EXTERNAL_API_WARNING"
  13026. // "FIELD_VALUE_OVERRIDEN"
  13027. // "INJECTED_KERNELS_DEPRECATED"
  13028. // "MISSING_TYPE_DEPENDENCY"
  13029. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13030. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13031. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13032. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13033. // "NEXT_HOP_NOT_RUNNING"
  13034. // "NOT_CRITICAL_ERROR"
  13035. // "NO_RESULTS_ON_PAGE"
  13036. // "REQUIRED_TOS_AGREEMENT"
  13037. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13038. // "RESOURCE_NOT_DELETED"
  13039. // "SCHEMA_VALIDATION_IGNORED"
  13040. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13041. // "UNDECLARED_PROPERTIES"
  13042. // "UNREACHABLE"
  13043. Code string `json:"code,omitempty"`
  13044. // Data: [Output Only] Metadata about this warning in key: value format.
  13045. // For example:
  13046. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13047. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  13048. // Message: [Output Only] A human-readable description of the warning
  13049. // code.
  13050. Message string `json:"message,omitempty"`
  13051. // ForceSendFields is a list of field names (e.g. "Code") to
  13052. // unconditionally include in API requests. By default, fields with
  13053. // empty values are omitted from API requests. However, any non-pointer,
  13054. // non-interface field appearing in ForceSendFields will be sent to the
  13055. // server regardless of whether the field is empty or not. This may be
  13056. // used to include empty fields in Patch requests.
  13057. ForceSendFields []string `json:"-"`
  13058. // NullFields is a list of field names (e.g. "Code") to include in API
  13059. // requests with the JSON null value. By default, fields with empty
  13060. // values are omitted from API requests. However, any field with an
  13061. // empty value appearing in NullFields will be sent to the server as
  13062. // null. It is an error if a field in this list has a non-empty value.
  13063. // This may be used to include null fields in Patch requests.
  13064. NullFields []string `json:"-"`
  13065. }
  13066. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  13067. type NoMethod InterconnectAttachmentsScopedListWarning
  13068. raw := NoMethod(*s)
  13069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13070. }
  13071. type InterconnectAttachmentsScopedListWarningData struct {
  13072. // Key: [Output Only] A key that provides more detail on the warning
  13073. // being returned. For example, for warnings where there are no results
  13074. // in a list request for a particular zone, this key might be scope and
  13075. // the key value might be the zone name. Other examples might be a key
  13076. // indicating a deprecated resource and a suggested replacement, or a
  13077. // warning about invalid network settings (for example, if an instance
  13078. // attempts to perform IP forwarding but is not enabled for IP
  13079. // forwarding).
  13080. Key string `json:"key,omitempty"`
  13081. // Value: [Output Only] A warning data value corresponding to the key.
  13082. Value string `json:"value,omitempty"`
  13083. // ForceSendFields is a list of field names (e.g. "Key") to
  13084. // unconditionally include in API requests. By default, fields with
  13085. // empty values are omitted from API requests. However, any non-pointer,
  13086. // non-interface field appearing in ForceSendFields will be sent to the
  13087. // server regardless of whether the field is empty or not. This may be
  13088. // used to include empty fields in Patch requests.
  13089. ForceSendFields []string `json:"-"`
  13090. // NullFields is a list of field names (e.g. "Key") to include in API
  13091. // requests with the JSON null value. By default, fields with empty
  13092. // values are omitted from API requests. However, any field with an
  13093. // empty value appearing in NullFields will be sent to the server as
  13094. // null. It is an error if a field in this list has a non-empty value.
  13095. // This may be used to include null fields in Patch requests.
  13096. NullFields []string `json:"-"`
  13097. }
  13098. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  13099. type NoMethod InterconnectAttachmentsScopedListWarningData
  13100. raw := NoMethod(*s)
  13101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13102. }
  13103. // InterconnectCircuitInfo: Describes a single physical circuit between
  13104. // the Customer and Google. CircuitInfo objects are created by Google,
  13105. // so all fields are output only. Next id: 4
  13106. type InterconnectCircuitInfo struct {
  13107. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  13108. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  13109. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  13110. // at circuit turn-up.
  13111. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  13112. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  13113. // circuit turn-up and provided by Google to the customer in the LOA.
  13114. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  13115. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  13116. // unconditionally include in API requests. By default, fields with
  13117. // empty values are omitted from API requests. However, any non-pointer,
  13118. // non-interface field appearing in ForceSendFields will be sent to the
  13119. // server regardless of whether the field is empty or not. This may be
  13120. // used to include empty fields in Patch requests.
  13121. ForceSendFields []string `json:"-"`
  13122. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  13123. // include in API requests with the JSON null value. By default, fields
  13124. // with empty values are omitted from API requests. However, any field
  13125. // with an empty value appearing in NullFields will be sent to the
  13126. // server as null. It is an error if a field in this list has a
  13127. // non-empty value. This may be used to include null fields in Patch
  13128. // requests.
  13129. NullFields []string `json:"-"`
  13130. }
  13131. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  13132. type NoMethod InterconnectCircuitInfo
  13133. raw := NoMethod(*s)
  13134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13135. }
  13136. // InterconnectDiagnostics: Diagnostics information about interconnect,
  13137. // contains detailed and current technical information about Google?s
  13138. // side of the connection.
  13139. type InterconnectDiagnostics struct {
  13140. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  13141. // describing individual neighbors currently seen by the Google router
  13142. // in the ARP cache for the Interconnect. This will be empty when the
  13143. // Interconnect is not bundled.
  13144. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  13145. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  13146. // describing the status for each link on the Interconnect.
  13147. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  13148. // MacAddress: The MAC address of the Interconnect's bundle interface.
  13149. MacAddress string `json:"macAddress,omitempty"`
  13150. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  13151. // unconditionally include in API requests. By default, fields with
  13152. // empty values are omitted from API requests. However, any non-pointer,
  13153. // non-interface field appearing in ForceSendFields will be sent to the
  13154. // server regardless of whether the field is empty or not. This may be
  13155. // used to include empty fields in Patch requests.
  13156. ForceSendFields []string `json:"-"`
  13157. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  13158. // API requests with the JSON null value. By default, fields with empty
  13159. // values are omitted from API requests. However, any field with an
  13160. // empty value appearing in NullFields will be sent to the server as
  13161. // null. It is an error if a field in this list has a non-empty value.
  13162. // This may be used to include null fields in Patch requests.
  13163. NullFields []string `json:"-"`
  13164. }
  13165. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  13166. type NoMethod InterconnectDiagnostics
  13167. raw := NoMethod(*s)
  13168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13169. }
  13170. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  13171. // seen on this link
  13172. type InterconnectDiagnosticsARPEntry struct {
  13173. // IpAddress: The IP address of this ARP neighbor.
  13174. IpAddress string `json:"ipAddress,omitempty"`
  13175. // MacAddress: The MAC address of this ARP neighbor.
  13176. MacAddress string `json:"macAddress,omitempty"`
  13177. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  13178. // unconditionally include in API requests. By default, fields with
  13179. // empty values are omitted from API requests. However, any non-pointer,
  13180. // non-interface field appearing in ForceSendFields will be sent to the
  13181. // server regardless of whether the field is empty or not. This may be
  13182. // used to include empty fields in Patch requests.
  13183. ForceSendFields []string `json:"-"`
  13184. // NullFields is a list of field names (e.g. "IpAddress") to include in
  13185. // API requests with the JSON null value. By default, fields with empty
  13186. // values are omitted from API requests. However, any field with an
  13187. // empty value appearing in NullFields will be sent to the server as
  13188. // null. It is an error if a field in this list has a non-empty value.
  13189. // This may be used to include null fields in Patch requests.
  13190. NullFields []string `json:"-"`
  13191. }
  13192. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  13193. type NoMethod InterconnectDiagnosticsARPEntry
  13194. raw := NoMethod(*s)
  13195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13196. }
  13197. type InterconnectDiagnosticsLinkLACPStatus struct {
  13198. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  13199. // exchange.
  13200. GoogleSystemId string `json:"googleSystemId,omitempty"`
  13201. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  13202. // LACP exchange.
  13203. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  13204. // Possible values:
  13205. // "ACTIVE"
  13206. // "DETACHED"
  13207. State string `json:"state,omitempty"`
  13208. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  13209. // unconditionally include in API requests. By default, fields with
  13210. // empty values are omitted from API requests. However, any non-pointer,
  13211. // non-interface field appearing in ForceSendFields will be sent to the
  13212. // server regardless of whether the field is empty or not. This may be
  13213. // used to include empty fields in Patch requests.
  13214. ForceSendFields []string `json:"-"`
  13215. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  13216. // include in API requests with the JSON null value. By default, fields
  13217. // with empty values are omitted from API requests. However, any field
  13218. // with an empty value appearing in NullFields will be sent to the
  13219. // server as null. It is an error if a field in this list has a
  13220. // non-empty value. This may be used to include null fields in Patch
  13221. // requests.
  13222. NullFields []string `json:"-"`
  13223. }
  13224. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  13225. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  13226. raw := NoMethod(*s)
  13227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13228. }
  13229. type InterconnectDiagnosticsLinkOpticalPower struct {
  13230. // Possible values:
  13231. // "HIGH_ALARM"
  13232. // "HIGH_WARNING"
  13233. // "LOW_ALARM"
  13234. // "LOW_WARNING"
  13235. // "OK"
  13236. State string `json:"state,omitempty"`
  13237. // Value: Value of the current optical power, read in dBm. Take a known
  13238. // good optical value, give it a 10% margin and trigger warnings
  13239. // relative to that value. In general, a -7dBm warning and a -11dBm
  13240. // alarm are good optical value estimates for most links.
  13241. Value float64 `json:"value,omitempty"`
  13242. // ForceSendFields is a list of field names (e.g. "State") to
  13243. // unconditionally include in API requests. By default, fields with
  13244. // empty values are omitted from API requests. However, any non-pointer,
  13245. // non-interface field appearing in ForceSendFields will be sent to the
  13246. // server regardless of whether the field is empty or not. This may be
  13247. // used to include empty fields in Patch requests.
  13248. ForceSendFields []string `json:"-"`
  13249. // NullFields is a list of field names (e.g. "State") to include in API
  13250. // requests with the JSON null value. By default, fields with empty
  13251. // values are omitted from API requests. However, any field with an
  13252. // empty value appearing in NullFields will be sent to the server as
  13253. // null. It is an error if a field in this list has a non-empty value.
  13254. // This may be used to include null fields in Patch requests.
  13255. NullFields []string `json:"-"`
  13256. }
  13257. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  13258. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  13259. raw := NoMethod(*s)
  13260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13261. }
  13262. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  13263. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  13264. var s1 struct {
  13265. Value gensupport.JSONFloat64 `json:"value"`
  13266. *NoMethod
  13267. }
  13268. s1.NoMethod = (*NoMethod)(s)
  13269. if err := json.Unmarshal(data, &s1); err != nil {
  13270. return err
  13271. }
  13272. s.Value = float64(s1.Value)
  13273. return nil
  13274. }
  13275. type InterconnectDiagnosticsLinkStatus struct {
  13276. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  13277. // describing the ARP neighbor entries seen on this link. This will be
  13278. // empty if the link is bundled
  13279. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  13280. // CircuitId: The unique ID for this link assigned during turn up by
  13281. // Google.
  13282. CircuitId string `json:"circuitId,omitempty"`
  13283. // GoogleDemarc: The Demarc address assigned by Google and provided in
  13284. // the LoA.
  13285. GoogleDemarc string `json:"googleDemarc,omitempty"`
  13286. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  13287. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  13288. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  13289. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  13290. // unconditionally include in API requests. By default, fields with
  13291. // empty values are omitted from API requests. However, any non-pointer,
  13292. // non-interface field appearing in ForceSendFields will be sent to the
  13293. // server regardless of whether the field is empty or not. This may be
  13294. // used to include empty fields in Patch requests.
  13295. ForceSendFields []string `json:"-"`
  13296. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  13297. // API requests with the JSON null value. By default, fields with empty
  13298. // values are omitted from API requests. However, any field with an
  13299. // empty value appearing in NullFields will be sent to the server as
  13300. // null. It is an error if a field in this list has a non-empty value.
  13301. // This may be used to include null fields in Patch requests.
  13302. NullFields []string `json:"-"`
  13303. }
  13304. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  13305. type NoMethod InterconnectDiagnosticsLinkStatus
  13306. raw := NoMethod(*s)
  13307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13308. }
  13309. // InterconnectList: Response to the list request, and contains a list
  13310. // of interconnects.
  13311. type InterconnectList struct {
  13312. // Id: [Output Only] Unique identifier for the resource; defined by the
  13313. // server.
  13314. Id string `json:"id,omitempty"`
  13315. // Items: A list of Interconnect resources.
  13316. Items []*Interconnect `json:"items,omitempty"`
  13317. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  13318. // for lists of interconnects.
  13319. Kind string `json:"kind,omitempty"`
  13320. // NextPageToken: [Output Only] This token allows you to get the next
  13321. // page of results for list requests. If the number of results is larger
  13322. // than maxResults, use the nextPageToken as a value for the query
  13323. // parameter pageToken in the next list request. Subsequent list
  13324. // requests will have their own nextPageToken to continue paging through
  13325. // the results.
  13326. NextPageToken string `json:"nextPageToken,omitempty"`
  13327. // SelfLink: [Output Only] Server-defined URL for this resource.
  13328. SelfLink string `json:"selfLink,omitempty"`
  13329. // Warning: [Output Only] Informational warning message.
  13330. Warning *InterconnectListWarning `json:"warning,omitempty"`
  13331. // ServerResponse contains the HTTP response code and headers from the
  13332. // server.
  13333. googleapi.ServerResponse `json:"-"`
  13334. // ForceSendFields is a list of field names (e.g. "Id") to
  13335. // unconditionally include in API requests. By default, fields with
  13336. // empty values are omitted from API requests. However, any non-pointer,
  13337. // non-interface field appearing in ForceSendFields will be sent to the
  13338. // server regardless of whether the field is empty or not. This may be
  13339. // used to include empty fields in Patch requests.
  13340. ForceSendFields []string `json:"-"`
  13341. // NullFields is a list of field names (e.g. "Id") to include in API
  13342. // requests with the JSON null value. By default, fields with empty
  13343. // values are omitted from API requests. However, any field with an
  13344. // empty value appearing in NullFields will be sent to the server as
  13345. // null. It is an error if a field in this list has a non-empty value.
  13346. // This may be used to include null fields in Patch requests.
  13347. NullFields []string `json:"-"`
  13348. }
  13349. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  13350. type NoMethod InterconnectList
  13351. raw := NoMethod(*s)
  13352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13353. }
  13354. // InterconnectListWarning: [Output Only] Informational warning message.
  13355. type InterconnectListWarning struct {
  13356. // Code: [Output Only] A warning code, if applicable. For example,
  13357. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13358. // the response.
  13359. //
  13360. // Possible values:
  13361. // "CLEANUP_FAILED"
  13362. // "DEPRECATED_RESOURCE_USED"
  13363. // "DEPRECATED_TYPE_USED"
  13364. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13365. // "EXPERIMENTAL_TYPE_USED"
  13366. // "EXTERNAL_API_WARNING"
  13367. // "FIELD_VALUE_OVERRIDEN"
  13368. // "INJECTED_KERNELS_DEPRECATED"
  13369. // "MISSING_TYPE_DEPENDENCY"
  13370. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13371. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13372. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13373. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13374. // "NEXT_HOP_NOT_RUNNING"
  13375. // "NOT_CRITICAL_ERROR"
  13376. // "NO_RESULTS_ON_PAGE"
  13377. // "REQUIRED_TOS_AGREEMENT"
  13378. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13379. // "RESOURCE_NOT_DELETED"
  13380. // "SCHEMA_VALIDATION_IGNORED"
  13381. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13382. // "UNDECLARED_PROPERTIES"
  13383. // "UNREACHABLE"
  13384. Code string `json:"code,omitempty"`
  13385. // Data: [Output Only] Metadata about this warning in key: value format.
  13386. // For example:
  13387. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13388. Data []*InterconnectListWarningData `json:"data,omitempty"`
  13389. // Message: [Output Only] A human-readable description of the warning
  13390. // code.
  13391. Message string `json:"message,omitempty"`
  13392. // ForceSendFields is a list of field names (e.g. "Code") to
  13393. // unconditionally include in API requests. By default, fields with
  13394. // empty values are omitted from API requests. However, any non-pointer,
  13395. // non-interface field appearing in ForceSendFields will be sent to the
  13396. // server regardless of whether the field is empty or not. This may be
  13397. // used to include empty fields in Patch requests.
  13398. ForceSendFields []string `json:"-"`
  13399. // NullFields is a list of field names (e.g. "Code") to include in API
  13400. // requests with the JSON null value. By default, fields with empty
  13401. // values are omitted from API requests. However, any field with an
  13402. // empty value appearing in NullFields will be sent to the server as
  13403. // null. It is an error if a field in this list has a non-empty value.
  13404. // This may be used to include null fields in Patch requests.
  13405. NullFields []string `json:"-"`
  13406. }
  13407. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  13408. type NoMethod InterconnectListWarning
  13409. raw := NoMethod(*s)
  13410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13411. }
  13412. type InterconnectListWarningData struct {
  13413. // Key: [Output Only] A key that provides more detail on the warning
  13414. // being returned. For example, for warnings where there are no results
  13415. // in a list request for a particular zone, this key might be scope and
  13416. // the key value might be the zone name. Other examples might be a key
  13417. // indicating a deprecated resource and a suggested replacement, or a
  13418. // warning about invalid network settings (for example, if an instance
  13419. // attempts to perform IP forwarding but is not enabled for IP
  13420. // forwarding).
  13421. Key string `json:"key,omitempty"`
  13422. // Value: [Output Only] A warning data value corresponding to the key.
  13423. Value string `json:"value,omitempty"`
  13424. // ForceSendFields is a list of field names (e.g. "Key") to
  13425. // unconditionally include in API requests. By default, fields with
  13426. // empty values are omitted from API requests. However, any non-pointer,
  13427. // non-interface field appearing in ForceSendFields will be sent to the
  13428. // server regardless of whether the field is empty or not. This may be
  13429. // used to include empty fields in Patch requests.
  13430. ForceSendFields []string `json:"-"`
  13431. // NullFields is a list of field names (e.g. "Key") to include in API
  13432. // requests with the JSON null value. By default, fields with empty
  13433. // values are omitted from API requests. However, any field with an
  13434. // empty value appearing in NullFields will be sent to the server as
  13435. // null. It is an error if a field in this list has a non-empty value.
  13436. // This may be used to include null fields in Patch requests.
  13437. NullFields []string `json:"-"`
  13438. }
  13439. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  13440. type NoMethod InterconnectListWarningData
  13441. raw := NoMethod(*s)
  13442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13443. }
  13444. // InterconnectLocation: Represents an InterconnectLocations resource.
  13445. // The InterconnectLocations resource describes the locations where you
  13446. // can connect to Google's networks. For more information, see
  13447. // Colocation Facilities.
  13448. type InterconnectLocation struct {
  13449. // Address: [Output Only] The postal address of the Point of Presence,
  13450. // each line in the address is separated by a newline character.
  13451. Address string `json:"address,omitempty"`
  13452. // AvailabilityZone: [Output Only] Availability zone for this
  13453. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  13454. // will not be simultaneously scheduled in more than one availability
  13455. // zone. Example: "zone1" or "zone2".
  13456. AvailabilityZone string `json:"availabilityZone,omitempty"`
  13457. // City: [Output Only] Metropolitan area designator that indicates which
  13458. // city an interconnect is located. For example: "Chicago, IL",
  13459. // "Amsterdam, Netherlands".
  13460. City string `json:"city,omitempty"`
  13461. // Continent: [Output Only] Continent for this location.
  13462. //
  13463. // Possible values:
  13464. // "AFRICA"
  13465. // "ASIA_PAC"
  13466. // "C_AFRICA"
  13467. // "C_ASIA_PAC"
  13468. // "C_EUROPE"
  13469. // "C_NORTH_AMERICA"
  13470. // "C_SOUTH_AMERICA"
  13471. // "EUROPE"
  13472. // "NORTH_AMERICA"
  13473. // "SOUTH_AMERICA"
  13474. Continent string `json:"continent,omitempty"`
  13475. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13476. // format.
  13477. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13478. // Description: [Output Only] An optional description of the resource.
  13479. Description string `json:"description,omitempty"`
  13480. // FacilityProvider: [Output Only] The name of the provider for this
  13481. // facility (e.g., EQUINIX).
  13482. FacilityProvider string `json:"facilityProvider,omitempty"`
  13483. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  13484. // Identifier for this facility (e.g., Ashburn-DC1).
  13485. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  13486. // Id: [Output Only] The unique identifier for the resource. This
  13487. // identifier is defined by the server.
  13488. Id uint64 `json:"id,omitempty,string"`
  13489. // Kind: [Output Only] Type of the resource. Always
  13490. // compute#interconnectLocation for interconnect locations.
  13491. Kind string `json:"kind,omitempty"`
  13492. // Name: [Output Only] Name of the resource.
  13493. Name string `json:"name,omitempty"`
  13494. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  13495. // facility (corresponding with a netfac type in peeringdb).
  13496. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  13497. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  13498. // objects, that describe parameters pertaining to the relation between
  13499. // this InterconnectLocation and various Google Cloud regions.
  13500. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  13501. // SelfLink: [Output Only] Server-defined URL for the resource.
  13502. SelfLink string `json:"selfLink,omitempty"`
  13503. // Status: [Output Only] The status of this InterconnectLocation. If the
  13504. // status is AVAILABLE, new Interconnects may be provisioned in this
  13505. // InterconnectLocation. Otherwise, no new Interconnects may be
  13506. // provisioned.
  13507. //
  13508. // Possible values:
  13509. // "AVAILABLE"
  13510. // "CLOSED"
  13511. Status string `json:"status,omitempty"`
  13512. // ServerResponse contains the HTTP response code and headers from the
  13513. // server.
  13514. googleapi.ServerResponse `json:"-"`
  13515. // ForceSendFields is a list of field names (e.g. "Address") to
  13516. // unconditionally include in API requests. By default, fields with
  13517. // empty values are omitted from API requests. However, any non-pointer,
  13518. // non-interface field appearing in ForceSendFields will be sent to the
  13519. // server regardless of whether the field is empty or not. This may be
  13520. // used to include empty fields in Patch requests.
  13521. ForceSendFields []string `json:"-"`
  13522. // NullFields is a list of field names (e.g. "Address") to include in
  13523. // API requests with the JSON null value. By default, fields with empty
  13524. // values are omitted from API requests. However, any field with an
  13525. // empty value appearing in NullFields will be sent to the server as
  13526. // null. It is an error if a field in this list has a non-empty value.
  13527. // This may be used to include null fields in Patch requests.
  13528. NullFields []string `json:"-"`
  13529. }
  13530. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  13531. type NoMethod InterconnectLocation
  13532. raw := NoMethod(*s)
  13533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13534. }
  13535. // InterconnectLocationList: Response to the list request, and contains
  13536. // a list of interconnect locations.
  13537. type InterconnectLocationList struct {
  13538. // Id: [Output Only] Unique identifier for the resource; defined by the
  13539. // server.
  13540. Id string `json:"id,omitempty"`
  13541. // Items: A list of InterconnectLocation resources.
  13542. Items []*InterconnectLocation `json:"items,omitempty"`
  13543. // Kind: [Output Only] Type of resource. Always
  13544. // compute#interconnectLocationList for lists of interconnect locations.
  13545. Kind string `json:"kind,omitempty"`
  13546. // NextPageToken: [Output Only] This token allows you to get the next
  13547. // page of results for list requests. If the number of results is larger
  13548. // than maxResults, use the nextPageToken as a value for the query
  13549. // parameter pageToken in the next list request. Subsequent list
  13550. // requests will have their own nextPageToken to continue paging through
  13551. // the results.
  13552. NextPageToken string `json:"nextPageToken,omitempty"`
  13553. // SelfLink: [Output Only] Server-defined URL for this resource.
  13554. SelfLink string `json:"selfLink,omitempty"`
  13555. // Warning: [Output Only] Informational warning message.
  13556. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  13557. // ServerResponse contains the HTTP response code and headers from the
  13558. // server.
  13559. googleapi.ServerResponse `json:"-"`
  13560. // ForceSendFields is a list of field names (e.g. "Id") to
  13561. // unconditionally include in API requests. By default, fields with
  13562. // empty values are omitted from API requests. However, any non-pointer,
  13563. // non-interface field appearing in ForceSendFields will be sent to the
  13564. // server regardless of whether the field is empty or not. This may be
  13565. // used to include empty fields in Patch requests.
  13566. ForceSendFields []string `json:"-"`
  13567. // NullFields is a list of field names (e.g. "Id") to include in API
  13568. // requests with the JSON null value. By default, fields with empty
  13569. // values are omitted from API requests. However, any field with an
  13570. // empty value appearing in NullFields will be sent to the server as
  13571. // null. It is an error if a field in this list has a non-empty value.
  13572. // This may be used to include null fields in Patch requests.
  13573. NullFields []string `json:"-"`
  13574. }
  13575. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  13576. type NoMethod InterconnectLocationList
  13577. raw := NoMethod(*s)
  13578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13579. }
  13580. // InterconnectLocationListWarning: [Output Only] Informational warning
  13581. // message.
  13582. type InterconnectLocationListWarning struct {
  13583. // Code: [Output Only] A warning code, if applicable. For example,
  13584. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13585. // the response.
  13586. //
  13587. // Possible values:
  13588. // "CLEANUP_FAILED"
  13589. // "DEPRECATED_RESOURCE_USED"
  13590. // "DEPRECATED_TYPE_USED"
  13591. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13592. // "EXPERIMENTAL_TYPE_USED"
  13593. // "EXTERNAL_API_WARNING"
  13594. // "FIELD_VALUE_OVERRIDEN"
  13595. // "INJECTED_KERNELS_DEPRECATED"
  13596. // "MISSING_TYPE_DEPENDENCY"
  13597. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13598. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13599. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13600. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13601. // "NEXT_HOP_NOT_RUNNING"
  13602. // "NOT_CRITICAL_ERROR"
  13603. // "NO_RESULTS_ON_PAGE"
  13604. // "REQUIRED_TOS_AGREEMENT"
  13605. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13606. // "RESOURCE_NOT_DELETED"
  13607. // "SCHEMA_VALIDATION_IGNORED"
  13608. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13609. // "UNDECLARED_PROPERTIES"
  13610. // "UNREACHABLE"
  13611. Code string `json:"code,omitempty"`
  13612. // Data: [Output Only] Metadata about this warning in key: value format.
  13613. // For example:
  13614. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13615. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  13616. // Message: [Output Only] A human-readable description of the warning
  13617. // code.
  13618. Message string `json:"message,omitempty"`
  13619. // ForceSendFields is a list of field names (e.g. "Code") to
  13620. // unconditionally include in API requests. By default, fields with
  13621. // empty values are omitted from API requests. However, any non-pointer,
  13622. // non-interface field appearing in ForceSendFields will be sent to the
  13623. // server regardless of whether the field is empty or not. This may be
  13624. // used to include empty fields in Patch requests.
  13625. ForceSendFields []string `json:"-"`
  13626. // NullFields is a list of field names (e.g. "Code") to include in API
  13627. // requests with the JSON null value. By default, fields with empty
  13628. // values are omitted from API requests. However, any field with an
  13629. // empty value appearing in NullFields will be sent to the server as
  13630. // null. It is an error if a field in this list has a non-empty value.
  13631. // This may be used to include null fields in Patch requests.
  13632. NullFields []string `json:"-"`
  13633. }
  13634. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  13635. type NoMethod InterconnectLocationListWarning
  13636. raw := NoMethod(*s)
  13637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13638. }
  13639. type InterconnectLocationListWarningData struct {
  13640. // Key: [Output Only] A key that provides more detail on the warning
  13641. // being returned. For example, for warnings where there are no results
  13642. // in a list request for a particular zone, this key might be scope and
  13643. // the key value might be the zone name. Other examples might be a key
  13644. // indicating a deprecated resource and a suggested replacement, or a
  13645. // warning about invalid network settings (for example, if an instance
  13646. // attempts to perform IP forwarding but is not enabled for IP
  13647. // forwarding).
  13648. Key string `json:"key,omitempty"`
  13649. // Value: [Output Only] A warning data value corresponding to the key.
  13650. Value string `json:"value,omitempty"`
  13651. // ForceSendFields is a list of field names (e.g. "Key") to
  13652. // unconditionally include in API requests. By default, fields with
  13653. // empty values are omitted from API requests. However, any non-pointer,
  13654. // non-interface field appearing in ForceSendFields will be sent to the
  13655. // server regardless of whether the field is empty or not. This may be
  13656. // used to include empty fields in Patch requests.
  13657. ForceSendFields []string `json:"-"`
  13658. // NullFields is a list of field names (e.g. "Key") to include in API
  13659. // requests with the JSON null value. By default, fields with empty
  13660. // values are omitted from API requests. However, any field with an
  13661. // empty value appearing in NullFields will be sent to the server as
  13662. // null. It is an error if a field in this list has a non-empty value.
  13663. // This may be used to include null fields in Patch requests.
  13664. NullFields []string `json:"-"`
  13665. }
  13666. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  13667. type NoMethod InterconnectLocationListWarningData
  13668. raw := NoMethod(*s)
  13669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13670. }
  13671. // InterconnectLocationRegionInfo: Information about any potential
  13672. // InterconnectAttachments between an Interconnect at a specific
  13673. // InterconnectLocation, and a specific Cloud Region.
  13674. type InterconnectLocationRegionInfo struct {
  13675. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  13676. // InterconnectLocation to a VM in this region.
  13677. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  13678. // LocationPresence: Identifies the network presence of this location.
  13679. //
  13680. // Possible values:
  13681. // "GLOBAL"
  13682. // "LOCAL_REGION"
  13683. // "LP_GLOBAL"
  13684. // "LP_LOCAL_REGION"
  13685. LocationPresence string `json:"locationPresence,omitempty"`
  13686. // Region: URL for the region of this location.
  13687. Region string `json:"region,omitempty"`
  13688. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  13689. // unconditionally include in API requests. By default, fields with
  13690. // empty values are omitted from API requests. However, any non-pointer,
  13691. // non-interface field appearing in ForceSendFields will be sent to the
  13692. // server regardless of whether the field is empty or not. This may be
  13693. // used to include empty fields in Patch requests.
  13694. ForceSendFields []string `json:"-"`
  13695. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  13696. // in API requests with the JSON null value. By default, fields with
  13697. // empty values are omitted from API requests. However, any field with
  13698. // an empty value appearing in NullFields will be sent to the server as
  13699. // null. It is an error if a field in this list has a non-empty value.
  13700. // This may be used to include null fields in Patch requests.
  13701. NullFields []string `json:"-"`
  13702. }
  13703. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  13704. type NoMethod InterconnectLocationRegionInfo
  13705. raw := NoMethod(*s)
  13706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13707. }
  13708. // InterconnectOutageNotification: Description of a planned outage on
  13709. // this Interconnect. Next id: 9
  13710. type InterconnectOutageNotification struct {
  13711. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  13712. // Google-side circuit IDs that will be affected.
  13713. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  13714. // Description: A description about the purpose of the outage.
  13715. Description string `json:"description,omitempty"`
  13716. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  13717. // epoch).
  13718. EndTime int64 `json:"endTime,omitempty,string"`
  13719. // IssueType: Form this outage is expected to take. Note that the "IT_"
  13720. // versions of this enum have been deprecated in favor of the unprefixed
  13721. // values.
  13722. //
  13723. // Possible values:
  13724. // "IT_OUTAGE"
  13725. // "IT_PARTIAL_OUTAGE"
  13726. // "OUTAGE"
  13727. // "PARTIAL_OUTAGE"
  13728. IssueType string `json:"issueType,omitempty"`
  13729. // Name: Unique identifier for this outage notification.
  13730. Name string `json:"name,omitempty"`
  13731. // Source: The party that generated this notification. Note that
  13732. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  13733. //
  13734. // Possible values:
  13735. // "GOOGLE"
  13736. // "NSRC_GOOGLE"
  13737. Source string `json:"source,omitempty"`
  13738. // StartTime: Scheduled start time for the outage (milliseconds since
  13739. // Unix epoch).
  13740. StartTime int64 `json:"startTime,omitempty,string"`
  13741. // State: State of this notification. Note that the "NS_" versions of
  13742. // this enum have been deprecated in favor of the unprefixed values.
  13743. //
  13744. // Possible values:
  13745. // "ACTIVE"
  13746. // "CANCELLED"
  13747. // "NS_ACTIVE"
  13748. // "NS_CANCELED"
  13749. State string `json:"state,omitempty"`
  13750. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  13751. // unconditionally include in API requests. By default, fields with
  13752. // empty values are omitted from API requests. However, any non-pointer,
  13753. // non-interface field appearing in ForceSendFields will be sent to the
  13754. // server regardless of whether the field is empty or not. This may be
  13755. // used to include empty fields in Patch requests.
  13756. ForceSendFields []string `json:"-"`
  13757. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  13758. // include in API requests with the JSON null value. By default, fields
  13759. // with empty values are omitted from API requests. However, any field
  13760. // with an empty value appearing in NullFields will be sent to the
  13761. // server as null. It is an error if a field in this list has a
  13762. // non-empty value. This may be used to include null fields in Patch
  13763. // requests.
  13764. NullFields []string `json:"-"`
  13765. }
  13766. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  13767. type NoMethod InterconnectOutageNotification
  13768. raw := NoMethod(*s)
  13769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13770. }
  13771. // InterconnectsGetDiagnosticsResponse: Response for the
  13772. // InterconnectsGetDiagnosticsRequest.
  13773. type InterconnectsGetDiagnosticsResponse struct {
  13774. Result *InterconnectDiagnostics `json:"result,omitempty"`
  13775. // ServerResponse contains the HTTP response code and headers from the
  13776. // server.
  13777. googleapi.ServerResponse `json:"-"`
  13778. // ForceSendFields is a list of field names (e.g. "Result") to
  13779. // unconditionally include in API requests. By default, fields with
  13780. // empty values are omitted from API requests. However, any non-pointer,
  13781. // non-interface field appearing in ForceSendFields will be sent to the
  13782. // server regardless of whether the field is empty or not. This may be
  13783. // used to include empty fields in Patch requests.
  13784. ForceSendFields []string `json:"-"`
  13785. // NullFields is a list of field names (e.g. "Result") to include in API
  13786. // requests with the JSON null value. By default, fields with empty
  13787. // values are omitted from API requests. However, any field with an
  13788. // empty value appearing in NullFields will be sent to the server as
  13789. // null. It is an error if a field in this list has a non-empty value.
  13790. // This may be used to include null fields in Patch requests.
  13791. NullFields []string `json:"-"`
  13792. }
  13793. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  13794. type NoMethod InterconnectsGetDiagnosticsResponse
  13795. raw := NoMethod(*s)
  13796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13797. }
  13798. // License: A license resource.
  13799. type License struct {
  13800. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  13801. // reflects whether a license charges a usage fee.
  13802. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  13803. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13804. // format.
  13805. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13806. // Description: An optional textual description of the resource;
  13807. // provided by the client when the resource is created.
  13808. Description string `json:"description,omitempty"`
  13809. // Id: [Output Only] The unique identifier for the resource. This
  13810. // identifier is defined by the server.
  13811. Id uint64 `json:"id,omitempty,string"`
  13812. // Kind: [Output Only] Type of resource. Always compute#license for
  13813. // licenses.
  13814. Kind string `json:"kind,omitempty"`
  13815. // LicenseCode: [Output Only] The unique code used to attach this
  13816. // license to images, snapshots, and disks.
  13817. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  13818. // Name: Name of the resource. The name must be 1-63 characters long and
  13819. // comply with RFC1035.
  13820. Name string `json:"name,omitempty"`
  13821. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  13822. // SelfLink: [Output Only] Server-defined URL for the resource.
  13823. SelfLink string `json:"selfLink,omitempty"`
  13824. // Transferable: If false, licenses will not be copied from the source
  13825. // resource when creating an image from a disk, disk from snapshot, or
  13826. // snapshot from disk.
  13827. Transferable bool `json:"transferable,omitempty"`
  13828. // ServerResponse contains the HTTP response code and headers from the
  13829. // server.
  13830. googleapi.ServerResponse `json:"-"`
  13831. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  13832. // unconditionally include in API requests. By default, fields with
  13833. // empty values are omitted from API requests. However, any non-pointer,
  13834. // non-interface field appearing in ForceSendFields will be sent to the
  13835. // server regardless of whether the field is empty or not. This may be
  13836. // used to include empty fields in Patch requests.
  13837. ForceSendFields []string `json:"-"`
  13838. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  13839. // in API requests with the JSON null value. By default, fields with
  13840. // empty values are omitted from API requests. However, any field with
  13841. // an empty value appearing in NullFields will be sent to the server as
  13842. // null. It is an error if a field in this list has a non-empty value.
  13843. // This may be used to include null fields in Patch requests.
  13844. NullFields []string `json:"-"`
  13845. }
  13846. func (s *License) MarshalJSON() ([]byte, error) {
  13847. type NoMethod License
  13848. raw := NoMethod(*s)
  13849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13850. }
  13851. type LicenseCode struct {
  13852. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13853. // format.
  13854. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13855. // Description: [Output Only] Description of this License Code.
  13856. Description string `json:"description,omitempty"`
  13857. // Id: [Output Only] The unique identifier for the resource. This
  13858. // identifier is defined by the server.
  13859. Id uint64 `json:"id,omitempty,string"`
  13860. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  13861. // licenses.
  13862. Kind string `json:"kind,omitempty"`
  13863. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  13864. // with the same License Code.
  13865. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  13866. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  13867. // long and must be a valid 64 bit integer.
  13868. Name string `json:"name,omitempty"`
  13869. // SelfLink: [Output Only] Server-defined URL for the resource.
  13870. SelfLink string `json:"selfLink,omitempty"`
  13871. // State: [Output Only] Current state of this License Code.
  13872. //
  13873. // Possible values:
  13874. // "DISABLED"
  13875. // "ENABLED"
  13876. // "RESTRICTED"
  13877. // "STATE_UNSPECIFIED"
  13878. // "TERMINATED"
  13879. State string `json:"state,omitempty"`
  13880. // Transferable: [Output Only] If true, the license will remain attached
  13881. // when creating images or snapshots from disks. Otherwise, the license
  13882. // is not transferred.
  13883. Transferable bool `json:"transferable,omitempty"`
  13884. // ServerResponse contains the HTTP response code and headers from the
  13885. // server.
  13886. googleapi.ServerResponse `json:"-"`
  13887. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  13888. // to unconditionally include in API requests. By default, fields with
  13889. // empty values are omitted from API requests. However, any non-pointer,
  13890. // non-interface field appearing in ForceSendFields will be sent to the
  13891. // server regardless of whether the field is empty or not. This may be
  13892. // used to include empty fields in Patch requests.
  13893. ForceSendFields []string `json:"-"`
  13894. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  13895. // include in API requests with the JSON null value. By default, fields
  13896. // with empty values are omitted from API requests. However, any field
  13897. // with an empty value appearing in NullFields will be sent to the
  13898. // server as null. It is an error if a field in this list has a
  13899. // non-empty value. This may be used to include null fields in Patch
  13900. // requests.
  13901. NullFields []string `json:"-"`
  13902. }
  13903. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  13904. type NoMethod LicenseCode
  13905. raw := NoMethod(*s)
  13906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13907. }
  13908. type LicenseCodeLicenseAlias struct {
  13909. // Description: [Output Only] Description of this License Code.
  13910. Description string `json:"description,omitempty"`
  13911. // SelfLink: [Output Only] URL of license corresponding to this License
  13912. // Code.
  13913. SelfLink string `json:"selfLink,omitempty"`
  13914. // ForceSendFields is a list of field names (e.g. "Description") to
  13915. // unconditionally include in API requests. By default, fields with
  13916. // empty values are omitted from API requests. However, any non-pointer,
  13917. // non-interface field appearing in ForceSendFields will be sent to the
  13918. // server regardless of whether the field is empty or not. This may be
  13919. // used to include empty fields in Patch requests.
  13920. ForceSendFields []string `json:"-"`
  13921. // NullFields is a list of field names (e.g. "Description") to include
  13922. // in API requests with the JSON null value. By default, fields with
  13923. // empty values are omitted from API requests. However, any field with
  13924. // an empty value appearing in NullFields will be sent to the server as
  13925. // null. It is an error if a field in this list has a non-empty value.
  13926. // This may be used to include null fields in Patch requests.
  13927. NullFields []string `json:"-"`
  13928. }
  13929. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  13930. type NoMethod LicenseCodeLicenseAlias
  13931. raw := NoMethod(*s)
  13932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13933. }
  13934. type LicenseResourceRequirements struct {
  13935. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  13936. // Instance. Enforced at Instance creation and Instance start.
  13937. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  13938. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  13939. // Instance creation and Instance start.
  13940. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  13941. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  13942. // unconditionally include in API requests. By default, fields with
  13943. // empty values are omitted from API requests. However, any non-pointer,
  13944. // non-interface field appearing in ForceSendFields will be sent to the
  13945. // server regardless of whether the field is empty or not. This may be
  13946. // used to include empty fields in Patch requests.
  13947. ForceSendFields []string `json:"-"`
  13948. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  13949. // include in API requests with the JSON null value. By default, fields
  13950. // with empty values are omitted from API requests. However, any field
  13951. // with an empty value appearing in NullFields will be sent to the
  13952. // server as null. It is an error if a field in this list has a
  13953. // non-empty value. This may be used to include null fields in Patch
  13954. // requests.
  13955. NullFields []string `json:"-"`
  13956. }
  13957. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  13958. type NoMethod LicenseResourceRequirements
  13959. raw := NoMethod(*s)
  13960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13961. }
  13962. type LicensesListResponse struct {
  13963. // Id: [Output Only] Unique identifier for the resource; defined by the
  13964. // server.
  13965. Id string `json:"id,omitempty"`
  13966. // Items: A list of License resources.
  13967. Items []*License `json:"items,omitempty"`
  13968. // NextPageToken: [Output Only] This token allows you to get the next
  13969. // page of results for list requests. If the number of results is larger
  13970. // than maxResults, use the nextPageToken as a value for the query
  13971. // parameter pageToken in the next list request. Subsequent list
  13972. // requests will have their own nextPageToken to continue paging through
  13973. // the results.
  13974. NextPageToken string `json:"nextPageToken,omitempty"`
  13975. // SelfLink: [Output Only] Server-defined URL for this resource.
  13976. SelfLink string `json:"selfLink,omitempty"`
  13977. // Warning: [Output Only] Informational warning message.
  13978. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  13979. // ServerResponse contains the HTTP response code and headers from the
  13980. // server.
  13981. googleapi.ServerResponse `json:"-"`
  13982. // ForceSendFields is a list of field names (e.g. "Id") to
  13983. // unconditionally include in API requests. By default, fields with
  13984. // empty values are omitted from API requests. However, any non-pointer,
  13985. // non-interface field appearing in ForceSendFields will be sent to the
  13986. // server regardless of whether the field is empty or not. This may be
  13987. // used to include empty fields in Patch requests.
  13988. ForceSendFields []string `json:"-"`
  13989. // NullFields is a list of field names (e.g. "Id") to include in API
  13990. // requests with the JSON null value. By default, fields with empty
  13991. // values are omitted from API requests. However, any field with an
  13992. // empty value appearing in NullFields will be sent to the server as
  13993. // null. It is an error if a field in this list has a non-empty value.
  13994. // This may be used to include null fields in Patch requests.
  13995. NullFields []string `json:"-"`
  13996. }
  13997. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  13998. type NoMethod LicensesListResponse
  13999. raw := NoMethod(*s)
  14000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14001. }
  14002. // LicensesListResponseWarning: [Output Only] Informational warning
  14003. // message.
  14004. type LicensesListResponseWarning struct {
  14005. // Code: [Output Only] A warning code, if applicable. For example,
  14006. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14007. // the response.
  14008. //
  14009. // Possible values:
  14010. // "CLEANUP_FAILED"
  14011. // "DEPRECATED_RESOURCE_USED"
  14012. // "DEPRECATED_TYPE_USED"
  14013. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14014. // "EXPERIMENTAL_TYPE_USED"
  14015. // "EXTERNAL_API_WARNING"
  14016. // "FIELD_VALUE_OVERRIDEN"
  14017. // "INJECTED_KERNELS_DEPRECATED"
  14018. // "MISSING_TYPE_DEPENDENCY"
  14019. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14020. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14021. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14022. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14023. // "NEXT_HOP_NOT_RUNNING"
  14024. // "NOT_CRITICAL_ERROR"
  14025. // "NO_RESULTS_ON_PAGE"
  14026. // "REQUIRED_TOS_AGREEMENT"
  14027. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14028. // "RESOURCE_NOT_DELETED"
  14029. // "SCHEMA_VALIDATION_IGNORED"
  14030. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14031. // "UNDECLARED_PROPERTIES"
  14032. // "UNREACHABLE"
  14033. Code string `json:"code,omitempty"`
  14034. // Data: [Output Only] Metadata about this warning in key: value format.
  14035. // For example:
  14036. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14037. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  14038. // Message: [Output Only] A human-readable description of the warning
  14039. // code.
  14040. Message string `json:"message,omitempty"`
  14041. // ForceSendFields is a list of field names (e.g. "Code") to
  14042. // unconditionally include in API requests. By default, fields with
  14043. // empty values are omitted from API requests. However, any non-pointer,
  14044. // non-interface field appearing in ForceSendFields will be sent to the
  14045. // server regardless of whether the field is empty or not. This may be
  14046. // used to include empty fields in Patch requests.
  14047. ForceSendFields []string `json:"-"`
  14048. // NullFields is a list of field names (e.g. "Code") to include in API
  14049. // requests with the JSON null value. By default, fields with empty
  14050. // values are omitted from API requests. However, any field with an
  14051. // empty value appearing in NullFields will be sent to the server as
  14052. // null. It is an error if a field in this list has a non-empty value.
  14053. // This may be used to include null fields in Patch requests.
  14054. NullFields []string `json:"-"`
  14055. }
  14056. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  14057. type NoMethod LicensesListResponseWarning
  14058. raw := NoMethod(*s)
  14059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14060. }
  14061. type LicensesListResponseWarningData struct {
  14062. // Key: [Output Only] A key that provides more detail on the warning
  14063. // being returned. For example, for warnings where there are no results
  14064. // in a list request for a particular zone, this key might be scope and
  14065. // the key value might be the zone name. Other examples might be a key
  14066. // indicating a deprecated resource and a suggested replacement, or a
  14067. // warning about invalid network settings (for example, if an instance
  14068. // attempts to perform IP forwarding but is not enabled for IP
  14069. // forwarding).
  14070. Key string `json:"key,omitempty"`
  14071. // Value: [Output Only] A warning data value corresponding to the key.
  14072. Value string `json:"value,omitempty"`
  14073. // ForceSendFields is a list of field names (e.g. "Key") to
  14074. // unconditionally include in API requests. By default, fields with
  14075. // empty values are omitted from API requests. However, any non-pointer,
  14076. // non-interface field appearing in ForceSendFields will be sent to the
  14077. // server regardless of whether the field is empty or not. This may be
  14078. // used to include empty fields in Patch requests.
  14079. ForceSendFields []string `json:"-"`
  14080. // NullFields is a list of field names (e.g. "Key") to include in API
  14081. // requests with the JSON null value. By default, fields with empty
  14082. // values are omitted from API requests. However, any field with an
  14083. // empty value appearing in NullFields will be sent to the server as
  14084. // null. It is an error if a field in this list has a non-empty value.
  14085. // This may be used to include null fields in Patch requests.
  14086. NullFields []string `json:"-"`
  14087. }
  14088. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  14089. type NoMethod LicensesListResponseWarningData
  14090. raw := NoMethod(*s)
  14091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14092. }
  14093. // LogConfig: Specifies what kind of log the caller must write
  14094. type LogConfig struct {
  14095. // CloudAudit: Cloud audit options.
  14096. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  14097. // Counter: Counter options.
  14098. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  14099. // DataAccess: Data access options.
  14100. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  14101. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  14102. // unconditionally include in API requests. By default, fields with
  14103. // empty values are omitted from API requests. However, any non-pointer,
  14104. // non-interface field appearing in ForceSendFields will be sent to the
  14105. // server regardless of whether the field is empty or not. This may be
  14106. // used to include empty fields in Patch requests.
  14107. ForceSendFields []string `json:"-"`
  14108. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  14109. // API requests with the JSON null value. By default, fields with empty
  14110. // values are omitted from API requests. However, any field with an
  14111. // empty value appearing in NullFields will be sent to the server as
  14112. // null. It is an error if a field in this list has a non-empty value.
  14113. // This may be used to include null fields in Patch requests.
  14114. NullFields []string `json:"-"`
  14115. }
  14116. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  14117. type NoMethod LogConfig
  14118. raw := NoMethod(*s)
  14119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14120. }
  14121. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  14122. type LogConfigCloudAuditOptions struct {
  14123. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  14124. // Logging pipeline.
  14125. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  14126. // LogName: The log_name to populate in the Cloud Audit Record.
  14127. //
  14128. // Possible values:
  14129. // "ADMIN_ACTIVITY"
  14130. // "DATA_ACCESS"
  14131. // "UNSPECIFIED_LOG_NAME"
  14132. LogName string `json:"logName,omitempty"`
  14133. // ForceSendFields is a list of field names (e.g.
  14134. // "AuthorizationLoggingOptions") to unconditionally include in API
  14135. // requests. By default, fields with empty values are omitted from API
  14136. // requests. However, any non-pointer, non-interface field appearing in
  14137. // ForceSendFields will be sent to the server regardless of whether the
  14138. // field is empty or not. This may be used to include empty fields in
  14139. // Patch requests.
  14140. ForceSendFields []string `json:"-"`
  14141. // NullFields is a list of field names (e.g.
  14142. // "AuthorizationLoggingOptions") to include in API requests with the
  14143. // JSON null value. By default, fields with empty values are omitted
  14144. // from API requests. However, any field with an empty value appearing
  14145. // in NullFields will be sent to the server as null. It is an error if a
  14146. // field in this list has a non-empty value. This may be used to include
  14147. // null fields in Patch requests.
  14148. NullFields []string `json:"-"`
  14149. }
  14150. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  14151. type NoMethod LogConfigCloudAuditOptions
  14152. raw := NoMethod(*s)
  14153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14154. }
  14155. // LogConfigCounterOptions: Increment a streamz counter with the
  14156. // specified metric and field names.
  14157. //
  14158. // Metric names should start with a '/', generally be lowercase-only,
  14159. // and end in "_count". Field names should not contain an initial slash.
  14160. // The actual exported metric names will have "/iam/policy"
  14161. // prepended.
  14162. //
  14163. // Field names correspond to IAM request parameters and field values are
  14164. // their respective values.
  14165. //
  14166. // Supported field names: - "authority", which is "[token]" if
  14167. // IAMContext.token is present, otherwise the value of
  14168. // IAMContext.authority_selector if present, and otherwise a
  14169. // representation of IAMContext.principal; or - "iam_principal", a
  14170. // representation of IAMContext.principal even if a token or authority
  14171. // selector is present; or - "" (empty string), resulting in a counter
  14172. // with no fields.
  14173. //
  14174. // Examples: counter { metric: "/debug_access_count" field:
  14175. // "iam_principal" } ==> increment counter
  14176. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  14177. // IAMContext.principal]}
  14178. //
  14179. // At this time we do not support multiple field names (though this may
  14180. // be supported in the future).
  14181. type LogConfigCounterOptions struct {
  14182. // Field: The field value to attribute.
  14183. Field string `json:"field,omitempty"`
  14184. // Metric: The metric to update.
  14185. Metric string `json:"metric,omitempty"`
  14186. // ForceSendFields is a list of field names (e.g. "Field") to
  14187. // unconditionally include in API requests. By default, fields with
  14188. // empty values are omitted from API requests. However, any non-pointer,
  14189. // non-interface field appearing in ForceSendFields will be sent to the
  14190. // server regardless of whether the field is empty or not. This may be
  14191. // used to include empty fields in Patch requests.
  14192. ForceSendFields []string `json:"-"`
  14193. // NullFields is a list of field names (e.g. "Field") to include in API
  14194. // requests with the JSON null value. By default, fields with empty
  14195. // values are omitted from API requests. However, any field with an
  14196. // empty value appearing in NullFields will be sent to the server as
  14197. // null. It is an error if a field in this list has a non-empty value.
  14198. // This may be used to include null fields in Patch requests.
  14199. NullFields []string `json:"-"`
  14200. }
  14201. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  14202. type NoMethod LogConfigCounterOptions
  14203. raw := NoMethod(*s)
  14204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14205. }
  14206. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  14207. type LogConfigDataAccessOptions struct {
  14208. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  14209. // the caller. This is relevant only in the LocalIAM implementation, for
  14210. // now.
  14211. //
  14212. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  14213. // while work is being done to satisfy the requirements of go/345.
  14214. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  14215. // still exists because there is active work being done to support it
  14216. // (b/115874152).
  14217. //
  14218. // Possible values:
  14219. // "LOG_FAIL_CLOSED"
  14220. // "LOG_MODE_UNSPECIFIED"
  14221. LogMode string `json:"logMode,omitempty"`
  14222. // ForceSendFields is a list of field names (e.g. "LogMode") to
  14223. // unconditionally include in API requests. By default, fields with
  14224. // empty values are omitted from API requests. However, any non-pointer,
  14225. // non-interface field appearing in ForceSendFields will be sent to the
  14226. // server regardless of whether the field is empty or not. This may be
  14227. // used to include empty fields in Patch requests.
  14228. ForceSendFields []string `json:"-"`
  14229. // NullFields is a list of field names (e.g. "LogMode") to include in
  14230. // API requests with the JSON null value. By default, fields with empty
  14231. // values are omitted from API requests. However, any field with an
  14232. // empty value appearing in NullFields will be sent to the server as
  14233. // null. It is an error if a field in this list has a non-empty value.
  14234. // This may be used to include null fields in Patch requests.
  14235. NullFields []string `json:"-"`
  14236. }
  14237. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  14238. type NoMethod LogConfigDataAccessOptions
  14239. raw := NoMethod(*s)
  14240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14241. }
  14242. // MachineType: A Machine Type resource. (== resource_for
  14243. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  14244. type MachineType struct {
  14245. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14246. // format.
  14247. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14248. // Deprecated: [Output Only] The deprecation status associated with this
  14249. // machine type.
  14250. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  14251. // Description: [Output Only] An optional textual description of the
  14252. // resource.
  14253. Description string `json:"description,omitempty"`
  14254. // GuestCpus: [Output Only] The number of virtual CPUs that are
  14255. // available to the instance.
  14256. GuestCpus int64 `json:"guestCpus,omitempty"`
  14257. // Id: [Output Only] The unique identifier for the resource. This
  14258. // identifier is defined by the server.
  14259. Id uint64 `json:"id,omitempty,string"`
  14260. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  14261. // CPU. See Shared-core machine types for more information.
  14262. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  14263. // Kind: [Output Only] The type of the resource. Always
  14264. // compute#machineType for machine types.
  14265. Kind string `json:"kind,omitempty"`
  14266. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  14267. // allowed.
  14268. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  14269. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  14270. // disks size (GB) allowed.
  14271. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  14272. // MemoryMb: [Output Only] The amount of physical memory available to
  14273. // the instance, defined in MB.
  14274. MemoryMb int64 `json:"memoryMb,omitempty"`
  14275. // Name: [Output Only] Name of the resource.
  14276. Name string `json:"name,omitempty"`
  14277. // SelfLink: [Output Only] Server-defined URL for the resource.
  14278. SelfLink string `json:"selfLink,omitempty"`
  14279. // Zone: [Output Only] The name of the zone where the machine type
  14280. // resides, such as us-central1-a.
  14281. Zone string `json:"zone,omitempty"`
  14282. // ServerResponse contains the HTTP response code and headers from the
  14283. // server.
  14284. googleapi.ServerResponse `json:"-"`
  14285. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14286. // to unconditionally include in API requests. By default, fields with
  14287. // empty values are omitted from API requests. However, any non-pointer,
  14288. // non-interface field appearing in ForceSendFields will be sent to the
  14289. // server regardless of whether the field is empty or not. This may be
  14290. // used to include empty fields in Patch requests.
  14291. ForceSendFields []string `json:"-"`
  14292. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14293. // include in API requests with the JSON null value. By default, fields
  14294. // with empty values are omitted from API requests. However, any field
  14295. // with an empty value appearing in NullFields will be sent to the
  14296. // server as null. It is an error if a field in this list has a
  14297. // non-empty value. This may be used to include null fields in Patch
  14298. // requests.
  14299. NullFields []string `json:"-"`
  14300. }
  14301. func (s *MachineType) MarshalJSON() ([]byte, error) {
  14302. type NoMethod MachineType
  14303. raw := NoMethod(*s)
  14304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14305. }
  14306. type MachineTypeAggregatedList struct {
  14307. // Id: [Output Only] Unique identifier for the resource; defined by the
  14308. // server.
  14309. Id string `json:"id,omitempty"`
  14310. // Items: A list of MachineTypesScopedList resources.
  14311. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  14312. // Kind: [Output Only] Type of resource. Always
  14313. // compute#machineTypeAggregatedList for aggregated lists of machine
  14314. // types.
  14315. Kind string `json:"kind,omitempty"`
  14316. // NextPageToken: [Output Only] This token allows you to get the next
  14317. // page of results for list requests. If the number of results is larger
  14318. // than maxResults, use the nextPageToken as a value for the query
  14319. // parameter pageToken in the next list request. Subsequent list
  14320. // requests will have their own nextPageToken to continue paging through
  14321. // the results.
  14322. NextPageToken string `json:"nextPageToken,omitempty"`
  14323. // SelfLink: [Output Only] Server-defined URL for this resource.
  14324. SelfLink string `json:"selfLink,omitempty"`
  14325. // Warning: [Output Only] Informational warning message.
  14326. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  14327. // ServerResponse contains the HTTP response code and headers from the
  14328. // server.
  14329. googleapi.ServerResponse `json:"-"`
  14330. // ForceSendFields is a list of field names (e.g. "Id") to
  14331. // unconditionally include in API requests. By default, fields with
  14332. // empty values are omitted from API requests. However, any non-pointer,
  14333. // non-interface field appearing in ForceSendFields will be sent to the
  14334. // server regardless of whether the field is empty or not. This may be
  14335. // used to include empty fields in Patch requests.
  14336. ForceSendFields []string `json:"-"`
  14337. // NullFields is a list of field names (e.g. "Id") to include in API
  14338. // requests with the JSON null value. By default, fields with empty
  14339. // values are omitted from API requests. However, any field with an
  14340. // empty value appearing in NullFields will be sent to the server as
  14341. // null. It is an error if a field in this list has a non-empty value.
  14342. // This may be used to include null fields in Patch requests.
  14343. NullFields []string `json:"-"`
  14344. }
  14345. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  14346. type NoMethod MachineTypeAggregatedList
  14347. raw := NoMethod(*s)
  14348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14349. }
  14350. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  14351. // message.
  14352. type MachineTypeAggregatedListWarning struct {
  14353. // Code: [Output Only] A warning code, if applicable. For example,
  14354. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14355. // the response.
  14356. //
  14357. // Possible values:
  14358. // "CLEANUP_FAILED"
  14359. // "DEPRECATED_RESOURCE_USED"
  14360. // "DEPRECATED_TYPE_USED"
  14361. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14362. // "EXPERIMENTAL_TYPE_USED"
  14363. // "EXTERNAL_API_WARNING"
  14364. // "FIELD_VALUE_OVERRIDEN"
  14365. // "INJECTED_KERNELS_DEPRECATED"
  14366. // "MISSING_TYPE_DEPENDENCY"
  14367. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14368. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14369. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14370. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14371. // "NEXT_HOP_NOT_RUNNING"
  14372. // "NOT_CRITICAL_ERROR"
  14373. // "NO_RESULTS_ON_PAGE"
  14374. // "REQUIRED_TOS_AGREEMENT"
  14375. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14376. // "RESOURCE_NOT_DELETED"
  14377. // "SCHEMA_VALIDATION_IGNORED"
  14378. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14379. // "UNDECLARED_PROPERTIES"
  14380. // "UNREACHABLE"
  14381. Code string `json:"code,omitempty"`
  14382. // Data: [Output Only] Metadata about this warning in key: value format.
  14383. // For example:
  14384. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14385. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  14386. // Message: [Output Only] A human-readable description of the warning
  14387. // code.
  14388. Message string `json:"message,omitempty"`
  14389. // ForceSendFields is a list of field names (e.g. "Code") to
  14390. // unconditionally include in API requests. By default, fields with
  14391. // empty values are omitted from API requests. However, any non-pointer,
  14392. // non-interface field appearing in ForceSendFields will be sent to the
  14393. // server regardless of whether the field is empty or not. This may be
  14394. // used to include empty fields in Patch requests.
  14395. ForceSendFields []string `json:"-"`
  14396. // NullFields is a list of field names (e.g. "Code") to include in API
  14397. // requests with the JSON null value. By default, fields with empty
  14398. // values are omitted from API requests. However, any field with an
  14399. // empty value appearing in NullFields will be sent to the server as
  14400. // null. It is an error if a field in this list has a non-empty value.
  14401. // This may be used to include null fields in Patch requests.
  14402. NullFields []string `json:"-"`
  14403. }
  14404. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14405. type NoMethod MachineTypeAggregatedListWarning
  14406. raw := NoMethod(*s)
  14407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14408. }
  14409. type MachineTypeAggregatedListWarningData struct {
  14410. // Key: [Output Only] A key that provides more detail on the warning
  14411. // being returned. For example, for warnings where there are no results
  14412. // in a list request for a particular zone, this key might be scope and
  14413. // the key value might be the zone name. Other examples might be a key
  14414. // indicating a deprecated resource and a suggested replacement, or a
  14415. // warning about invalid network settings (for example, if an instance
  14416. // attempts to perform IP forwarding but is not enabled for IP
  14417. // forwarding).
  14418. Key string `json:"key,omitempty"`
  14419. // Value: [Output Only] A warning data value corresponding to the key.
  14420. Value string `json:"value,omitempty"`
  14421. // ForceSendFields is a list of field names (e.g. "Key") to
  14422. // unconditionally include in API requests. By default, fields with
  14423. // empty values are omitted from API requests. However, any non-pointer,
  14424. // non-interface field appearing in ForceSendFields will be sent to the
  14425. // server regardless of whether the field is empty or not. This may be
  14426. // used to include empty fields in Patch requests.
  14427. ForceSendFields []string `json:"-"`
  14428. // NullFields is a list of field names (e.g. "Key") to include in API
  14429. // requests with the JSON null value. By default, fields with empty
  14430. // values are omitted from API requests. However, any field with an
  14431. // empty value appearing in NullFields will be sent to the server as
  14432. // null. It is an error if a field in this list has a non-empty value.
  14433. // This may be used to include null fields in Patch requests.
  14434. NullFields []string `json:"-"`
  14435. }
  14436. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14437. type NoMethod MachineTypeAggregatedListWarningData
  14438. raw := NoMethod(*s)
  14439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14440. }
  14441. // MachineTypeList: Contains a list of machine types.
  14442. type MachineTypeList struct {
  14443. // Id: [Output Only] Unique identifier for the resource; defined by the
  14444. // server.
  14445. Id string `json:"id,omitempty"`
  14446. // Items: A list of MachineType resources.
  14447. Items []*MachineType `json:"items,omitempty"`
  14448. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  14449. // for lists of machine types.
  14450. Kind string `json:"kind,omitempty"`
  14451. // NextPageToken: [Output Only] This token allows you to get the next
  14452. // page of results for list requests. If the number of results is larger
  14453. // than maxResults, use the nextPageToken as a value for the query
  14454. // parameter pageToken in the next list request. Subsequent list
  14455. // requests will have their own nextPageToken to continue paging through
  14456. // the results.
  14457. NextPageToken string `json:"nextPageToken,omitempty"`
  14458. // SelfLink: [Output Only] Server-defined URL for this resource.
  14459. SelfLink string `json:"selfLink,omitempty"`
  14460. // Warning: [Output Only] Informational warning message.
  14461. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  14462. // ServerResponse contains the HTTP response code and headers from the
  14463. // server.
  14464. googleapi.ServerResponse `json:"-"`
  14465. // ForceSendFields is a list of field names (e.g. "Id") to
  14466. // unconditionally include in API requests. By default, fields with
  14467. // empty values are omitted from API requests. However, any non-pointer,
  14468. // non-interface field appearing in ForceSendFields will be sent to the
  14469. // server regardless of whether the field is empty or not. This may be
  14470. // used to include empty fields in Patch requests.
  14471. ForceSendFields []string `json:"-"`
  14472. // NullFields is a list of field names (e.g. "Id") to include in API
  14473. // requests with the JSON null value. By default, fields with empty
  14474. // values are omitted from API requests. However, any field with an
  14475. // empty value appearing in NullFields will be sent to the server as
  14476. // null. It is an error if a field in this list has a non-empty value.
  14477. // This may be used to include null fields in Patch requests.
  14478. NullFields []string `json:"-"`
  14479. }
  14480. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  14481. type NoMethod MachineTypeList
  14482. raw := NoMethod(*s)
  14483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14484. }
  14485. // MachineTypeListWarning: [Output Only] Informational warning message.
  14486. type MachineTypeListWarning struct {
  14487. // Code: [Output Only] A warning code, if applicable. For example,
  14488. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14489. // the response.
  14490. //
  14491. // Possible values:
  14492. // "CLEANUP_FAILED"
  14493. // "DEPRECATED_RESOURCE_USED"
  14494. // "DEPRECATED_TYPE_USED"
  14495. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14496. // "EXPERIMENTAL_TYPE_USED"
  14497. // "EXTERNAL_API_WARNING"
  14498. // "FIELD_VALUE_OVERRIDEN"
  14499. // "INJECTED_KERNELS_DEPRECATED"
  14500. // "MISSING_TYPE_DEPENDENCY"
  14501. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14502. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14503. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14504. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14505. // "NEXT_HOP_NOT_RUNNING"
  14506. // "NOT_CRITICAL_ERROR"
  14507. // "NO_RESULTS_ON_PAGE"
  14508. // "REQUIRED_TOS_AGREEMENT"
  14509. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14510. // "RESOURCE_NOT_DELETED"
  14511. // "SCHEMA_VALIDATION_IGNORED"
  14512. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14513. // "UNDECLARED_PROPERTIES"
  14514. // "UNREACHABLE"
  14515. Code string `json:"code,omitempty"`
  14516. // Data: [Output Only] Metadata about this warning in key: value format.
  14517. // For example:
  14518. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14519. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  14520. // Message: [Output Only] A human-readable description of the warning
  14521. // code.
  14522. Message string `json:"message,omitempty"`
  14523. // ForceSendFields is a list of field names (e.g. "Code") to
  14524. // unconditionally include in API requests. By default, fields with
  14525. // empty values are omitted from API requests. However, any non-pointer,
  14526. // non-interface field appearing in ForceSendFields will be sent to the
  14527. // server regardless of whether the field is empty or not. This may be
  14528. // used to include empty fields in Patch requests.
  14529. ForceSendFields []string `json:"-"`
  14530. // NullFields is a list of field names (e.g. "Code") to include in API
  14531. // requests with the JSON null value. By default, fields with empty
  14532. // values are omitted from API requests. However, any field with an
  14533. // empty value appearing in NullFields will be sent to the server as
  14534. // null. It is an error if a field in this list has a non-empty value.
  14535. // This may be used to include null fields in Patch requests.
  14536. NullFields []string `json:"-"`
  14537. }
  14538. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  14539. type NoMethod MachineTypeListWarning
  14540. raw := NoMethod(*s)
  14541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14542. }
  14543. type MachineTypeListWarningData struct {
  14544. // Key: [Output Only] A key that provides more detail on the warning
  14545. // being returned. For example, for warnings where there are no results
  14546. // in a list request for a particular zone, this key might be scope and
  14547. // the key value might be the zone name. Other examples might be a key
  14548. // indicating a deprecated resource and a suggested replacement, or a
  14549. // warning about invalid network settings (for example, if an instance
  14550. // attempts to perform IP forwarding but is not enabled for IP
  14551. // forwarding).
  14552. Key string `json:"key,omitempty"`
  14553. // Value: [Output Only] A warning data value corresponding to the key.
  14554. Value string `json:"value,omitempty"`
  14555. // ForceSendFields is a list of field names (e.g. "Key") to
  14556. // unconditionally include in API requests. By default, fields with
  14557. // empty values are omitted from API requests. However, any non-pointer,
  14558. // non-interface field appearing in ForceSendFields will be sent to the
  14559. // server regardless of whether the field is empty or not. This may be
  14560. // used to include empty fields in Patch requests.
  14561. ForceSendFields []string `json:"-"`
  14562. // NullFields is a list of field names (e.g. "Key") to include in API
  14563. // requests with the JSON null value. By default, fields with empty
  14564. // values are omitted from API requests. However, any field with an
  14565. // empty value appearing in NullFields will be sent to the server as
  14566. // null. It is an error if a field in this list has a non-empty value.
  14567. // This may be used to include null fields in Patch requests.
  14568. NullFields []string `json:"-"`
  14569. }
  14570. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  14571. type NoMethod MachineTypeListWarningData
  14572. raw := NoMethod(*s)
  14573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14574. }
  14575. type MachineTypesScopedList struct {
  14576. // MachineTypes: [Output Only] A list of machine types contained in this
  14577. // scope.
  14578. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  14579. // Warning: [Output Only] An informational warning that appears when the
  14580. // machine types list is empty.
  14581. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  14582. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  14583. // unconditionally include in API requests. By default, fields with
  14584. // empty values are omitted from API requests. However, any non-pointer,
  14585. // non-interface field appearing in ForceSendFields will be sent to the
  14586. // server regardless of whether the field is empty or not. This may be
  14587. // used to include empty fields in Patch requests.
  14588. ForceSendFields []string `json:"-"`
  14589. // NullFields is a list of field names (e.g. "MachineTypes") to include
  14590. // in API requests with the JSON null value. By default, fields with
  14591. // empty values are omitted from API requests. However, any field with
  14592. // an empty value appearing in NullFields will be sent to the server as
  14593. // null. It is an error if a field in this list has a non-empty value.
  14594. // This may be used to include null fields in Patch requests.
  14595. NullFields []string `json:"-"`
  14596. }
  14597. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  14598. type NoMethod MachineTypesScopedList
  14599. raw := NoMethod(*s)
  14600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14601. }
  14602. // MachineTypesScopedListWarning: [Output Only] An informational warning
  14603. // that appears when the machine types list is empty.
  14604. type MachineTypesScopedListWarning struct {
  14605. // Code: [Output Only] A warning code, if applicable. For example,
  14606. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14607. // the response.
  14608. //
  14609. // Possible values:
  14610. // "CLEANUP_FAILED"
  14611. // "DEPRECATED_RESOURCE_USED"
  14612. // "DEPRECATED_TYPE_USED"
  14613. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14614. // "EXPERIMENTAL_TYPE_USED"
  14615. // "EXTERNAL_API_WARNING"
  14616. // "FIELD_VALUE_OVERRIDEN"
  14617. // "INJECTED_KERNELS_DEPRECATED"
  14618. // "MISSING_TYPE_DEPENDENCY"
  14619. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14620. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14621. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14622. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14623. // "NEXT_HOP_NOT_RUNNING"
  14624. // "NOT_CRITICAL_ERROR"
  14625. // "NO_RESULTS_ON_PAGE"
  14626. // "REQUIRED_TOS_AGREEMENT"
  14627. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14628. // "RESOURCE_NOT_DELETED"
  14629. // "SCHEMA_VALIDATION_IGNORED"
  14630. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14631. // "UNDECLARED_PROPERTIES"
  14632. // "UNREACHABLE"
  14633. Code string `json:"code,omitempty"`
  14634. // Data: [Output Only] Metadata about this warning in key: value format.
  14635. // For example:
  14636. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14637. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  14638. // Message: [Output Only] A human-readable description of the warning
  14639. // code.
  14640. Message string `json:"message,omitempty"`
  14641. // ForceSendFields is a list of field names (e.g. "Code") to
  14642. // unconditionally include in API requests. By default, fields with
  14643. // empty values are omitted from API requests. However, any non-pointer,
  14644. // non-interface field appearing in ForceSendFields will be sent to the
  14645. // server regardless of whether the field is empty or not. This may be
  14646. // used to include empty fields in Patch requests.
  14647. ForceSendFields []string `json:"-"`
  14648. // NullFields is a list of field names (e.g. "Code") to include in API
  14649. // requests with the JSON null value. By default, fields with empty
  14650. // values are omitted from API requests. However, any field with an
  14651. // empty value appearing in NullFields will be sent to the server as
  14652. // null. It is an error if a field in this list has a non-empty value.
  14653. // This may be used to include null fields in Patch requests.
  14654. NullFields []string `json:"-"`
  14655. }
  14656. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  14657. type NoMethod MachineTypesScopedListWarning
  14658. raw := NoMethod(*s)
  14659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14660. }
  14661. type MachineTypesScopedListWarningData struct {
  14662. // Key: [Output Only] A key that provides more detail on the warning
  14663. // being returned. For example, for warnings where there are no results
  14664. // in a list request for a particular zone, this key might be scope and
  14665. // the key value might be the zone name. Other examples might be a key
  14666. // indicating a deprecated resource and a suggested replacement, or a
  14667. // warning about invalid network settings (for example, if an instance
  14668. // attempts to perform IP forwarding but is not enabled for IP
  14669. // forwarding).
  14670. Key string `json:"key,omitempty"`
  14671. // Value: [Output Only] A warning data value corresponding to the key.
  14672. Value string `json:"value,omitempty"`
  14673. // ForceSendFields is a list of field names (e.g. "Key") to
  14674. // unconditionally include in API requests. By default, fields with
  14675. // empty values are omitted from API requests. However, any non-pointer,
  14676. // non-interface field appearing in ForceSendFields will be sent to the
  14677. // server regardless of whether the field is empty or not. This may be
  14678. // used to include empty fields in Patch requests.
  14679. ForceSendFields []string `json:"-"`
  14680. // NullFields is a list of field names (e.g. "Key") to include in API
  14681. // requests with the JSON null value. By default, fields with empty
  14682. // values are omitted from API requests. However, any field with an
  14683. // empty value appearing in NullFields will be sent to the server as
  14684. // null. It is an error if a field in this list has a non-empty value.
  14685. // This may be used to include null fields in Patch requests.
  14686. NullFields []string `json:"-"`
  14687. }
  14688. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  14689. type NoMethod MachineTypesScopedListWarningData
  14690. raw := NoMethod(*s)
  14691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14692. }
  14693. // ManagedInstance: A Managed Instance resource.
  14694. type ManagedInstance struct {
  14695. // CurrentAction: [Output Only] The current action that the managed
  14696. // instance group has scheduled for the instance. Possible values:
  14697. // - NONE The instance is running, and the managed instance group does
  14698. // not have any scheduled actions for this instance.
  14699. // - CREATING The managed instance group is creating this instance. If
  14700. // the group fails to create this instance, it will try again until it
  14701. // is successful.
  14702. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  14703. // to create this instance only once. If the group fails to create this
  14704. // instance, it does not try again and the group's targetSize value is
  14705. // decreased instead.
  14706. // - RECREATING The managed instance group is recreating this instance.
  14707. //
  14708. // - DELETING The managed instance group is permanently deleting this
  14709. // instance.
  14710. // - ABANDONING The managed instance group is abandoning this instance.
  14711. // The instance will be removed from the instance group and from any
  14712. // target pools that are associated with this group.
  14713. // - RESTARTING The managed instance group is restarting the instance.
  14714. //
  14715. // - REFRESHING The managed instance group is applying configuration
  14716. // changes to the instance without stopping it. For example, the group
  14717. // can update the target pool list for an instance without stopping that
  14718. // instance.
  14719. // - VERIFYING The managed instance group has created the instance and
  14720. // it is in the process of being verified.
  14721. //
  14722. // Possible values:
  14723. // "ABANDONING"
  14724. // "CREATING"
  14725. // "CREATING_WITHOUT_RETRIES"
  14726. // "DELETING"
  14727. // "NONE"
  14728. // "RECREATING"
  14729. // "REFRESHING"
  14730. // "RESTARTING"
  14731. // "VERIFYING"
  14732. CurrentAction string `json:"currentAction,omitempty"`
  14733. // Id: [Output only] The unique identifier for this resource. This field
  14734. // is empty when instance does not exist.
  14735. Id uint64 `json:"id,omitempty,string"`
  14736. // Instance: [Output Only] The URL of the instance. The URL can exist
  14737. // even if the instance has not yet been created.
  14738. Instance string `json:"instance,omitempty"`
  14739. // InstanceStatus: [Output Only] The status of the instance. This field
  14740. // is empty when the instance does not exist.
  14741. //
  14742. // Possible values:
  14743. // "PROVISIONING"
  14744. // "RUNNING"
  14745. // "STAGING"
  14746. // "STOPPED"
  14747. // "STOPPING"
  14748. // "SUSPENDED"
  14749. // "SUSPENDING"
  14750. // "TERMINATED"
  14751. InstanceStatus string `json:"instanceStatus,omitempty"`
  14752. // LastAttempt: [Output Only] Information about the last attempt to
  14753. // create or delete the instance.
  14754. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  14755. // Version: [Output Only] Intended version of this instance.
  14756. Version *ManagedInstanceVersion `json:"version,omitempty"`
  14757. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  14758. // unconditionally include in API requests. By default, fields with
  14759. // empty values are omitted from API requests. However, any non-pointer,
  14760. // non-interface field appearing in ForceSendFields will be sent to the
  14761. // server regardless of whether the field is empty or not. This may be
  14762. // used to include empty fields in Patch requests.
  14763. ForceSendFields []string `json:"-"`
  14764. // NullFields is a list of field names (e.g. "CurrentAction") to include
  14765. // in API requests with the JSON null value. By default, fields with
  14766. // empty values are omitted from API requests. However, any field with
  14767. // an empty value appearing in NullFields will be sent to the server as
  14768. // null. It is an error if a field in this list has a non-empty value.
  14769. // This may be used to include null fields in Patch requests.
  14770. NullFields []string `json:"-"`
  14771. }
  14772. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  14773. type NoMethod ManagedInstance
  14774. raw := NoMethod(*s)
  14775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14776. }
  14777. type ManagedInstanceLastAttempt struct {
  14778. // Errors: [Output Only] Encountered errors during the last attempt to
  14779. // create or delete the instance.
  14780. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  14781. // ForceSendFields is a list of field names (e.g. "Errors") to
  14782. // unconditionally include in API requests. By default, fields with
  14783. // empty values are omitted from API requests. However, any non-pointer,
  14784. // non-interface field appearing in ForceSendFields will be sent to the
  14785. // server regardless of whether the field is empty or not. This may be
  14786. // used to include empty fields in Patch requests.
  14787. ForceSendFields []string `json:"-"`
  14788. // NullFields is a list of field names (e.g. "Errors") to include in API
  14789. // requests with the JSON null value. By default, fields with empty
  14790. // values are omitted from API requests. However, any field with an
  14791. // empty value appearing in NullFields will be sent to the server as
  14792. // null. It is an error if a field in this list has a non-empty value.
  14793. // This may be used to include null fields in Patch requests.
  14794. NullFields []string `json:"-"`
  14795. }
  14796. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  14797. type NoMethod ManagedInstanceLastAttempt
  14798. raw := NoMethod(*s)
  14799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14800. }
  14801. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  14802. // during the last attempt to create or delete the instance.
  14803. type ManagedInstanceLastAttemptErrors struct {
  14804. // Errors: [Output Only] The array of errors encountered while
  14805. // processing this operation.
  14806. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  14807. // ForceSendFields is a list of field names (e.g. "Errors") to
  14808. // unconditionally include in API requests. By default, fields with
  14809. // empty values are omitted from API requests. However, any non-pointer,
  14810. // non-interface field appearing in ForceSendFields will be sent to the
  14811. // server regardless of whether the field is empty or not. This may be
  14812. // used to include empty fields in Patch requests.
  14813. ForceSendFields []string `json:"-"`
  14814. // NullFields is a list of field names (e.g. "Errors") to include in API
  14815. // requests with the JSON null value. By default, fields with empty
  14816. // values are omitted from API requests. However, any field with an
  14817. // empty value appearing in NullFields will be sent to the server as
  14818. // null. It is an error if a field in this list has a non-empty value.
  14819. // This may be used to include null fields in Patch requests.
  14820. NullFields []string `json:"-"`
  14821. }
  14822. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  14823. type NoMethod ManagedInstanceLastAttemptErrors
  14824. raw := NoMethod(*s)
  14825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14826. }
  14827. type ManagedInstanceLastAttemptErrorsErrors struct {
  14828. // Code: [Output Only] The error type identifier for this error.
  14829. Code string `json:"code,omitempty"`
  14830. // Location: [Output Only] Indicates the field in the request that
  14831. // caused the error. This property is optional.
  14832. Location string `json:"location,omitempty"`
  14833. // Message: [Output Only] An optional, human-readable error message.
  14834. Message string `json:"message,omitempty"`
  14835. // ForceSendFields is a list of field names (e.g. "Code") to
  14836. // unconditionally include in API requests. By default, fields with
  14837. // empty values are omitted from API requests. However, any non-pointer,
  14838. // non-interface field appearing in ForceSendFields will be sent to the
  14839. // server regardless of whether the field is empty or not. This may be
  14840. // used to include empty fields in Patch requests.
  14841. ForceSendFields []string `json:"-"`
  14842. // NullFields is a list of field names (e.g. "Code") to include in API
  14843. // requests with the JSON null value. By default, fields with empty
  14844. // values are omitted from API requests. However, any field with an
  14845. // empty value appearing in NullFields will be sent to the server as
  14846. // null. It is an error if a field in this list has a non-empty value.
  14847. // This may be used to include null fields in Patch requests.
  14848. NullFields []string `json:"-"`
  14849. }
  14850. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  14851. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  14852. raw := NoMethod(*s)
  14853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14854. }
  14855. type ManagedInstanceVersion struct {
  14856. // InstanceTemplate: [Output Only] The intended template of the
  14857. // instance. This field is empty when current_action is one of {
  14858. // DELETING, ABANDONING }.
  14859. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  14860. // Name: [Output Only] Name of the version.
  14861. Name string `json:"name,omitempty"`
  14862. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  14863. // unconditionally include in API requests. By default, fields with
  14864. // empty values are omitted from API requests. However, any non-pointer,
  14865. // non-interface field appearing in ForceSendFields will be sent to the
  14866. // server regardless of whether the field is empty or not. This may be
  14867. // used to include empty fields in Patch requests.
  14868. ForceSendFields []string `json:"-"`
  14869. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  14870. // include in API requests with the JSON null value. By default, fields
  14871. // with empty values are omitted from API requests. However, any field
  14872. // with an empty value appearing in NullFields will be sent to the
  14873. // server as null. It is an error if a field in this list has a
  14874. // non-empty value. This may be used to include null fields in Patch
  14875. // requests.
  14876. NullFields []string `json:"-"`
  14877. }
  14878. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  14879. type NoMethod ManagedInstanceVersion
  14880. raw := NoMethod(*s)
  14881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14882. }
  14883. // Metadata: A metadata key/value entry.
  14884. type Metadata struct {
  14885. // Fingerprint: Specifies a fingerprint for this request, which is
  14886. // essentially a hash of the metadata's contents and used for optimistic
  14887. // locking. The fingerprint is initially generated by Compute Engine and
  14888. // changes after every request to modify or update metadata. You must
  14889. // always provide an up-to-date fingerprint hash in order to update or
  14890. // change metadata, otherwise the request will fail with error 412
  14891. // conditionNotMet.
  14892. //
  14893. // To see the latest fingerprint, make a get() request to retrieve the
  14894. // resource.
  14895. Fingerprint string `json:"fingerprint,omitempty"`
  14896. // Items: Array of key/value pairs. The total size of all keys and
  14897. // values must be less than 512 KB.
  14898. Items []*MetadataItems `json:"items,omitempty"`
  14899. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  14900. // metadata.
  14901. Kind string `json:"kind,omitempty"`
  14902. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  14903. // unconditionally include in API requests. By default, fields with
  14904. // empty values are omitted from API requests. However, any non-pointer,
  14905. // non-interface field appearing in ForceSendFields will be sent to the
  14906. // server regardless of whether the field is empty or not. This may be
  14907. // used to include empty fields in Patch requests.
  14908. ForceSendFields []string `json:"-"`
  14909. // NullFields is a list of field names (e.g. "Fingerprint") to include
  14910. // in API requests with the JSON null value. By default, fields with
  14911. // empty values are omitted from API requests. However, any field with
  14912. // an empty value appearing in NullFields will be sent to the server as
  14913. // null. It is an error if a field in this list has a non-empty value.
  14914. // This may be used to include null fields in Patch requests.
  14915. NullFields []string `json:"-"`
  14916. }
  14917. func (s *Metadata) MarshalJSON() ([]byte, error) {
  14918. type NoMethod Metadata
  14919. raw := NoMethod(*s)
  14920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14921. }
  14922. type MetadataItems struct {
  14923. // Key: Key for the metadata entry. Keys must conform to the following
  14924. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  14925. // reflected as part of a URL in the metadata server. Additionally, to
  14926. // avoid ambiguity, keys must not conflict with any other metadata keys
  14927. // for the project.
  14928. Key string `json:"key,omitempty"`
  14929. // Value: Value for the metadata entry. These are free-form strings, and
  14930. // only have meaning as interpreted by the image running in the
  14931. // instance. The only restriction placed on values is that their size
  14932. // must be less than or equal to 262144 bytes (256 KiB).
  14933. Value *string `json:"value,omitempty"`
  14934. // ForceSendFields is a list of field names (e.g. "Key") to
  14935. // unconditionally include in API requests. By default, fields with
  14936. // empty values are omitted from API requests. However, any non-pointer,
  14937. // non-interface field appearing in ForceSendFields will be sent to the
  14938. // server regardless of whether the field is empty or not. This may be
  14939. // used to include empty fields in Patch requests.
  14940. ForceSendFields []string `json:"-"`
  14941. // NullFields is a list of field names (e.g. "Key") to include in API
  14942. // requests with the JSON null value. By default, fields with empty
  14943. // values are omitted from API requests. However, any field with an
  14944. // empty value appearing in NullFields will be sent to the server as
  14945. // null. It is an error if a field in this list has a non-empty value.
  14946. // This may be used to include null fields in Patch requests.
  14947. NullFields []string `json:"-"`
  14948. }
  14949. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  14950. type NoMethod MetadataItems
  14951. raw := NoMethod(*s)
  14952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14953. }
  14954. // NamedPort: The named port. For example: .
  14955. type NamedPort struct {
  14956. // Name: The name for this named port. The name must be 1-63 characters
  14957. // long, and comply with RFC1035.
  14958. Name string `json:"name,omitempty"`
  14959. // Port: The port number, which can be a value between 1 and 65535.
  14960. Port int64 `json:"port,omitempty"`
  14961. // ForceSendFields is a list of field names (e.g. "Name") to
  14962. // unconditionally include in API requests. By default, fields with
  14963. // empty values are omitted from API requests. However, any non-pointer,
  14964. // non-interface field appearing in ForceSendFields will be sent to the
  14965. // server regardless of whether the field is empty or not. This may be
  14966. // used to include empty fields in Patch requests.
  14967. ForceSendFields []string `json:"-"`
  14968. // NullFields is a list of field names (e.g. "Name") to include in API
  14969. // requests with the JSON null value. By default, fields with empty
  14970. // values are omitted from API requests. However, any field with an
  14971. // empty value appearing in NullFields will be sent to the server as
  14972. // null. It is an error if a field in this list has a non-empty value.
  14973. // This may be used to include null fields in Patch requests.
  14974. NullFields []string `json:"-"`
  14975. }
  14976. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  14977. type NoMethod NamedPort
  14978. raw := NoMethod(*s)
  14979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14980. }
  14981. // Network: Represents a Network resource. Read Virtual Private Cloud
  14982. // (VPC) Network Overview for more information. (== resource_for
  14983. // v1.networks ==) (== resource_for beta.networks ==)
  14984. type Network struct {
  14985. // IPv4Range: The range of internal addresses that are legal on this
  14986. // network. This range is a CIDR specification, for example:
  14987. // 192.168.0.0/16. Provided by the client when the network is created.
  14988. IPv4Range string `json:"IPv4Range,omitempty"`
  14989. // AutoCreateSubnetworks: When set to true, the VPC network is created
  14990. // in "auto" mode. When set to false, the VPC network is created in
  14991. // "custom" mode.
  14992. //
  14993. // An auto mode VPC network starts with one subnet per region. Each
  14994. // subnet has a predetermined range as described in Auto mode VPC
  14995. // network IP ranges.
  14996. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  14997. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14998. // format.
  14999. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15000. // Description: An optional description of this resource. Provide this
  15001. // property when you create the resource.
  15002. Description string `json:"description,omitempty"`
  15003. // GatewayIPv4: [Output Only] The gateway address for default routing
  15004. // out of the network. This value is read only and is selected by GCP.
  15005. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  15006. // Id: [Output Only] The unique identifier for the resource. This
  15007. // identifier is defined by the server.
  15008. Id uint64 `json:"id,omitempty,string"`
  15009. // Kind: [Output Only] Type of the resource. Always compute#network for
  15010. // networks.
  15011. Kind string `json:"kind,omitempty"`
  15012. // Name: Name of the resource. Provided by the client when the resource
  15013. // is created. The name must be 1-63 characters long, and comply with
  15014. // RFC1035. Specifically, the name must be 1-63 characters long and
  15015. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15016. // the first character must be a lowercase letter, and all following
  15017. // characters must be a dash, lowercase letter, or digit, except the
  15018. // last character, which cannot be a dash.
  15019. Name string `json:"name,omitempty"`
  15020. // Peerings: [Output Only] A list of network peerings for the resource.
  15021. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  15022. // RoutingConfig: The network-level routing configuration for this
  15023. // network. Used by Cloud Router to determine what type of network-wide
  15024. // routing behavior to enforce.
  15025. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  15026. // SelfLink: [Output Only] Server-defined URL for the resource.
  15027. SelfLink string `json:"selfLink,omitempty"`
  15028. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  15029. // all subnetworks in this VPC network.
  15030. Subnetworks []string `json:"subnetworks,omitempty"`
  15031. // ServerResponse contains the HTTP response code and headers from the
  15032. // server.
  15033. googleapi.ServerResponse `json:"-"`
  15034. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  15035. // unconditionally include in API requests. By default, fields with
  15036. // empty values are omitted from API requests. However, any non-pointer,
  15037. // non-interface field appearing in ForceSendFields will be sent to the
  15038. // server regardless of whether the field is empty or not. This may be
  15039. // used to include empty fields in Patch requests.
  15040. ForceSendFields []string `json:"-"`
  15041. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  15042. // API requests with the JSON null value. By default, fields with empty
  15043. // values are omitted from API requests. However, any field with an
  15044. // empty value appearing in NullFields will be sent to the server as
  15045. // null. It is an error if a field in this list has a non-empty value.
  15046. // This may be used to include null fields in Patch requests.
  15047. NullFields []string `json:"-"`
  15048. }
  15049. func (s *Network) MarshalJSON() ([]byte, error) {
  15050. type NoMethod Network
  15051. raw := NoMethod(*s)
  15052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15053. }
  15054. // NetworkEndpoint: The network endpoint.
  15055. type NetworkEndpoint struct {
  15056. // Instance: The name for a specific VM instance that the IP address
  15057. // belongs to. This is required for network endpoints of type
  15058. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  15059. // endpoint group.
  15060. //
  15061. // The name must be 1-63 characters long, and comply with RFC1035.
  15062. Instance string `json:"instance,omitempty"`
  15063. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  15064. // must belong to a VM in GCE (either the primary IP or as part of an
  15065. // aliased IP range). If the IP address is not specified, then the
  15066. // primary IP address for the VM instance in the network that the
  15067. // network endpoint group belongs to will be used.
  15068. IpAddress string `json:"ipAddress,omitempty"`
  15069. // Port: Optional port number of network endpoint. If not specified and
  15070. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  15071. // defaultPort for the network endpoint group will be used.
  15072. Port int64 `json:"port,omitempty"`
  15073. // ForceSendFields is a list of field names (e.g. "Instance") to
  15074. // unconditionally include in API requests. By default, fields with
  15075. // empty values are omitted from API requests. However, any non-pointer,
  15076. // non-interface field appearing in ForceSendFields will be sent to the
  15077. // server regardless of whether the field is empty or not. This may be
  15078. // used to include empty fields in Patch requests.
  15079. ForceSendFields []string `json:"-"`
  15080. // NullFields is a list of field names (e.g. "Instance") to include in
  15081. // API requests with the JSON null value. By default, fields with empty
  15082. // values are omitted from API requests. However, any field with an
  15083. // empty value appearing in NullFields will be sent to the server as
  15084. // null. It is an error if a field in this list has a non-empty value.
  15085. // This may be used to include null fields in Patch requests.
  15086. NullFields []string `json:"-"`
  15087. }
  15088. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  15089. type NoMethod NetworkEndpoint
  15090. raw := NoMethod(*s)
  15091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15092. }
  15093. // NetworkEndpointGroup: Represents a collection of network endpoints.
  15094. type NetworkEndpointGroup struct {
  15095. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15096. // format.
  15097. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15098. // DefaultPort: The default port used if the port number is not
  15099. // specified in the network endpoint.
  15100. DefaultPort int64 `json:"defaultPort,omitempty"`
  15101. // Description: An optional description of this resource. Provide this
  15102. // property when you create the resource.
  15103. Description string `json:"description,omitempty"`
  15104. // Id: [Output Only] The unique identifier for the resource. This
  15105. // identifier is defined by the server.
  15106. Id uint64 `json:"id,omitempty,string"`
  15107. // Kind: [Output Only] Type of the resource. Always
  15108. // compute#networkEndpointGroup for network endpoint group.
  15109. Kind string `json:"kind,omitempty"`
  15110. // LoadBalancer: This field is only valid when the network endpoint
  15111. // group is used for load balancing. [Deprecated] This field is
  15112. // deprecated.
  15113. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  15114. // Name: Name of the resource; provided by the client when the resource
  15115. // is created. The name must be 1-63 characters long, and comply with
  15116. // RFC1035. Specifically, the name must be 1-63 characters long and
  15117. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15118. // the first character must be a lowercase letter, and all following
  15119. // characters must be a dash, lowercase letter, or digit, except the
  15120. // last character, which cannot be a dash.
  15121. Name string `json:"name,omitempty"`
  15122. // Network: The URL of the network to which all network endpoints in the
  15123. // NEG belong. Uses "default" project network if unspecified.
  15124. Network string `json:"network,omitempty"`
  15125. // NetworkEndpointType: Type of network endpoints in this network
  15126. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  15127. //
  15128. // Possible values:
  15129. // "GCE_VM_IP_PORT"
  15130. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  15131. // SelfLink: [Output Only] Server-defined URL for the resource.
  15132. SelfLink string `json:"selfLink,omitempty"`
  15133. // Size: [Output only] Number of network endpoints in the network
  15134. // endpoint group.
  15135. Size int64 `json:"size,omitempty"`
  15136. // Subnetwork: Optional URL of the subnetwork to which all network
  15137. // endpoints in the NEG belong.
  15138. Subnetwork string `json:"subnetwork,omitempty"`
  15139. // Zone: [Output Only] The URL of the zone where the network endpoint
  15140. // group is located.
  15141. Zone string `json:"zone,omitempty"`
  15142. // ServerResponse contains the HTTP response code and headers from the
  15143. // server.
  15144. googleapi.ServerResponse `json:"-"`
  15145. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15146. // to unconditionally include in API requests. By default, fields with
  15147. // empty values are omitted from API requests. However, any non-pointer,
  15148. // non-interface field appearing in ForceSendFields will be sent to the
  15149. // server regardless of whether the field is empty or not. This may be
  15150. // used to include empty fields in Patch requests.
  15151. ForceSendFields []string `json:"-"`
  15152. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15153. // include in API requests with the JSON null value. By default, fields
  15154. // with empty values are omitted from API requests. However, any field
  15155. // with an empty value appearing in NullFields will be sent to the
  15156. // server as null. It is an error if a field in this list has a
  15157. // non-empty value. This may be used to include null fields in Patch
  15158. // requests.
  15159. NullFields []string `json:"-"`
  15160. }
  15161. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  15162. type NoMethod NetworkEndpointGroup
  15163. raw := NoMethod(*s)
  15164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15165. }
  15166. type NetworkEndpointGroupAggregatedList struct {
  15167. // Id: [Output Only] Unique identifier for the resource; defined by the
  15168. // server.
  15169. Id string `json:"id,omitempty"`
  15170. // Items: A list of NetworkEndpointGroupsScopedList resources.
  15171. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  15172. // Kind: [Output Only] The resource type, which is always
  15173. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  15174. // network endpoint groups.
  15175. Kind string `json:"kind,omitempty"`
  15176. // NextPageToken: [Output Only] This token allows you to get the next
  15177. // page of results for list requests. If the number of results is larger
  15178. // than maxResults, use the nextPageToken as a value for the query
  15179. // parameter pageToken in the next list request. Subsequent list
  15180. // requests will have their own nextPageToken to continue paging through
  15181. // the results.
  15182. NextPageToken string `json:"nextPageToken,omitempty"`
  15183. // SelfLink: [Output Only] Server-defined URL for this resource.
  15184. SelfLink string `json:"selfLink,omitempty"`
  15185. // Warning: [Output Only] Informational warning message.
  15186. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  15187. // ServerResponse contains the HTTP response code and headers from the
  15188. // server.
  15189. googleapi.ServerResponse `json:"-"`
  15190. // ForceSendFields is a list of field names (e.g. "Id") to
  15191. // unconditionally include in API requests. By default, fields with
  15192. // empty values are omitted from API requests. However, any non-pointer,
  15193. // non-interface field appearing in ForceSendFields will be sent to the
  15194. // server regardless of whether the field is empty or not. This may be
  15195. // used to include empty fields in Patch requests.
  15196. ForceSendFields []string `json:"-"`
  15197. // NullFields is a list of field names (e.g. "Id") to include in API
  15198. // requests with the JSON null value. By default, fields with empty
  15199. // values are omitted from API requests. However, any field with an
  15200. // empty value appearing in NullFields will be sent to the server as
  15201. // null. It is an error if a field in this list has a non-empty value.
  15202. // This may be used to include null fields in Patch requests.
  15203. NullFields []string `json:"-"`
  15204. }
  15205. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  15206. type NoMethod NetworkEndpointGroupAggregatedList
  15207. raw := NoMethod(*s)
  15208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15209. }
  15210. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  15211. // Informational warning message.
  15212. type NetworkEndpointGroupAggregatedListWarning struct {
  15213. // Code: [Output Only] A warning code, if applicable. For example,
  15214. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15215. // the response.
  15216. //
  15217. // Possible values:
  15218. // "CLEANUP_FAILED"
  15219. // "DEPRECATED_RESOURCE_USED"
  15220. // "DEPRECATED_TYPE_USED"
  15221. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15222. // "EXPERIMENTAL_TYPE_USED"
  15223. // "EXTERNAL_API_WARNING"
  15224. // "FIELD_VALUE_OVERRIDEN"
  15225. // "INJECTED_KERNELS_DEPRECATED"
  15226. // "MISSING_TYPE_DEPENDENCY"
  15227. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15228. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15229. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15230. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15231. // "NEXT_HOP_NOT_RUNNING"
  15232. // "NOT_CRITICAL_ERROR"
  15233. // "NO_RESULTS_ON_PAGE"
  15234. // "REQUIRED_TOS_AGREEMENT"
  15235. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15236. // "RESOURCE_NOT_DELETED"
  15237. // "SCHEMA_VALIDATION_IGNORED"
  15238. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15239. // "UNDECLARED_PROPERTIES"
  15240. // "UNREACHABLE"
  15241. Code string `json:"code,omitempty"`
  15242. // Data: [Output Only] Metadata about this warning in key: value format.
  15243. // For example:
  15244. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15245. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  15246. // Message: [Output Only] A human-readable description of the warning
  15247. // code.
  15248. Message string `json:"message,omitempty"`
  15249. // ForceSendFields is a list of field names (e.g. "Code") to
  15250. // unconditionally include in API requests. By default, fields with
  15251. // empty values are omitted from API requests. However, any non-pointer,
  15252. // non-interface field appearing in ForceSendFields will be sent to the
  15253. // server regardless of whether the field is empty or not. This may be
  15254. // used to include empty fields in Patch requests.
  15255. ForceSendFields []string `json:"-"`
  15256. // NullFields is a list of field names (e.g. "Code") to include in API
  15257. // requests with the JSON null value. By default, fields with empty
  15258. // values are omitted from API requests. However, any field with an
  15259. // empty value appearing in NullFields will be sent to the server as
  15260. // null. It is an error if a field in this list has a non-empty value.
  15261. // This may be used to include null fields in Patch requests.
  15262. NullFields []string `json:"-"`
  15263. }
  15264. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15265. type NoMethod NetworkEndpointGroupAggregatedListWarning
  15266. raw := NoMethod(*s)
  15267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15268. }
  15269. type NetworkEndpointGroupAggregatedListWarningData struct {
  15270. // Key: [Output Only] A key that provides more detail on the warning
  15271. // being returned. For example, for warnings where there are no results
  15272. // in a list request for a particular zone, this key might be scope and
  15273. // the key value might be the zone name. Other examples might be a key
  15274. // indicating a deprecated resource and a suggested replacement, or a
  15275. // warning about invalid network settings (for example, if an instance
  15276. // attempts to perform IP forwarding but is not enabled for IP
  15277. // forwarding).
  15278. Key string `json:"key,omitempty"`
  15279. // Value: [Output Only] A warning data value corresponding to the key.
  15280. Value string `json:"value,omitempty"`
  15281. // ForceSendFields is a list of field names (e.g. "Key") to
  15282. // unconditionally include in API requests. By default, fields with
  15283. // empty values are omitted from API requests. However, any non-pointer,
  15284. // non-interface field appearing in ForceSendFields will be sent to the
  15285. // server regardless of whether the field is empty or not. This may be
  15286. // used to include empty fields in Patch requests.
  15287. ForceSendFields []string `json:"-"`
  15288. // NullFields is a list of field names (e.g. "Key") to include in API
  15289. // requests with the JSON null value. By default, fields with empty
  15290. // values are omitted from API requests. However, any field with an
  15291. // empty value appearing in NullFields will be sent to the server as
  15292. // null. It is an error if a field in this list has a non-empty value.
  15293. // This may be used to include null fields in Patch requests.
  15294. NullFields []string `json:"-"`
  15295. }
  15296. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15297. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  15298. raw := NoMethod(*s)
  15299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15300. }
  15301. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  15302. // fields for network endpoint group.
  15303. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  15304. // DefaultPort: The default port used if the port number is not
  15305. // specified in the network endpoint. [Deprecated] This field is
  15306. // deprecated.
  15307. DefaultPort int64 `json:"defaultPort,omitempty"`
  15308. // Network: The URL of the network to which all network endpoints in the
  15309. // NEG belong. Uses "default" project network if unspecified.
  15310. // [Deprecated] This field is deprecated.
  15311. Network string `json:"network,omitempty"`
  15312. // Subnetwork: Optional URL of the subnetwork to which all network
  15313. // endpoints in the NEG belong. [Deprecated] This field is deprecated.
  15314. Subnetwork string `json:"subnetwork,omitempty"`
  15315. // Zone: [Output Only] The URL of the zone where the network endpoint
  15316. // group is located. [Deprecated] This field is deprecated.
  15317. Zone string `json:"zone,omitempty"`
  15318. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  15319. // unconditionally include in API requests. By default, fields with
  15320. // empty values are omitted from API requests. However, any non-pointer,
  15321. // non-interface field appearing in ForceSendFields will be sent to the
  15322. // server regardless of whether the field is empty or not. This may be
  15323. // used to include empty fields in Patch requests.
  15324. ForceSendFields []string `json:"-"`
  15325. // NullFields is a list of field names (e.g. "DefaultPort") to include
  15326. // in API requests with the JSON null value. By default, fields with
  15327. // empty values are omitted from API requests. However, any field with
  15328. // an empty value appearing in NullFields will be sent to the server as
  15329. // null. It is an error if a field in this list has a non-empty value.
  15330. // This may be used to include null fields in Patch requests.
  15331. NullFields []string `json:"-"`
  15332. }
  15333. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  15334. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  15335. raw := NoMethod(*s)
  15336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15337. }
  15338. type NetworkEndpointGroupList struct {
  15339. // Id: [Output Only] Unique identifier for the resource; defined by the
  15340. // server.
  15341. Id string `json:"id,omitempty"`
  15342. // Items: A list of NetworkEndpointGroup resources.
  15343. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  15344. // Kind: [Output Only] The resource type, which is always
  15345. // compute#networkEndpointGroupList for network endpoint group lists.
  15346. Kind string `json:"kind,omitempty"`
  15347. // NextPageToken: [Output Only] This token allows you to get the next
  15348. // page of results for list requests. If the number of results is larger
  15349. // than maxResults, use the nextPageToken as a value for the query
  15350. // parameter pageToken in the next list request. Subsequent list
  15351. // requests will have their own nextPageToken to continue paging through
  15352. // the results.
  15353. NextPageToken string `json:"nextPageToken,omitempty"`
  15354. // SelfLink: [Output Only] Server-defined URL for this resource.
  15355. SelfLink string `json:"selfLink,omitempty"`
  15356. // Warning: [Output Only] Informational warning message.
  15357. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  15358. // ServerResponse contains the HTTP response code and headers from the
  15359. // server.
  15360. googleapi.ServerResponse `json:"-"`
  15361. // ForceSendFields is a list of field names (e.g. "Id") to
  15362. // unconditionally include in API requests. By default, fields with
  15363. // empty values are omitted from API requests. However, any non-pointer,
  15364. // non-interface field appearing in ForceSendFields will be sent to the
  15365. // server regardless of whether the field is empty or not. This may be
  15366. // used to include empty fields in Patch requests.
  15367. ForceSendFields []string `json:"-"`
  15368. // NullFields is a list of field names (e.g. "Id") to include in API
  15369. // requests with the JSON null value. By default, fields with empty
  15370. // values are omitted from API requests. However, any field with an
  15371. // empty value appearing in NullFields will be sent to the server as
  15372. // null. It is an error if a field in this list has a non-empty value.
  15373. // This may be used to include null fields in Patch requests.
  15374. NullFields []string `json:"-"`
  15375. }
  15376. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  15377. type NoMethod NetworkEndpointGroupList
  15378. raw := NoMethod(*s)
  15379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15380. }
  15381. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  15382. // message.
  15383. type NetworkEndpointGroupListWarning struct {
  15384. // Code: [Output Only] A warning code, if applicable. For example,
  15385. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15386. // the response.
  15387. //
  15388. // Possible values:
  15389. // "CLEANUP_FAILED"
  15390. // "DEPRECATED_RESOURCE_USED"
  15391. // "DEPRECATED_TYPE_USED"
  15392. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15393. // "EXPERIMENTAL_TYPE_USED"
  15394. // "EXTERNAL_API_WARNING"
  15395. // "FIELD_VALUE_OVERRIDEN"
  15396. // "INJECTED_KERNELS_DEPRECATED"
  15397. // "MISSING_TYPE_DEPENDENCY"
  15398. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15399. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15400. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15401. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15402. // "NEXT_HOP_NOT_RUNNING"
  15403. // "NOT_CRITICAL_ERROR"
  15404. // "NO_RESULTS_ON_PAGE"
  15405. // "REQUIRED_TOS_AGREEMENT"
  15406. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15407. // "RESOURCE_NOT_DELETED"
  15408. // "SCHEMA_VALIDATION_IGNORED"
  15409. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15410. // "UNDECLARED_PROPERTIES"
  15411. // "UNREACHABLE"
  15412. Code string `json:"code,omitempty"`
  15413. // Data: [Output Only] Metadata about this warning in key: value format.
  15414. // For example:
  15415. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15416. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  15417. // Message: [Output Only] A human-readable description of the warning
  15418. // code.
  15419. Message string `json:"message,omitempty"`
  15420. // ForceSendFields is a list of field names (e.g. "Code") to
  15421. // unconditionally include in API requests. By default, fields with
  15422. // empty values are omitted from API requests. However, any non-pointer,
  15423. // non-interface field appearing in ForceSendFields will be sent to the
  15424. // server regardless of whether the field is empty or not. This may be
  15425. // used to include empty fields in Patch requests.
  15426. ForceSendFields []string `json:"-"`
  15427. // NullFields is a list of field names (e.g. "Code") to include in API
  15428. // requests with the JSON null value. By default, fields with empty
  15429. // values are omitted from API requests. However, any field with an
  15430. // empty value appearing in NullFields will be sent to the server as
  15431. // null. It is an error if a field in this list has a non-empty value.
  15432. // This may be used to include null fields in Patch requests.
  15433. NullFields []string `json:"-"`
  15434. }
  15435. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  15436. type NoMethod NetworkEndpointGroupListWarning
  15437. raw := NoMethod(*s)
  15438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15439. }
  15440. type NetworkEndpointGroupListWarningData struct {
  15441. // Key: [Output Only] A key that provides more detail on the warning
  15442. // being returned. For example, for warnings where there are no results
  15443. // in a list request for a particular zone, this key might be scope and
  15444. // the key value might be the zone name. Other examples might be a key
  15445. // indicating a deprecated resource and a suggested replacement, or a
  15446. // warning about invalid network settings (for example, if an instance
  15447. // attempts to perform IP forwarding but is not enabled for IP
  15448. // forwarding).
  15449. Key string `json:"key,omitempty"`
  15450. // Value: [Output Only] A warning data value corresponding to the key.
  15451. Value string `json:"value,omitempty"`
  15452. // ForceSendFields is a list of field names (e.g. "Key") to
  15453. // unconditionally include in API requests. By default, fields with
  15454. // empty values are omitted from API requests. However, any non-pointer,
  15455. // non-interface field appearing in ForceSendFields will be sent to the
  15456. // server regardless of whether the field is empty or not. This may be
  15457. // used to include empty fields in Patch requests.
  15458. ForceSendFields []string `json:"-"`
  15459. // NullFields is a list of field names (e.g. "Key") to include in API
  15460. // requests with the JSON null value. By default, fields with empty
  15461. // values are omitted from API requests. However, any field with an
  15462. // empty value appearing in NullFields will be sent to the server as
  15463. // null. It is an error if a field in this list has a non-empty value.
  15464. // This may be used to include null fields in Patch requests.
  15465. NullFields []string `json:"-"`
  15466. }
  15467. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  15468. type NoMethod NetworkEndpointGroupListWarningData
  15469. raw := NoMethod(*s)
  15470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15471. }
  15472. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  15473. // NetworkEndpoints: The list of network endpoints to be attached.
  15474. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  15475. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  15476. // unconditionally include in API requests. By default, fields with
  15477. // empty values are omitted from API requests. However, any non-pointer,
  15478. // non-interface field appearing in ForceSendFields will be sent to the
  15479. // server regardless of whether the field is empty or not. This may be
  15480. // used to include empty fields in Patch requests.
  15481. ForceSendFields []string `json:"-"`
  15482. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  15483. // include in API requests with the JSON null value. By default, fields
  15484. // with empty values are omitted from API requests. However, any field
  15485. // with an empty value appearing in NullFields will be sent to the
  15486. // server as null. It is an error if a field in this list has a
  15487. // non-empty value. This may be used to include null fields in Patch
  15488. // requests.
  15489. NullFields []string `json:"-"`
  15490. }
  15491. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  15492. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  15493. raw := NoMethod(*s)
  15494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15495. }
  15496. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  15497. // NetworkEndpoints: The list of network endpoints to be detached.
  15498. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  15499. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  15500. // unconditionally include in API requests. By default, fields with
  15501. // empty values are omitted from API requests. However, any non-pointer,
  15502. // non-interface field appearing in ForceSendFields will be sent to the
  15503. // server regardless of whether the field is empty or not. This may be
  15504. // used to include empty fields in Patch requests.
  15505. ForceSendFields []string `json:"-"`
  15506. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  15507. // include in API requests with the JSON null value. By default, fields
  15508. // with empty values are omitted from API requests. However, any field
  15509. // with an empty value appearing in NullFields will be sent to the
  15510. // server as null. It is an error if a field in this list has a
  15511. // non-empty value. This may be used to include null fields in Patch
  15512. // requests.
  15513. NullFields []string `json:"-"`
  15514. }
  15515. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  15516. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  15517. raw := NoMethod(*s)
  15518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15519. }
  15520. type NetworkEndpointGroupsListEndpointsRequest struct {
  15521. // HealthStatus: Optional query parameter for showing the health status
  15522. // of each network endpoint. Valid options are SKIP or SHOW. If you
  15523. // don't specifiy this parameter, the health status of network endpoints
  15524. // will not be provided.
  15525. //
  15526. // Possible values:
  15527. // "SHOW"
  15528. // "SKIP"
  15529. HealthStatus string `json:"healthStatus,omitempty"`
  15530. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  15531. // unconditionally include in API requests. By default, fields with
  15532. // empty values are omitted from API requests. However, any non-pointer,
  15533. // non-interface field appearing in ForceSendFields will be sent to the
  15534. // server regardless of whether the field is empty or not. This may be
  15535. // used to include empty fields in Patch requests.
  15536. ForceSendFields []string `json:"-"`
  15537. // NullFields is a list of field names (e.g. "HealthStatus") to include
  15538. // in API requests with the JSON null value. By default, fields with
  15539. // empty values are omitted from API requests. However, any field with
  15540. // an empty value appearing in NullFields will be sent to the server as
  15541. // null. It is an error if a field in this list has a non-empty value.
  15542. // This may be used to include null fields in Patch requests.
  15543. NullFields []string `json:"-"`
  15544. }
  15545. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  15546. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  15547. raw := NoMethod(*s)
  15548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15549. }
  15550. type NetworkEndpointGroupsListNetworkEndpoints struct {
  15551. // Id: [Output Only] Unique identifier for the resource; defined by the
  15552. // server.
  15553. Id string `json:"id,omitempty"`
  15554. // Items: A list of NetworkEndpointWithHealthStatus resources.
  15555. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  15556. // Kind: [Output Only] The resource type, which is always
  15557. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  15558. // network endpoints in the specified network endpoint group.
  15559. Kind string `json:"kind,omitempty"`
  15560. // NextPageToken: [Output Only] This token allows you to get the next
  15561. // page of results for list requests. If the number of results is larger
  15562. // than maxResults, use the nextPageToken as a value for the query
  15563. // parameter pageToken in the next list request. Subsequent list
  15564. // requests will have their own nextPageToken to continue paging through
  15565. // the results.
  15566. NextPageToken string `json:"nextPageToken,omitempty"`
  15567. // Warning: [Output Only] Informational warning message.
  15568. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  15569. // ServerResponse contains the HTTP response code and headers from the
  15570. // server.
  15571. googleapi.ServerResponse `json:"-"`
  15572. // ForceSendFields is a list of field names (e.g. "Id") to
  15573. // unconditionally include in API requests. By default, fields with
  15574. // empty values are omitted from API requests. However, any non-pointer,
  15575. // non-interface field appearing in ForceSendFields will be sent to the
  15576. // server regardless of whether the field is empty or not. This may be
  15577. // used to include empty fields in Patch requests.
  15578. ForceSendFields []string `json:"-"`
  15579. // NullFields is a list of field names (e.g. "Id") to include in API
  15580. // requests with the JSON null value. By default, fields with empty
  15581. // values are omitted from API requests. However, any field with an
  15582. // empty value appearing in NullFields will be sent to the server as
  15583. // null. It is an error if a field in this list has a non-empty value.
  15584. // This may be used to include null fields in Patch requests.
  15585. NullFields []string `json:"-"`
  15586. }
  15587. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  15588. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  15589. raw := NoMethod(*s)
  15590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15591. }
  15592. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  15593. // Informational warning message.
  15594. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  15595. // Code: [Output Only] A warning code, if applicable. For example,
  15596. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15597. // the response.
  15598. //
  15599. // Possible values:
  15600. // "CLEANUP_FAILED"
  15601. // "DEPRECATED_RESOURCE_USED"
  15602. // "DEPRECATED_TYPE_USED"
  15603. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15604. // "EXPERIMENTAL_TYPE_USED"
  15605. // "EXTERNAL_API_WARNING"
  15606. // "FIELD_VALUE_OVERRIDEN"
  15607. // "INJECTED_KERNELS_DEPRECATED"
  15608. // "MISSING_TYPE_DEPENDENCY"
  15609. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15610. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15611. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15612. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15613. // "NEXT_HOP_NOT_RUNNING"
  15614. // "NOT_CRITICAL_ERROR"
  15615. // "NO_RESULTS_ON_PAGE"
  15616. // "REQUIRED_TOS_AGREEMENT"
  15617. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15618. // "RESOURCE_NOT_DELETED"
  15619. // "SCHEMA_VALIDATION_IGNORED"
  15620. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15621. // "UNDECLARED_PROPERTIES"
  15622. // "UNREACHABLE"
  15623. Code string `json:"code,omitempty"`
  15624. // Data: [Output Only] Metadata about this warning in key: value format.
  15625. // For example:
  15626. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15627. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  15628. // Message: [Output Only] A human-readable description of the warning
  15629. // code.
  15630. Message string `json:"message,omitempty"`
  15631. // ForceSendFields is a list of field names (e.g. "Code") to
  15632. // unconditionally include in API requests. By default, fields with
  15633. // empty values are omitted from API requests. However, any non-pointer,
  15634. // non-interface field appearing in ForceSendFields will be sent to the
  15635. // server regardless of whether the field is empty or not. This may be
  15636. // used to include empty fields in Patch requests.
  15637. ForceSendFields []string `json:"-"`
  15638. // NullFields is a list of field names (e.g. "Code") to include in API
  15639. // requests with the JSON null value. By default, fields with empty
  15640. // values are omitted from API requests. However, any field with an
  15641. // empty value appearing in NullFields will be sent to the server as
  15642. // null. It is an error if a field in this list has a non-empty value.
  15643. // This may be used to include null fields in Patch requests.
  15644. NullFields []string `json:"-"`
  15645. }
  15646. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  15647. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  15648. raw := NoMethod(*s)
  15649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15650. }
  15651. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  15652. // Key: [Output Only] A key that provides more detail on the warning
  15653. // being returned. For example, for warnings where there are no results
  15654. // in a list request for a particular zone, this key might be scope and
  15655. // the key value might be the zone name. Other examples might be a key
  15656. // indicating a deprecated resource and a suggested replacement, or a
  15657. // warning about invalid network settings (for example, if an instance
  15658. // attempts to perform IP forwarding but is not enabled for IP
  15659. // forwarding).
  15660. Key string `json:"key,omitempty"`
  15661. // Value: [Output Only] A warning data value corresponding to the key.
  15662. Value string `json:"value,omitempty"`
  15663. // ForceSendFields is a list of field names (e.g. "Key") to
  15664. // unconditionally include in API requests. By default, fields with
  15665. // empty values are omitted from API requests. However, any non-pointer,
  15666. // non-interface field appearing in ForceSendFields will be sent to the
  15667. // server regardless of whether the field is empty or not. This may be
  15668. // used to include empty fields in Patch requests.
  15669. ForceSendFields []string `json:"-"`
  15670. // NullFields is a list of field names (e.g. "Key") to include in API
  15671. // requests with the JSON null value. By default, fields with empty
  15672. // values are omitted from API requests. However, any field with an
  15673. // empty value appearing in NullFields will be sent to the server as
  15674. // null. It is an error if a field in this list has a non-empty value.
  15675. // This may be used to include null fields in Patch requests.
  15676. NullFields []string `json:"-"`
  15677. }
  15678. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  15679. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  15680. raw := NoMethod(*s)
  15681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15682. }
  15683. type NetworkEndpointGroupsScopedList struct {
  15684. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  15685. // groups that are contained in this scope.
  15686. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  15687. // Warning: [Output Only] An informational warning that replaces the
  15688. // list of network endpoint groups when the list is empty.
  15689. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  15690. // ForceSendFields is a list of field names (e.g.
  15691. // "NetworkEndpointGroups") to unconditionally include in API requests.
  15692. // By default, fields with empty values are omitted from API requests.
  15693. // However, any non-pointer, non-interface field appearing in
  15694. // ForceSendFields will be sent to the server regardless of whether the
  15695. // field is empty or not. This may be used to include empty fields in
  15696. // Patch requests.
  15697. ForceSendFields []string `json:"-"`
  15698. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  15699. // include in API requests with the JSON null value. By default, fields
  15700. // with empty values are omitted from API requests. However, any field
  15701. // with an empty value appearing in NullFields will be sent to the
  15702. // server as null. It is an error if a field in this list has a
  15703. // non-empty value. This may be used to include null fields in Patch
  15704. // requests.
  15705. NullFields []string `json:"-"`
  15706. }
  15707. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  15708. type NoMethod NetworkEndpointGroupsScopedList
  15709. raw := NoMethod(*s)
  15710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15711. }
  15712. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  15713. // informational warning that replaces the list of network endpoint
  15714. // groups when the list is empty.
  15715. type NetworkEndpointGroupsScopedListWarning struct {
  15716. // Code: [Output Only] A warning code, if applicable. For example,
  15717. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15718. // the response.
  15719. //
  15720. // Possible values:
  15721. // "CLEANUP_FAILED"
  15722. // "DEPRECATED_RESOURCE_USED"
  15723. // "DEPRECATED_TYPE_USED"
  15724. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15725. // "EXPERIMENTAL_TYPE_USED"
  15726. // "EXTERNAL_API_WARNING"
  15727. // "FIELD_VALUE_OVERRIDEN"
  15728. // "INJECTED_KERNELS_DEPRECATED"
  15729. // "MISSING_TYPE_DEPENDENCY"
  15730. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15731. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15732. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15733. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15734. // "NEXT_HOP_NOT_RUNNING"
  15735. // "NOT_CRITICAL_ERROR"
  15736. // "NO_RESULTS_ON_PAGE"
  15737. // "REQUIRED_TOS_AGREEMENT"
  15738. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15739. // "RESOURCE_NOT_DELETED"
  15740. // "SCHEMA_VALIDATION_IGNORED"
  15741. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15742. // "UNDECLARED_PROPERTIES"
  15743. // "UNREACHABLE"
  15744. Code string `json:"code,omitempty"`
  15745. // Data: [Output Only] Metadata about this warning in key: value format.
  15746. // For example:
  15747. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15748. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  15749. // Message: [Output Only] A human-readable description of the warning
  15750. // code.
  15751. Message string `json:"message,omitempty"`
  15752. // ForceSendFields is a list of field names (e.g. "Code") to
  15753. // unconditionally include in API requests. By default, fields with
  15754. // empty values are omitted from API requests. However, any non-pointer,
  15755. // non-interface field appearing in ForceSendFields will be sent to the
  15756. // server regardless of whether the field is empty or not. This may be
  15757. // used to include empty fields in Patch requests.
  15758. ForceSendFields []string `json:"-"`
  15759. // NullFields is a list of field names (e.g. "Code") to include in API
  15760. // requests with the JSON null value. By default, fields with empty
  15761. // values are omitted from API requests. However, any field with an
  15762. // empty value appearing in NullFields will be sent to the server as
  15763. // null. It is an error if a field in this list has a non-empty value.
  15764. // This may be used to include null fields in Patch requests.
  15765. NullFields []string `json:"-"`
  15766. }
  15767. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  15768. type NoMethod NetworkEndpointGroupsScopedListWarning
  15769. raw := NoMethod(*s)
  15770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15771. }
  15772. type NetworkEndpointGroupsScopedListWarningData struct {
  15773. // Key: [Output Only] A key that provides more detail on the warning
  15774. // being returned. For example, for warnings where there are no results
  15775. // in a list request for a particular zone, this key might be scope and
  15776. // the key value might be the zone name. Other examples might be a key
  15777. // indicating a deprecated resource and a suggested replacement, or a
  15778. // warning about invalid network settings (for example, if an instance
  15779. // attempts to perform IP forwarding but is not enabled for IP
  15780. // forwarding).
  15781. Key string `json:"key,omitempty"`
  15782. // Value: [Output Only] A warning data value corresponding to the key.
  15783. Value string `json:"value,omitempty"`
  15784. // ForceSendFields is a list of field names (e.g. "Key") to
  15785. // unconditionally include in API requests. By default, fields with
  15786. // empty values are omitted from API requests. However, any non-pointer,
  15787. // non-interface field appearing in ForceSendFields will be sent to the
  15788. // server regardless of whether the field is empty or not. This may be
  15789. // used to include empty fields in Patch requests.
  15790. ForceSendFields []string `json:"-"`
  15791. // NullFields is a list of field names (e.g. "Key") to include in API
  15792. // requests with the JSON null value. By default, fields with empty
  15793. // values are omitted from API requests. However, any field with an
  15794. // empty value appearing in NullFields will be sent to the server as
  15795. // null. It is an error if a field in this list has a non-empty value.
  15796. // This may be used to include null fields in Patch requests.
  15797. NullFields []string `json:"-"`
  15798. }
  15799. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  15800. type NoMethod NetworkEndpointGroupsScopedListWarningData
  15801. raw := NoMethod(*s)
  15802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15803. }
  15804. type NetworkEndpointWithHealthStatus struct {
  15805. // Healths: [Output only] The health status of network endpoint;
  15806. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  15807. // NetworkEndpoint: [Output only] The network endpoint;
  15808. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  15809. // ForceSendFields is a list of field names (e.g. "Healths") to
  15810. // unconditionally include in API requests. By default, fields with
  15811. // empty values are omitted from API requests. However, any non-pointer,
  15812. // non-interface field appearing in ForceSendFields will be sent to the
  15813. // server regardless of whether the field is empty or not. This may be
  15814. // used to include empty fields in Patch requests.
  15815. ForceSendFields []string `json:"-"`
  15816. // NullFields is a list of field names (e.g. "Healths") to include in
  15817. // API requests with the JSON null value. By default, fields with empty
  15818. // values are omitted from API requests. However, any field with an
  15819. // empty value appearing in NullFields will be sent to the server as
  15820. // null. It is an error if a field in this list has a non-empty value.
  15821. // This may be used to include null fields in Patch requests.
  15822. NullFields []string `json:"-"`
  15823. }
  15824. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  15825. type NoMethod NetworkEndpointWithHealthStatus
  15826. raw := NoMethod(*s)
  15827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15828. }
  15829. // NetworkInterface: A network interface resource attached to an
  15830. // instance.
  15831. type NetworkInterface struct {
  15832. // AccessConfigs: An array of configurations for this interface.
  15833. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  15834. // there are no accessConfigs specified, then this instance will have no
  15835. // external internet access.
  15836. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  15837. // AliasIpRanges: An array of alias IP ranges for this network
  15838. // interface. Can only be specified for network interfaces on
  15839. // subnet-mode networks.
  15840. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  15841. // Fingerprint: Fingerprint hash of contents stored in this network
  15842. // interface. This field will be ignored when inserting an Instance or
  15843. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  15844. // in order to update the NetworkInterface, otherwise the request will
  15845. // fail with error 412 conditionNotMet.
  15846. Fingerprint string `json:"fingerprint,omitempty"`
  15847. // Kind: [Output Only] Type of the resource. Always
  15848. // compute#networkInterface for network interfaces.
  15849. Kind string `json:"kind,omitempty"`
  15850. // Name: [Output Only] The name of the network interface, generated by
  15851. // the server. For network devices, these are eth0, eth1, etc.
  15852. Name string `json:"name,omitempty"`
  15853. // Network: URL of the network resource for this instance. When creating
  15854. // an instance, if neither the network nor the subnetwork is specified,
  15855. // the default network global/networks/default is used; if the network
  15856. // is not specified but the subnetwork is specified, the network is
  15857. // inferred.
  15858. //
  15859. // This field is optional when creating a firewall rule. If not
  15860. // specified when creating a firewall rule, the default network
  15861. // global/networks/default is used.
  15862. //
  15863. // If you specify this property, you can specify the network as a full
  15864. // or partial URL. For example, the following are all valid URLs:
  15865. // -
  15866. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  15867. // - projects/project/global/networks/network
  15868. // - global/networks/default
  15869. Network string `json:"network,omitempty"`
  15870. // NetworkIP: An IPv4 internal network address to assign to the instance
  15871. // for this network interface. If not specified by the user, an unused
  15872. // internal IP is assigned by the system.
  15873. NetworkIP string `json:"networkIP,omitempty"`
  15874. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  15875. // the network resource is in legacy mode, do not provide this property.
  15876. // If the network is in auto subnet mode, providing the subnetwork is
  15877. // optional. If the network is in custom subnet mode, then this field
  15878. // should be specified. If you specify this property, you can specify
  15879. // the subnetwork as a full or partial URL. For example, the following
  15880. // are all valid URLs:
  15881. // -
  15882. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  15883. // - regions/region/subnetworks/subnetwork
  15884. Subnetwork string `json:"subnetwork,omitempty"`
  15885. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  15886. // unconditionally include in API requests. By default, fields with
  15887. // empty values are omitted from API requests. However, any non-pointer,
  15888. // non-interface field appearing in ForceSendFields will be sent to the
  15889. // server regardless of whether the field is empty or not. This may be
  15890. // used to include empty fields in Patch requests.
  15891. ForceSendFields []string `json:"-"`
  15892. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  15893. // in API requests with the JSON null value. By default, fields with
  15894. // empty values are omitted from API requests. However, any field with
  15895. // an empty value appearing in NullFields will be sent to the server as
  15896. // null. It is an error if a field in this list has a non-empty value.
  15897. // This may be used to include null fields in Patch requests.
  15898. NullFields []string `json:"-"`
  15899. }
  15900. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  15901. type NoMethod NetworkInterface
  15902. raw := NoMethod(*s)
  15903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15904. }
  15905. // NetworkList: Contains a list of networks.
  15906. type NetworkList struct {
  15907. // Id: [Output Only] Unique identifier for the resource; defined by the
  15908. // server.
  15909. Id string `json:"id,omitempty"`
  15910. // Items: A list of Network resources.
  15911. Items []*Network `json:"items,omitempty"`
  15912. // Kind: [Output Only] Type of resource. Always compute#networkList for
  15913. // lists of networks.
  15914. Kind string `json:"kind,omitempty"`
  15915. // NextPageToken: [Output Only] This token allows you to get the next
  15916. // page of results for list requests. If the number of results is larger
  15917. // than maxResults, use the nextPageToken as a value for the query
  15918. // parameter pageToken in the next list request. Subsequent list
  15919. // requests will have their own nextPageToken to continue paging through
  15920. // the results.
  15921. NextPageToken string `json:"nextPageToken,omitempty"`
  15922. // SelfLink: [Output Only] Server-defined URL for this resource.
  15923. SelfLink string `json:"selfLink,omitempty"`
  15924. // Warning: [Output Only] Informational warning message.
  15925. Warning *NetworkListWarning `json:"warning,omitempty"`
  15926. // ServerResponse contains the HTTP response code and headers from the
  15927. // server.
  15928. googleapi.ServerResponse `json:"-"`
  15929. // ForceSendFields is a list of field names (e.g. "Id") to
  15930. // unconditionally include in API requests. By default, fields with
  15931. // empty values are omitted from API requests. However, any non-pointer,
  15932. // non-interface field appearing in ForceSendFields will be sent to the
  15933. // server regardless of whether the field is empty or not. This may be
  15934. // used to include empty fields in Patch requests.
  15935. ForceSendFields []string `json:"-"`
  15936. // NullFields is a list of field names (e.g. "Id") to include in API
  15937. // requests with the JSON null value. By default, fields with empty
  15938. // values are omitted from API requests. However, any field with an
  15939. // empty value appearing in NullFields will be sent to the server as
  15940. // null. It is an error if a field in this list has a non-empty value.
  15941. // This may be used to include null fields in Patch requests.
  15942. NullFields []string `json:"-"`
  15943. }
  15944. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  15945. type NoMethod NetworkList
  15946. raw := NoMethod(*s)
  15947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15948. }
  15949. // NetworkListWarning: [Output Only] Informational warning message.
  15950. type NetworkListWarning struct {
  15951. // Code: [Output Only] A warning code, if applicable. For example,
  15952. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15953. // the response.
  15954. //
  15955. // Possible values:
  15956. // "CLEANUP_FAILED"
  15957. // "DEPRECATED_RESOURCE_USED"
  15958. // "DEPRECATED_TYPE_USED"
  15959. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15960. // "EXPERIMENTAL_TYPE_USED"
  15961. // "EXTERNAL_API_WARNING"
  15962. // "FIELD_VALUE_OVERRIDEN"
  15963. // "INJECTED_KERNELS_DEPRECATED"
  15964. // "MISSING_TYPE_DEPENDENCY"
  15965. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15966. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15967. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15968. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15969. // "NEXT_HOP_NOT_RUNNING"
  15970. // "NOT_CRITICAL_ERROR"
  15971. // "NO_RESULTS_ON_PAGE"
  15972. // "REQUIRED_TOS_AGREEMENT"
  15973. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15974. // "RESOURCE_NOT_DELETED"
  15975. // "SCHEMA_VALIDATION_IGNORED"
  15976. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15977. // "UNDECLARED_PROPERTIES"
  15978. // "UNREACHABLE"
  15979. Code string `json:"code,omitempty"`
  15980. // Data: [Output Only] Metadata about this warning in key: value format.
  15981. // For example:
  15982. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15983. Data []*NetworkListWarningData `json:"data,omitempty"`
  15984. // Message: [Output Only] A human-readable description of the warning
  15985. // code.
  15986. Message string `json:"message,omitempty"`
  15987. // ForceSendFields is a list of field names (e.g. "Code") to
  15988. // unconditionally include in API requests. By default, fields with
  15989. // empty values are omitted from API requests. However, any non-pointer,
  15990. // non-interface field appearing in ForceSendFields will be sent to the
  15991. // server regardless of whether the field is empty or not. This may be
  15992. // used to include empty fields in Patch requests.
  15993. ForceSendFields []string `json:"-"`
  15994. // NullFields is a list of field names (e.g. "Code") to include in API
  15995. // requests with the JSON null value. By default, fields with empty
  15996. // values are omitted from API requests. However, any field with an
  15997. // empty value appearing in NullFields will be sent to the server as
  15998. // null. It is an error if a field in this list has a non-empty value.
  15999. // This may be used to include null fields in Patch requests.
  16000. NullFields []string `json:"-"`
  16001. }
  16002. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  16003. type NoMethod NetworkListWarning
  16004. raw := NoMethod(*s)
  16005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16006. }
  16007. type NetworkListWarningData struct {
  16008. // Key: [Output Only] A key that provides more detail on the warning
  16009. // being returned. For example, for warnings where there are no results
  16010. // in a list request for a particular zone, this key might be scope and
  16011. // the key value might be the zone name. Other examples might be a key
  16012. // indicating a deprecated resource and a suggested replacement, or a
  16013. // warning about invalid network settings (for example, if an instance
  16014. // attempts to perform IP forwarding but is not enabled for IP
  16015. // forwarding).
  16016. Key string `json:"key,omitempty"`
  16017. // Value: [Output Only] A warning data value corresponding to the key.
  16018. Value string `json:"value,omitempty"`
  16019. // ForceSendFields is a list of field names (e.g. "Key") to
  16020. // unconditionally include in API requests. By default, fields with
  16021. // empty values are omitted from API requests. However, any non-pointer,
  16022. // non-interface field appearing in ForceSendFields will be sent to the
  16023. // server regardless of whether the field is empty or not. This may be
  16024. // used to include empty fields in Patch requests.
  16025. ForceSendFields []string `json:"-"`
  16026. // NullFields is a list of field names (e.g. "Key") to include in API
  16027. // requests with the JSON null value. By default, fields with empty
  16028. // values are omitted from API requests. However, any field with an
  16029. // empty value appearing in NullFields will be sent to the server as
  16030. // null. It is an error if a field in this list has a non-empty value.
  16031. // This may be used to include null fields in Patch requests.
  16032. NullFields []string `json:"-"`
  16033. }
  16034. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  16035. type NoMethod NetworkListWarningData
  16036. raw := NoMethod(*s)
  16037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16038. }
  16039. // NetworkPeering: A network peering attached to a network resource. The
  16040. // message includes the peering name, peer network, peering state, and a
  16041. // flag indicating whether Google Compute Engine should automatically
  16042. // create routes for the peering.
  16043. type NetworkPeering struct {
  16044. // AutoCreateRoutes: Indicates whether full mesh connectivity is created
  16045. // and managed automatically. When it is set to true, Google Compute
  16046. // Engine will automatically create and manage the routes between two
  16047. // networks when the state is ACTIVE. Otherwise, user needs to create
  16048. // routes manually to route packets to peer network.
  16049. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  16050. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  16051. // managed automatically. When it is set to true, Google Compute Engine
  16052. // will automatically create and manage the routes between two networks
  16053. // when the peering state is ACTIVE. Otherwise, user needs to create
  16054. // routes manually to route packets to peer network.
  16055. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  16056. // ExportCustomRoutes: Whether to export the custom routes to peer
  16057. // network.
  16058. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  16059. // ImportCustomRoutes: Whether to import the custom routes from peer
  16060. // network.
  16061. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  16062. // Name: Name of this peering. Provided by the client when the peering
  16063. // is created. The name must comply with RFC1035. Specifically, the name
  16064. // must be 1-63 characters long and match regular expression
  16065. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16066. // a lowercase letter, and all the following characters must be a dash,
  16067. // lowercase letter, or digit, except the last character, which cannot
  16068. // be a dash.
  16069. Name string `json:"name,omitempty"`
  16070. // Network: The URL of the peer network. It can be either full URL or
  16071. // partial URL. The peer network may belong to a different project. If
  16072. // the partial URL does not contain project, it is assumed that the peer
  16073. // network is in the same project as the current network.
  16074. Network string `json:"network,omitempty"`
  16075. // State: [Output Only] State for the peering.
  16076. //
  16077. // Possible values:
  16078. // "ACTIVE"
  16079. // "INACTIVE"
  16080. State string `json:"state,omitempty"`
  16081. // StateDetails: [Output Only] Details about the current state of the
  16082. // peering.
  16083. StateDetails string `json:"stateDetails,omitempty"`
  16084. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  16085. // unconditionally include in API requests. By default, fields with
  16086. // empty values are omitted from API requests. However, any non-pointer,
  16087. // non-interface field appearing in ForceSendFields will be sent to the
  16088. // server regardless of whether the field is empty or not. This may be
  16089. // used to include empty fields in Patch requests.
  16090. ForceSendFields []string `json:"-"`
  16091. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  16092. // include in API requests with the JSON null value. By default, fields
  16093. // with empty values are omitted from API requests. However, any field
  16094. // with an empty value appearing in NullFields will be sent to the
  16095. // server as null. It is an error if a field in this list has a
  16096. // non-empty value. This may be used to include null fields in Patch
  16097. // requests.
  16098. NullFields []string `json:"-"`
  16099. }
  16100. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  16101. type NoMethod NetworkPeering
  16102. raw := NoMethod(*s)
  16103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16104. }
  16105. // NetworkRoutingConfig: A routing configuration attached to a network
  16106. // resource. The message includes the list of routers associated with
  16107. // the network, and a flag indicating the type of routing behavior to
  16108. // enforce network-wide.
  16109. type NetworkRoutingConfig struct {
  16110. // RoutingMode: The network-wide routing mode to use. If set to
  16111. // REGIONAL, this network's cloud routers will only advertise routes
  16112. // with subnets of this network in the same region as the router. If set
  16113. // to GLOBAL, this network's cloud routers will advertise routes with
  16114. // all subnets of this network, across regions.
  16115. //
  16116. // Possible values:
  16117. // "GLOBAL"
  16118. // "REGIONAL"
  16119. RoutingMode string `json:"routingMode,omitempty"`
  16120. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  16121. // unconditionally include in API requests. By default, fields with
  16122. // empty values are omitted from API requests. However, any non-pointer,
  16123. // non-interface field appearing in ForceSendFields will be sent to the
  16124. // server regardless of whether the field is empty or not. This may be
  16125. // used to include empty fields in Patch requests.
  16126. ForceSendFields []string `json:"-"`
  16127. // NullFields is a list of field names (e.g. "RoutingMode") to include
  16128. // in API requests with the JSON null value. By default, fields with
  16129. // empty values are omitted from API requests. However, any field with
  16130. // an empty value appearing in NullFields will be sent to the server as
  16131. // null. It is an error if a field in this list has a non-empty value.
  16132. // This may be used to include null fields in Patch requests.
  16133. NullFields []string `json:"-"`
  16134. }
  16135. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  16136. type NoMethod NetworkRoutingConfig
  16137. raw := NoMethod(*s)
  16138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16139. }
  16140. type NetworksAddPeeringRequest struct {
  16141. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  16142. // automatically.
  16143. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  16144. // Name: Name of the peering, which should conform to RFC1035.
  16145. Name string `json:"name,omitempty"`
  16146. // NetworkPeering: Network peering parameters. In order to specify route
  16147. // policies for peering using import/export custom routes, you will have
  16148. // to fill all peering related parameters (name, peer network,
  16149. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  16150. // in NetworksAddPeeringRequest will be deprecated soon.
  16151. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  16152. // PeerNetwork: URL of the peer network. It can be either full URL or
  16153. // partial URL. The peer network may belong to a different project. If
  16154. // the partial URL does not contain project, it is assumed that the peer
  16155. // network is in the same project as the current network.
  16156. PeerNetwork string `json:"peerNetwork,omitempty"`
  16157. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  16158. // unconditionally include in API requests. By default, fields with
  16159. // empty values are omitted from API requests. However, any non-pointer,
  16160. // non-interface field appearing in ForceSendFields will be sent to the
  16161. // server regardless of whether the field is empty or not. This may be
  16162. // used to include empty fields in Patch requests.
  16163. ForceSendFields []string `json:"-"`
  16164. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  16165. // include in API requests with the JSON null value. By default, fields
  16166. // with empty values are omitted from API requests. However, any field
  16167. // with an empty value appearing in NullFields will be sent to the
  16168. // server as null. It is an error if a field in this list has a
  16169. // non-empty value. This may be used to include null fields in Patch
  16170. // requests.
  16171. NullFields []string `json:"-"`
  16172. }
  16173. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  16174. type NoMethod NetworksAddPeeringRequest
  16175. raw := NoMethod(*s)
  16176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16177. }
  16178. type NetworksRemovePeeringRequest struct {
  16179. // Name: Name of the peering, which should conform to RFC1035.
  16180. Name string `json:"name,omitempty"`
  16181. // ForceSendFields is a list of field names (e.g. "Name") to
  16182. // unconditionally include in API requests. By default, fields with
  16183. // empty values are omitted from API requests. However, any non-pointer,
  16184. // non-interface field appearing in ForceSendFields will be sent to the
  16185. // server regardless of whether the field is empty or not. This may be
  16186. // used to include empty fields in Patch requests.
  16187. ForceSendFields []string `json:"-"`
  16188. // NullFields is a list of field names (e.g. "Name") to include in API
  16189. // requests with the JSON null value. By default, fields with empty
  16190. // values are omitted from API requests. However, any field with an
  16191. // empty value appearing in NullFields will be sent to the server as
  16192. // null. It is an error if a field in this list has a non-empty value.
  16193. // This may be used to include null fields in Patch requests.
  16194. NullFields []string `json:"-"`
  16195. }
  16196. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  16197. type NoMethod NetworksRemovePeeringRequest
  16198. raw := NoMethod(*s)
  16199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16200. }
  16201. type NetworksUpdatePeeringRequest struct {
  16202. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  16203. // ForceSendFields is a list of field names (e.g. "NetworkPeering") to
  16204. // unconditionally include in API requests. By default, fields with
  16205. // empty values are omitted from API requests. However, any non-pointer,
  16206. // non-interface field appearing in ForceSendFields will be sent to the
  16207. // server regardless of whether the field is empty or not. This may be
  16208. // used to include empty fields in Patch requests.
  16209. ForceSendFields []string `json:"-"`
  16210. // NullFields is a list of field names (e.g. "NetworkPeering") to
  16211. // include in API requests with the JSON null value. By default, fields
  16212. // with empty values are omitted from API requests. However, any field
  16213. // with an empty value appearing in NullFields will be sent to the
  16214. // server as null. It is an error if a field in this list has a
  16215. // non-empty value. This may be used to include null fields in Patch
  16216. // requests.
  16217. NullFields []string `json:"-"`
  16218. }
  16219. func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
  16220. type NoMethod NetworksUpdatePeeringRequest
  16221. raw := NoMethod(*s)
  16222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16223. }
  16224. // NodeGroup: A NodeGroup resource.
  16225. type NodeGroup struct {
  16226. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16227. // format.
  16228. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16229. // Description: An optional description of this resource. Provide this
  16230. // property when you create the resource.
  16231. Description string `json:"description,omitempty"`
  16232. // Id: [Output Only] The unique identifier for the resource. This
  16233. // identifier is defined by the server.
  16234. Id uint64 `json:"id,omitempty,string"`
  16235. // Kind: [Output Only] The type of the resource. Always
  16236. // compute#nodeGroup for node group.
  16237. Kind string `json:"kind,omitempty"`
  16238. // Name: The name of the resource, provided by the client when initially
  16239. // creating the resource. The resource name must be 1-63 characters
  16240. // long, and comply with RFC1035. Specifically, the name must be 1-63
  16241. // characters long and match the regular expression
  16242. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16243. // a lowercase letter, and all following characters must be a dash,
  16244. // lowercase letter, or digit, except the last character, which cannot
  16245. // be a dash.
  16246. Name string `json:"name,omitempty"`
  16247. // NodeTemplate: The URL of the node template to which this node group
  16248. // belongs.
  16249. NodeTemplate string `json:"nodeTemplate,omitempty"`
  16250. // SelfLink: [Output Only] Server-defined URL for the resource.
  16251. SelfLink string `json:"selfLink,omitempty"`
  16252. // Size: [Output Only] The total number of nodes in the node group.
  16253. Size int64 `json:"size,omitempty"`
  16254. // Possible values:
  16255. // "CREATING"
  16256. // "DELETING"
  16257. // "INVALID"
  16258. // "READY"
  16259. Status string `json:"status,omitempty"`
  16260. // Zone: [Output Only] The name of the zone where the node group
  16261. // resides, such as us-central1-a.
  16262. Zone string `json:"zone,omitempty"`
  16263. // ServerResponse contains the HTTP response code and headers from the
  16264. // server.
  16265. googleapi.ServerResponse `json:"-"`
  16266. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16267. // to unconditionally include in API requests. By default, fields with
  16268. // empty values are omitted from API requests. However, any non-pointer,
  16269. // non-interface field appearing in ForceSendFields will be sent to the
  16270. // server regardless of whether the field is empty or not. This may be
  16271. // used to include empty fields in Patch requests.
  16272. ForceSendFields []string `json:"-"`
  16273. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16274. // include in API requests with the JSON null value. By default, fields
  16275. // with empty values are omitted from API requests. However, any field
  16276. // with an empty value appearing in NullFields will be sent to the
  16277. // server as null. It is an error if a field in this list has a
  16278. // non-empty value. This may be used to include null fields in Patch
  16279. // requests.
  16280. NullFields []string `json:"-"`
  16281. }
  16282. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  16283. type NoMethod NodeGroup
  16284. raw := NoMethod(*s)
  16285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16286. }
  16287. type NodeGroupAggregatedList struct {
  16288. // Id: [Output Only] Unique identifier for the resource; defined by the
  16289. // server.
  16290. Id string `json:"id,omitempty"`
  16291. // Items: A list of NodeGroupsScopedList resources.
  16292. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  16293. // Kind: [Output Only] Type of resource.Always
  16294. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  16295. Kind string `json:"kind,omitempty"`
  16296. // NextPageToken: [Output Only] This token allows you to get the next
  16297. // page of results for list requests. If the number of results is larger
  16298. // than maxResults, use the nextPageToken as a value for the query
  16299. // parameter pageToken in the next list request. Subsequent list
  16300. // requests will have their own nextPageToken to continue paging through
  16301. // the results.
  16302. NextPageToken string `json:"nextPageToken,omitempty"`
  16303. // SelfLink: [Output Only] Server-defined URL for this resource.
  16304. SelfLink string `json:"selfLink,omitempty"`
  16305. // Warning: [Output Only] Informational warning message.
  16306. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  16307. // ServerResponse contains the HTTP response code and headers from the
  16308. // server.
  16309. googleapi.ServerResponse `json:"-"`
  16310. // ForceSendFields is a list of field names (e.g. "Id") to
  16311. // unconditionally include in API requests. By default, fields with
  16312. // empty values are omitted from API requests. However, any non-pointer,
  16313. // non-interface field appearing in ForceSendFields will be sent to the
  16314. // server regardless of whether the field is empty or not. This may be
  16315. // used to include empty fields in Patch requests.
  16316. ForceSendFields []string `json:"-"`
  16317. // NullFields is a list of field names (e.g. "Id") to include in API
  16318. // requests with the JSON null value. By default, fields with empty
  16319. // values are omitted from API requests. However, any field with an
  16320. // empty value appearing in NullFields will be sent to the server as
  16321. // null. It is an error if a field in this list has a non-empty value.
  16322. // This may be used to include null fields in Patch requests.
  16323. NullFields []string `json:"-"`
  16324. }
  16325. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  16326. type NoMethod NodeGroupAggregatedList
  16327. raw := NoMethod(*s)
  16328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16329. }
  16330. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  16331. // message.
  16332. type NodeGroupAggregatedListWarning struct {
  16333. // Code: [Output Only] A warning code, if applicable. For example,
  16334. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16335. // the response.
  16336. //
  16337. // Possible values:
  16338. // "CLEANUP_FAILED"
  16339. // "DEPRECATED_RESOURCE_USED"
  16340. // "DEPRECATED_TYPE_USED"
  16341. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16342. // "EXPERIMENTAL_TYPE_USED"
  16343. // "EXTERNAL_API_WARNING"
  16344. // "FIELD_VALUE_OVERRIDEN"
  16345. // "INJECTED_KERNELS_DEPRECATED"
  16346. // "MISSING_TYPE_DEPENDENCY"
  16347. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16348. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16349. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16350. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16351. // "NEXT_HOP_NOT_RUNNING"
  16352. // "NOT_CRITICAL_ERROR"
  16353. // "NO_RESULTS_ON_PAGE"
  16354. // "REQUIRED_TOS_AGREEMENT"
  16355. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16356. // "RESOURCE_NOT_DELETED"
  16357. // "SCHEMA_VALIDATION_IGNORED"
  16358. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16359. // "UNDECLARED_PROPERTIES"
  16360. // "UNREACHABLE"
  16361. Code string `json:"code,omitempty"`
  16362. // Data: [Output Only] Metadata about this warning in key: value format.
  16363. // For example:
  16364. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16365. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  16366. // Message: [Output Only] A human-readable description of the warning
  16367. // code.
  16368. Message string `json:"message,omitempty"`
  16369. // ForceSendFields is a list of field names (e.g. "Code") to
  16370. // unconditionally include in API requests. By default, fields with
  16371. // empty values are omitted from API requests. However, any non-pointer,
  16372. // non-interface field appearing in ForceSendFields will be sent to the
  16373. // server regardless of whether the field is empty or not. This may be
  16374. // used to include empty fields in Patch requests.
  16375. ForceSendFields []string `json:"-"`
  16376. // NullFields is a list of field names (e.g. "Code") to include in API
  16377. // requests with the JSON null value. By default, fields with empty
  16378. // values are omitted from API requests. However, any field with an
  16379. // empty value appearing in NullFields will be sent to the server as
  16380. // null. It is an error if a field in this list has a non-empty value.
  16381. // This may be used to include null fields in Patch requests.
  16382. NullFields []string `json:"-"`
  16383. }
  16384. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16385. type NoMethod NodeGroupAggregatedListWarning
  16386. raw := NoMethod(*s)
  16387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16388. }
  16389. type NodeGroupAggregatedListWarningData struct {
  16390. // Key: [Output Only] A key that provides more detail on the warning
  16391. // being returned. For example, for warnings where there are no results
  16392. // in a list request for a particular zone, this key might be scope and
  16393. // the key value might be the zone name. Other examples might be a key
  16394. // indicating a deprecated resource and a suggested replacement, or a
  16395. // warning about invalid network settings (for example, if an instance
  16396. // attempts to perform IP forwarding but is not enabled for IP
  16397. // forwarding).
  16398. Key string `json:"key,omitempty"`
  16399. // Value: [Output Only] A warning data value corresponding to the key.
  16400. Value string `json:"value,omitempty"`
  16401. // ForceSendFields is a list of field names (e.g. "Key") to
  16402. // unconditionally include in API requests. By default, fields with
  16403. // empty values are omitted from API requests. However, any non-pointer,
  16404. // non-interface field appearing in ForceSendFields will be sent to the
  16405. // server regardless of whether the field is empty or not. This may be
  16406. // used to include empty fields in Patch requests.
  16407. ForceSendFields []string `json:"-"`
  16408. // NullFields is a list of field names (e.g. "Key") to include in API
  16409. // requests with the JSON null value. By default, fields with empty
  16410. // values are omitted from API requests. However, any field with an
  16411. // empty value appearing in NullFields will be sent to the server as
  16412. // null. It is an error if a field in this list has a non-empty value.
  16413. // This may be used to include null fields in Patch requests.
  16414. NullFields []string `json:"-"`
  16415. }
  16416. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16417. type NoMethod NodeGroupAggregatedListWarningData
  16418. raw := NoMethod(*s)
  16419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16420. }
  16421. // NodeGroupList: Contains a list of nodeGroups.
  16422. type NodeGroupList struct {
  16423. // Id: [Output Only] Unique identifier for the resource; defined by the
  16424. // server.
  16425. Id string `json:"id,omitempty"`
  16426. // Items: A list of NodeGroup resources.
  16427. Items []*NodeGroup `json:"items,omitempty"`
  16428. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  16429. // lists of node groups.
  16430. Kind string `json:"kind,omitempty"`
  16431. // NextPageToken: [Output Only] This token allows you to get the next
  16432. // page of results for list requests. If the number of results is larger
  16433. // than maxResults, use the nextPageToken as a value for the query
  16434. // parameter pageToken in the next list request. Subsequent list
  16435. // requests will have their own nextPageToken to continue paging through
  16436. // the results.
  16437. NextPageToken string `json:"nextPageToken,omitempty"`
  16438. // SelfLink: [Output Only] Server-defined URL for this resource.
  16439. SelfLink string `json:"selfLink,omitempty"`
  16440. // Warning: [Output Only] Informational warning message.
  16441. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  16442. // ServerResponse contains the HTTP response code and headers from the
  16443. // server.
  16444. googleapi.ServerResponse `json:"-"`
  16445. // ForceSendFields is a list of field names (e.g. "Id") to
  16446. // unconditionally include in API requests. By default, fields with
  16447. // empty values are omitted from API requests. However, any non-pointer,
  16448. // non-interface field appearing in ForceSendFields will be sent to the
  16449. // server regardless of whether the field is empty or not. This may be
  16450. // used to include empty fields in Patch requests.
  16451. ForceSendFields []string `json:"-"`
  16452. // NullFields is a list of field names (e.g. "Id") to include in API
  16453. // requests with the JSON null value. By default, fields with empty
  16454. // values are omitted from API requests. However, any field with an
  16455. // empty value appearing in NullFields will be sent to the server as
  16456. // null. It is an error if a field in this list has a non-empty value.
  16457. // This may be used to include null fields in Patch requests.
  16458. NullFields []string `json:"-"`
  16459. }
  16460. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  16461. type NoMethod NodeGroupList
  16462. raw := NoMethod(*s)
  16463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16464. }
  16465. // NodeGroupListWarning: [Output Only] Informational warning message.
  16466. type NodeGroupListWarning struct {
  16467. // Code: [Output Only] A warning code, if applicable. For example,
  16468. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16469. // the response.
  16470. //
  16471. // Possible values:
  16472. // "CLEANUP_FAILED"
  16473. // "DEPRECATED_RESOURCE_USED"
  16474. // "DEPRECATED_TYPE_USED"
  16475. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16476. // "EXPERIMENTAL_TYPE_USED"
  16477. // "EXTERNAL_API_WARNING"
  16478. // "FIELD_VALUE_OVERRIDEN"
  16479. // "INJECTED_KERNELS_DEPRECATED"
  16480. // "MISSING_TYPE_DEPENDENCY"
  16481. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16482. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16483. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16484. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16485. // "NEXT_HOP_NOT_RUNNING"
  16486. // "NOT_CRITICAL_ERROR"
  16487. // "NO_RESULTS_ON_PAGE"
  16488. // "REQUIRED_TOS_AGREEMENT"
  16489. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16490. // "RESOURCE_NOT_DELETED"
  16491. // "SCHEMA_VALIDATION_IGNORED"
  16492. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16493. // "UNDECLARED_PROPERTIES"
  16494. // "UNREACHABLE"
  16495. Code string `json:"code,omitempty"`
  16496. // Data: [Output Only] Metadata about this warning in key: value format.
  16497. // For example:
  16498. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16499. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  16500. // Message: [Output Only] A human-readable description of the warning
  16501. // code.
  16502. Message string `json:"message,omitempty"`
  16503. // ForceSendFields is a list of field names (e.g. "Code") to
  16504. // unconditionally include in API requests. By default, fields with
  16505. // empty values are omitted from API requests. However, any non-pointer,
  16506. // non-interface field appearing in ForceSendFields will be sent to the
  16507. // server regardless of whether the field is empty or not. This may be
  16508. // used to include empty fields in Patch requests.
  16509. ForceSendFields []string `json:"-"`
  16510. // NullFields is a list of field names (e.g. "Code") to include in API
  16511. // requests with the JSON null value. By default, fields with empty
  16512. // values are omitted from API requests. However, any field with an
  16513. // empty value appearing in NullFields will be sent to the server as
  16514. // null. It is an error if a field in this list has a non-empty value.
  16515. // This may be used to include null fields in Patch requests.
  16516. NullFields []string `json:"-"`
  16517. }
  16518. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  16519. type NoMethod NodeGroupListWarning
  16520. raw := NoMethod(*s)
  16521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16522. }
  16523. type NodeGroupListWarningData struct {
  16524. // Key: [Output Only] A key that provides more detail on the warning
  16525. // being returned. For example, for warnings where there are no results
  16526. // in a list request for a particular zone, this key might be scope and
  16527. // the key value might be the zone name. Other examples might be a key
  16528. // indicating a deprecated resource and a suggested replacement, or a
  16529. // warning about invalid network settings (for example, if an instance
  16530. // attempts to perform IP forwarding but is not enabled for IP
  16531. // forwarding).
  16532. Key string `json:"key,omitempty"`
  16533. // Value: [Output Only] A warning data value corresponding to the key.
  16534. Value string `json:"value,omitempty"`
  16535. // ForceSendFields is a list of field names (e.g. "Key") to
  16536. // unconditionally include in API requests. By default, fields with
  16537. // empty values are omitted from API requests. However, any non-pointer,
  16538. // non-interface field appearing in ForceSendFields will be sent to the
  16539. // server regardless of whether the field is empty or not. This may be
  16540. // used to include empty fields in Patch requests.
  16541. ForceSendFields []string `json:"-"`
  16542. // NullFields is a list of field names (e.g. "Key") to include in API
  16543. // requests with the JSON null value. By default, fields with empty
  16544. // values are omitted from API requests. However, any field with an
  16545. // empty value appearing in NullFields will be sent to the server as
  16546. // null. It is an error if a field in this list has a non-empty value.
  16547. // This may be used to include null fields in Patch requests.
  16548. NullFields []string `json:"-"`
  16549. }
  16550. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  16551. type NoMethod NodeGroupListWarningData
  16552. raw := NoMethod(*s)
  16553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16554. }
  16555. type NodeGroupNode struct {
  16556. // Instances: Instances scheduled on this node.
  16557. Instances []string `json:"instances,omitempty"`
  16558. // Name: The name of the node.
  16559. Name string `json:"name,omitempty"`
  16560. // NodeType: The type of this node.
  16561. NodeType string `json:"nodeType,omitempty"`
  16562. // Possible values:
  16563. // "CREATING"
  16564. // "DELETING"
  16565. // "INVALID"
  16566. // "READY"
  16567. // "REPAIRING"
  16568. Status string `json:"status,omitempty"`
  16569. // ForceSendFields is a list of field names (e.g. "Instances") to
  16570. // unconditionally include in API requests. By default, fields with
  16571. // empty values are omitted from API requests. However, any non-pointer,
  16572. // non-interface field appearing in ForceSendFields will be sent to the
  16573. // server regardless of whether the field is empty or not. This may be
  16574. // used to include empty fields in Patch requests.
  16575. ForceSendFields []string `json:"-"`
  16576. // NullFields is a list of field names (e.g. "Instances") to include in
  16577. // API requests with the JSON null value. By default, fields with empty
  16578. // values are omitted from API requests. However, any field with an
  16579. // empty value appearing in NullFields will be sent to the server as
  16580. // null. It is an error if a field in this list has a non-empty value.
  16581. // This may be used to include null fields in Patch requests.
  16582. NullFields []string `json:"-"`
  16583. }
  16584. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  16585. type NoMethod NodeGroupNode
  16586. raw := NoMethod(*s)
  16587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16588. }
  16589. type NodeGroupsAddNodesRequest struct {
  16590. // AdditionalNodeCount: Count of additional nodes to be added to the
  16591. // node group.
  16592. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  16593. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  16594. // to unconditionally include in API requests. By default, fields with
  16595. // empty values are omitted from API requests. However, any non-pointer,
  16596. // non-interface field appearing in ForceSendFields will be sent to the
  16597. // server regardless of whether the field is empty or not. This may be
  16598. // used to include empty fields in Patch requests.
  16599. ForceSendFields []string `json:"-"`
  16600. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  16601. // include in API requests with the JSON null value. By default, fields
  16602. // with empty values are omitted from API requests. However, any field
  16603. // with an empty value appearing in NullFields will be sent to the
  16604. // server as null. It is an error if a field in this list has a
  16605. // non-empty value. This may be used to include null fields in Patch
  16606. // requests.
  16607. NullFields []string `json:"-"`
  16608. }
  16609. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  16610. type NoMethod NodeGroupsAddNodesRequest
  16611. raw := NoMethod(*s)
  16612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16613. }
  16614. type NodeGroupsDeleteNodesRequest struct {
  16615. Nodes []string `json:"nodes,omitempty"`
  16616. // ForceSendFields is a list of field names (e.g. "Nodes") to
  16617. // unconditionally include in API requests. By default, fields with
  16618. // empty values are omitted from API requests. However, any non-pointer,
  16619. // non-interface field appearing in ForceSendFields will be sent to the
  16620. // server regardless of whether the field is empty or not. This may be
  16621. // used to include empty fields in Patch requests.
  16622. ForceSendFields []string `json:"-"`
  16623. // NullFields is a list of field names (e.g. "Nodes") to include in API
  16624. // requests with the JSON null value. By default, fields with empty
  16625. // values are omitted from API requests. However, any field with an
  16626. // empty value appearing in NullFields will be sent to the server as
  16627. // null. It is an error if a field in this list has a non-empty value.
  16628. // This may be used to include null fields in Patch requests.
  16629. NullFields []string `json:"-"`
  16630. }
  16631. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  16632. type NoMethod NodeGroupsDeleteNodesRequest
  16633. raw := NoMethod(*s)
  16634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16635. }
  16636. type NodeGroupsListNodes struct {
  16637. // Id: [Output Only] Unique identifier for the resource; defined by the
  16638. // server.
  16639. Id string `json:"id,omitempty"`
  16640. // Items: A list of Node resources.
  16641. Items []*NodeGroupNode `json:"items,omitempty"`
  16642. // Kind: [Output Only] The resource type, which is always
  16643. // compute.nodeGroupsListNodes for the list of nodes in the specified
  16644. // node group.
  16645. Kind string `json:"kind,omitempty"`
  16646. // NextPageToken: [Output Only] This token allows you to get the next
  16647. // page of results for list requests. If the number of results is larger
  16648. // than maxResults, use the nextPageToken as a value for the query
  16649. // parameter pageToken in the next list request. Subsequent list
  16650. // requests will have their own nextPageToken to continue paging through
  16651. // the results.
  16652. NextPageToken string `json:"nextPageToken,omitempty"`
  16653. // SelfLink: [Output Only] Server-defined URL for this resource.
  16654. SelfLink string `json:"selfLink,omitempty"`
  16655. // Warning: [Output Only] Informational warning message.
  16656. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  16657. // ServerResponse contains the HTTP response code and headers from the
  16658. // server.
  16659. googleapi.ServerResponse `json:"-"`
  16660. // ForceSendFields is a list of field names (e.g. "Id") to
  16661. // unconditionally include in API requests. By default, fields with
  16662. // empty values are omitted from API requests. However, any non-pointer,
  16663. // non-interface field appearing in ForceSendFields will be sent to the
  16664. // server regardless of whether the field is empty or not. This may be
  16665. // used to include empty fields in Patch requests.
  16666. ForceSendFields []string `json:"-"`
  16667. // NullFields is a list of field names (e.g. "Id") to include in API
  16668. // requests with the JSON null value. By default, fields with empty
  16669. // values are omitted from API requests. However, any field with an
  16670. // empty value appearing in NullFields will be sent to the server as
  16671. // null. It is an error if a field in this list has a non-empty value.
  16672. // This may be used to include null fields in Patch requests.
  16673. NullFields []string `json:"-"`
  16674. }
  16675. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  16676. type NoMethod NodeGroupsListNodes
  16677. raw := NoMethod(*s)
  16678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16679. }
  16680. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  16681. // message.
  16682. type NodeGroupsListNodesWarning struct {
  16683. // Code: [Output Only] A warning code, if applicable. For example,
  16684. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16685. // the response.
  16686. //
  16687. // Possible values:
  16688. // "CLEANUP_FAILED"
  16689. // "DEPRECATED_RESOURCE_USED"
  16690. // "DEPRECATED_TYPE_USED"
  16691. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16692. // "EXPERIMENTAL_TYPE_USED"
  16693. // "EXTERNAL_API_WARNING"
  16694. // "FIELD_VALUE_OVERRIDEN"
  16695. // "INJECTED_KERNELS_DEPRECATED"
  16696. // "MISSING_TYPE_DEPENDENCY"
  16697. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16698. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16699. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16700. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16701. // "NEXT_HOP_NOT_RUNNING"
  16702. // "NOT_CRITICAL_ERROR"
  16703. // "NO_RESULTS_ON_PAGE"
  16704. // "REQUIRED_TOS_AGREEMENT"
  16705. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16706. // "RESOURCE_NOT_DELETED"
  16707. // "SCHEMA_VALIDATION_IGNORED"
  16708. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16709. // "UNDECLARED_PROPERTIES"
  16710. // "UNREACHABLE"
  16711. Code string `json:"code,omitempty"`
  16712. // Data: [Output Only] Metadata about this warning in key: value format.
  16713. // For example:
  16714. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16715. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  16716. // Message: [Output Only] A human-readable description of the warning
  16717. // code.
  16718. Message string `json:"message,omitempty"`
  16719. // ForceSendFields is a list of field names (e.g. "Code") to
  16720. // unconditionally include in API requests. By default, fields with
  16721. // empty values are omitted from API requests. However, any non-pointer,
  16722. // non-interface field appearing in ForceSendFields will be sent to the
  16723. // server regardless of whether the field is empty or not. This may be
  16724. // used to include empty fields in Patch requests.
  16725. ForceSendFields []string `json:"-"`
  16726. // NullFields is a list of field names (e.g. "Code") to include in API
  16727. // requests with the JSON null value. By default, fields with empty
  16728. // values are omitted from API requests. However, any field with an
  16729. // empty value appearing in NullFields will be sent to the server as
  16730. // null. It is an error if a field in this list has a non-empty value.
  16731. // This may be used to include null fields in Patch requests.
  16732. NullFields []string `json:"-"`
  16733. }
  16734. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  16735. type NoMethod NodeGroupsListNodesWarning
  16736. raw := NoMethod(*s)
  16737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16738. }
  16739. type NodeGroupsListNodesWarningData struct {
  16740. // Key: [Output Only] A key that provides more detail on the warning
  16741. // being returned. For example, for warnings where there are no results
  16742. // in a list request for a particular zone, this key might be scope and
  16743. // the key value might be the zone name. Other examples might be a key
  16744. // indicating a deprecated resource and a suggested replacement, or a
  16745. // warning about invalid network settings (for example, if an instance
  16746. // attempts to perform IP forwarding but is not enabled for IP
  16747. // forwarding).
  16748. Key string `json:"key,omitempty"`
  16749. // Value: [Output Only] A warning data value corresponding to the key.
  16750. Value string `json:"value,omitempty"`
  16751. // ForceSendFields is a list of field names (e.g. "Key") to
  16752. // unconditionally include in API requests. By default, fields with
  16753. // empty values are omitted from API requests. However, any non-pointer,
  16754. // non-interface field appearing in ForceSendFields will be sent to the
  16755. // server regardless of whether the field is empty or not. This may be
  16756. // used to include empty fields in Patch requests.
  16757. ForceSendFields []string `json:"-"`
  16758. // NullFields is a list of field names (e.g. "Key") to include in API
  16759. // requests with the JSON null value. By default, fields with empty
  16760. // values are omitted from API requests. However, any field with an
  16761. // empty value appearing in NullFields will be sent to the server as
  16762. // null. It is an error if a field in this list has a non-empty value.
  16763. // This may be used to include null fields in Patch requests.
  16764. NullFields []string `json:"-"`
  16765. }
  16766. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  16767. type NoMethod NodeGroupsListNodesWarningData
  16768. raw := NoMethod(*s)
  16769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16770. }
  16771. type NodeGroupsScopedList struct {
  16772. // NodeGroups: [Output Only] A list of node groups contained in this
  16773. // scope.
  16774. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  16775. // Warning: [Output Only] An informational warning that appears when the
  16776. // nodeGroup list is empty.
  16777. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  16778. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  16779. // unconditionally include in API requests. By default, fields with
  16780. // empty values are omitted from API requests. However, any non-pointer,
  16781. // non-interface field appearing in ForceSendFields will be sent to the
  16782. // server regardless of whether the field is empty or not. This may be
  16783. // used to include empty fields in Patch requests.
  16784. ForceSendFields []string `json:"-"`
  16785. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  16786. // API requests with the JSON null value. By default, fields with empty
  16787. // values are omitted from API requests. However, any field with an
  16788. // empty value appearing in NullFields will be sent to the server as
  16789. // null. It is an error if a field in this list has a non-empty value.
  16790. // This may be used to include null fields in Patch requests.
  16791. NullFields []string `json:"-"`
  16792. }
  16793. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  16794. type NoMethod NodeGroupsScopedList
  16795. raw := NoMethod(*s)
  16796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16797. }
  16798. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  16799. // that appears when the nodeGroup list is empty.
  16800. type NodeGroupsScopedListWarning struct {
  16801. // Code: [Output Only] A warning code, if applicable. For example,
  16802. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16803. // the response.
  16804. //
  16805. // Possible values:
  16806. // "CLEANUP_FAILED"
  16807. // "DEPRECATED_RESOURCE_USED"
  16808. // "DEPRECATED_TYPE_USED"
  16809. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16810. // "EXPERIMENTAL_TYPE_USED"
  16811. // "EXTERNAL_API_WARNING"
  16812. // "FIELD_VALUE_OVERRIDEN"
  16813. // "INJECTED_KERNELS_DEPRECATED"
  16814. // "MISSING_TYPE_DEPENDENCY"
  16815. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16816. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16817. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16818. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16819. // "NEXT_HOP_NOT_RUNNING"
  16820. // "NOT_CRITICAL_ERROR"
  16821. // "NO_RESULTS_ON_PAGE"
  16822. // "REQUIRED_TOS_AGREEMENT"
  16823. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16824. // "RESOURCE_NOT_DELETED"
  16825. // "SCHEMA_VALIDATION_IGNORED"
  16826. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16827. // "UNDECLARED_PROPERTIES"
  16828. // "UNREACHABLE"
  16829. Code string `json:"code,omitempty"`
  16830. // Data: [Output Only] Metadata about this warning in key: value format.
  16831. // For example:
  16832. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16833. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  16834. // Message: [Output Only] A human-readable description of the warning
  16835. // code.
  16836. Message string `json:"message,omitempty"`
  16837. // ForceSendFields is a list of field names (e.g. "Code") to
  16838. // unconditionally include in API requests. By default, fields with
  16839. // empty values are omitted from API requests. However, any non-pointer,
  16840. // non-interface field appearing in ForceSendFields will be sent to the
  16841. // server regardless of whether the field is empty or not. This may be
  16842. // used to include empty fields in Patch requests.
  16843. ForceSendFields []string `json:"-"`
  16844. // NullFields is a list of field names (e.g. "Code") to include in API
  16845. // requests with the JSON null value. By default, fields with empty
  16846. // values are omitted from API requests. However, any field with an
  16847. // empty value appearing in NullFields will be sent to the server as
  16848. // null. It is an error if a field in this list has a non-empty value.
  16849. // This may be used to include null fields in Patch requests.
  16850. NullFields []string `json:"-"`
  16851. }
  16852. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  16853. type NoMethod NodeGroupsScopedListWarning
  16854. raw := NoMethod(*s)
  16855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16856. }
  16857. type NodeGroupsScopedListWarningData struct {
  16858. // Key: [Output Only] A key that provides more detail on the warning
  16859. // being returned. For example, for warnings where there are no results
  16860. // in a list request for a particular zone, this key might be scope and
  16861. // the key value might be the zone name. Other examples might be a key
  16862. // indicating a deprecated resource and a suggested replacement, or a
  16863. // warning about invalid network settings (for example, if an instance
  16864. // attempts to perform IP forwarding but is not enabled for IP
  16865. // forwarding).
  16866. Key string `json:"key,omitempty"`
  16867. // Value: [Output Only] A warning data value corresponding to the key.
  16868. Value string `json:"value,omitempty"`
  16869. // ForceSendFields is a list of field names (e.g. "Key") to
  16870. // unconditionally include in API requests. By default, fields with
  16871. // empty values are omitted from API requests. However, any non-pointer,
  16872. // non-interface field appearing in ForceSendFields will be sent to the
  16873. // server regardless of whether the field is empty or not. This may be
  16874. // used to include empty fields in Patch requests.
  16875. ForceSendFields []string `json:"-"`
  16876. // NullFields is a list of field names (e.g. "Key") to include in API
  16877. // requests with the JSON null value. By default, fields with empty
  16878. // values are omitted from API requests. However, any field with an
  16879. // empty value appearing in NullFields will be sent to the server as
  16880. // null. It is an error if a field in this list has a non-empty value.
  16881. // This may be used to include null fields in Patch requests.
  16882. NullFields []string `json:"-"`
  16883. }
  16884. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16885. type NoMethod NodeGroupsScopedListWarningData
  16886. raw := NoMethod(*s)
  16887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16888. }
  16889. type NodeGroupsSetNodeTemplateRequest struct {
  16890. // NodeTemplate: Full or partial URL of the node template resource to be
  16891. // updated for this node group.
  16892. NodeTemplate string `json:"nodeTemplate,omitempty"`
  16893. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  16894. // unconditionally include in API requests. By default, fields with
  16895. // empty values are omitted from API requests. However, any non-pointer,
  16896. // non-interface field appearing in ForceSendFields will be sent to the
  16897. // server regardless of whether the field is empty or not. This may be
  16898. // used to include empty fields in Patch requests.
  16899. ForceSendFields []string `json:"-"`
  16900. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  16901. // in API requests with the JSON null value. By default, fields with
  16902. // empty values are omitted from API requests. However, any field with
  16903. // an empty value appearing in NullFields will be sent to the server as
  16904. // null. It is an error if a field in this list has a non-empty value.
  16905. // This may be used to include null fields in Patch requests.
  16906. NullFields []string `json:"-"`
  16907. }
  16908. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  16909. type NoMethod NodeGroupsSetNodeTemplateRequest
  16910. raw := NoMethod(*s)
  16911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16912. }
  16913. // NodeTemplate: A Node Template resource.
  16914. type NodeTemplate struct {
  16915. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16916. // format.
  16917. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16918. // Description: An optional description of this resource. Provide this
  16919. // property when you create the resource.
  16920. Description string `json:"description,omitempty"`
  16921. // Id: [Output Only] The unique identifier for the resource. This
  16922. // identifier is defined by the server.
  16923. Id uint64 `json:"id,omitempty,string"`
  16924. // Kind: [Output Only] The type of the resource. Always
  16925. // compute#nodeTemplate for node templates.
  16926. Kind string `json:"kind,omitempty"`
  16927. // Name: The name of the resource, provided by the client when initially
  16928. // creating the resource. The resource name must be 1-63 characters
  16929. // long, and comply with RFC1035. Specifically, the name must be 1-63
  16930. // characters long and match the regular expression
  16931. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16932. // a lowercase letter, and all following characters must be a dash,
  16933. // lowercase letter, or digit, except the last character, which cannot
  16934. // be a dash.
  16935. Name string `json:"name,omitempty"`
  16936. // NodeAffinityLabels: Labels to use for node affinity, which will be
  16937. // used in instance scheduling.
  16938. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  16939. // NodeType: The node type to use for nodes group that are created from
  16940. // this template.
  16941. NodeType string `json:"nodeType,omitempty"`
  16942. // NodeTypeFlexibility: The flexible properties of the desired node
  16943. // type. Node groups that use this node template will create nodes of a
  16944. // type that matches these properties.
  16945. //
  16946. // This field is mutually exclusive with the node_type property; you can
  16947. // only define one or the other, but not both.
  16948. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  16949. // Region: [Output Only] The name of the region where the node template
  16950. // resides, such as us-central1.
  16951. Region string `json:"region,omitempty"`
  16952. // SelfLink: [Output Only] Server-defined URL for the resource.
  16953. SelfLink string `json:"selfLink,omitempty"`
  16954. // Status: [Output Only] The status of the node template. One of the
  16955. // following values: CREATING, READY, and DELETING.
  16956. //
  16957. // Possible values:
  16958. // "CREATING"
  16959. // "DELETING"
  16960. // "INVALID"
  16961. // "READY"
  16962. Status string `json:"status,omitempty"`
  16963. // StatusMessage: [Output Only] An optional, human-readable explanation
  16964. // of the status.
  16965. StatusMessage string `json:"statusMessage,omitempty"`
  16966. // ServerResponse contains the HTTP response code and headers from the
  16967. // server.
  16968. googleapi.ServerResponse `json:"-"`
  16969. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16970. // to unconditionally include in API requests. By default, fields with
  16971. // empty values are omitted from API requests. However, any non-pointer,
  16972. // non-interface field appearing in ForceSendFields will be sent to the
  16973. // server regardless of whether the field is empty or not. This may be
  16974. // used to include empty fields in Patch requests.
  16975. ForceSendFields []string `json:"-"`
  16976. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16977. // include in API requests with the JSON null value. By default, fields
  16978. // with empty values are omitted from API requests. However, any field
  16979. // with an empty value appearing in NullFields will be sent to the
  16980. // server as null. It is an error if a field in this list has a
  16981. // non-empty value. This may be used to include null fields in Patch
  16982. // requests.
  16983. NullFields []string `json:"-"`
  16984. }
  16985. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  16986. type NoMethod NodeTemplate
  16987. raw := NoMethod(*s)
  16988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16989. }
  16990. type NodeTemplateAggregatedList struct {
  16991. // Id: [Output Only] Unique identifier for the resource; defined by the
  16992. // server.
  16993. Id string `json:"id,omitempty"`
  16994. // Items: A list of NodeTemplatesScopedList resources.
  16995. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  16996. // Kind: [Output Only] Type of resource.Always
  16997. // compute#nodeTemplateAggregatedList for aggregated lists of node
  16998. // templates.
  16999. Kind string `json:"kind,omitempty"`
  17000. // NextPageToken: [Output Only] This token allows you to get the next
  17001. // page of results for list requests. If the number of results is larger
  17002. // than maxResults, use the nextPageToken as a value for the query
  17003. // parameter pageToken in the next list request. Subsequent list
  17004. // requests will have their own nextPageToken to continue paging through
  17005. // the results.
  17006. NextPageToken string `json:"nextPageToken,omitempty"`
  17007. // SelfLink: [Output Only] Server-defined URL for this resource.
  17008. SelfLink string `json:"selfLink,omitempty"`
  17009. // Warning: [Output Only] Informational warning message.
  17010. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  17011. // ServerResponse contains the HTTP response code and headers from the
  17012. // server.
  17013. googleapi.ServerResponse `json:"-"`
  17014. // ForceSendFields is a list of field names (e.g. "Id") to
  17015. // unconditionally include in API requests. By default, fields with
  17016. // empty values are omitted from API requests. However, any non-pointer,
  17017. // non-interface field appearing in ForceSendFields will be sent to the
  17018. // server regardless of whether the field is empty or not. This may be
  17019. // used to include empty fields in Patch requests.
  17020. ForceSendFields []string `json:"-"`
  17021. // NullFields is a list of field names (e.g. "Id") to include in API
  17022. // requests with the JSON null value. By default, fields with empty
  17023. // values are omitted from API requests. However, any field with an
  17024. // empty value appearing in NullFields will be sent to the server as
  17025. // null. It is an error if a field in this list has a non-empty value.
  17026. // This may be used to include null fields in Patch requests.
  17027. NullFields []string `json:"-"`
  17028. }
  17029. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  17030. type NoMethod NodeTemplateAggregatedList
  17031. raw := NoMethod(*s)
  17032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17033. }
  17034. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  17035. // warning message.
  17036. type NodeTemplateAggregatedListWarning struct {
  17037. // Code: [Output Only] A warning code, if applicable. For example,
  17038. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17039. // the response.
  17040. //
  17041. // Possible values:
  17042. // "CLEANUP_FAILED"
  17043. // "DEPRECATED_RESOURCE_USED"
  17044. // "DEPRECATED_TYPE_USED"
  17045. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17046. // "EXPERIMENTAL_TYPE_USED"
  17047. // "EXTERNAL_API_WARNING"
  17048. // "FIELD_VALUE_OVERRIDEN"
  17049. // "INJECTED_KERNELS_DEPRECATED"
  17050. // "MISSING_TYPE_DEPENDENCY"
  17051. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17052. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17053. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17054. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17055. // "NEXT_HOP_NOT_RUNNING"
  17056. // "NOT_CRITICAL_ERROR"
  17057. // "NO_RESULTS_ON_PAGE"
  17058. // "REQUIRED_TOS_AGREEMENT"
  17059. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17060. // "RESOURCE_NOT_DELETED"
  17061. // "SCHEMA_VALIDATION_IGNORED"
  17062. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17063. // "UNDECLARED_PROPERTIES"
  17064. // "UNREACHABLE"
  17065. Code string `json:"code,omitempty"`
  17066. // Data: [Output Only] Metadata about this warning in key: value format.
  17067. // For example:
  17068. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17069. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  17070. // Message: [Output Only] A human-readable description of the warning
  17071. // code.
  17072. Message string `json:"message,omitempty"`
  17073. // ForceSendFields is a list of field names (e.g. "Code") to
  17074. // unconditionally include in API requests. By default, fields with
  17075. // empty values are omitted from API requests. However, any non-pointer,
  17076. // non-interface field appearing in ForceSendFields will be sent to the
  17077. // server regardless of whether the field is empty or not. This may be
  17078. // used to include empty fields in Patch requests.
  17079. ForceSendFields []string `json:"-"`
  17080. // NullFields is a list of field names (e.g. "Code") to include in API
  17081. // requests with the JSON null value. By default, fields with empty
  17082. // values are omitted from API requests. However, any field with an
  17083. // empty value appearing in NullFields will be sent to the server as
  17084. // null. It is an error if a field in this list has a non-empty value.
  17085. // This may be used to include null fields in Patch requests.
  17086. NullFields []string `json:"-"`
  17087. }
  17088. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17089. type NoMethod NodeTemplateAggregatedListWarning
  17090. raw := NoMethod(*s)
  17091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17092. }
  17093. type NodeTemplateAggregatedListWarningData struct {
  17094. // Key: [Output Only] A key that provides more detail on the warning
  17095. // being returned. For example, for warnings where there are no results
  17096. // in a list request for a particular zone, this key might be scope and
  17097. // the key value might be the zone name. Other examples might be a key
  17098. // indicating a deprecated resource and a suggested replacement, or a
  17099. // warning about invalid network settings (for example, if an instance
  17100. // attempts to perform IP forwarding but is not enabled for IP
  17101. // forwarding).
  17102. Key string `json:"key,omitempty"`
  17103. // Value: [Output Only] A warning data value corresponding to the key.
  17104. Value string `json:"value,omitempty"`
  17105. // ForceSendFields is a list of field names (e.g. "Key") to
  17106. // unconditionally include in API requests. By default, fields with
  17107. // empty values are omitted from API requests. However, any non-pointer,
  17108. // non-interface field appearing in ForceSendFields will be sent to the
  17109. // server regardless of whether the field is empty or not. This may be
  17110. // used to include empty fields in Patch requests.
  17111. ForceSendFields []string `json:"-"`
  17112. // NullFields is a list of field names (e.g. "Key") to include in API
  17113. // requests with the JSON null value. By default, fields with empty
  17114. // values are omitted from API requests. However, any field with an
  17115. // empty value appearing in NullFields will be sent to the server as
  17116. // null. It is an error if a field in this list has a non-empty value.
  17117. // This may be used to include null fields in Patch requests.
  17118. NullFields []string `json:"-"`
  17119. }
  17120. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17121. type NoMethod NodeTemplateAggregatedListWarningData
  17122. raw := NoMethod(*s)
  17123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17124. }
  17125. // NodeTemplateList: Contains a list of node templates.
  17126. type NodeTemplateList struct {
  17127. // Id: [Output Only] Unique identifier for the resource; defined by the
  17128. // server.
  17129. Id string `json:"id,omitempty"`
  17130. // Items: A list of NodeTemplate resources.
  17131. Items []*NodeTemplate `json:"items,omitempty"`
  17132. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  17133. // for lists of node templates.
  17134. Kind string `json:"kind,omitempty"`
  17135. // NextPageToken: [Output Only] This token allows you to get the next
  17136. // page of results for list requests. If the number of results is larger
  17137. // than maxResults, use the nextPageToken as a value for the query
  17138. // parameter pageToken in the next list request. Subsequent list
  17139. // requests will have their own nextPageToken to continue paging through
  17140. // the results.
  17141. NextPageToken string `json:"nextPageToken,omitempty"`
  17142. // SelfLink: [Output Only] Server-defined URL for this resource.
  17143. SelfLink string `json:"selfLink,omitempty"`
  17144. // Warning: [Output Only] Informational warning message.
  17145. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  17146. // ServerResponse contains the HTTP response code and headers from the
  17147. // server.
  17148. googleapi.ServerResponse `json:"-"`
  17149. // ForceSendFields is a list of field names (e.g. "Id") to
  17150. // unconditionally include in API requests. By default, fields with
  17151. // empty values are omitted from API requests. However, any non-pointer,
  17152. // non-interface field appearing in ForceSendFields will be sent to the
  17153. // server regardless of whether the field is empty or not. This may be
  17154. // used to include empty fields in Patch requests.
  17155. ForceSendFields []string `json:"-"`
  17156. // NullFields is a list of field names (e.g. "Id") to include in API
  17157. // requests with the JSON null value. By default, fields with empty
  17158. // values are omitted from API requests. However, any field with an
  17159. // empty value appearing in NullFields will be sent to the server as
  17160. // null. It is an error if a field in this list has a non-empty value.
  17161. // This may be used to include null fields in Patch requests.
  17162. NullFields []string `json:"-"`
  17163. }
  17164. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  17165. type NoMethod NodeTemplateList
  17166. raw := NoMethod(*s)
  17167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17168. }
  17169. // NodeTemplateListWarning: [Output Only] Informational warning message.
  17170. type NodeTemplateListWarning struct {
  17171. // Code: [Output Only] A warning code, if applicable. For example,
  17172. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17173. // the response.
  17174. //
  17175. // Possible values:
  17176. // "CLEANUP_FAILED"
  17177. // "DEPRECATED_RESOURCE_USED"
  17178. // "DEPRECATED_TYPE_USED"
  17179. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17180. // "EXPERIMENTAL_TYPE_USED"
  17181. // "EXTERNAL_API_WARNING"
  17182. // "FIELD_VALUE_OVERRIDEN"
  17183. // "INJECTED_KERNELS_DEPRECATED"
  17184. // "MISSING_TYPE_DEPENDENCY"
  17185. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17186. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17187. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17188. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17189. // "NEXT_HOP_NOT_RUNNING"
  17190. // "NOT_CRITICAL_ERROR"
  17191. // "NO_RESULTS_ON_PAGE"
  17192. // "REQUIRED_TOS_AGREEMENT"
  17193. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17194. // "RESOURCE_NOT_DELETED"
  17195. // "SCHEMA_VALIDATION_IGNORED"
  17196. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17197. // "UNDECLARED_PROPERTIES"
  17198. // "UNREACHABLE"
  17199. Code string `json:"code,omitempty"`
  17200. // Data: [Output Only] Metadata about this warning in key: value format.
  17201. // For example:
  17202. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17203. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  17204. // Message: [Output Only] A human-readable description of the warning
  17205. // code.
  17206. Message string `json:"message,omitempty"`
  17207. // ForceSendFields is a list of field names (e.g. "Code") to
  17208. // unconditionally include in API requests. By default, fields with
  17209. // empty values are omitted from API requests. However, any non-pointer,
  17210. // non-interface field appearing in ForceSendFields will be sent to the
  17211. // server regardless of whether the field is empty or not. This may be
  17212. // used to include empty fields in Patch requests.
  17213. ForceSendFields []string `json:"-"`
  17214. // NullFields is a list of field names (e.g. "Code") to include in API
  17215. // requests with the JSON null value. By default, fields with empty
  17216. // values are omitted from API requests. However, any field with an
  17217. // empty value appearing in NullFields will be sent to the server as
  17218. // null. It is an error if a field in this list has a non-empty value.
  17219. // This may be used to include null fields in Patch requests.
  17220. NullFields []string `json:"-"`
  17221. }
  17222. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  17223. type NoMethod NodeTemplateListWarning
  17224. raw := NoMethod(*s)
  17225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17226. }
  17227. type NodeTemplateListWarningData struct {
  17228. // Key: [Output Only] A key that provides more detail on the warning
  17229. // being returned. For example, for warnings where there are no results
  17230. // in a list request for a particular zone, this key might be scope and
  17231. // the key value might be the zone name. Other examples might be a key
  17232. // indicating a deprecated resource and a suggested replacement, or a
  17233. // warning about invalid network settings (for example, if an instance
  17234. // attempts to perform IP forwarding but is not enabled for IP
  17235. // forwarding).
  17236. Key string `json:"key,omitempty"`
  17237. // Value: [Output Only] A warning data value corresponding to the key.
  17238. Value string `json:"value,omitempty"`
  17239. // ForceSendFields is a list of field names (e.g. "Key") to
  17240. // unconditionally include in API requests. By default, fields with
  17241. // empty values are omitted from API requests. However, any non-pointer,
  17242. // non-interface field appearing in ForceSendFields will be sent to the
  17243. // server regardless of whether the field is empty or not. This may be
  17244. // used to include empty fields in Patch requests.
  17245. ForceSendFields []string `json:"-"`
  17246. // NullFields is a list of field names (e.g. "Key") to include in API
  17247. // requests with the JSON null value. By default, fields with empty
  17248. // values are omitted from API requests. However, any field with an
  17249. // empty value appearing in NullFields will be sent to the server as
  17250. // null. It is an error if a field in this list has a non-empty value.
  17251. // This may be used to include null fields in Patch requests.
  17252. NullFields []string `json:"-"`
  17253. }
  17254. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  17255. type NoMethod NodeTemplateListWarningData
  17256. raw := NoMethod(*s)
  17257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17258. }
  17259. type NodeTemplateNodeTypeFlexibility struct {
  17260. Cpus string `json:"cpus,omitempty"`
  17261. LocalSsd string `json:"localSsd,omitempty"`
  17262. Memory string `json:"memory,omitempty"`
  17263. // ForceSendFields is a list of field names (e.g. "Cpus") to
  17264. // unconditionally include in API requests. By default, fields with
  17265. // empty values are omitted from API requests. However, any non-pointer,
  17266. // non-interface field appearing in ForceSendFields will be sent to the
  17267. // server regardless of whether the field is empty or not. This may be
  17268. // used to include empty fields in Patch requests.
  17269. ForceSendFields []string `json:"-"`
  17270. // NullFields is a list of field names (e.g. "Cpus") to include in API
  17271. // requests with the JSON null value. By default, fields with empty
  17272. // values are omitted from API requests. However, any field with an
  17273. // empty value appearing in NullFields will be sent to the server as
  17274. // null. It is an error if a field in this list has a non-empty value.
  17275. // This may be used to include null fields in Patch requests.
  17276. NullFields []string `json:"-"`
  17277. }
  17278. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  17279. type NoMethod NodeTemplateNodeTypeFlexibility
  17280. raw := NoMethod(*s)
  17281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17282. }
  17283. type NodeTemplatesScopedList struct {
  17284. // NodeTemplates: [Output Only] A list of node templates contained in
  17285. // this scope.
  17286. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  17287. // Warning: [Output Only] An informational warning that appears when the
  17288. // node templates list is empty.
  17289. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  17290. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  17291. // unconditionally include in API requests. By default, fields with
  17292. // empty values are omitted from API requests. However, any non-pointer,
  17293. // non-interface field appearing in ForceSendFields will be sent to the
  17294. // server regardless of whether the field is empty or not. This may be
  17295. // used to include empty fields in Patch requests.
  17296. ForceSendFields []string `json:"-"`
  17297. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  17298. // in API requests with the JSON null value. By default, fields with
  17299. // empty values are omitted from API requests. However, any field with
  17300. // an empty value appearing in NullFields will be sent to the server as
  17301. // null. It is an error if a field in this list has a non-empty value.
  17302. // This may be used to include null fields in Patch requests.
  17303. NullFields []string `json:"-"`
  17304. }
  17305. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  17306. type NoMethod NodeTemplatesScopedList
  17307. raw := NoMethod(*s)
  17308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17309. }
  17310. // NodeTemplatesScopedListWarning: [Output Only] An informational
  17311. // warning that appears when the node templates list is empty.
  17312. type NodeTemplatesScopedListWarning struct {
  17313. // Code: [Output Only] A warning code, if applicable. For example,
  17314. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17315. // the response.
  17316. //
  17317. // Possible values:
  17318. // "CLEANUP_FAILED"
  17319. // "DEPRECATED_RESOURCE_USED"
  17320. // "DEPRECATED_TYPE_USED"
  17321. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17322. // "EXPERIMENTAL_TYPE_USED"
  17323. // "EXTERNAL_API_WARNING"
  17324. // "FIELD_VALUE_OVERRIDEN"
  17325. // "INJECTED_KERNELS_DEPRECATED"
  17326. // "MISSING_TYPE_DEPENDENCY"
  17327. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17328. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17329. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17330. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17331. // "NEXT_HOP_NOT_RUNNING"
  17332. // "NOT_CRITICAL_ERROR"
  17333. // "NO_RESULTS_ON_PAGE"
  17334. // "REQUIRED_TOS_AGREEMENT"
  17335. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17336. // "RESOURCE_NOT_DELETED"
  17337. // "SCHEMA_VALIDATION_IGNORED"
  17338. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17339. // "UNDECLARED_PROPERTIES"
  17340. // "UNREACHABLE"
  17341. Code string `json:"code,omitempty"`
  17342. // Data: [Output Only] Metadata about this warning in key: value format.
  17343. // For example:
  17344. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17345. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  17346. // Message: [Output Only] A human-readable description of the warning
  17347. // code.
  17348. Message string `json:"message,omitempty"`
  17349. // ForceSendFields is a list of field names (e.g. "Code") to
  17350. // unconditionally include in API requests. By default, fields with
  17351. // empty values are omitted from API requests. However, any non-pointer,
  17352. // non-interface field appearing in ForceSendFields will be sent to the
  17353. // server regardless of whether the field is empty or not. This may be
  17354. // used to include empty fields in Patch requests.
  17355. ForceSendFields []string `json:"-"`
  17356. // NullFields is a list of field names (e.g. "Code") to include in API
  17357. // requests with the JSON null value. By default, fields with empty
  17358. // values are omitted from API requests. However, any field with an
  17359. // empty value appearing in NullFields will be sent to the server as
  17360. // null. It is an error if a field in this list has a non-empty value.
  17361. // This may be used to include null fields in Patch requests.
  17362. NullFields []string `json:"-"`
  17363. }
  17364. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  17365. type NoMethod NodeTemplatesScopedListWarning
  17366. raw := NoMethod(*s)
  17367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17368. }
  17369. type NodeTemplatesScopedListWarningData struct {
  17370. // Key: [Output Only] A key that provides more detail on the warning
  17371. // being returned. For example, for warnings where there are no results
  17372. // in a list request for a particular zone, this key might be scope and
  17373. // the key value might be the zone name. Other examples might be a key
  17374. // indicating a deprecated resource and a suggested replacement, or a
  17375. // warning about invalid network settings (for example, if an instance
  17376. // attempts to perform IP forwarding but is not enabled for IP
  17377. // forwarding).
  17378. Key string `json:"key,omitempty"`
  17379. // Value: [Output Only] A warning data value corresponding to the key.
  17380. Value string `json:"value,omitempty"`
  17381. // ForceSendFields is a list of field names (e.g. "Key") to
  17382. // unconditionally include in API requests. By default, fields with
  17383. // empty values are omitted from API requests. However, any non-pointer,
  17384. // non-interface field appearing in ForceSendFields will be sent to the
  17385. // server regardless of whether the field is empty or not. This may be
  17386. // used to include empty fields in Patch requests.
  17387. ForceSendFields []string `json:"-"`
  17388. // NullFields is a list of field names (e.g. "Key") to include in API
  17389. // requests with the JSON null value. By default, fields with empty
  17390. // values are omitted from API requests. However, any field with an
  17391. // empty value appearing in NullFields will be sent to the server as
  17392. // null. It is an error if a field in this list has a non-empty value.
  17393. // This may be used to include null fields in Patch requests.
  17394. NullFields []string `json:"-"`
  17395. }
  17396. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  17397. type NoMethod NodeTemplatesScopedListWarningData
  17398. raw := NoMethod(*s)
  17399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17400. }
  17401. // NodeType: A Node Type resource.
  17402. type NodeType struct {
  17403. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  17404. CpuPlatform string `json:"cpuPlatform,omitempty"`
  17405. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17406. // format.
  17407. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17408. // Deprecated: [Output Only] The deprecation status associated with this
  17409. // node type.
  17410. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17411. // Description: [Output Only] An optional textual description of the
  17412. // resource.
  17413. Description string `json:"description,omitempty"`
  17414. // GuestCpus: [Output Only] The number of virtual CPUs that are
  17415. // available to the node type.
  17416. GuestCpus int64 `json:"guestCpus,omitempty"`
  17417. // Id: [Output Only] The unique identifier for the resource. This
  17418. // identifier is defined by the server.
  17419. Id uint64 `json:"id,omitempty,string"`
  17420. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  17421. // for node types.
  17422. Kind string `json:"kind,omitempty"`
  17423. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  17424. // defined in GB.
  17425. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  17426. // MemoryMb: [Output Only] The amount of physical memory available to
  17427. // the node type, defined in MB.
  17428. MemoryMb int64 `json:"memoryMb,omitempty"`
  17429. // Name: [Output Only] Name of the resource.
  17430. Name string `json:"name,omitempty"`
  17431. // SelfLink: [Output Only] Server-defined URL for the resource.
  17432. SelfLink string `json:"selfLink,omitempty"`
  17433. // Zone: [Output Only] The name of the zone where the node type resides,
  17434. // such as us-central1-a.
  17435. Zone string `json:"zone,omitempty"`
  17436. // ServerResponse contains the HTTP response code and headers from the
  17437. // server.
  17438. googleapi.ServerResponse `json:"-"`
  17439. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  17440. // unconditionally include in API requests. By default, fields with
  17441. // empty values are omitted from API requests. However, any non-pointer,
  17442. // non-interface field appearing in ForceSendFields will be sent to the
  17443. // server regardless of whether the field is empty or not. This may be
  17444. // used to include empty fields in Patch requests.
  17445. ForceSendFields []string `json:"-"`
  17446. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  17447. // in API requests with the JSON null value. By default, fields with
  17448. // empty values are omitted from API requests. However, any field with
  17449. // an empty value appearing in NullFields will be sent to the server as
  17450. // null. It is an error if a field in this list has a non-empty value.
  17451. // This may be used to include null fields in Patch requests.
  17452. NullFields []string `json:"-"`
  17453. }
  17454. func (s *NodeType) MarshalJSON() ([]byte, error) {
  17455. type NoMethod NodeType
  17456. raw := NoMethod(*s)
  17457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17458. }
  17459. type NodeTypeAggregatedList struct {
  17460. // Id: [Output Only] Unique identifier for the resource; defined by the
  17461. // server.
  17462. Id string `json:"id,omitempty"`
  17463. // Items: A list of NodeTypesScopedList resources.
  17464. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  17465. // Kind: [Output Only] Type of resource.Always
  17466. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  17467. Kind string `json:"kind,omitempty"`
  17468. // NextPageToken: [Output Only] This token allows you to get the next
  17469. // page of results for list requests. If the number of results is larger
  17470. // than maxResults, use the nextPageToken as a value for the query
  17471. // parameter pageToken in the next list request. Subsequent list
  17472. // requests will have their own nextPageToken to continue paging through
  17473. // the results.
  17474. NextPageToken string `json:"nextPageToken,omitempty"`
  17475. // SelfLink: [Output Only] Server-defined URL for this resource.
  17476. SelfLink string `json:"selfLink,omitempty"`
  17477. // Warning: [Output Only] Informational warning message.
  17478. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  17479. // ServerResponse contains the HTTP response code and headers from the
  17480. // server.
  17481. googleapi.ServerResponse `json:"-"`
  17482. // ForceSendFields is a list of field names (e.g. "Id") to
  17483. // unconditionally include in API requests. By default, fields with
  17484. // empty values are omitted from API requests. However, any non-pointer,
  17485. // non-interface field appearing in ForceSendFields will be sent to the
  17486. // server regardless of whether the field is empty or not. This may be
  17487. // used to include empty fields in Patch requests.
  17488. ForceSendFields []string `json:"-"`
  17489. // NullFields is a list of field names (e.g. "Id") to include in API
  17490. // requests with the JSON null value. By default, fields with empty
  17491. // values are omitted from API requests. However, any field with an
  17492. // empty value appearing in NullFields will be sent to the server as
  17493. // null. It is an error if a field in this list has a non-empty value.
  17494. // This may be used to include null fields in Patch requests.
  17495. NullFields []string `json:"-"`
  17496. }
  17497. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  17498. type NoMethod NodeTypeAggregatedList
  17499. raw := NoMethod(*s)
  17500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17501. }
  17502. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  17503. // message.
  17504. type NodeTypeAggregatedListWarning struct {
  17505. // Code: [Output Only] A warning code, if applicable. For example,
  17506. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17507. // the response.
  17508. //
  17509. // Possible values:
  17510. // "CLEANUP_FAILED"
  17511. // "DEPRECATED_RESOURCE_USED"
  17512. // "DEPRECATED_TYPE_USED"
  17513. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17514. // "EXPERIMENTAL_TYPE_USED"
  17515. // "EXTERNAL_API_WARNING"
  17516. // "FIELD_VALUE_OVERRIDEN"
  17517. // "INJECTED_KERNELS_DEPRECATED"
  17518. // "MISSING_TYPE_DEPENDENCY"
  17519. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17520. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17521. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17522. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17523. // "NEXT_HOP_NOT_RUNNING"
  17524. // "NOT_CRITICAL_ERROR"
  17525. // "NO_RESULTS_ON_PAGE"
  17526. // "REQUIRED_TOS_AGREEMENT"
  17527. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17528. // "RESOURCE_NOT_DELETED"
  17529. // "SCHEMA_VALIDATION_IGNORED"
  17530. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17531. // "UNDECLARED_PROPERTIES"
  17532. // "UNREACHABLE"
  17533. Code string `json:"code,omitempty"`
  17534. // Data: [Output Only] Metadata about this warning in key: value format.
  17535. // For example:
  17536. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17537. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  17538. // Message: [Output Only] A human-readable description of the warning
  17539. // code.
  17540. Message string `json:"message,omitempty"`
  17541. // ForceSendFields is a list of field names (e.g. "Code") to
  17542. // unconditionally include in API requests. By default, fields with
  17543. // empty values are omitted from API requests. However, any non-pointer,
  17544. // non-interface field appearing in ForceSendFields will be sent to the
  17545. // server regardless of whether the field is empty or not. This may be
  17546. // used to include empty fields in Patch requests.
  17547. ForceSendFields []string `json:"-"`
  17548. // NullFields is a list of field names (e.g. "Code") to include in API
  17549. // requests with the JSON null value. By default, fields with empty
  17550. // values are omitted from API requests. However, any field with an
  17551. // empty value appearing in NullFields will be sent to the server as
  17552. // null. It is an error if a field in this list has a non-empty value.
  17553. // This may be used to include null fields in Patch requests.
  17554. NullFields []string `json:"-"`
  17555. }
  17556. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17557. type NoMethod NodeTypeAggregatedListWarning
  17558. raw := NoMethod(*s)
  17559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17560. }
  17561. type NodeTypeAggregatedListWarningData struct {
  17562. // Key: [Output Only] A key that provides more detail on the warning
  17563. // being returned. For example, for warnings where there are no results
  17564. // in a list request for a particular zone, this key might be scope and
  17565. // the key value might be the zone name. Other examples might be a key
  17566. // indicating a deprecated resource and a suggested replacement, or a
  17567. // warning about invalid network settings (for example, if an instance
  17568. // attempts to perform IP forwarding but is not enabled for IP
  17569. // forwarding).
  17570. Key string `json:"key,omitempty"`
  17571. // Value: [Output Only] A warning data value corresponding to the key.
  17572. Value string `json:"value,omitempty"`
  17573. // ForceSendFields is a list of field names (e.g. "Key") to
  17574. // unconditionally include in API requests. By default, fields with
  17575. // empty values are omitted from API requests. However, any non-pointer,
  17576. // non-interface field appearing in ForceSendFields will be sent to the
  17577. // server regardless of whether the field is empty or not. This may be
  17578. // used to include empty fields in Patch requests.
  17579. ForceSendFields []string `json:"-"`
  17580. // NullFields is a list of field names (e.g. "Key") to include in API
  17581. // requests with the JSON null value. By default, fields with empty
  17582. // values are omitted from API requests. However, any field with an
  17583. // empty value appearing in NullFields will be sent to the server as
  17584. // null. It is an error if a field in this list has a non-empty value.
  17585. // This may be used to include null fields in Patch requests.
  17586. NullFields []string `json:"-"`
  17587. }
  17588. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17589. type NoMethod NodeTypeAggregatedListWarningData
  17590. raw := NoMethod(*s)
  17591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17592. }
  17593. // NodeTypeList: Contains a list of node types.
  17594. type NodeTypeList struct {
  17595. // Id: [Output Only] Unique identifier for the resource; defined by the
  17596. // server.
  17597. Id string `json:"id,omitempty"`
  17598. // Items: A list of NodeType resources.
  17599. Items []*NodeType `json:"items,omitempty"`
  17600. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  17601. // lists of node types.
  17602. Kind string `json:"kind,omitempty"`
  17603. // NextPageToken: [Output Only] This token allows you to get the next
  17604. // page of results for list requests. If the number of results is larger
  17605. // than maxResults, use the nextPageToken as a value for the query
  17606. // parameter pageToken in the next list request. Subsequent list
  17607. // requests will have their own nextPageToken to continue paging through
  17608. // the results.
  17609. NextPageToken string `json:"nextPageToken,omitempty"`
  17610. // SelfLink: [Output Only] Server-defined URL for this resource.
  17611. SelfLink string `json:"selfLink,omitempty"`
  17612. // Warning: [Output Only] Informational warning message.
  17613. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  17614. // ServerResponse contains the HTTP response code and headers from the
  17615. // server.
  17616. googleapi.ServerResponse `json:"-"`
  17617. // ForceSendFields is a list of field names (e.g. "Id") to
  17618. // unconditionally include in API requests. By default, fields with
  17619. // empty values are omitted from API requests. However, any non-pointer,
  17620. // non-interface field appearing in ForceSendFields will be sent to the
  17621. // server regardless of whether the field is empty or not. This may be
  17622. // used to include empty fields in Patch requests.
  17623. ForceSendFields []string `json:"-"`
  17624. // NullFields is a list of field names (e.g. "Id") to include in API
  17625. // requests with the JSON null value. By default, fields with empty
  17626. // values are omitted from API requests. However, any field with an
  17627. // empty value appearing in NullFields will be sent to the server as
  17628. // null. It is an error if a field in this list has a non-empty value.
  17629. // This may be used to include null fields in Patch requests.
  17630. NullFields []string `json:"-"`
  17631. }
  17632. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  17633. type NoMethod NodeTypeList
  17634. raw := NoMethod(*s)
  17635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17636. }
  17637. // NodeTypeListWarning: [Output Only] Informational warning message.
  17638. type NodeTypeListWarning struct {
  17639. // Code: [Output Only] A warning code, if applicable. For example,
  17640. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17641. // the response.
  17642. //
  17643. // Possible values:
  17644. // "CLEANUP_FAILED"
  17645. // "DEPRECATED_RESOURCE_USED"
  17646. // "DEPRECATED_TYPE_USED"
  17647. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17648. // "EXPERIMENTAL_TYPE_USED"
  17649. // "EXTERNAL_API_WARNING"
  17650. // "FIELD_VALUE_OVERRIDEN"
  17651. // "INJECTED_KERNELS_DEPRECATED"
  17652. // "MISSING_TYPE_DEPENDENCY"
  17653. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17654. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17655. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17656. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17657. // "NEXT_HOP_NOT_RUNNING"
  17658. // "NOT_CRITICAL_ERROR"
  17659. // "NO_RESULTS_ON_PAGE"
  17660. // "REQUIRED_TOS_AGREEMENT"
  17661. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17662. // "RESOURCE_NOT_DELETED"
  17663. // "SCHEMA_VALIDATION_IGNORED"
  17664. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17665. // "UNDECLARED_PROPERTIES"
  17666. // "UNREACHABLE"
  17667. Code string `json:"code,omitempty"`
  17668. // Data: [Output Only] Metadata about this warning in key: value format.
  17669. // For example:
  17670. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17671. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  17672. // Message: [Output Only] A human-readable description of the warning
  17673. // code.
  17674. Message string `json:"message,omitempty"`
  17675. // ForceSendFields is a list of field names (e.g. "Code") to
  17676. // unconditionally include in API requests. By default, fields with
  17677. // empty values are omitted from API requests. However, any non-pointer,
  17678. // non-interface field appearing in ForceSendFields will be sent to the
  17679. // server regardless of whether the field is empty or not. This may be
  17680. // used to include empty fields in Patch requests.
  17681. ForceSendFields []string `json:"-"`
  17682. // NullFields is a list of field names (e.g. "Code") to include in API
  17683. // requests with the JSON null value. By default, fields with empty
  17684. // values are omitted from API requests. However, any field with an
  17685. // empty value appearing in NullFields will be sent to the server as
  17686. // null. It is an error if a field in this list has a non-empty value.
  17687. // This may be used to include null fields in Patch requests.
  17688. NullFields []string `json:"-"`
  17689. }
  17690. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  17691. type NoMethod NodeTypeListWarning
  17692. raw := NoMethod(*s)
  17693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17694. }
  17695. type NodeTypeListWarningData struct {
  17696. // Key: [Output Only] A key that provides more detail on the warning
  17697. // being returned. For example, for warnings where there are no results
  17698. // in a list request for a particular zone, this key might be scope and
  17699. // the key value might be the zone name. Other examples might be a key
  17700. // indicating a deprecated resource and a suggested replacement, or a
  17701. // warning about invalid network settings (for example, if an instance
  17702. // attempts to perform IP forwarding but is not enabled for IP
  17703. // forwarding).
  17704. Key string `json:"key,omitempty"`
  17705. // Value: [Output Only] A warning data value corresponding to the key.
  17706. Value string `json:"value,omitempty"`
  17707. // ForceSendFields is a list of field names (e.g. "Key") to
  17708. // unconditionally include in API requests. By default, fields with
  17709. // empty values are omitted from API requests. However, any non-pointer,
  17710. // non-interface field appearing in ForceSendFields will be sent to the
  17711. // server regardless of whether the field is empty or not. This may be
  17712. // used to include empty fields in Patch requests.
  17713. ForceSendFields []string `json:"-"`
  17714. // NullFields is a list of field names (e.g. "Key") to include in API
  17715. // requests with the JSON null value. By default, fields with empty
  17716. // values are omitted from API requests. However, any field with an
  17717. // empty value appearing in NullFields will be sent to the server as
  17718. // null. It is an error if a field in this list has a non-empty value.
  17719. // This may be used to include null fields in Patch requests.
  17720. NullFields []string `json:"-"`
  17721. }
  17722. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  17723. type NoMethod NodeTypeListWarningData
  17724. raw := NoMethod(*s)
  17725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17726. }
  17727. type NodeTypesScopedList struct {
  17728. // NodeTypes: [Output Only] A list of node types contained in this
  17729. // scope.
  17730. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  17731. // Warning: [Output Only] An informational warning that appears when the
  17732. // node types list is empty.
  17733. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  17734. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  17735. // unconditionally include in API requests. By default, fields with
  17736. // empty values are omitted from API requests. However, any non-pointer,
  17737. // non-interface field appearing in ForceSendFields will be sent to the
  17738. // server regardless of whether the field is empty or not. This may be
  17739. // used to include empty fields in Patch requests.
  17740. ForceSendFields []string `json:"-"`
  17741. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  17742. // API requests with the JSON null value. By default, fields with empty
  17743. // values are omitted from API requests. However, any field with an
  17744. // empty value appearing in NullFields will be sent to the server as
  17745. // null. It is an error if a field in this list has a non-empty value.
  17746. // This may be used to include null fields in Patch requests.
  17747. NullFields []string `json:"-"`
  17748. }
  17749. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  17750. type NoMethod NodeTypesScopedList
  17751. raw := NoMethod(*s)
  17752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17753. }
  17754. // NodeTypesScopedListWarning: [Output Only] An informational warning
  17755. // that appears when the node types list is empty.
  17756. type NodeTypesScopedListWarning struct {
  17757. // Code: [Output Only] A warning code, if applicable. For example,
  17758. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17759. // the response.
  17760. //
  17761. // Possible values:
  17762. // "CLEANUP_FAILED"
  17763. // "DEPRECATED_RESOURCE_USED"
  17764. // "DEPRECATED_TYPE_USED"
  17765. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17766. // "EXPERIMENTAL_TYPE_USED"
  17767. // "EXTERNAL_API_WARNING"
  17768. // "FIELD_VALUE_OVERRIDEN"
  17769. // "INJECTED_KERNELS_DEPRECATED"
  17770. // "MISSING_TYPE_DEPENDENCY"
  17771. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17772. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17773. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17774. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17775. // "NEXT_HOP_NOT_RUNNING"
  17776. // "NOT_CRITICAL_ERROR"
  17777. // "NO_RESULTS_ON_PAGE"
  17778. // "REQUIRED_TOS_AGREEMENT"
  17779. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17780. // "RESOURCE_NOT_DELETED"
  17781. // "SCHEMA_VALIDATION_IGNORED"
  17782. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17783. // "UNDECLARED_PROPERTIES"
  17784. // "UNREACHABLE"
  17785. Code string `json:"code,omitempty"`
  17786. // Data: [Output Only] Metadata about this warning in key: value format.
  17787. // For example:
  17788. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17789. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  17790. // Message: [Output Only] A human-readable description of the warning
  17791. // code.
  17792. Message string `json:"message,omitempty"`
  17793. // ForceSendFields is a list of field names (e.g. "Code") to
  17794. // unconditionally include in API requests. By default, fields with
  17795. // empty values are omitted from API requests. However, any non-pointer,
  17796. // non-interface field appearing in ForceSendFields will be sent to the
  17797. // server regardless of whether the field is empty or not. This may be
  17798. // used to include empty fields in Patch requests.
  17799. ForceSendFields []string `json:"-"`
  17800. // NullFields is a list of field names (e.g. "Code") to include in API
  17801. // requests with the JSON null value. By default, fields with empty
  17802. // values are omitted from API requests. However, any field with an
  17803. // empty value appearing in NullFields will be sent to the server as
  17804. // null. It is an error if a field in this list has a non-empty value.
  17805. // This may be used to include null fields in Patch requests.
  17806. NullFields []string `json:"-"`
  17807. }
  17808. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  17809. type NoMethod NodeTypesScopedListWarning
  17810. raw := NoMethod(*s)
  17811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17812. }
  17813. type NodeTypesScopedListWarningData struct {
  17814. // Key: [Output Only] A key that provides more detail on the warning
  17815. // being returned. For example, for warnings where there are no results
  17816. // in a list request for a particular zone, this key might be scope and
  17817. // the key value might be the zone name. Other examples might be a key
  17818. // indicating a deprecated resource and a suggested replacement, or a
  17819. // warning about invalid network settings (for example, if an instance
  17820. // attempts to perform IP forwarding but is not enabled for IP
  17821. // forwarding).
  17822. Key string `json:"key,omitempty"`
  17823. // Value: [Output Only] A warning data value corresponding to the key.
  17824. Value string `json:"value,omitempty"`
  17825. // ForceSendFields is a list of field names (e.g. "Key") to
  17826. // unconditionally include in API requests. By default, fields with
  17827. // empty values are omitted from API requests. However, any non-pointer,
  17828. // non-interface field appearing in ForceSendFields will be sent to the
  17829. // server regardless of whether the field is empty or not. This may be
  17830. // used to include empty fields in Patch requests.
  17831. ForceSendFields []string `json:"-"`
  17832. // NullFields is a list of field names (e.g. "Key") to include in API
  17833. // requests with the JSON null value. By default, fields with empty
  17834. // values are omitted from API requests. However, any field with an
  17835. // empty value appearing in NullFields will be sent to the server as
  17836. // null. It is an error if a field in this list has a non-empty value.
  17837. // This may be used to include null fields in Patch requests.
  17838. NullFields []string `json:"-"`
  17839. }
  17840. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  17841. type NoMethod NodeTypesScopedListWarningData
  17842. raw := NoMethod(*s)
  17843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17844. }
  17845. // Operation: An Operation resource, used to manage asynchronous API
  17846. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  17847. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  17848. // (== resource_for beta.regionOperations ==) (== resource_for
  17849. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  17850. type Operation struct {
  17851. // ClientOperationId: [Output Only] The value of `requestId` if you
  17852. // provided it in the request. Not present otherwise.
  17853. ClientOperationId string `json:"clientOperationId,omitempty"`
  17854. // CreationTimestamp: [Deprecated] This field is deprecated.
  17855. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17856. // Description: [Output Only] A textual description of the operation,
  17857. // which is set when the operation is created.
  17858. Description string `json:"description,omitempty"`
  17859. // EndTime: [Output Only] The time that this operation was completed.
  17860. // This value is in RFC3339 text format.
  17861. EndTime string `json:"endTime,omitempty"`
  17862. // Error: [Output Only] If errors are generated during processing of the
  17863. // operation, this field will be populated.
  17864. Error *OperationError `json:"error,omitempty"`
  17865. // HttpErrorMessage: [Output Only] If the operation fails, this field
  17866. // contains the HTTP error message that was returned, such as NOT FOUND.
  17867. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  17868. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  17869. // contains the HTTP error status code that was returned. For example, a
  17870. // 404 means the resource was not found.
  17871. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  17872. // Id: [Output Only] The unique identifier for the resource. This
  17873. // identifier is defined by the server.
  17874. Id uint64 `json:"id,omitempty,string"`
  17875. // InsertTime: [Output Only] The time that this operation was requested.
  17876. // This value is in RFC3339 text format.
  17877. InsertTime string `json:"insertTime,omitempty"`
  17878. // Kind: [Output Only] Type of the resource. Always compute#operation
  17879. // for Operation resources.
  17880. Kind string `json:"kind,omitempty"`
  17881. // Name: [Output Only] Name of the resource.
  17882. Name string `json:"name,omitempty"`
  17883. // OperationType: [Output Only] The type of operation, such as insert,
  17884. // update, or delete, and so on.
  17885. OperationType string `json:"operationType,omitempty"`
  17886. // Progress: [Output Only] An optional progress indicator that ranges
  17887. // from 0 to 100. There is no requirement that this be linear or support
  17888. // any granularity of operations. This should not be used to guess when
  17889. // the operation will be complete. This number should monotonically
  17890. // increase as the operation progresses.
  17891. Progress int64 `json:"progress,omitempty"`
  17892. // Region: [Output Only] The URL of the region where the operation
  17893. // resides. Only available when performing regional operations. You must
  17894. // specify this field as part of the HTTP request URL. It is not
  17895. // settable as a field in the request body.
  17896. Region string `json:"region,omitempty"`
  17897. // SelfLink: [Output Only] Server-defined URL for the resource.
  17898. SelfLink string `json:"selfLink,omitempty"`
  17899. // StartTime: [Output Only] The time that this operation was started by
  17900. // the server. This value is in RFC3339 text format.
  17901. StartTime string `json:"startTime,omitempty"`
  17902. // Status: [Output Only] The status of the operation, which can be one
  17903. // of the following: PENDING, RUNNING, or DONE.
  17904. //
  17905. // Possible values:
  17906. // "DONE"
  17907. // "PENDING"
  17908. // "RUNNING"
  17909. Status string `json:"status,omitempty"`
  17910. // StatusMessage: [Output Only] An optional textual description of the
  17911. // current status of the operation.
  17912. StatusMessage string `json:"statusMessage,omitempty"`
  17913. // TargetId: [Output Only] The unique target ID, which identifies a
  17914. // specific incarnation of the target resource.
  17915. TargetId uint64 `json:"targetId,omitempty,string"`
  17916. // TargetLink: [Output Only] The URL of the resource that the operation
  17917. // modifies. For operations related to creating a snapshot, this points
  17918. // to the persistent disk that the snapshot was created from.
  17919. TargetLink string `json:"targetLink,omitempty"`
  17920. // User: [Output Only] User who requested the operation, for example:
  17921. // user@example.com.
  17922. User string `json:"user,omitempty"`
  17923. // Warnings: [Output Only] If warning messages are generated during
  17924. // processing of the operation, this field will be populated.
  17925. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  17926. // Zone: [Output Only] The URL of the zone where the operation resides.
  17927. // Only available when performing per-zone operations. You must specify
  17928. // this field as part of the HTTP request URL. It is not settable as a
  17929. // field in the request body.
  17930. Zone string `json:"zone,omitempty"`
  17931. // ServerResponse contains the HTTP response code and headers from the
  17932. // server.
  17933. googleapi.ServerResponse `json:"-"`
  17934. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  17935. // to unconditionally include in API requests. By default, fields with
  17936. // empty values are omitted from API requests. However, any non-pointer,
  17937. // non-interface field appearing in ForceSendFields will be sent to the
  17938. // server regardless of whether the field is empty or not. This may be
  17939. // used to include empty fields in Patch requests.
  17940. ForceSendFields []string `json:"-"`
  17941. // NullFields is a list of field names (e.g. "ClientOperationId") to
  17942. // include in API requests with the JSON null value. By default, fields
  17943. // with empty values are omitted from API requests. However, any field
  17944. // with an empty value appearing in NullFields will be sent to the
  17945. // server as null. It is an error if a field in this list has a
  17946. // non-empty value. This may be used to include null fields in Patch
  17947. // requests.
  17948. NullFields []string `json:"-"`
  17949. }
  17950. func (s *Operation) MarshalJSON() ([]byte, error) {
  17951. type NoMethod Operation
  17952. raw := NoMethod(*s)
  17953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17954. }
  17955. // OperationError: [Output Only] If errors are generated during
  17956. // processing of the operation, this field will be populated.
  17957. type OperationError struct {
  17958. // Errors: [Output Only] The array of errors encountered while
  17959. // processing this operation.
  17960. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  17961. // ForceSendFields is a list of field names (e.g. "Errors") to
  17962. // unconditionally include in API requests. By default, fields with
  17963. // empty values are omitted from API requests. However, any non-pointer,
  17964. // non-interface field appearing in ForceSendFields will be sent to the
  17965. // server regardless of whether the field is empty or not. This may be
  17966. // used to include empty fields in Patch requests.
  17967. ForceSendFields []string `json:"-"`
  17968. // NullFields is a list of field names (e.g. "Errors") to include in API
  17969. // requests with the JSON null value. By default, fields with empty
  17970. // values are omitted from API requests. However, any field with an
  17971. // empty value appearing in NullFields will be sent to the server as
  17972. // null. It is an error if a field in this list has a non-empty value.
  17973. // This may be used to include null fields in Patch requests.
  17974. NullFields []string `json:"-"`
  17975. }
  17976. func (s *OperationError) MarshalJSON() ([]byte, error) {
  17977. type NoMethod OperationError
  17978. raw := NoMethod(*s)
  17979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17980. }
  17981. type OperationErrorErrors struct {
  17982. // Code: [Output Only] The error type identifier for this error.
  17983. Code string `json:"code,omitempty"`
  17984. // Location: [Output Only] Indicates the field in the request that
  17985. // caused the error. This property is optional.
  17986. Location string `json:"location,omitempty"`
  17987. // Message: [Output Only] An optional, human-readable error message.
  17988. Message string `json:"message,omitempty"`
  17989. // ForceSendFields is a list of field names (e.g. "Code") to
  17990. // unconditionally include in API requests. By default, fields with
  17991. // empty values are omitted from API requests. However, any non-pointer,
  17992. // non-interface field appearing in ForceSendFields will be sent to the
  17993. // server regardless of whether the field is empty or not. This may be
  17994. // used to include empty fields in Patch requests.
  17995. ForceSendFields []string `json:"-"`
  17996. // NullFields is a list of field names (e.g. "Code") to include in API
  17997. // requests with the JSON null value. By default, fields with empty
  17998. // values are omitted from API requests. However, any field with an
  17999. // empty value appearing in NullFields will be sent to the server as
  18000. // null. It is an error if a field in this list has a non-empty value.
  18001. // This may be used to include null fields in Patch requests.
  18002. NullFields []string `json:"-"`
  18003. }
  18004. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  18005. type NoMethod OperationErrorErrors
  18006. raw := NoMethod(*s)
  18007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18008. }
  18009. type OperationWarnings struct {
  18010. // Code: [Output Only] A warning code, if applicable. For example,
  18011. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18012. // the response.
  18013. //
  18014. // Possible values:
  18015. // "CLEANUP_FAILED"
  18016. // "DEPRECATED_RESOURCE_USED"
  18017. // "DEPRECATED_TYPE_USED"
  18018. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18019. // "EXPERIMENTAL_TYPE_USED"
  18020. // "EXTERNAL_API_WARNING"
  18021. // "FIELD_VALUE_OVERRIDEN"
  18022. // "INJECTED_KERNELS_DEPRECATED"
  18023. // "MISSING_TYPE_DEPENDENCY"
  18024. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18025. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18026. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18027. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18028. // "NEXT_HOP_NOT_RUNNING"
  18029. // "NOT_CRITICAL_ERROR"
  18030. // "NO_RESULTS_ON_PAGE"
  18031. // "REQUIRED_TOS_AGREEMENT"
  18032. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18033. // "RESOURCE_NOT_DELETED"
  18034. // "SCHEMA_VALIDATION_IGNORED"
  18035. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18036. // "UNDECLARED_PROPERTIES"
  18037. // "UNREACHABLE"
  18038. Code string `json:"code,omitempty"`
  18039. // Data: [Output Only] Metadata about this warning in key: value format.
  18040. // For example:
  18041. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18042. Data []*OperationWarningsData `json:"data,omitempty"`
  18043. // Message: [Output Only] A human-readable description of the warning
  18044. // code.
  18045. Message string `json:"message,omitempty"`
  18046. // ForceSendFields is a list of field names (e.g. "Code") to
  18047. // unconditionally include in API requests. By default, fields with
  18048. // empty values are omitted from API requests. However, any non-pointer,
  18049. // non-interface field appearing in ForceSendFields will be sent to the
  18050. // server regardless of whether the field is empty or not. This may be
  18051. // used to include empty fields in Patch requests.
  18052. ForceSendFields []string `json:"-"`
  18053. // NullFields is a list of field names (e.g. "Code") to include in API
  18054. // requests with the JSON null value. By default, fields with empty
  18055. // values are omitted from API requests. However, any field with an
  18056. // empty value appearing in NullFields will be sent to the server as
  18057. // null. It is an error if a field in this list has a non-empty value.
  18058. // This may be used to include null fields in Patch requests.
  18059. NullFields []string `json:"-"`
  18060. }
  18061. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  18062. type NoMethod OperationWarnings
  18063. raw := NoMethod(*s)
  18064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18065. }
  18066. type OperationWarningsData struct {
  18067. // Key: [Output Only] A key that provides more detail on the warning
  18068. // being returned. For example, for warnings where there are no results
  18069. // in a list request for a particular zone, this key might be scope and
  18070. // the key value might be the zone name. Other examples might be a key
  18071. // indicating a deprecated resource and a suggested replacement, or a
  18072. // warning about invalid network settings (for example, if an instance
  18073. // attempts to perform IP forwarding but is not enabled for IP
  18074. // forwarding).
  18075. Key string `json:"key,omitempty"`
  18076. // Value: [Output Only] A warning data value corresponding to the key.
  18077. Value string `json:"value,omitempty"`
  18078. // ForceSendFields is a list of field names (e.g. "Key") to
  18079. // unconditionally include in API requests. By default, fields with
  18080. // empty values are omitted from API requests. However, any non-pointer,
  18081. // non-interface field appearing in ForceSendFields will be sent to the
  18082. // server regardless of whether the field is empty or not. This may be
  18083. // used to include empty fields in Patch requests.
  18084. ForceSendFields []string `json:"-"`
  18085. // NullFields is a list of field names (e.g. "Key") to include in API
  18086. // requests with the JSON null value. By default, fields with empty
  18087. // values are omitted from API requests. However, any field with an
  18088. // empty value appearing in NullFields will be sent to the server as
  18089. // null. It is an error if a field in this list has a non-empty value.
  18090. // This may be used to include null fields in Patch requests.
  18091. NullFields []string `json:"-"`
  18092. }
  18093. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  18094. type NoMethod OperationWarningsData
  18095. raw := NoMethod(*s)
  18096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18097. }
  18098. type OperationAggregatedList struct {
  18099. // Id: [Output Only] The unique identifier for the resource. This
  18100. // identifier is defined by the server.
  18101. Id string `json:"id,omitempty"`
  18102. // Items: [Output Only] A map of scoped operation lists.
  18103. Items map[string]OperationsScopedList `json:"items,omitempty"`
  18104. // Kind: [Output Only] Type of resource. Always
  18105. // compute#operationAggregatedList for aggregated lists of operations.
  18106. Kind string `json:"kind,omitempty"`
  18107. // NextPageToken: [Output Only] This token allows you to get the next
  18108. // page of results for list requests. If the number of results is larger
  18109. // than maxResults, use the nextPageToken as a value for the query
  18110. // parameter pageToken in the next list request. Subsequent list
  18111. // requests will have their own nextPageToken to continue paging through
  18112. // the results.
  18113. NextPageToken string `json:"nextPageToken,omitempty"`
  18114. // SelfLink: [Output Only] Server-defined URL for this resource.
  18115. SelfLink string `json:"selfLink,omitempty"`
  18116. // Warning: [Output Only] Informational warning message.
  18117. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  18118. // ServerResponse contains the HTTP response code and headers from the
  18119. // server.
  18120. googleapi.ServerResponse `json:"-"`
  18121. // ForceSendFields is a list of field names (e.g. "Id") to
  18122. // unconditionally include in API requests. By default, fields with
  18123. // empty values are omitted from API requests. However, any non-pointer,
  18124. // non-interface field appearing in ForceSendFields will be sent to the
  18125. // server regardless of whether the field is empty or not. This may be
  18126. // used to include empty fields in Patch requests.
  18127. ForceSendFields []string `json:"-"`
  18128. // NullFields is a list of field names (e.g. "Id") to include in API
  18129. // requests with the JSON null value. By default, fields with empty
  18130. // values are omitted from API requests. However, any field with an
  18131. // empty value appearing in NullFields will be sent to the server as
  18132. // null. It is an error if a field in this list has a non-empty value.
  18133. // This may be used to include null fields in Patch requests.
  18134. NullFields []string `json:"-"`
  18135. }
  18136. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  18137. type NoMethod OperationAggregatedList
  18138. raw := NoMethod(*s)
  18139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18140. }
  18141. // OperationAggregatedListWarning: [Output Only] Informational warning
  18142. // message.
  18143. type OperationAggregatedListWarning struct {
  18144. // Code: [Output Only] A warning code, if applicable. For example,
  18145. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18146. // the response.
  18147. //
  18148. // Possible values:
  18149. // "CLEANUP_FAILED"
  18150. // "DEPRECATED_RESOURCE_USED"
  18151. // "DEPRECATED_TYPE_USED"
  18152. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18153. // "EXPERIMENTAL_TYPE_USED"
  18154. // "EXTERNAL_API_WARNING"
  18155. // "FIELD_VALUE_OVERRIDEN"
  18156. // "INJECTED_KERNELS_DEPRECATED"
  18157. // "MISSING_TYPE_DEPENDENCY"
  18158. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18159. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18160. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18161. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18162. // "NEXT_HOP_NOT_RUNNING"
  18163. // "NOT_CRITICAL_ERROR"
  18164. // "NO_RESULTS_ON_PAGE"
  18165. // "REQUIRED_TOS_AGREEMENT"
  18166. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18167. // "RESOURCE_NOT_DELETED"
  18168. // "SCHEMA_VALIDATION_IGNORED"
  18169. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18170. // "UNDECLARED_PROPERTIES"
  18171. // "UNREACHABLE"
  18172. Code string `json:"code,omitempty"`
  18173. // Data: [Output Only] Metadata about this warning in key: value format.
  18174. // For example:
  18175. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18176. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  18177. // Message: [Output Only] A human-readable description of the warning
  18178. // code.
  18179. Message string `json:"message,omitempty"`
  18180. // ForceSendFields is a list of field names (e.g. "Code") to
  18181. // unconditionally include in API requests. By default, fields with
  18182. // empty values are omitted from API requests. However, any non-pointer,
  18183. // non-interface field appearing in ForceSendFields will be sent to the
  18184. // server regardless of whether the field is empty or not. This may be
  18185. // used to include empty fields in Patch requests.
  18186. ForceSendFields []string `json:"-"`
  18187. // NullFields is a list of field names (e.g. "Code") to include in API
  18188. // requests with the JSON null value. By default, fields with empty
  18189. // values are omitted from API requests. However, any field with an
  18190. // empty value appearing in NullFields will be sent to the server as
  18191. // null. It is an error if a field in this list has a non-empty value.
  18192. // This may be used to include null fields in Patch requests.
  18193. NullFields []string `json:"-"`
  18194. }
  18195. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18196. type NoMethod OperationAggregatedListWarning
  18197. raw := NoMethod(*s)
  18198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18199. }
  18200. type OperationAggregatedListWarningData struct {
  18201. // Key: [Output Only] A key that provides more detail on the warning
  18202. // being returned. For example, for warnings where there are no results
  18203. // in a list request for a particular zone, this key might be scope and
  18204. // the key value might be the zone name. Other examples might be a key
  18205. // indicating a deprecated resource and a suggested replacement, or a
  18206. // warning about invalid network settings (for example, if an instance
  18207. // attempts to perform IP forwarding but is not enabled for IP
  18208. // forwarding).
  18209. Key string `json:"key,omitempty"`
  18210. // Value: [Output Only] A warning data value corresponding to the key.
  18211. Value string `json:"value,omitempty"`
  18212. // ForceSendFields is a list of field names (e.g. "Key") to
  18213. // unconditionally include in API requests. By default, fields with
  18214. // empty values are omitted from API requests. However, any non-pointer,
  18215. // non-interface field appearing in ForceSendFields will be sent to the
  18216. // server regardless of whether the field is empty or not. This may be
  18217. // used to include empty fields in Patch requests.
  18218. ForceSendFields []string `json:"-"`
  18219. // NullFields is a list of field names (e.g. "Key") to include in API
  18220. // requests with the JSON null value. By default, fields with empty
  18221. // values are omitted from API requests. However, any field with an
  18222. // empty value appearing in NullFields will be sent to the server as
  18223. // null. It is an error if a field in this list has a non-empty value.
  18224. // This may be used to include null fields in Patch requests.
  18225. NullFields []string `json:"-"`
  18226. }
  18227. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18228. type NoMethod OperationAggregatedListWarningData
  18229. raw := NoMethod(*s)
  18230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18231. }
  18232. // OperationList: Contains a list of Operation resources.
  18233. type OperationList struct {
  18234. // Id: [Output Only] The unique identifier for the resource. This
  18235. // identifier is defined by the server.
  18236. Id string `json:"id,omitempty"`
  18237. // Items: [Output Only] A list of Operation resources.
  18238. Items []*Operation `json:"items,omitempty"`
  18239. // Kind: [Output Only] Type of resource. Always compute#operations for
  18240. // Operations resource.
  18241. Kind string `json:"kind,omitempty"`
  18242. // NextPageToken: [Output Only] This token allows you to get the next
  18243. // page of results for list requests. If the number of results is larger
  18244. // than maxResults, use the nextPageToken as a value for the query
  18245. // parameter pageToken in the next list request. Subsequent list
  18246. // requests will have their own nextPageToken to continue paging through
  18247. // the results.
  18248. NextPageToken string `json:"nextPageToken,omitempty"`
  18249. // SelfLink: [Output Only] Server-defined URL for this resource.
  18250. SelfLink string `json:"selfLink,omitempty"`
  18251. // Warning: [Output Only] Informational warning message.
  18252. Warning *OperationListWarning `json:"warning,omitempty"`
  18253. // ServerResponse contains the HTTP response code and headers from the
  18254. // server.
  18255. googleapi.ServerResponse `json:"-"`
  18256. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *OperationList) MarshalJSON() ([]byte, error) {
  18272. type NoMethod OperationList
  18273. raw := NoMethod(*s)
  18274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18275. }
  18276. // OperationListWarning: [Output Only] Informational warning message.
  18277. type OperationListWarning struct {
  18278. // Code: [Output Only] A warning code, if applicable. For example,
  18279. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18280. // the response.
  18281. //
  18282. // Possible values:
  18283. // "CLEANUP_FAILED"
  18284. // "DEPRECATED_RESOURCE_USED"
  18285. // "DEPRECATED_TYPE_USED"
  18286. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18287. // "EXPERIMENTAL_TYPE_USED"
  18288. // "EXTERNAL_API_WARNING"
  18289. // "FIELD_VALUE_OVERRIDEN"
  18290. // "INJECTED_KERNELS_DEPRECATED"
  18291. // "MISSING_TYPE_DEPENDENCY"
  18292. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18293. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18294. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18295. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18296. // "NEXT_HOP_NOT_RUNNING"
  18297. // "NOT_CRITICAL_ERROR"
  18298. // "NO_RESULTS_ON_PAGE"
  18299. // "REQUIRED_TOS_AGREEMENT"
  18300. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18301. // "RESOURCE_NOT_DELETED"
  18302. // "SCHEMA_VALIDATION_IGNORED"
  18303. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18304. // "UNDECLARED_PROPERTIES"
  18305. // "UNREACHABLE"
  18306. Code string `json:"code,omitempty"`
  18307. // Data: [Output Only] Metadata about this warning in key: value format.
  18308. // For example:
  18309. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18310. Data []*OperationListWarningData `json:"data,omitempty"`
  18311. // Message: [Output Only] A human-readable description of the warning
  18312. // code.
  18313. Message string `json:"message,omitempty"`
  18314. // ForceSendFields is a list of field names (e.g. "Code") to
  18315. // unconditionally include in API requests. By default, fields with
  18316. // empty values are omitted from API requests. However, any non-pointer,
  18317. // non-interface field appearing in ForceSendFields will be sent to the
  18318. // server regardless of whether the field is empty or not. This may be
  18319. // used to include empty fields in Patch requests.
  18320. ForceSendFields []string `json:"-"`
  18321. // NullFields is a list of field names (e.g. "Code") to include in API
  18322. // requests with the JSON null value. By default, fields with empty
  18323. // values are omitted from API requests. However, any field with an
  18324. // empty value appearing in NullFields will be sent to the server as
  18325. // null. It is an error if a field in this list has a non-empty value.
  18326. // This may be used to include null fields in Patch requests.
  18327. NullFields []string `json:"-"`
  18328. }
  18329. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  18330. type NoMethod OperationListWarning
  18331. raw := NoMethod(*s)
  18332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18333. }
  18334. type OperationListWarningData struct {
  18335. // Key: [Output Only] A key that provides more detail on the warning
  18336. // being returned. For example, for warnings where there are no results
  18337. // in a list request for a particular zone, this key might be scope and
  18338. // the key value might be the zone name. Other examples might be a key
  18339. // indicating a deprecated resource and a suggested replacement, or a
  18340. // warning about invalid network settings (for example, if an instance
  18341. // attempts to perform IP forwarding but is not enabled for IP
  18342. // forwarding).
  18343. Key string `json:"key,omitempty"`
  18344. // Value: [Output Only] A warning data value corresponding to the key.
  18345. Value string `json:"value,omitempty"`
  18346. // ForceSendFields is a list of field names (e.g. "Key") to
  18347. // unconditionally include in API requests. By default, fields with
  18348. // empty values are omitted from API requests. However, any non-pointer,
  18349. // non-interface field appearing in ForceSendFields will be sent to the
  18350. // server regardless of whether the field is empty or not. This may be
  18351. // used to include empty fields in Patch requests.
  18352. ForceSendFields []string `json:"-"`
  18353. // NullFields is a list of field names (e.g. "Key") to include in API
  18354. // requests with the JSON null value. By default, fields with empty
  18355. // values are omitted from API requests. However, any field with an
  18356. // empty value appearing in NullFields will be sent to the server as
  18357. // null. It is an error if a field in this list has a non-empty value.
  18358. // This may be used to include null fields in Patch requests.
  18359. NullFields []string `json:"-"`
  18360. }
  18361. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  18362. type NoMethod OperationListWarningData
  18363. raw := NoMethod(*s)
  18364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18365. }
  18366. type OperationsScopedList struct {
  18367. // Operations: [Output Only] A list of operations contained in this
  18368. // scope.
  18369. Operations []*Operation `json:"operations,omitempty"`
  18370. // Warning: [Output Only] Informational warning which replaces the list
  18371. // of operations when the list is empty.
  18372. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  18373. // ForceSendFields is a list of field names (e.g. "Operations") to
  18374. // unconditionally include in API requests. By default, fields with
  18375. // empty values are omitted from API requests. However, any non-pointer,
  18376. // non-interface field appearing in ForceSendFields will be sent to the
  18377. // server regardless of whether the field is empty or not. This may be
  18378. // used to include empty fields in Patch requests.
  18379. ForceSendFields []string `json:"-"`
  18380. // NullFields is a list of field names (e.g. "Operations") to include in
  18381. // API requests with the JSON null value. By default, fields with empty
  18382. // values are omitted from API requests. However, any field with an
  18383. // empty value appearing in NullFields will be sent to the server as
  18384. // null. It is an error if a field in this list has a non-empty value.
  18385. // This may be used to include null fields in Patch requests.
  18386. NullFields []string `json:"-"`
  18387. }
  18388. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  18389. type NoMethod OperationsScopedList
  18390. raw := NoMethod(*s)
  18391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18392. }
  18393. // OperationsScopedListWarning: [Output Only] Informational warning
  18394. // which replaces the list of operations when the list is empty.
  18395. type OperationsScopedListWarning struct {
  18396. // Code: [Output Only] A warning code, if applicable. For example,
  18397. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18398. // the response.
  18399. //
  18400. // Possible values:
  18401. // "CLEANUP_FAILED"
  18402. // "DEPRECATED_RESOURCE_USED"
  18403. // "DEPRECATED_TYPE_USED"
  18404. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18405. // "EXPERIMENTAL_TYPE_USED"
  18406. // "EXTERNAL_API_WARNING"
  18407. // "FIELD_VALUE_OVERRIDEN"
  18408. // "INJECTED_KERNELS_DEPRECATED"
  18409. // "MISSING_TYPE_DEPENDENCY"
  18410. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18411. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18412. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18413. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18414. // "NEXT_HOP_NOT_RUNNING"
  18415. // "NOT_CRITICAL_ERROR"
  18416. // "NO_RESULTS_ON_PAGE"
  18417. // "REQUIRED_TOS_AGREEMENT"
  18418. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18419. // "RESOURCE_NOT_DELETED"
  18420. // "SCHEMA_VALIDATION_IGNORED"
  18421. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18422. // "UNDECLARED_PROPERTIES"
  18423. // "UNREACHABLE"
  18424. Code string `json:"code,omitempty"`
  18425. // Data: [Output Only] Metadata about this warning in key: value format.
  18426. // For example:
  18427. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18428. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  18429. // Message: [Output Only] A human-readable description of the warning
  18430. // code.
  18431. Message string `json:"message,omitempty"`
  18432. // ForceSendFields is a list of field names (e.g. "Code") to
  18433. // unconditionally include in API requests. By default, fields with
  18434. // empty values are omitted from API requests. However, any non-pointer,
  18435. // non-interface field appearing in ForceSendFields will be sent to the
  18436. // server regardless of whether the field is empty or not. This may be
  18437. // used to include empty fields in Patch requests.
  18438. ForceSendFields []string `json:"-"`
  18439. // NullFields is a list of field names (e.g. "Code") to include in API
  18440. // requests with the JSON null value. By default, fields with empty
  18441. // values are omitted from API requests. However, any field with an
  18442. // empty value appearing in NullFields will be sent to the server as
  18443. // null. It is an error if a field in this list has a non-empty value.
  18444. // This may be used to include null fields in Patch requests.
  18445. NullFields []string `json:"-"`
  18446. }
  18447. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  18448. type NoMethod OperationsScopedListWarning
  18449. raw := NoMethod(*s)
  18450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18451. }
  18452. type OperationsScopedListWarningData struct {
  18453. // Key: [Output Only] A key that provides more detail on the warning
  18454. // being returned. For example, for warnings where there are no results
  18455. // in a list request for a particular zone, this key might be scope and
  18456. // the key value might be the zone name. Other examples might be a key
  18457. // indicating a deprecated resource and a suggested replacement, or a
  18458. // warning about invalid network settings (for example, if an instance
  18459. // attempts to perform IP forwarding but is not enabled for IP
  18460. // forwarding).
  18461. Key string `json:"key,omitempty"`
  18462. // Value: [Output Only] A warning data value corresponding to the key.
  18463. Value string `json:"value,omitempty"`
  18464. // ForceSendFields is a list of field names (e.g. "Key") to
  18465. // unconditionally include in API requests. By default, fields with
  18466. // empty values are omitted from API requests. However, any non-pointer,
  18467. // non-interface field appearing in ForceSendFields will be sent to the
  18468. // server regardless of whether the field is empty or not. This may be
  18469. // used to include empty fields in Patch requests.
  18470. ForceSendFields []string `json:"-"`
  18471. // NullFields is a list of field names (e.g. "Key") to include in API
  18472. // requests with the JSON null value. By default, fields with empty
  18473. // values are omitted from API requests. However, any field with an
  18474. // empty value appearing in NullFields will be sent to the server as
  18475. // null. It is an error if a field in this list has a non-empty value.
  18476. // This may be used to include null fields in Patch requests.
  18477. NullFields []string `json:"-"`
  18478. }
  18479. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  18480. type NoMethod OperationsScopedListWarningData
  18481. raw := NoMethod(*s)
  18482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18483. }
  18484. // PathMatcher: A matcher for the path portion of the URL. The
  18485. // BackendService from the longest-matched rule will serve the URL. If
  18486. // no rule was matched, the default service will be used.
  18487. type PathMatcher struct {
  18488. // DefaultService: The full or partial URL to the BackendService
  18489. // resource. This will be used if none of the pathRules or routeRules
  18490. // defined by this PathMatcher are matched. For example, the following
  18491. // are all valid URLs to a BackendService resource:
  18492. // -
  18493. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  18494. // - compute/v1/projects/project/global/backendServices/backendService
  18495. //
  18496. // - global/backendServices/backendService
  18497. // Use defaultService instead of defaultRouteAction when simple routing
  18498. // to a backend service is desired and other advanced capabilities like
  18499. // traffic splitting and URL rewrites are not required.
  18500. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  18501. // must be set.
  18502. // Authorization requires one or more of the following Google IAM
  18503. // permissions on the specified resource default_service:
  18504. // - compute.backendBuckets.use
  18505. // - compute.backendServices.use
  18506. DefaultService string `json:"defaultService,omitempty"`
  18507. // Description: An optional description of this resource. Provide this
  18508. // property when you create the resource.
  18509. Description string `json:"description,omitempty"`
  18510. // Name: The name to which this PathMatcher is referred by the HostRule.
  18511. Name string `json:"name,omitempty"`
  18512. // PathRules: The list of path rules. Use this list instead of
  18513. // routeRules when routing based on simple path matching is all that's
  18514. // required. The order by which path rules are specified does not
  18515. // matter. Matches are always done on the longest-path-first basis.
  18516. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  18517. // irrespective of the order in which those paths appear in this
  18518. // list.
  18519. // Only one of pathRules or routeRules must be set.
  18520. PathRules []*PathRule `json:"pathRules,omitempty"`
  18521. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  18522. // unconditionally include in API requests. By default, fields with
  18523. // empty values are omitted from API requests. However, any non-pointer,
  18524. // non-interface field appearing in ForceSendFields will be sent to the
  18525. // server regardless of whether the field is empty or not. This may be
  18526. // used to include empty fields in Patch requests.
  18527. ForceSendFields []string `json:"-"`
  18528. // NullFields is a list of field names (e.g. "DefaultService") to
  18529. // include in API requests with the JSON null value. By default, fields
  18530. // with empty values are omitted from API requests. However, any field
  18531. // with an empty value appearing in NullFields will be sent to the
  18532. // server as null. It is an error if a field in this list has a
  18533. // non-empty value. This may be used to include null fields in Patch
  18534. // requests.
  18535. NullFields []string `json:"-"`
  18536. }
  18537. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  18538. type NoMethod PathMatcher
  18539. raw := NoMethod(*s)
  18540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18541. }
  18542. // PathRule: A path-matching rule for a URL. If matched, will use the
  18543. // specified BackendService to handle the traffic arriving at this URL.
  18544. type PathRule struct {
  18545. // Paths: The list of path patterns to match. Each must start with / and
  18546. // the only place a * is allowed is at the end following a /. The string
  18547. // fed to the path matcher does not include any text after the first ?
  18548. // or #, and those chars are not allowed here.
  18549. Paths []string `json:"paths,omitempty"`
  18550. // Service: The URL of the backend service resource if this rule is
  18551. // matched.
  18552. // Use service instead of routeAction when simple routing to a backend
  18553. // service is desired and other advanced capabilities like traffic
  18554. // splitting and rewrites are not required.
  18555. // Only one of service, routeAction or urlRedirect should must be set.
  18556. Service string `json:"service,omitempty"`
  18557. // ForceSendFields is a list of field names (e.g. "Paths") to
  18558. // unconditionally include in API requests. By default, fields with
  18559. // empty values are omitted from API requests. However, any non-pointer,
  18560. // non-interface field appearing in ForceSendFields will be sent to the
  18561. // server regardless of whether the field is empty or not. This may be
  18562. // used to include empty fields in Patch requests.
  18563. ForceSendFields []string `json:"-"`
  18564. // NullFields is a list of field names (e.g. "Paths") to include in API
  18565. // requests with the JSON null value. By default, fields with empty
  18566. // values are omitted from API requests. However, any field with an
  18567. // empty value appearing in NullFields will be sent to the server as
  18568. // null. It is an error if a field in this list has a non-empty value.
  18569. // This may be used to include null fields in Patch requests.
  18570. NullFields []string `json:"-"`
  18571. }
  18572. func (s *PathRule) MarshalJSON() ([]byte, error) {
  18573. type NoMethod PathRule
  18574. raw := NoMethod(*s)
  18575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18576. }
  18577. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  18578. // used to specify access control policies for Cloud Platform
  18579. // resources.
  18580. //
  18581. //
  18582. //
  18583. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  18584. // of `members` to a `role`, where the members can be user accounts,
  18585. // Google groups, Google domains, and service accounts. A `role` is a
  18586. // named list of permissions defined by IAM.
  18587. //
  18588. // **JSON Example**
  18589. //
  18590. // { "bindings": [ { "role": "roles/owner", "members": [
  18591. // "user:mike@example.com", "group:admins@example.com",
  18592. // "domain:google.com",
  18593. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  18594. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  18595. // }
  18596. //
  18597. // **YAML Example**
  18598. //
  18599. // bindings: - members: - user:mike@example.com -
  18600. // group:admins@example.com - domain:google.com -
  18601. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  18602. // roles/owner - members: - user:sean@example.com role:
  18603. // roles/viewer
  18604. //
  18605. //
  18606. //
  18607. // For a description of IAM and its features, see the [IAM developer's
  18608. // guide](https://cloud.google.com/iam/docs).
  18609. type Policy struct {
  18610. // AuditConfigs: Specifies cloud audit logging configuration for this
  18611. // policy.
  18612. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  18613. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  18614. // no members will result in an error.
  18615. Bindings []*Binding `json:"bindings,omitempty"`
  18616. // Etag: `etag` is used for optimistic concurrency control as a way to
  18617. // help prevent simultaneous updates of a policy from overwriting each
  18618. // other. It is strongly suggested that systems make use of the `etag`
  18619. // in the read-modify-write cycle to perform policy updates in order to
  18620. // avoid race conditions: An `etag` is returned in the response to
  18621. // `getIamPolicy`, and systems are expected to put that etag in the
  18622. // request to `setIamPolicy` to ensure that their change will be applied
  18623. // to the same version of the policy.
  18624. //
  18625. // If no `etag` is provided in the call to `setIamPolicy`, then the
  18626. // existing policy is overwritten blindly.
  18627. Etag string `json:"etag,omitempty"`
  18628. IamOwned bool `json:"iamOwned,omitempty"`
  18629. // Rules: If more than one rule is specified, the rules are applied in
  18630. // the following manner: - All matching LOG rules are always applied. -
  18631. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  18632. // will be applied if one or more matching rule requires logging. -
  18633. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  18634. // granted. Logging will be applied if one or more matching rule
  18635. // requires logging. - Otherwise, if no rule applies, permission is
  18636. // denied.
  18637. Rules []*Rule `json:"rules,omitempty"`
  18638. // Version: Deprecated.
  18639. Version int64 `json:"version,omitempty"`
  18640. // ServerResponse contains the HTTP response code and headers from the
  18641. // server.
  18642. googleapi.ServerResponse `json:"-"`
  18643. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  18644. // unconditionally include in API requests. By default, fields with
  18645. // empty values are omitted from API requests. However, any non-pointer,
  18646. // non-interface field appearing in ForceSendFields will be sent to the
  18647. // server regardless of whether the field is empty or not. This may be
  18648. // used to include empty fields in Patch requests.
  18649. ForceSendFields []string `json:"-"`
  18650. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  18651. // in API requests with the JSON null value. By default, fields with
  18652. // empty values are omitted from API requests. However, any field with
  18653. // an empty value appearing in NullFields will be sent to the server as
  18654. // null. It is an error if a field in this list has a non-empty value.
  18655. // This may be used to include null fields in Patch requests.
  18656. NullFields []string `json:"-"`
  18657. }
  18658. func (s *Policy) MarshalJSON() ([]byte, error) {
  18659. type NoMethod Policy
  18660. raw := NoMethod(*s)
  18661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18662. }
  18663. type PreconfiguredWafSet struct {
  18664. // ExpressionSets: List of entities that are currently supported for WAF
  18665. // rules.
  18666. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  18667. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  18668. // unconditionally include in API requests. By default, fields with
  18669. // empty values are omitted from API requests. However, any non-pointer,
  18670. // non-interface field appearing in ForceSendFields will be sent to the
  18671. // server regardless of whether the field is empty or not. This may be
  18672. // used to include empty fields in Patch requests.
  18673. ForceSendFields []string `json:"-"`
  18674. // NullFields is a list of field names (e.g. "ExpressionSets") to
  18675. // include in API requests with the JSON null value. By default, fields
  18676. // with empty values are omitted from API requests. However, any field
  18677. // with an empty value appearing in NullFields will be sent to the
  18678. // server as null. It is an error if a field in this list has a
  18679. // non-empty value. This may be used to include null fields in Patch
  18680. // requests.
  18681. NullFields []string `json:"-"`
  18682. }
  18683. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  18684. type NoMethod PreconfiguredWafSet
  18685. raw := NoMethod(*s)
  18686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18687. }
  18688. // Project: A Project resource. For an overview of projects, see Cloud
  18689. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  18690. // resource_for beta.projects ==)
  18691. type Project struct {
  18692. // CommonInstanceMetadata: Metadata key/value pairs available to all
  18693. // instances contained in this project. See Custom metadata for more
  18694. // information.
  18695. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  18696. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18697. // format.
  18698. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18699. // DefaultNetworkTier: This signifies the default network tier used for
  18700. // configuring resources of the project and can only take the following
  18701. // values: PREMIUM, STANDARD. Initially the default network tier is
  18702. // PREMIUM.
  18703. //
  18704. // Possible values:
  18705. // "PREMIUM"
  18706. // "STANDARD"
  18707. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  18708. // DefaultServiceAccount: [Output Only] Default service account used by
  18709. // VMs running in this project.
  18710. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  18711. // Description: An optional textual description of the resource.
  18712. Description string `json:"description,omitempty"`
  18713. // EnabledFeatures: Restricted features enabled for use on this project.
  18714. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  18715. // Id: [Output Only] The unique identifier for the resource. This
  18716. // identifier is defined by the server. This is not the project ID, and
  18717. // is just a unique ID used by Compute Engine to identify resources.
  18718. Id uint64 `json:"id,omitempty,string"`
  18719. // Kind: [Output Only] Type of the resource. Always compute#project for
  18720. // projects.
  18721. Kind string `json:"kind,omitempty"`
  18722. // Name: The project ID. For example: my-example-project. Use the
  18723. // project ID to make requests to Compute Engine.
  18724. Name string `json:"name,omitempty"`
  18725. // Quotas: [Output Only] Quotas assigned to this project.
  18726. Quotas []*Quota `json:"quotas,omitempty"`
  18727. // SelfLink: [Output Only] Server-defined URL for the resource.
  18728. SelfLink string `json:"selfLink,omitempty"`
  18729. // UsageExportLocation: The naming prefix for daily usage reports and
  18730. // the Google Cloud Storage bucket where they are stored.
  18731. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  18732. // XpnProjectStatus: [Output Only] The role this project has in a shared
  18733. // VPC configuration. Currently only HOST projects are differentiated.
  18734. //
  18735. // Possible values:
  18736. // "HOST"
  18737. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  18738. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  18739. // ServerResponse contains the HTTP response code and headers from the
  18740. // server.
  18741. googleapi.ServerResponse `json:"-"`
  18742. // ForceSendFields is a list of field names (e.g.
  18743. // "CommonInstanceMetadata") to unconditionally include in API requests.
  18744. // By default, fields with empty values are omitted from API requests.
  18745. // However, any non-pointer, non-interface field appearing in
  18746. // ForceSendFields will be sent to the server regardless of whether the
  18747. // field is empty or not. This may be used to include empty fields in
  18748. // Patch requests.
  18749. ForceSendFields []string `json:"-"`
  18750. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  18751. // to include in API requests with the JSON null value. By default,
  18752. // fields with empty values are omitted from API requests. However, any
  18753. // field with an empty value appearing in NullFields will be sent to the
  18754. // server as null. It is an error if a field in this list has a
  18755. // non-empty value. This may be used to include null fields in Patch
  18756. // requests.
  18757. NullFields []string `json:"-"`
  18758. }
  18759. func (s *Project) MarshalJSON() ([]byte, error) {
  18760. type NoMethod Project
  18761. raw := NoMethod(*s)
  18762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18763. }
  18764. type ProjectsDisableXpnResourceRequest struct {
  18765. // XpnResource: Service resource (a.k.a service project) ID.
  18766. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  18767. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  18768. // unconditionally include in API requests. By default, fields with
  18769. // empty values are omitted from API requests. However, any non-pointer,
  18770. // non-interface field appearing in ForceSendFields will be sent to the
  18771. // server regardless of whether the field is empty or not. This may be
  18772. // used to include empty fields in Patch requests.
  18773. ForceSendFields []string `json:"-"`
  18774. // NullFields is a list of field names (e.g. "XpnResource") to include
  18775. // in API requests with the JSON null value. By default, fields with
  18776. // empty values are omitted from API requests. However, any field with
  18777. // an empty value appearing in NullFields will be sent to the server as
  18778. // null. It is an error if a field in this list has a non-empty value.
  18779. // This may be used to include null fields in Patch requests.
  18780. NullFields []string `json:"-"`
  18781. }
  18782. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  18783. type NoMethod ProjectsDisableXpnResourceRequest
  18784. raw := NoMethod(*s)
  18785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18786. }
  18787. type ProjectsEnableXpnResourceRequest struct {
  18788. // XpnResource: Service resource (a.k.a service project) ID.
  18789. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  18790. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  18791. // unconditionally include in API requests. By default, fields with
  18792. // empty values are omitted from API requests. However, any non-pointer,
  18793. // non-interface field appearing in ForceSendFields will be sent to the
  18794. // server regardless of whether the field is empty or not. This may be
  18795. // used to include empty fields in Patch requests.
  18796. ForceSendFields []string `json:"-"`
  18797. // NullFields is a list of field names (e.g. "XpnResource") to include
  18798. // in API requests with the JSON null value. By default, fields with
  18799. // empty values are omitted from API requests. However, any field with
  18800. // an empty value appearing in NullFields will be sent to the server as
  18801. // null. It is an error if a field in this list has a non-empty value.
  18802. // This may be used to include null fields in Patch requests.
  18803. NullFields []string `json:"-"`
  18804. }
  18805. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  18806. type NoMethod ProjectsEnableXpnResourceRequest
  18807. raw := NoMethod(*s)
  18808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18809. }
  18810. type ProjectsGetXpnResources struct {
  18811. // Kind: [Output Only] Type of resource. Always
  18812. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  18813. // service projects)
  18814. Kind string `json:"kind,omitempty"`
  18815. // NextPageToken: [Output Only] This token allows you to get the next
  18816. // page of results for list requests. If the number of results is larger
  18817. // than maxResults, use the nextPageToken as a value for the query
  18818. // parameter pageToken in the next list request. Subsequent list
  18819. // requests will have their own nextPageToken to continue paging through
  18820. // the results.
  18821. NextPageToken string `json:"nextPageToken,omitempty"`
  18822. // Resources: Service resources (a.k.a service projects) attached to
  18823. // this project as their shared VPC host.
  18824. Resources []*XpnResourceId `json:"resources,omitempty"`
  18825. // ServerResponse contains the HTTP response code and headers from the
  18826. // server.
  18827. googleapi.ServerResponse `json:"-"`
  18828. // ForceSendFields is a list of field names (e.g. "Kind") to
  18829. // unconditionally include in API requests. By default, fields with
  18830. // empty values are omitted from API requests. However, any non-pointer,
  18831. // non-interface field appearing in ForceSendFields will be sent to the
  18832. // server regardless of whether the field is empty or not. This may be
  18833. // used to include empty fields in Patch requests.
  18834. ForceSendFields []string `json:"-"`
  18835. // NullFields is a list of field names (e.g. "Kind") to include in API
  18836. // requests with the JSON null value. By default, fields with empty
  18837. // values are omitted from API requests. However, any field with an
  18838. // empty value appearing in NullFields will be sent to the server as
  18839. // null. It is an error if a field in this list has a non-empty value.
  18840. // This may be used to include null fields in Patch requests.
  18841. NullFields []string `json:"-"`
  18842. }
  18843. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  18844. type NoMethod ProjectsGetXpnResources
  18845. raw := NoMethod(*s)
  18846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18847. }
  18848. type ProjectsListXpnHostsRequest struct {
  18849. // Organization: Optional organization ID managed by Cloud Resource
  18850. // Manager, for which to list shared VPC host projects. If not
  18851. // specified, the organization will be inferred from the project.
  18852. Organization string `json:"organization,omitempty"`
  18853. // ForceSendFields is a list of field names (e.g. "Organization") to
  18854. // unconditionally include in API requests. By default, fields with
  18855. // empty values are omitted from API requests. However, any non-pointer,
  18856. // non-interface field appearing in ForceSendFields will be sent to the
  18857. // server regardless of whether the field is empty or not. This may be
  18858. // used to include empty fields in Patch requests.
  18859. ForceSendFields []string `json:"-"`
  18860. // NullFields is a list of field names (e.g. "Organization") to include
  18861. // in API requests with the JSON null value. By default, fields with
  18862. // empty values are omitted from API requests. However, any field with
  18863. // an empty value appearing in NullFields will be sent to the server as
  18864. // null. It is an error if a field in this list has a non-empty value.
  18865. // This may be used to include null fields in Patch requests.
  18866. NullFields []string `json:"-"`
  18867. }
  18868. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  18869. type NoMethod ProjectsListXpnHostsRequest
  18870. raw := NoMethod(*s)
  18871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18872. }
  18873. type ProjectsSetDefaultNetworkTierRequest struct {
  18874. // NetworkTier: Default network tier to be set.
  18875. //
  18876. // Possible values:
  18877. // "PREMIUM"
  18878. // "STANDARD"
  18879. NetworkTier string `json:"networkTier,omitempty"`
  18880. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  18881. // unconditionally include in API requests. By default, fields with
  18882. // empty values are omitted from API requests. However, any non-pointer,
  18883. // non-interface field appearing in ForceSendFields will be sent to the
  18884. // server regardless of whether the field is empty or not. This may be
  18885. // used to include empty fields in Patch requests.
  18886. ForceSendFields []string `json:"-"`
  18887. // NullFields is a list of field names (e.g. "NetworkTier") to include
  18888. // in API requests with the JSON null value. By default, fields with
  18889. // empty values are omitted from API requests. However, any field with
  18890. // an empty value appearing in NullFields will be sent to the server as
  18891. // null. It is an error if a field in this list has a non-empty value.
  18892. // This may be used to include null fields in Patch requests.
  18893. NullFields []string `json:"-"`
  18894. }
  18895. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  18896. type NoMethod ProjectsSetDefaultNetworkTierRequest
  18897. raw := NoMethod(*s)
  18898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18899. }
  18900. // Quota: A quotas entry.
  18901. type Quota struct {
  18902. // Limit: [Output Only] Quota limit for this metric.
  18903. Limit float64 `json:"limit,omitempty"`
  18904. // Metric: [Output Only] Name of the quota metric.
  18905. //
  18906. // Possible values:
  18907. // "AUTOSCALERS"
  18908. // "BACKEND_BUCKETS"
  18909. // "BACKEND_SERVICES"
  18910. // "COMMITMENTS"
  18911. // "CPUS"
  18912. // "CPUS_ALL_REGIONS"
  18913. // "DISKS_TOTAL_GB"
  18914. // "FIREWALLS"
  18915. // "FORWARDING_RULES"
  18916. // "GLOBAL_INTERNAL_ADDRESSES"
  18917. // "GPUS_ALL_REGIONS"
  18918. // "HEALTH_CHECKS"
  18919. // "IMAGES"
  18920. // "INSTANCES"
  18921. // "INSTANCE_GROUPS"
  18922. // "INSTANCE_GROUP_MANAGERS"
  18923. // "INSTANCE_TEMPLATES"
  18924. // "INTERCONNECTS"
  18925. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  18926. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  18927. // "INTERNAL_ADDRESSES"
  18928. // "IN_USE_ADDRESSES"
  18929. // "IN_USE_BACKUP_SCHEDULES"
  18930. // "LOCAL_SSD_TOTAL_GB"
  18931. // "NETWORKS"
  18932. // "NETWORK_ENDPOINT_GROUPS"
  18933. // "NVIDIA_K80_GPUS"
  18934. // "NVIDIA_P100_GPUS"
  18935. // "NVIDIA_P100_VWS_GPUS"
  18936. // "NVIDIA_P4_GPUS"
  18937. // "NVIDIA_P4_VWS_GPUS"
  18938. // "NVIDIA_T4_GPUS"
  18939. // "NVIDIA_T4_VWS_GPUS"
  18940. // "NVIDIA_V100_GPUS"
  18941. // "PREEMPTIBLE_CPUS"
  18942. // "PREEMPTIBLE_LOCAL_SSD_GB"
  18943. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  18944. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  18945. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  18946. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  18947. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  18948. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  18949. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  18950. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  18951. // "REGIONAL_AUTOSCALERS"
  18952. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  18953. // "RESOURCE_POLICIES"
  18954. // "ROUTERS"
  18955. // "ROUTES"
  18956. // "SECURITY_POLICIES"
  18957. // "SECURITY_POLICY_RULES"
  18958. // "SNAPSHOTS"
  18959. // "SSD_TOTAL_GB"
  18960. // "SSL_CERTIFICATES"
  18961. // "STATIC_ADDRESSES"
  18962. // "SUBNETWORKS"
  18963. // "TARGET_HTTPS_PROXIES"
  18964. // "TARGET_HTTP_PROXIES"
  18965. // "TARGET_INSTANCES"
  18966. // "TARGET_POOLS"
  18967. // "TARGET_SSL_PROXIES"
  18968. // "TARGET_TCP_PROXIES"
  18969. // "TARGET_VPN_GATEWAYS"
  18970. // "URL_MAPS"
  18971. // "VPN_GATEWAYS"
  18972. // "VPN_TUNNELS"
  18973. Metric string `json:"metric,omitempty"`
  18974. // Usage: [Output Only] Current usage of this metric.
  18975. Usage float64 `json:"usage,omitempty"`
  18976. // ForceSendFields is a list of field names (e.g. "Limit") to
  18977. // unconditionally include in API requests. By default, fields with
  18978. // empty values are omitted from API requests. However, any non-pointer,
  18979. // non-interface field appearing in ForceSendFields will be sent to the
  18980. // server regardless of whether the field is empty or not. This may be
  18981. // used to include empty fields in Patch requests.
  18982. ForceSendFields []string `json:"-"`
  18983. // NullFields is a list of field names (e.g. "Limit") to include in API
  18984. // requests with the JSON null value. By default, fields with empty
  18985. // values are omitted from API requests. However, any field with an
  18986. // empty value appearing in NullFields will be sent to the server as
  18987. // null. It is an error if a field in this list has a non-empty value.
  18988. // This may be used to include null fields in Patch requests.
  18989. NullFields []string `json:"-"`
  18990. }
  18991. func (s *Quota) MarshalJSON() ([]byte, error) {
  18992. type NoMethod Quota
  18993. raw := NoMethod(*s)
  18994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18995. }
  18996. func (s *Quota) UnmarshalJSON(data []byte) error {
  18997. type NoMethod Quota
  18998. var s1 struct {
  18999. Limit gensupport.JSONFloat64 `json:"limit"`
  19000. Usage gensupport.JSONFloat64 `json:"usage"`
  19001. *NoMethod
  19002. }
  19003. s1.NoMethod = (*NoMethod)(s)
  19004. if err := json.Unmarshal(data, &s1); err != nil {
  19005. return err
  19006. }
  19007. s.Limit = float64(s1.Limit)
  19008. s.Usage = float64(s1.Usage)
  19009. return nil
  19010. }
  19011. // Reference: Represents a reference to a resource.
  19012. type Reference struct {
  19013. // Kind: [Output Only] Type of the resource. Always compute#reference
  19014. // for references.
  19015. Kind string `json:"kind,omitempty"`
  19016. // ReferenceType: A description of the reference type with no implied
  19017. // semantics. Possible values include:
  19018. // - MEMBER_OF
  19019. ReferenceType string `json:"referenceType,omitempty"`
  19020. // Referrer: URL of the resource which refers to the target.
  19021. Referrer string `json:"referrer,omitempty"`
  19022. // Target: URL of the resource to which this reference points.
  19023. Target string `json:"target,omitempty"`
  19024. // ForceSendFields is a list of field names (e.g. "Kind") to
  19025. // unconditionally include in API requests. By default, fields with
  19026. // empty values are omitted from API requests. However, any non-pointer,
  19027. // non-interface field appearing in ForceSendFields will be sent to the
  19028. // server regardless of whether the field is empty or not. This may be
  19029. // used to include empty fields in Patch requests.
  19030. ForceSendFields []string `json:"-"`
  19031. // NullFields is a list of field names (e.g. "Kind") to include in API
  19032. // requests with the JSON null value. By default, fields with empty
  19033. // values are omitted from API requests. However, any field with an
  19034. // empty value appearing in NullFields will be sent to the server as
  19035. // null. It is an error if a field in this list has a non-empty value.
  19036. // This may be used to include null fields in Patch requests.
  19037. NullFields []string `json:"-"`
  19038. }
  19039. func (s *Reference) MarshalJSON() ([]byte, error) {
  19040. type NoMethod Reference
  19041. raw := NoMethod(*s)
  19042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19043. }
  19044. // Region: Region resource. (== resource_for beta.regions ==) (==
  19045. // resource_for v1.regions ==)
  19046. type Region struct {
  19047. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19048. // format.
  19049. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19050. // Deprecated: [Output Only] The deprecation status associated with this
  19051. // region.
  19052. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  19053. // Description: [Output Only] Textual description of the resource.
  19054. Description string `json:"description,omitempty"`
  19055. // Id: [Output Only] The unique identifier for the resource. This
  19056. // identifier is defined by the server.
  19057. Id uint64 `json:"id,omitempty,string"`
  19058. // Kind: [Output Only] Type of the resource. Always compute#region for
  19059. // regions.
  19060. Kind string `json:"kind,omitempty"`
  19061. // Name: [Output Only] Name of the resource.
  19062. Name string `json:"name,omitempty"`
  19063. // Quotas: [Output Only] Quotas assigned to this region.
  19064. Quotas []*Quota `json:"quotas,omitempty"`
  19065. // SelfLink: [Output Only] Server-defined URL for the resource.
  19066. SelfLink string `json:"selfLink,omitempty"`
  19067. // Status: [Output Only] Status of the region, either UP or DOWN.
  19068. //
  19069. // Possible values:
  19070. // "DOWN"
  19071. // "UP"
  19072. Status string `json:"status,omitempty"`
  19073. // Zones: [Output Only] A list of zones available in this region, in the
  19074. // form of resource URLs.
  19075. Zones []string `json:"zones,omitempty"`
  19076. // ServerResponse contains the HTTP response code and headers from the
  19077. // server.
  19078. googleapi.ServerResponse `json:"-"`
  19079. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19080. // to unconditionally include in API requests. By default, fields with
  19081. // empty values are omitted from API requests. However, any non-pointer,
  19082. // non-interface field appearing in ForceSendFields will be sent to the
  19083. // server regardless of whether the field is empty or not. This may be
  19084. // used to include empty fields in Patch requests.
  19085. ForceSendFields []string `json:"-"`
  19086. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19087. // include in API requests with the JSON null value. By default, fields
  19088. // with empty values are omitted from API requests. However, any field
  19089. // with an empty value appearing in NullFields will be sent to the
  19090. // server as null. It is an error if a field in this list has a
  19091. // non-empty value. This may be used to include null fields in Patch
  19092. // requests.
  19093. NullFields []string `json:"-"`
  19094. }
  19095. func (s *Region) MarshalJSON() ([]byte, error) {
  19096. type NoMethod Region
  19097. raw := NoMethod(*s)
  19098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19099. }
  19100. // RegionAutoscalerList: Contains a list of autoscalers.
  19101. type RegionAutoscalerList struct {
  19102. // Id: [Output Only] Unique identifier for the resource; defined by the
  19103. // server.
  19104. Id string `json:"id,omitempty"`
  19105. // Items: A list of Autoscaler resources.
  19106. Items []*Autoscaler `json:"items,omitempty"`
  19107. // Kind: Type of resource.
  19108. Kind string `json:"kind,omitempty"`
  19109. // NextPageToken: [Output Only] This token allows you to get the next
  19110. // page of results for list requests. If the number of results is larger
  19111. // than maxResults, use the nextPageToken as a value for the query
  19112. // parameter pageToken in the next list request. Subsequent list
  19113. // requests will have their own nextPageToken to continue paging through
  19114. // the results.
  19115. NextPageToken string `json:"nextPageToken,omitempty"`
  19116. // SelfLink: [Output Only] Server-defined URL for this resource.
  19117. SelfLink string `json:"selfLink,omitempty"`
  19118. // Warning: [Output Only] Informational warning message.
  19119. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  19120. // ServerResponse contains the HTTP response code and headers from the
  19121. // server.
  19122. googleapi.ServerResponse `json:"-"`
  19123. // ForceSendFields is a list of field names (e.g. "Id") to
  19124. // unconditionally include in API requests. By default, fields with
  19125. // empty values are omitted from API requests. However, any non-pointer,
  19126. // non-interface field appearing in ForceSendFields will be sent to the
  19127. // server regardless of whether the field is empty or not. This may be
  19128. // used to include empty fields in Patch requests.
  19129. ForceSendFields []string `json:"-"`
  19130. // NullFields is a list of field names (e.g. "Id") to include in API
  19131. // requests with the JSON null value. By default, fields with empty
  19132. // values are omitted from API requests. However, any field with an
  19133. // empty value appearing in NullFields will be sent to the server as
  19134. // null. It is an error if a field in this list has a non-empty value.
  19135. // This may be used to include null fields in Patch requests.
  19136. NullFields []string `json:"-"`
  19137. }
  19138. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  19139. type NoMethod RegionAutoscalerList
  19140. raw := NoMethod(*s)
  19141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19142. }
  19143. // RegionAutoscalerListWarning: [Output Only] Informational warning
  19144. // message.
  19145. type RegionAutoscalerListWarning struct {
  19146. // Code: [Output Only] A warning code, if applicable. For example,
  19147. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19148. // the response.
  19149. //
  19150. // Possible values:
  19151. // "CLEANUP_FAILED"
  19152. // "DEPRECATED_RESOURCE_USED"
  19153. // "DEPRECATED_TYPE_USED"
  19154. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19155. // "EXPERIMENTAL_TYPE_USED"
  19156. // "EXTERNAL_API_WARNING"
  19157. // "FIELD_VALUE_OVERRIDEN"
  19158. // "INJECTED_KERNELS_DEPRECATED"
  19159. // "MISSING_TYPE_DEPENDENCY"
  19160. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19161. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19162. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19163. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19164. // "NEXT_HOP_NOT_RUNNING"
  19165. // "NOT_CRITICAL_ERROR"
  19166. // "NO_RESULTS_ON_PAGE"
  19167. // "REQUIRED_TOS_AGREEMENT"
  19168. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19169. // "RESOURCE_NOT_DELETED"
  19170. // "SCHEMA_VALIDATION_IGNORED"
  19171. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19172. // "UNDECLARED_PROPERTIES"
  19173. // "UNREACHABLE"
  19174. Code string `json:"code,omitempty"`
  19175. // Data: [Output Only] Metadata about this warning in key: value format.
  19176. // For example:
  19177. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19178. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  19179. // Message: [Output Only] A human-readable description of the warning
  19180. // code.
  19181. Message string `json:"message,omitempty"`
  19182. // ForceSendFields is a list of field names (e.g. "Code") to
  19183. // unconditionally include in API requests. By default, fields with
  19184. // empty values are omitted from API requests. However, any non-pointer,
  19185. // non-interface field appearing in ForceSendFields will be sent to the
  19186. // server regardless of whether the field is empty or not. This may be
  19187. // used to include empty fields in Patch requests.
  19188. ForceSendFields []string `json:"-"`
  19189. // NullFields is a list of field names (e.g. "Code") to include in API
  19190. // requests with the JSON null value. By default, fields with empty
  19191. // values are omitted from API requests. However, any field with an
  19192. // empty value appearing in NullFields will be sent to the server as
  19193. // null. It is an error if a field in this list has a non-empty value.
  19194. // This may be used to include null fields in Patch requests.
  19195. NullFields []string `json:"-"`
  19196. }
  19197. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  19198. type NoMethod RegionAutoscalerListWarning
  19199. raw := NoMethod(*s)
  19200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19201. }
  19202. type RegionAutoscalerListWarningData struct {
  19203. // Key: [Output Only] A key that provides more detail on the warning
  19204. // being returned. For example, for warnings where there are no results
  19205. // in a list request for a particular zone, this key might be scope and
  19206. // the key value might be the zone name. Other examples might be a key
  19207. // indicating a deprecated resource and a suggested replacement, or a
  19208. // warning about invalid network settings (for example, if an instance
  19209. // attempts to perform IP forwarding but is not enabled for IP
  19210. // forwarding).
  19211. Key string `json:"key,omitempty"`
  19212. // Value: [Output Only] A warning data value corresponding to the key.
  19213. Value string `json:"value,omitempty"`
  19214. // ForceSendFields is a list of field names (e.g. "Key") to
  19215. // unconditionally include in API requests. By default, fields with
  19216. // empty values are omitted from API requests. However, any non-pointer,
  19217. // non-interface field appearing in ForceSendFields will be sent to the
  19218. // server regardless of whether the field is empty or not. This may be
  19219. // used to include empty fields in Patch requests.
  19220. ForceSendFields []string `json:"-"`
  19221. // NullFields is a list of field names (e.g. "Key") to include in API
  19222. // requests with the JSON null value. By default, fields with empty
  19223. // values are omitted from API requests. However, any field with an
  19224. // empty value appearing in NullFields will be sent to the server as
  19225. // null. It is an error if a field in this list has a non-empty value.
  19226. // This may be used to include null fields in Patch requests.
  19227. NullFields []string `json:"-"`
  19228. }
  19229. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  19230. type NoMethod RegionAutoscalerListWarningData
  19231. raw := NoMethod(*s)
  19232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19233. }
  19234. type RegionDiskTypeList struct {
  19235. // Id: [Output Only] Unique identifier for the resource; defined by the
  19236. // server.
  19237. Id string `json:"id,omitempty"`
  19238. // Items: A list of DiskType resources.
  19239. Items []*DiskType `json:"items,omitempty"`
  19240. // Kind: [Output Only] Type of resource. Always
  19241. // compute#regionDiskTypeList for region disk types.
  19242. Kind string `json:"kind,omitempty"`
  19243. // NextPageToken: [Output Only] This token allows you to get the next
  19244. // page of results for list requests. If the number of results is larger
  19245. // than maxResults, use the nextPageToken as a value for the query
  19246. // parameter pageToken in the next list request. Subsequent list
  19247. // requests will have their own nextPageToken to continue paging through
  19248. // the results.
  19249. NextPageToken string `json:"nextPageToken,omitempty"`
  19250. // SelfLink: [Output Only] Server-defined URL for this resource.
  19251. SelfLink string `json:"selfLink,omitempty"`
  19252. // Warning: [Output Only] Informational warning message.
  19253. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  19254. // ServerResponse contains the HTTP response code and headers from the
  19255. // server.
  19256. googleapi.ServerResponse `json:"-"`
  19257. // ForceSendFields is a list of field names (e.g. "Id") to
  19258. // unconditionally include in API requests. By default, fields with
  19259. // empty values are omitted from API requests. However, any non-pointer,
  19260. // non-interface field appearing in ForceSendFields will be sent to the
  19261. // server regardless of whether the field is empty or not. This may be
  19262. // used to include empty fields in Patch requests.
  19263. ForceSendFields []string `json:"-"`
  19264. // NullFields is a list of field names (e.g. "Id") to include in API
  19265. // requests with the JSON null value. By default, fields with empty
  19266. // values are omitted from API requests. However, any field with an
  19267. // empty value appearing in NullFields will be sent to the server as
  19268. // null. It is an error if a field in this list has a non-empty value.
  19269. // This may be used to include null fields in Patch requests.
  19270. NullFields []string `json:"-"`
  19271. }
  19272. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  19273. type NoMethod RegionDiskTypeList
  19274. raw := NoMethod(*s)
  19275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19276. }
  19277. // RegionDiskTypeListWarning: [Output Only] Informational warning
  19278. // message.
  19279. type RegionDiskTypeListWarning struct {
  19280. // Code: [Output Only] A warning code, if applicable. For example,
  19281. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19282. // the response.
  19283. //
  19284. // Possible values:
  19285. // "CLEANUP_FAILED"
  19286. // "DEPRECATED_RESOURCE_USED"
  19287. // "DEPRECATED_TYPE_USED"
  19288. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19289. // "EXPERIMENTAL_TYPE_USED"
  19290. // "EXTERNAL_API_WARNING"
  19291. // "FIELD_VALUE_OVERRIDEN"
  19292. // "INJECTED_KERNELS_DEPRECATED"
  19293. // "MISSING_TYPE_DEPENDENCY"
  19294. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19295. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19296. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19297. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19298. // "NEXT_HOP_NOT_RUNNING"
  19299. // "NOT_CRITICAL_ERROR"
  19300. // "NO_RESULTS_ON_PAGE"
  19301. // "REQUIRED_TOS_AGREEMENT"
  19302. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19303. // "RESOURCE_NOT_DELETED"
  19304. // "SCHEMA_VALIDATION_IGNORED"
  19305. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19306. // "UNDECLARED_PROPERTIES"
  19307. // "UNREACHABLE"
  19308. Code string `json:"code,omitempty"`
  19309. // Data: [Output Only] Metadata about this warning in key: value format.
  19310. // For example:
  19311. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19312. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  19313. // Message: [Output Only] A human-readable description of the warning
  19314. // code.
  19315. Message string `json:"message,omitempty"`
  19316. // ForceSendFields is a list of field names (e.g. "Code") to
  19317. // unconditionally include in API requests. By default, fields with
  19318. // empty values are omitted from API requests. However, any non-pointer,
  19319. // non-interface field appearing in ForceSendFields will be sent to the
  19320. // server regardless of whether the field is empty or not. This may be
  19321. // used to include empty fields in Patch requests.
  19322. ForceSendFields []string `json:"-"`
  19323. // NullFields is a list of field names (e.g. "Code") to include in API
  19324. // requests with the JSON null value. By default, fields with empty
  19325. // values are omitted from API requests. However, any field with an
  19326. // empty value appearing in NullFields will be sent to the server as
  19327. // null. It is an error if a field in this list has a non-empty value.
  19328. // This may be used to include null fields in Patch requests.
  19329. NullFields []string `json:"-"`
  19330. }
  19331. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  19332. type NoMethod RegionDiskTypeListWarning
  19333. raw := NoMethod(*s)
  19334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19335. }
  19336. type RegionDiskTypeListWarningData struct {
  19337. // Key: [Output Only] A key that provides more detail on the warning
  19338. // being returned. For example, for warnings where there are no results
  19339. // in a list request for a particular zone, this key might be scope and
  19340. // the key value might be the zone name. Other examples might be a key
  19341. // indicating a deprecated resource and a suggested replacement, or a
  19342. // warning about invalid network settings (for example, if an instance
  19343. // attempts to perform IP forwarding but is not enabled for IP
  19344. // forwarding).
  19345. Key string `json:"key,omitempty"`
  19346. // Value: [Output Only] A warning data value corresponding to the key.
  19347. Value string `json:"value,omitempty"`
  19348. // ForceSendFields is a list of field names (e.g. "Key") to
  19349. // unconditionally include in API requests. By default, fields with
  19350. // empty values are omitted from API requests. However, any non-pointer,
  19351. // non-interface field appearing in ForceSendFields will be sent to the
  19352. // server regardless of whether the field is empty or not. This may be
  19353. // used to include empty fields in Patch requests.
  19354. ForceSendFields []string `json:"-"`
  19355. // NullFields is a list of field names (e.g. "Key") to include in API
  19356. // requests with the JSON null value. By default, fields with empty
  19357. // values are omitted from API requests. However, any field with an
  19358. // empty value appearing in NullFields will be sent to the server as
  19359. // null. It is an error if a field in this list has a non-empty value.
  19360. // This may be used to include null fields in Patch requests.
  19361. NullFields []string `json:"-"`
  19362. }
  19363. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  19364. type NoMethod RegionDiskTypeListWarningData
  19365. raw := NoMethod(*s)
  19366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19367. }
  19368. type RegionDisksAddResourcePoliciesRequest struct {
  19369. // ResourcePolicies: Resource policies to be added to this disk.
  19370. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  19371. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  19372. // unconditionally include in API requests. By default, fields with
  19373. // empty values are omitted from API requests. However, any non-pointer,
  19374. // non-interface field appearing in ForceSendFields will be sent to the
  19375. // server regardless of whether the field is empty or not. This may be
  19376. // used to include empty fields in Patch requests.
  19377. ForceSendFields []string `json:"-"`
  19378. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  19379. // include in API requests with the JSON null value. By default, fields
  19380. // with empty values are omitted from API requests. However, any field
  19381. // with an empty value appearing in NullFields will be sent to the
  19382. // server as null. It is an error if a field in this list has a
  19383. // non-empty value. This may be used to include null fields in Patch
  19384. // requests.
  19385. NullFields []string `json:"-"`
  19386. }
  19387. func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  19388. type NoMethod RegionDisksAddResourcePoliciesRequest
  19389. raw := NoMethod(*s)
  19390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19391. }
  19392. type RegionDisksRemoveResourcePoliciesRequest struct {
  19393. // ResourcePolicies: Resource policies to be removed from this disk.
  19394. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  19395. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  19396. // unconditionally include in API requests. By default, fields with
  19397. // empty values are omitted from API requests. However, any non-pointer,
  19398. // non-interface field appearing in ForceSendFields will be sent to the
  19399. // server regardless of whether the field is empty or not. This may be
  19400. // used to include empty fields in Patch requests.
  19401. ForceSendFields []string `json:"-"`
  19402. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  19403. // include in API requests with the JSON null value. By default, fields
  19404. // with empty values are omitted from API requests. However, any field
  19405. // with an empty value appearing in NullFields will be sent to the
  19406. // server as null. It is an error if a field in this list has a
  19407. // non-empty value. This may be used to include null fields in Patch
  19408. // requests.
  19409. NullFields []string `json:"-"`
  19410. }
  19411. func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  19412. type NoMethod RegionDisksRemoveResourcePoliciesRequest
  19413. raw := NoMethod(*s)
  19414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19415. }
  19416. type RegionDisksResizeRequest struct {
  19417. // SizeGb: The new size of the regional persistent disk, which is
  19418. // specified in GB.
  19419. SizeGb int64 `json:"sizeGb,omitempty,string"`
  19420. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  19421. // unconditionally include in API requests. By default, fields with
  19422. // empty values are omitted from API requests. However, any non-pointer,
  19423. // non-interface field appearing in ForceSendFields will be sent to the
  19424. // server regardless of whether the field is empty or not. This may be
  19425. // used to include empty fields in Patch requests.
  19426. ForceSendFields []string `json:"-"`
  19427. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  19428. // requests with the JSON null value. By default, fields with empty
  19429. // values are omitted from API requests. However, any field with an
  19430. // empty value appearing in NullFields will be sent to the server as
  19431. // null. It is an error if a field in this list has a non-empty value.
  19432. // This may be used to include null fields in Patch requests.
  19433. NullFields []string `json:"-"`
  19434. }
  19435. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  19436. type NoMethod RegionDisksResizeRequest
  19437. raw := NoMethod(*s)
  19438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19439. }
  19440. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  19441. type RegionInstanceGroupList struct {
  19442. // Id: [Output Only] Unique identifier for the resource; defined by the
  19443. // server.
  19444. Id string `json:"id,omitempty"`
  19445. // Items: A list of InstanceGroup resources.
  19446. Items []*InstanceGroup `json:"items,omitempty"`
  19447. // Kind: The resource type.
  19448. Kind string `json:"kind,omitempty"`
  19449. // NextPageToken: [Output Only] This token allows you to get the next
  19450. // page of results for list requests. If the number of results is larger
  19451. // than maxResults, use the nextPageToken as a value for the query
  19452. // parameter pageToken in the next list request. Subsequent list
  19453. // requests will have their own nextPageToken to continue paging through
  19454. // the results.
  19455. NextPageToken string `json:"nextPageToken,omitempty"`
  19456. // SelfLink: [Output Only] Server-defined URL for this resource.
  19457. SelfLink string `json:"selfLink,omitempty"`
  19458. // Warning: [Output Only] Informational warning message.
  19459. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  19460. // ServerResponse contains the HTTP response code and headers from the
  19461. // server.
  19462. googleapi.ServerResponse `json:"-"`
  19463. // ForceSendFields is a list of field names (e.g. "Id") to
  19464. // unconditionally include in API requests. By default, fields with
  19465. // empty values are omitted from API requests. However, any non-pointer,
  19466. // non-interface field appearing in ForceSendFields will be sent to the
  19467. // server regardless of whether the field is empty or not. This may be
  19468. // used to include empty fields in Patch requests.
  19469. ForceSendFields []string `json:"-"`
  19470. // NullFields is a list of field names (e.g. "Id") to include in API
  19471. // requests with the JSON null value. By default, fields with empty
  19472. // values are omitted from API requests. However, any field with an
  19473. // empty value appearing in NullFields will be sent to the server as
  19474. // null. It is an error if a field in this list has a non-empty value.
  19475. // This may be used to include null fields in Patch requests.
  19476. NullFields []string `json:"-"`
  19477. }
  19478. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  19479. type NoMethod RegionInstanceGroupList
  19480. raw := NoMethod(*s)
  19481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19482. }
  19483. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  19484. // message.
  19485. type RegionInstanceGroupListWarning struct {
  19486. // Code: [Output Only] A warning code, if applicable. For example,
  19487. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19488. // the response.
  19489. //
  19490. // Possible values:
  19491. // "CLEANUP_FAILED"
  19492. // "DEPRECATED_RESOURCE_USED"
  19493. // "DEPRECATED_TYPE_USED"
  19494. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19495. // "EXPERIMENTAL_TYPE_USED"
  19496. // "EXTERNAL_API_WARNING"
  19497. // "FIELD_VALUE_OVERRIDEN"
  19498. // "INJECTED_KERNELS_DEPRECATED"
  19499. // "MISSING_TYPE_DEPENDENCY"
  19500. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19501. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19502. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19503. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19504. // "NEXT_HOP_NOT_RUNNING"
  19505. // "NOT_CRITICAL_ERROR"
  19506. // "NO_RESULTS_ON_PAGE"
  19507. // "REQUIRED_TOS_AGREEMENT"
  19508. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19509. // "RESOURCE_NOT_DELETED"
  19510. // "SCHEMA_VALIDATION_IGNORED"
  19511. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19512. // "UNDECLARED_PROPERTIES"
  19513. // "UNREACHABLE"
  19514. Code string `json:"code,omitempty"`
  19515. // Data: [Output Only] Metadata about this warning in key: value format.
  19516. // For example:
  19517. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19518. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  19519. // Message: [Output Only] A human-readable description of the warning
  19520. // code.
  19521. Message string `json:"message,omitempty"`
  19522. // ForceSendFields is a list of field names (e.g. "Code") to
  19523. // unconditionally include in API requests. By default, fields with
  19524. // empty values are omitted from API requests. However, any non-pointer,
  19525. // non-interface field appearing in ForceSendFields will be sent to the
  19526. // server regardless of whether the field is empty or not. This may be
  19527. // used to include empty fields in Patch requests.
  19528. ForceSendFields []string `json:"-"`
  19529. // NullFields is a list of field names (e.g. "Code") to include in API
  19530. // requests with the JSON null value. By default, fields with empty
  19531. // values are omitted from API requests. However, any field with an
  19532. // empty value appearing in NullFields will be sent to the server as
  19533. // null. It is an error if a field in this list has a non-empty value.
  19534. // This may be used to include null fields in Patch requests.
  19535. NullFields []string `json:"-"`
  19536. }
  19537. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  19538. type NoMethod RegionInstanceGroupListWarning
  19539. raw := NoMethod(*s)
  19540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19541. }
  19542. type RegionInstanceGroupListWarningData struct {
  19543. // Key: [Output Only] A key that provides more detail on the warning
  19544. // being returned. For example, for warnings where there are no results
  19545. // in a list request for a particular zone, this key might be scope and
  19546. // the key value might be the zone name. Other examples might be a key
  19547. // indicating a deprecated resource and a suggested replacement, or a
  19548. // warning about invalid network settings (for example, if an instance
  19549. // attempts to perform IP forwarding but is not enabled for IP
  19550. // forwarding).
  19551. Key string `json:"key,omitempty"`
  19552. // Value: [Output Only] A warning data value corresponding to the key.
  19553. Value string `json:"value,omitempty"`
  19554. // ForceSendFields is a list of field names (e.g. "Key") to
  19555. // unconditionally include in API requests. By default, fields with
  19556. // empty values are omitted from API requests. However, any non-pointer,
  19557. // non-interface field appearing in ForceSendFields will be sent to the
  19558. // server regardless of whether the field is empty or not. This may be
  19559. // used to include empty fields in Patch requests.
  19560. ForceSendFields []string `json:"-"`
  19561. // NullFields is a list of field names (e.g. "Key") to include in API
  19562. // requests with the JSON null value. By default, fields with empty
  19563. // values are omitted from API requests. However, any field with an
  19564. // empty value appearing in NullFields will be sent to the server as
  19565. // null. It is an error if a field in this list has a non-empty value.
  19566. // This may be used to include null fields in Patch requests.
  19567. NullFields []string `json:"-"`
  19568. }
  19569. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  19570. type NoMethod RegionInstanceGroupListWarningData
  19571. raw := NoMethod(*s)
  19572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19573. }
  19574. // RegionInstanceGroupManagerList: Contains a list of managed instance
  19575. // groups.
  19576. type RegionInstanceGroupManagerList struct {
  19577. // Id: [Output Only] Unique identifier for the resource; defined by the
  19578. // server.
  19579. Id string `json:"id,omitempty"`
  19580. // Items: A list of InstanceGroupManager resources.
  19581. Items []*InstanceGroupManager `json:"items,omitempty"`
  19582. // Kind: [Output Only] The resource type, which is always
  19583. // compute#instanceGroupManagerList for a list of managed instance
  19584. // groups that exist in th regional scope.
  19585. Kind string `json:"kind,omitempty"`
  19586. // NextPageToken: [Output Only] This token allows you to get the next
  19587. // page of results for list requests. If the number of results is larger
  19588. // than maxResults, use the nextPageToken as a value for the query
  19589. // parameter pageToken in the next list request. Subsequent list
  19590. // requests will have their own nextPageToken to continue paging through
  19591. // the results.
  19592. NextPageToken string `json:"nextPageToken,omitempty"`
  19593. // SelfLink: [Output Only] Server-defined URL for this resource.
  19594. SelfLink string `json:"selfLink,omitempty"`
  19595. // Warning: [Output Only] Informational warning message.
  19596. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  19597. // ServerResponse contains the HTTP response code and headers from the
  19598. // server.
  19599. googleapi.ServerResponse `json:"-"`
  19600. // ForceSendFields is a list of field names (e.g. "Id") to
  19601. // unconditionally include in API requests. By default, fields with
  19602. // empty values are omitted from API requests. However, any non-pointer,
  19603. // non-interface field appearing in ForceSendFields will be sent to the
  19604. // server regardless of whether the field is empty or not. This may be
  19605. // used to include empty fields in Patch requests.
  19606. ForceSendFields []string `json:"-"`
  19607. // NullFields is a list of field names (e.g. "Id") to include in API
  19608. // requests with the JSON null value. By default, fields with empty
  19609. // values are omitted from API requests. However, any field with an
  19610. // empty value appearing in NullFields will be sent to the server as
  19611. // null. It is an error if a field in this list has a non-empty value.
  19612. // This may be used to include null fields in Patch requests.
  19613. NullFields []string `json:"-"`
  19614. }
  19615. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  19616. type NoMethod RegionInstanceGroupManagerList
  19617. raw := NoMethod(*s)
  19618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19619. }
  19620. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  19621. // warning message.
  19622. type RegionInstanceGroupManagerListWarning struct {
  19623. // Code: [Output Only] A warning code, if applicable. For example,
  19624. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19625. // the response.
  19626. //
  19627. // Possible values:
  19628. // "CLEANUP_FAILED"
  19629. // "DEPRECATED_RESOURCE_USED"
  19630. // "DEPRECATED_TYPE_USED"
  19631. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19632. // "EXPERIMENTAL_TYPE_USED"
  19633. // "EXTERNAL_API_WARNING"
  19634. // "FIELD_VALUE_OVERRIDEN"
  19635. // "INJECTED_KERNELS_DEPRECATED"
  19636. // "MISSING_TYPE_DEPENDENCY"
  19637. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19638. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19639. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19640. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19641. // "NEXT_HOP_NOT_RUNNING"
  19642. // "NOT_CRITICAL_ERROR"
  19643. // "NO_RESULTS_ON_PAGE"
  19644. // "REQUIRED_TOS_AGREEMENT"
  19645. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19646. // "RESOURCE_NOT_DELETED"
  19647. // "SCHEMA_VALIDATION_IGNORED"
  19648. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19649. // "UNDECLARED_PROPERTIES"
  19650. // "UNREACHABLE"
  19651. Code string `json:"code,omitempty"`
  19652. // Data: [Output Only] Metadata about this warning in key: value format.
  19653. // For example:
  19654. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19655. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  19656. // Message: [Output Only] A human-readable description of the warning
  19657. // code.
  19658. Message string `json:"message,omitempty"`
  19659. // ForceSendFields is a list of field names (e.g. "Code") to
  19660. // unconditionally include in API requests. By default, fields with
  19661. // empty values are omitted from API requests. However, any non-pointer,
  19662. // non-interface field appearing in ForceSendFields will be sent to the
  19663. // server regardless of whether the field is empty or not. This may be
  19664. // used to include empty fields in Patch requests.
  19665. ForceSendFields []string `json:"-"`
  19666. // NullFields is a list of field names (e.g. "Code") to include in API
  19667. // requests with the JSON null value. By default, fields with empty
  19668. // values are omitted from API requests. However, any field with an
  19669. // empty value appearing in NullFields will be sent to the server as
  19670. // null. It is an error if a field in this list has a non-empty value.
  19671. // This may be used to include null fields in Patch requests.
  19672. NullFields []string `json:"-"`
  19673. }
  19674. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  19675. type NoMethod RegionInstanceGroupManagerListWarning
  19676. raw := NoMethod(*s)
  19677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19678. }
  19679. type RegionInstanceGroupManagerListWarningData struct {
  19680. // Key: [Output Only] A key that provides more detail on the warning
  19681. // being returned. For example, for warnings where there are no results
  19682. // in a list request for a particular zone, this key might be scope and
  19683. // the key value might be the zone name. Other examples might be a key
  19684. // indicating a deprecated resource and a suggested replacement, or a
  19685. // warning about invalid network settings (for example, if an instance
  19686. // attempts to perform IP forwarding but is not enabled for IP
  19687. // forwarding).
  19688. Key string `json:"key,omitempty"`
  19689. // Value: [Output Only] A warning data value corresponding to the key.
  19690. Value string `json:"value,omitempty"`
  19691. // ForceSendFields is a list of field names (e.g. "Key") to
  19692. // unconditionally include in API requests. By default, fields with
  19693. // empty values are omitted from API requests. However, any non-pointer,
  19694. // non-interface field appearing in ForceSendFields will be sent to the
  19695. // server regardless of whether the field is empty or not. This may be
  19696. // used to include empty fields in Patch requests.
  19697. ForceSendFields []string `json:"-"`
  19698. // NullFields is a list of field names (e.g. "Key") to include in API
  19699. // requests with the JSON null value. By default, fields with empty
  19700. // values are omitted from API requests. However, any field with an
  19701. // empty value appearing in NullFields will be sent to the server as
  19702. // null. It is an error if a field in this list has a non-empty value.
  19703. // This may be used to include null fields in Patch requests.
  19704. NullFields []string `json:"-"`
  19705. }
  19706. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  19707. type NoMethod RegionInstanceGroupManagerListWarningData
  19708. raw := NoMethod(*s)
  19709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19710. }
  19711. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  19712. // Instances: The URLs of one or more instances to abandon. This can be
  19713. // a full URL or a partial URL, such as
  19714. // zones/[ZONE]/instances/[INSTANCE_NAME].
  19715. Instances []string `json:"instances,omitempty"`
  19716. // ForceSendFields is a list of field names (e.g. "Instances") to
  19717. // unconditionally include in API requests. By default, fields with
  19718. // empty values are omitted from API requests. However, any non-pointer,
  19719. // non-interface field appearing in ForceSendFields will be sent to the
  19720. // server regardless of whether the field is empty or not. This may be
  19721. // used to include empty fields in Patch requests.
  19722. ForceSendFields []string `json:"-"`
  19723. // NullFields is a list of field names (e.g. "Instances") to include in
  19724. // API requests with the JSON null value. By default, fields with empty
  19725. // values are omitted from API requests. However, any field with an
  19726. // empty value appearing in NullFields will be sent to the server as
  19727. // null. It is an error if a field in this list has a non-empty value.
  19728. // This may be used to include null fields in Patch requests.
  19729. NullFields []string `json:"-"`
  19730. }
  19731. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  19732. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  19733. raw := NoMethod(*s)
  19734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19735. }
  19736. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  19737. // Instances: The URLs of one or more instances to delete. This can be a
  19738. // full URL or a partial URL, such as
  19739. // zones/[ZONE]/instances/[INSTANCE_NAME].
  19740. Instances []string `json:"instances,omitempty"`
  19741. // ForceSendFields is a list of field names (e.g. "Instances") to
  19742. // unconditionally include in API requests. By default, fields with
  19743. // empty values are omitted from API requests. However, any non-pointer,
  19744. // non-interface field appearing in ForceSendFields will be sent to the
  19745. // server regardless of whether the field is empty or not. This may be
  19746. // used to include empty fields in Patch requests.
  19747. ForceSendFields []string `json:"-"`
  19748. // NullFields is a list of field names (e.g. "Instances") to include in
  19749. // API requests with the JSON null value. By default, fields with empty
  19750. // values are omitted from API requests. However, any field with an
  19751. // empty value appearing in NullFields will be sent to the server as
  19752. // null. It is an error if a field in this list has a non-empty value.
  19753. // This may be used to include null fields in Patch requests.
  19754. NullFields []string `json:"-"`
  19755. }
  19756. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  19757. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  19758. raw := NoMethod(*s)
  19759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19760. }
  19761. type RegionInstanceGroupManagersListInstancesResponse struct {
  19762. // ManagedInstances: A list of managed instances.
  19763. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  19764. // NextPageToken: [Output Only] This token allows you to get the next
  19765. // page of results for list requests. If the number of results is larger
  19766. // than maxResults, use the nextPageToken as a value for the query
  19767. // parameter pageToken in the next list request. Subsequent list
  19768. // requests will have their own nextPageToken to continue paging through
  19769. // the results.
  19770. NextPageToken string `json:"nextPageToken,omitempty"`
  19771. // ServerResponse contains the HTTP response code and headers from the
  19772. // server.
  19773. googleapi.ServerResponse `json:"-"`
  19774. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  19775. // unconditionally include in API requests. By default, fields with
  19776. // empty values are omitted from API requests. However, any non-pointer,
  19777. // non-interface field appearing in ForceSendFields will be sent to the
  19778. // server regardless of whether the field is empty or not. This may be
  19779. // used to include empty fields in Patch requests.
  19780. ForceSendFields []string `json:"-"`
  19781. // NullFields is a list of field names (e.g. "ManagedInstances") to
  19782. // include in API requests with the JSON null value. By default, fields
  19783. // with empty values are omitted from API requests. However, any field
  19784. // with an empty value appearing in NullFields will be sent to the
  19785. // server as null. It is an error if a field in this list has a
  19786. // non-empty value. This may be used to include null fields in Patch
  19787. // requests.
  19788. NullFields []string `json:"-"`
  19789. }
  19790. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  19791. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  19792. raw := NoMethod(*s)
  19793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19794. }
  19795. type RegionInstanceGroupManagersRecreateRequest struct {
  19796. // Instances: The URLs of one or more instances to recreate. This can be
  19797. // a full URL or a partial URL, such as
  19798. // zones/[ZONE]/instances/[INSTANCE_NAME].
  19799. Instances []string `json:"instances,omitempty"`
  19800. // ForceSendFields is a list of field names (e.g. "Instances") to
  19801. // unconditionally include in API requests. By default, fields with
  19802. // empty values are omitted from API requests. However, any non-pointer,
  19803. // non-interface field appearing in ForceSendFields will be sent to the
  19804. // server regardless of whether the field is empty or not. This may be
  19805. // used to include empty fields in Patch requests.
  19806. ForceSendFields []string `json:"-"`
  19807. // NullFields is a list of field names (e.g. "Instances") to include in
  19808. // API requests with the JSON null value. By default, fields with empty
  19809. // values are omitted from API requests. However, any field with an
  19810. // empty value appearing in NullFields will be sent to the server as
  19811. // null. It is an error if a field in this list has a non-empty value.
  19812. // This may be used to include null fields in Patch requests.
  19813. NullFields []string `json:"-"`
  19814. }
  19815. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  19816. type NoMethod RegionInstanceGroupManagersRecreateRequest
  19817. raw := NoMethod(*s)
  19818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19819. }
  19820. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  19821. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  19822. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  19823. // to unconditionally include in API requests. By default, fields with
  19824. // empty values are omitted from API requests. However, any non-pointer,
  19825. // non-interface field appearing in ForceSendFields will be sent to the
  19826. // server regardless of whether the field is empty or not. This may be
  19827. // used to include empty fields in Patch requests.
  19828. ForceSendFields []string `json:"-"`
  19829. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  19830. // include in API requests with the JSON null value. By default, fields
  19831. // with empty values are omitted from API requests. However, any field
  19832. // with an empty value appearing in NullFields will be sent to the
  19833. // server as null. It is an error if a field in this list has a
  19834. // non-empty value. This may be used to include null fields in Patch
  19835. // requests.
  19836. NullFields []string `json:"-"`
  19837. }
  19838. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  19839. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  19840. raw := NoMethod(*s)
  19841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19842. }
  19843. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  19844. // Fingerprint: Fingerprint of the target pools information, which is a
  19845. // hash of the contents. This field is used for optimistic locking when
  19846. // you update the target pool entries. This field is optional.
  19847. Fingerprint string `json:"fingerprint,omitempty"`
  19848. // TargetPools: The URL of all TargetPool resources to which instances
  19849. // in the instanceGroup field are added. The target pools automatically
  19850. // apply to all of the instances in the managed instance group.
  19851. TargetPools []string `json:"targetPools,omitempty"`
  19852. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  19853. // unconditionally include in API requests. By default, fields with
  19854. // empty values are omitted from API requests. However, any non-pointer,
  19855. // non-interface field appearing in ForceSendFields will be sent to the
  19856. // server regardless of whether the field is empty or not. This may be
  19857. // used to include empty fields in Patch requests.
  19858. ForceSendFields []string `json:"-"`
  19859. // NullFields is a list of field names (e.g. "Fingerprint") to include
  19860. // in API requests with the JSON null value. By default, fields with
  19861. // empty values are omitted from API requests. However, any field with
  19862. // an empty value appearing in NullFields will be sent to the server as
  19863. // null. It is an error if a field in this list has a non-empty value.
  19864. // This may be used to include null fields in Patch requests.
  19865. NullFields []string `json:"-"`
  19866. }
  19867. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  19868. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  19869. raw := NoMethod(*s)
  19870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19871. }
  19872. type RegionInstanceGroupManagersSetTemplateRequest struct {
  19873. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  19874. // new instances will be created.
  19875. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  19876. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  19877. // unconditionally include in API requests. By default, fields with
  19878. // empty values are omitted from API requests. However, any non-pointer,
  19879. // non-interface field appearing in ForceSendFields will be sent to the
  19880. // server regardless of whether the field is empty or not. This may be
  19881. // used to include empty fields in Patch requests.
  19882. ForceSendFields []string `json:"-"`
  19883. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  19884. // include in API requests with the JSON null value. By default, fields
  19885. // with empty values are omitted from API requests. However, any field
  19886. // with an empty value appearing in NullFields will be sent to the
  19887. // server as null. It is an error if a field in this list has a
  19888. // non-empty value. This may be used to include null fields in Patch
  19889. // requests.
  19890. NullFields []string `json:"-"`
  19891. }
  19892. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  19893. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  19894. raw := NoMethod(*s)
  19895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19896. }
  19897. type RegionInstanceGroupsListInstances struct {
  19898. // Id: [Output Only] Unique identifier for the resource; defined by the
  19899. // server.
  19900. Id string `json:"id,omitempty"`
  19901. // Items: A list of InstanceWithNamedPorts resources.
  19902. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  19903. // Kind: The resource type.
  19904. Kind string `json:"kind,omitempty"`
  19905. // NextPageToken: [Output Only] This token allows you to get the next
  19906. // page of results for list requests. If the number of results is larger
  19907. // than maxResults, use the nextPageToken as a value for the query
  19908. // parameter pageToken in the next list request. Subsequent list
  19909. // requests will have their own nextPageToken to continue paging through
  19910. // the results.
  19911. NextPageToken string `json:"nextPageToken,omitempty"`
  19912. // SelfLink: [Output Only] Server-defined URL for this resource.
  19913. SelfLink string `json:"selfLink,omitempty"`
  19914. // Warning: [Output Only] Informational warning message.
  19915. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  19916. // ServerResponse contains the HTTP response code and headers from the
  19917. // server.
  19918. googleapi.ServerResponse `json:"-"`
  19919. // ForceSendFields is a list of field names (e.g. "Id") to
  19920. // unconditionally include in API requests. By default, fields with
  19921. // empty values are omitted from API requests. However, any non-pointer,
  19922. // non-interface field appearing in ForceSendFields will be sent to the
  19923. // server regardless of whether the field is empty or not. This may be
  19924. // used to include empty fields in Patch requests.
  19925. ForceSendFields []string `json:"-"`
  19926. // NullFields is a list of field names (e.g. "Id") to include in API
  19927. // requests with the JSON null value. By default, fields with empty
  19928. // values are omitted from API requests. However, any field with an
  19929. // empty value appearing in NullFields will be sent to the server as
  19930. // null. It is an error if a field in this list has a non-empty value.
  19931. // This may be used to include null fields in Patch requests.
  19932. NullFields []string `json:"-"`
  19933. }
  19934. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  19935. type NoMethod RegionInstanceGroupsListInstances
  19936. raw := NoMethod(*s)
  19937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19938. }
  19939. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  19940. // warning message.
  19941. type RegionInstanceGroupsListInstancesWarning struct {
  19942. // Code: [Output Only] A warning code, if applicable. For example,
  19943. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19944. // the response.
  19945. //
  19946. // Possible values:
  19947. // "CLEANUP_FAILED"
  19948. // "DEPRECATED_RESOURCE_USED"
  19949. // "DEPRECATED_TYPE_USED"
  19950. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19951. // "EXPERIMENTAL_TYPE_USED"
  19952. // "EXTERNAL_API_WARNING"
  19953. // "FIELD_VALUE_OVERRIDEN"
  19954. // "INJECTED_KERNELS_DEPRECATED"
  19955. // "MISSING_TYPE_DEPENDENCY"
  19956. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19957. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19958. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19959. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19960. // "NEXT_HOP_NOT_RUNNING"
  19961. // "NOT_CRITICAL_ERROR"
  19962. // "NO_RESULTS_ON_PAGE"
  19963. // "REQUIRED_TOS_AGREEMENT"
  19964. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19965. // "RESOURCE_NOT_DELETED"
  19966. // "SCHEMA_VALIDATION_IGNORED"
  19967. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19968. // "UNDECLARED_PROPERTIES"
  19969. // "UNREACHABLE"
  19970. Code string `json:"code,omitempty"`
  19971. // Data: [Output Only] Metadata about this warning in key: value format.
  19972. // For example:
  19973. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19974. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  19975. // Message: [Output Only] A human-readable description of the warning
  19976. // code.
  19977. Message string `json:"message,omitempty"`
  19978. // ForceSendFields is a list of field names (e.g. "Code") to
  19979. // unconditionally include in API requests. By default, fields with
  19980. // empty values are omitted from API requests. However, any non-pointer,
  19981. // non-interface field appearing in ForceSendFields will be sent to the
  19982. // server regardless of whether the field is empty or not. This may be
  19983. // used to include empty fields in Patch requests.
  19984. ForceSendFields []string `json:"-"`
  19985. // NullFields is a list of field names (e.g. "Code") to include in API
  19986. // requests with the JSON null value. By default, fields with empty
  19987. // values are omitted from API requests. However, any field with an
  19988. // empty value appearing in NullFields will be sent to the server as
  19989. // null. It is an error if a field in this list has a non-empty value.
  19990. // This may be used to include null fields in Patch requests.
  19991. NullFields []string `json:"-"`
  19992. }
  19993. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  19994. type NoMethod RegionInstanceGroupsListInstancesWarning
  19995. raw := NoMethod(*s)
  19996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19997. }
  19998. type RegionInstanceGroupsListInstancesWarningData struct {
  19999. // Key: [Output Only] A key that provides more detail on the warning
  20000. // being returned. For example, for warnings where there are no results
  20001. // in a list request for a particular zone, this key might be scope and
  20002. // the key value might be the zone name. Other examples might be a key
  20003. // indicating a deprecated resource and a suggested replacement, or a
  20004. // warning about invalid network settings (for example, if an instance
  20005. // attempts to perform IP forwarding but is not enabled for IP
  20006. // forwarding).
  20007. Key string `json:"key,omitempty"`
  20008. // Value: [Output Only] A warning data value corresponding to the key.
  20009. Value string `json:"value,omitempty"`
  20010. // ForceSendFields is a list of field names (e.g. "Key") to
  20011. // unconditionally include in API requests. By default, fields with
  20012. // empty values are omitted from API requests. However, any non-pointer,
  20013. // non-interface field appearing in ForceSendFields will be sent to the
  20014. // server regardless of whether the field is empty or not. This may be
  20015. // used to include empty fields in Patch requests.
  20016. ForceSendFields []string `json:"-"`
  20017. // NullFields is a list of field names (e.g. "Key") to include in API
  20018. // requests with the JSON null value. By default, fields with empty
  20019. // values are omitted from API requests. However, any field with an
  20020. // empty value appearing in NullFields will be sent to the server as
  20021. // null. It is an error if a field in this list has a non-empty value.
  20022. // This may be used to include null fields in Patch requests.
  20023. NullFields []string `json:"-"`
  20024. }
  20025. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  20026. type NoMethod RegionInstanceGroupsListInstancesWarningData
  20027. raw := NoMethod(*s)
  20028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20029. }
  20030. type RegionInstanceGroupsListInstancesRequest struct {
  20031. // InstanceState: Instances in which state should be returned. Valid
  20032. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  20033. //
  20034. // Possible values:
  20035. // "ALL"
  20036. // "RUNNING"
  20037. InstanceState string `json:"instanceState,omitempty"`
  20038. // PortName: Name of port user is interested in. It is optional. If it
  20039. // is set, only information about this ports will be returned. If it is
  20040. // not set, all the named ports will be returned. Always lists all
  20041. // instances.
  20042. PortName string `json:"portName,omitempty"`
  20043. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  20044. // unconditionally include in API requests. By default, fields with
  20045. // empty values are omitted from API requests. However, any non-pointer,
  20046. // non-interface field appearing in ForceSendFields will be sent to the
  20047. // server regardless of whether the field is empty or not. This may be
  20048. // used to include empty fields in Patch requests.
  20049. ForceSendFields []string `json:"-"`
  20050. // NullFields is a list of field names (e.g. "InstanceState") to include
  20051. // in API requests with the JSON null value. By default, fields with
  20052. // empty values are omitted from API requests. However, any field with
  20053. // an empty value appearing in NullFields will be sent to the server as
  20054. // null. It is an error if a field in this list has a non-empty value.
  20055. // This may be used to include null fields in Patch requests.
  20056. NullFields []string `json:"-"`
  20057. }
  20058. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  20059. type NoMethod RegionInstanceGroupsListInstancesRequest
  20060. raw := NoMethod(*s)
  20061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20062. }
  20063. type RegionInstanceGroupsSetNamedPortsRequest struct {
  20064. // Fingerprint: The fingerprint of the named ports information for this
  20065. // instance group. Use this optional property to prevent conflicts when
  20066. // multiple users change the named ports settings concurrently. Obtain
  20067. // the fingerprint with the instanceGroups.get method. Then, include the
  20068. // fingerprint in your request to ensure that you do not overwrite
  20069. // changes that were applied from another concurrent request.
  20070. Fingerprint string `json:"fingerprint,omitempty"`
  20071. // NamedPorts: The list of named ports to set for this instance group.
  20072. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  20073. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  20074. // unconditionally include in API requests. By default, fields with
  20075. // empty values are omitted from API requests. However, any non-pointer,
  20076. // non-interface field appearing in ForceSendFields will be sent to the
  20077. // server regardless of whether the field is empty or not. This may be
  20078. // used to include empty fields in Patch requests.
  20079. ForceSendFields []string `json:"-"`
  20080. // NullFields is a list of field names (e.g. "Fingerprint") to include
  20081. // in API requests with the JSON null value. By default, fields with
  20082. // empty values are omitted from API requests. However, any field with
  20083. // an empty value appearing in NullFields will be sent to the server as
  20084. // null. It is an error if a field in this list has a non-empty value.
  20085. // This may be used to include null fields in Patch requests.
  20086. NullFields []string `json:"-"`
  20087. }
  20088. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  20089. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  20090. raw := NoMethod(*s)
  20091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20092. }
  20093. // RegionList: Contains a list of region resources.
  20094. type RegionList struct {
  20095. // Id: [Output Only] Unique identifier for the resource; defined by the
  20096. // server.
  20097. Id string `json:"id,omitempty"`
  20098. // Items: A list of Region resources.
  20099. Items []*Region `json:"items,omitempty"`
  20100. // Kind: [Output Only] Type of resource. Always compute#regionList for
  20101. // lists of regions.
  20102. Kind string `json:"kind,omitempty"`
  20103. // NextPageToken: [Output Only] This token allows you to get the next
  20104. // page of results for list requests. If the number of results is larger
  20105. // than maxResults, use the nextPageToken as a value for the query
  20106. // parameter pageToken in the next list request. Subsequent list
  20107. // requests will have their own nextPageToken to continue paging through
  20108. // the results.
  20109. NextPageToken string `json:"nextPageToken,omitempty"`
  20110. // SelfLink: [Output Only] Server-defined URL for this resource.
  20111. SelfLink string `json:"selfLink,omitempty"`
  20112. // Warning: [Output Only] Informational warning message.
  20113. Warning *RegionListWarning `json:"warning,omitempty"`
  20114. // ServerResponse contains the HTTP response code and headers from the
  20115. // server.
  20116. googleapi.ServerResponse `json:"-"`
  20117. // ForceSendFields is a list of field names (e.g. "Id") to
  20118. // unconditionally include in API requests. By default, fields with
  20119. // empty values are omitted from API requests. However, any non-pointer,
  20120. // non-interface field appearing in ForceSendFields will be sent to the
  20121. // server regardless of whether the field is empty or not. This may be
  20122. // used to include empty fields in Patch requests.
  20123. ForceSendFields []string `json:"-"`
  20124. // NullFields is a list of field names (e.g. "Id") to include in API
  20125. // requests with the JSON null value. By default, fields with empty
  20126. // values are omitted from API requests. However, any field with an
  20127. // empty value appearing in NullFields will be sent to the server as
  20128. // null. It is an error if a field in this list has a non-empty value.
  20129. // This may be used to include null fields in Patch requests.
  20130. NullFields []string `json:"-"`
  20131. }
  20132. func (s *RegionList) MarshalJSON() ([]byte, error) {
  20133. type NoMethod RegionList
  20134. raw := NoMethod(*s)
  20135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20136. }
  20137. // RegionListWarning: [Output Only] Informational warning message.
  20138. type RegionListWarning struct {
  20139. // Code: [Output Only] A warning code, if applicable. For example,
  20140. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20141. // the response.
  20142. //
  20143. // Possible values:
  20144. // "CLEANUP_FAILED"
  20145. // "DEPRECATED_RESOURCE_USED"
  20146. // "DEPRECATED_TYPE_USED"
  20147. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20148. // "EXPERIMENTAL_TYPE_USED"
  20149. // "EXTERNAL_API_WARNING"
  20150. // "FIELD_VALUE_OVERRIDEN"
  20151. // "INJECTED_KERNELS_DEPRECATED"
  20152. // "MISSING_TYPE_DEPENDENCY"
  20153. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20154. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20155. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20156. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20157. // "NEXT_HOP_NOT_RUNNING"
  20158. // "NOT_CRITICAL_ERROR"
  20159. // "NO_RESULTS_ON_PAGE"
  20160. // "REQUIRED_TOS_AGREEMENT"
  20161. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20162. // "RESOURCE_NOT_DELETED"
  20163. // "SCHEMA_VALIDATION_IGNORED"
  20164. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20165. // "UNDECLARED_PROPERTIES"
  20166. // "UNREACHABLE"
  20167. Code string `json:"code,omitempty"`
  20168. // Data: [Output Only] Metadata about this warning in key: value format.
  20169. // For example:
  20170. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20171. Data []*RegionListWarningData `json:"data,omitempty"`
  20172. // Message: [Output Only] A human-readable description of the warning
  20173. // code.
  20174. Message string `json:"message,omitempty"`
  20175. // ForceSendFields is a list of field names (e.g. "Code") to
  20176. // unconditionally include in API requests. By default, fields with
  20177. // empty values are omitted from API requests. However, any non-pointer,
  20178. // non-interface field appearing in ForceSendFields will be sent to the
  20179. // server regardless of whether the field is empty or not. This may be
  20180. // used to include empty fields in Patch requests.
  20181. ForceSendFields []string `json:"-"`
  20182. // NullFields is a list of field names (e.g. "Code") to include in API
  20183. // requests with the JSON null value. By default, fields with empty
  20184. // values are omitted from API requests. However, any field with an
  20185. // empty value appearing in NullFields will be sent to the server as
  20186. // null. It is an error if a field in this list has a non-empty value.
  20187. // This may be used to include null fields in Patch requests.
  20188. NullFields []string `json:"-"`
  20189. }
  20190. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  20191. type NoMethod RegionListWarning
  20192. raw := NoMethod(*s)
  20193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20194. }
  20195. type RegionListWarningData struct {
  20196. // Key: [Output Only] A key that provides more detail on the warning
  20197. // being returned. For example, for warnings where there are no results
  20198. // in a list request for a particular zone, this key might be scope and
  20199. // the key value might be the zone name. Other examples might be a key
  20200. // indicating a deprecated resource and a suggested replacement, or a
  20201. // warning about invalid network settings (for example, if an instance
  20202. // attempts to perform IP forwarding but is not enabled for IP
  20203. // forwarding).
  20204. Key string `json:"key,omitempty"`
  20205. // Value: [Output Only] A warning data value corresponding to the key.
  20206. Value string `json:"value,omitempty"`
  20207. // ForceSendFields is a list of field names (e.g. "Key") to
  20208. // unconditionally include in API requests. By default, fields with
  20209. // empty values are omitted from API requests. However, any non-pointer,
  20210. // non-interface field appearing in ForceSendFields will be sent to the
  20211. // server regardless of whether the field is empty or not. This may be
  20212. // used to include empty fields in Patch requests.
  20213. ForceSendFields []string `json:"-"`
  20214. // NullFields is a list of field names (e.g. "Key") to include in API
  20215. // requests with the JSON null value. By default, fields with empty
  20216. // values are omitted from API requests. However, any field with an
  20217. // empty value appearing in NullFields will be sent to the server as
  20218. // null. It is an error if a field in this list has a non-empty value.
  20219. // This may be used to include null fields in Patch requests.
  20220. NullFields []string `json:"-"`
  20221. }
  20222. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  20223. type NoMethod RegionListWarningData
  20224. raw := NoMethod(*s)
  20225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20226. }
  20227. type RegionSetLabelsRequest struct {
  20228. // LabelFingerprint: The fingerprint of the previous set of labels for
  20229. // this resource, used to detect conflicts. The fingerprint is initially
  20230. // generated by Compute Engine and changes after every request to modify
  20231. // or update labels. You must always provide an up-to-date fingerprint
  20232. // hash in order to update or change labels. Make a get() request to the
  20233. // resource to get the latest fingerprint.
  20234. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  20235. // Labels: The labels to set for this resource.
  20236. Labels map[string]string `json:"labels,omitempty"`
  20237. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  20238. // unconditionally include in API requests. By default, fields with
  20239. // empty values are omitted from API requests. However, any non-pointer,
  20240. // non-interface field appearing in ForceSendFields will be sent to the
  20241. // server regardless of whether the field is empty or not. This may be
  20242. // used to include empty fields in Patch requests.
  20243. ForceSendFields []string `json:"-"`
  20244. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  20245. // include in API requests with the JSON null value. By default, fields
  20246. // with empty values are omitted from API requests. However, any field
  20247. // with an empty value appearing in NullFields will be sent to the
  20248. // server as null. It is an error if a field in this list has a
  20249. // non-empty value. This may be used to include null fields in Patch
  20250. // requests.
  20251. NullFields []string `json:"-"`
  20252. }
  20253. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  20254. type NoMethod RegionSetLabelsRequest
  20255. raw := NoMethod(*s)
  20256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20257. }
  20258. type RegionSetPolicyRequest struct {
  20259. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  20260. // Deprecated. Use 'policy' to specify bindings.
  20261. Bindings []*Binding `json:"bindings,omitempty"`
  20262. // Etag: Flatten Policy to create a backward compatible wire-format.
  20263. // Deprecated. Use 'policy' to specify the etag.
  20264. Etag string `json:"etag,omitempty"`
  20265. // Policy: REQUIRED: The complete policy to be applied to the
  20266. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  20267. // empty policy is in general a valid policy but certain services (like
  20268. // Projects) might reject them.
  20269. Policy *Policy `json:"policy,omitempty"`
  20270. // ForceSendFields is a list of field names (e.g. "Bindings") to
  20271. // unconditionally include in API requests. By default, fields with
  20272. // empty values are omitted from API requests. However, any non-pointer,
  20273. // non-interface field appearing in ForceSendFields will be sent to the
  20274. // server regardless of whether the field is empty or not. This may be
  20275. // used to include empty fields in Patch requests.
  20276. ForceSendFields []string `json:"-"`
  20277. // NullFields is a list of field names (e.g. "Bindings") to include in
  20278. // API requests with the JSON null value. By default, fields with empty
  20279. // values are omitted from API requests. However, any field with an
  20280. // empty value appearing in NullFields will be sent to the server as
  20281. // null. It is an error if a field in this list has a non-empty value.
  20282. // This may be used to include null fields in Patch requests.
  20283. NullFields []string `json:"-"`
  20284. }
  20285. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  20286. type NoMethod RegionSetPolicyRequest
  20287. raw := NoMethod(*s)
  20288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20289. }
  20290. // ResourceCommitment: Commitment for a particular resource (a
  20291. // Commitment is composed of one or more of these).
  20292. type ResourceCommitment struct {
  20293. // Amount: The amount of the resource purchased (in a type-dependent
  20294. // unit, such as bytes). For vCPUs, this can just be an integer. For
  20295. // memory, this must be provided in MB. Memory must be a multiple of 256
  20296. // MB, with up to 6.5GB of memory per every vCPU.
  20297. Amount int64 `json:"amount,omitempty,string"`
  20298. // Type: Type of resource for which this commitment applies. Possible
  20299. // values are VCPU and MEMORY
  20300. //
  20301. // Possible values:
  20302. // "MEMORY"
  20303. // "UNSPECIFIED"
  20304. // "VCPU"
  20305. Type string `json:"type,omitempty"`
  20306. // ForceSendFields is a list of field names (e.g. "Amount") to
  20307. // unconditionally include in API requests. By default, fields with
  20308. // empty values are omitted from API requests. However, any non-pointer,
  20309. // non-interface field appearing in ForceSendFields will be sent to the
  20310. // server regardless of whether the field is empty or not. This may be
  20311. // used to include empty fields in Patch requests.
  20312. ForceSendFields []string `json:"-"`
  20313. // NullFields is a list of field names (e.g. "Amount") to include in API
  20314. // requests with the JSON null value. By default, fields with empty
  20315. // values are omitted from API requests. However, any field with an
  20316. // empty value appearing in NullFields will be sent to the server as
  20317. // null. It is an error if a field in this list has a non-empty value.
  20318. // This may be used to include null fields in Patch requests.
  20319. NullFields []string `json:"-"`
  20320. }
  20321. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  20322. type NoMethod ResourceCommitment
  20323. raw := NoMethod(*s)
  20324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20325. }
  20326. type ResourceGroupReference struct {
  20327. // Group: A URI referencing one of the instance groups or network
  20328. // endpoint groups listed in the backend service.
  20329. Group string `json:"group,omitempty"`
  20330. // ForceSendFields is a list of field names (e.g. "Group") to
  20331. // unconditionally include in API requests. By default, fields with
  20332. // empty values are omitted from API requests. However, any non-pointer,
  20333. // non-interface field appearing in ForceSendFields will be sent to the
  20334. // server regardless of whether the field is empty or not. This may be
  20335. // used to include empty fields in Patch requests.
  20336. ForceSendFields []string `json:"-"`
  20337. // NullFields is a list of field names (e.g. "Group") to include in API
  20338. // requests with the JSON null value. By default, fields with empty
  20339. // values are omitted from API requests. However, any field with an
  20340. // empty value appearing in NullFields will be sent to the server as
  20341. // null. It is an error if a field in this list has a non-empty value.
  20342. // This may be used to include null fields in Patch requests.
  20343. NullFields []string `json:"-"`
  20344. }
  20345. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  20346. type NoMethod ResourceGroupReference
  20347. raw := NoMethod(*s)
  20348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20349. }
  20350. type ResourcePoliciesScopedList struct {
  20351. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  20352. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  20353. // Warning: Informational warning which replaces the list of
  20354. // resourcePolicies when the list is empty.
  20355. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  20356. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  20357. // unconditionally include in API requests. By default, fields with
  20358. // empty values are omitted from API requests. However, any non-pointer,
  20359. // non-interface field appearing in ForceSendFields will be sent to the
  20360. // server regardless of whether the field is empty or not. This may be
  20361. // used to include empty fields in Patch requests.
  20362. ForceSendFields []string `json:"-"`
  20363. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  20364. // include in API requests with the JSON null value. By default, fields
  20365. // with empty values are omitted from API requests. However, any field
  20366. // with an empty value appearing in NullFields will be sent to the
  20367. // server as null. It is an error if a field in this list has a
  20368. // non-empty value. This may be used to include null fields in Patch
  20369. // requests.
  20370. NullFields []string `json:"-"`
  20371. }
  20372. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  20373. type NoMethod ResourcePoliciesScopedList
  20374. raw := NoMethod(*s)
  20375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20376. }
  20377. // ResourcePoliciesScopedListWarning: Informational warning which
  20378. // replaces the list of resourcePolicies when the list is empty.
  20379. type ResourcePoliciesScopedListWarning struct {
  20380. // Code: [Output Only] A warning code, if applicable. For example,
  20381. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20382. // the response.
  20383. //
  20384. // Possible values:
  20385. // "CLEANUP_FAILED"
  20386. // "DEPRECATED_RESOURCE_USED"
  20387. // "DEPRECATED_TYPE_USED"
  20388. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20389. // "EXPERIMENTAL_TYPE_USED"
  20390. // "EXTERNAL_API_WARNING"
  20391. // "FIELD_VALUE_OVERRIDEN"
  20392. // "INJECTED_KERNELS_DEPRECATED"
  20393. // "MISSING_TYPE_DEPENDENCY"
  20394. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20395. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20396. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20397. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20398. // "NEXT_HOP_NOT_RUNNING"
  20399. // "NOT_CRITICAL_ERROR"
  20400. // "NO_RESULTS_ON_PAGE"
  20401. // "REQUIRED_TOS_AGREEMENT"
  20402. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20403. // "RESOURCE_NOT_DELETED"
  20404. // "SCHEMA_VALIDATION_IGNORED"
  20405. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20406. // "UNDECLARED_PROPERTIES"
  20407. // "UNREACHABLE"
  20408. Code string `json:"code,omitempty"`
  20409. // Data: [Output Only] Metadata about this warning in key: value format.
  20410. // For example:
  20411. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20412. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  20413. // Message: [Output Only] A human-readable description of the warning
  20414. // code.
  20415. Message string `json:"message,omitempty"`
  20416. // ForceSendFields is a list of field names (e.g. "Code") to
  20417. // unconditionally include in API requests. By default, fields with
  20418. // empty values are omitted from API requests. However, any non-pointer,
  20419. // non-interface field appearing in ForceSendFields will be sent to the
  20420. // server regardless of whether the field is empty or not. This may be
  20421. // used to include empty fields in Patch requests.
  20422. ForceSendFields []string `json:"-"`
  20423. // NullFields is a list of field names (e.g. "Code") to include in API
  20424. // requests with the JSON null value. By default, fields with empty
  20425. // values are omitted from API requests. However, any field with an
  20426. // empty value appearing in NullFields will be sent to the server as
  20427. // null. It is an error if a field in this list has a non-empty value.
  20428. // This may be used to include null fields in Patch requests.
  20429. NullFields []string `json:"-"`
  20430. }
  20431. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  20432. type NoMethod ResourcePoliciesScopedListWarning
  20433. raw := NoMethod(*s)
  20434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20435. }
  20436. type ResourcePoliciesScopedListWarningData struct {
  20437. // Key: [Output Only] A key that provides more detail on the warning
  20438. // being returned. For example, for warnings where there are no results
  20439. // in a list request for a particular zone, this key might be scope and
  20440. // the key value might be the zone name. Other examples might be a key
  20441. // indicating a deprecated resource and a suggested replacement, or a
  20442. // warning about invalid network settings (for example, if an instance
  20443. // attempts to perform IP forwarding but is not enabled for IP
  20444. // forwarding).
  20445. Key string `json:"key,omitempty"`
  20446. // Value: [Output Only] A warning data value corresponding to the key.
  20447. Value string `json:"value,omitempty"`
  20448. // ForceSendFields is a list of field names (e.g. "Key") to
  20449. // unconditionally include in API requests. By default, fields with
  20450. // empty values are omitted from API requests. However, any non-pointer,
  20451. // non-interface field appearing in ForceSendFields will be sent to the
  20452. // server regardless of whether the field is empty or not. This may be
  20453. // used to include empty fields in Patch requests.
  20454. ForceSendFields []string `json:"-"`
  20455. // NullFields is a list of field names (e.g. "Key") to include in API
  20456. // requests with the JSON null value. By default, fields with empty
  20457. // values are omitted from API requests. However, any field with an
  20458. // empty value appearing in NullFields will be sent to the server as
  20459. // null. It is an error if a field in this list has a non-empty value.
  20460. // This may be used to include null fields in Patch requests.
  20461. NullFields []string `json:"-"`
  20462. }
  20463. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  20464. type NoMethod ResourcePoliciesScopedListWarningData
  20465. raw := NoMethod(*s)
  20466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20467. }
  20468. type ResourcePolicy struct {
  20469. // BackupSchedulePolicy: Resource policy for persistent disks for
  20470. // creating snapshots.
  20471. BackupSchedulePolicy *ResourcePolicyBackupSchedulePolicy `json:"backupSchedulePolicy,omitempty"`
  20472. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20473. // format.
  20474. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20475. Description string `json:"description,omitempty"`
  20476. // Id: [Output Only] The unique identifier for the resource. This
  20477. // identifier is defined by the server.
  20478. Id uint64 `json:"id,omitempty,string"`
  20479. // Kind: [Output Only] Type of the resource. Always
  20480. // compute#resource_policies for resource policies.
  20481. Kind string `json:"kind,omitempty"`
  20482. // Name: The name of the resource, provided by the client when initially
  20483. // creating the resource. The resource name must be 1-63 characters
  20484. // long, and comply with RFC1035. Specifically, the name must be 1-63
  20485. // characters long and match the regular expression
  20486. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20487. // a lowercase letter, and all following characters must be a dash,
  20488. // lowercase letter, or digit, except the last character, which cannot
  20489. // be a dash.
  20490. Name string `json:"name,omitempty"`
  20491. Region string `json:"region,omitempty"`
  20492. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  20493. // resource.
  20494. SelfLink string `json:"selfLink,omitempty"`
  20495. // ServerResponse contains the HTTP response code and headers from the
  20496. // server.
  20497. googleapi.ServerResponse `json:"-"`
  20498. // ForceSendFields is a list of field names (e.g.
  20499. // "BackupSchedulePolicy") to unconditionally include in API requests.
  20500. // By default, fields with empty values are omitted from API requests.
  20501. // However, any non-pointer, non-interface field appearing in
  20502. // ForceSendFields will be sent to the server regardless of whether the
  20503. // field is empty or not. This may be used to include empty fields in
  20504. // Patch requests.
  20505. ForceSendFields []string `json:"-"`
  20506. // NullFields is a list of field names (e.g. "BackupSchedulePolicy") to
  20507. // include in API requests with the JSON null value. By default, fields
  20508. // with empty values are omitted from API requests. However, any field
  20509. // with an empty value appearing in NullFields will be sent to the
  20510. // server as null. It is an error if a field in this list has a
  20511. // non-empty value. This may be used to include null fields in Patch
  20512. // requests.
  20513. NullFields []string `json:"-"`
  20514. }
  20515. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  20516. type NoMethod ResourcePolicy
  20517. raw := NoMethod(*s)
  20518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20519. }
  20520. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  20521. type ResourcePolicyAggregatedList struct {
  20522. Etag string `json:"etag,omitempty"`
  20523. // Id: [Output Only] Unique identifier for the resource; defined by the
  20524. // server.
  20525. Id string `json:"id,omitempty"`
  20526. // Items: A list of ResourcePolicy resources.
  20527. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  20528. // Kind: Type of resource.
  20529. Kind string `json:"kind,omitempty"`
  20530. // NextPageToken: [Output Only] This token allows you to get the next
  20531. // page of results for list requests. If the number of results is larger
  20532. // than maxResults, use the nextPageToken as a value for the query
  20533. // parameter pageToken in the next list request. Subsequent list
  20534. // requests will have their own nextPageToken to continue paging through
  20535. // the results.
  20536. NextPageToken string `json:"nextPageToken,omitempty"`
  20537. // SelfLink: [Output Only] Server-defined URL for this resource.
  20538. SelfLink string `json:"selfLink,omitempty"`
  20539. // Warning: [Output Only] Informational warning message.
  20540. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  20541. // ServerResponse contains the HTTP response code and headers from the
  20542. // server.
  20543. googleapi.ServerResponse `json:"-"`
  20544. // ForceSendFields is a list of field names (e.g. "Etag") to
  20545. // unconditionally include in API requests. By default, fields with
  20546. // empty values are omitted from API requests. However, any non-pointer,
  20547. // non-interface field appearing in ForceSendFields will be sent to the
  20548. // server regardless of whether the field is empty or not. This may be
  20549. // used to include empty fields in Patch requests.
  20550. ForceSendFields []string `json:"-"`
  20551. // NullFields is a list of field names (e.g. "Etag") to include in API
  20552. // requests with the JSON null value. By default, fields with empty
  20553. // values are omitted from API requests. However, any field with an
  20554. // empty value appearing in NullFields will be sent to the server as
  20555. // null. It is an error if a field in this list has a non-empty value.
  20556. // This may be used to include null fields in Patch requests.
  20557. NullFields []string `json:"-"`
  20558. }
  20559. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  20560. type NoMethod ResourcePolicyAggregatedList
  20561. raw := NoMethod(*s)
  20562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20563. }
  20564. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  20565. // warning message.
  20566. type ResourcePolicyAggregatedListWarning struct {
  20567. // Code: [Output Only] A warning code, if applicable. For example,
  20568. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20569. // the response.
  20570. //
  20571. // Possible values:
  20572. // "CLEANUP_FAILED"
  20573. // "DEPRECATED_RESOURCE_USED"
  20574. // "DEPRECATED_TYPE_USED"
  20575. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20576. // "EXPERIMENTAL_TYPE_USED"
  20577. // "EXTERNAL_API_WARNING"
  20578. // "FIELD_VALUE_OVERRIDEN"
  20579. // "INJECTED_KERNELS_DEPRECATED"
  20580. // "MISSING_TYPE_DEPENDENCY"
  20581. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20582. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20583. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20584. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20585. // "NEXT_HOP_NOT_RUNNING"
  20586. // "NOT_CRITICAL_ERROR"
  20587. // "NO_RESULTS_ON_PAGE"
  20588. // "REQUIRED_TOS_AGREEMENT"
  20589. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20590. // "RESOURCE_NOT_DELETED"
  20591. // "SCHEMA_VALIDATION_IGNORED"
  20592. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20593. // "UNDECLARED_PROPERTIES"
  20594. // "UNREACHABLE"
  20595. Code string `json:"code,omitempty"`
  20596. // Data: [Output Only] Metadata about this warning in key: value format.
  20597. // For example:
  20598. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20599. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  20600. // Message: [Output Only] A human-readable description of the warning
  20601. // code.
  20602. Message string `json:"message,omitempty"`
  20603. // ForceSendFields is a list of field names (e.g. "Code") to
  20604. // unconditionally include in API requests. By default, fields with
  20605. // empty values are omitted from API requests. However, any non-pointer,
  20606. // non-interface field appearing in ForceSendFields will be sent to the
  20607. // server regardless of whether the field is empty or not. This may be
  20608. // used to include empty fields in Patch requests.
  20609. ForceSendFields []string `json:"-"`
  20610. // NullFields is a list of field names (e.g. "Code") to include in API
  20611. // requests with the JSON null value. By default, fields with empty
  20612. // values are omitted from API requests. However, any field with an
  20613. // empty value appearing in NullFields will be sent to the server as
  20614. // null. It is an error if a field in this list has a non-empty value.
  20615. // This may be used to include null fields in Patch requests.
  20616. NullFields []string `json:"-"`
  20617. }
  20618. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20619. type NoMethod ResourcePolicyAggregatedListWarning
  20620. raw := NoMethod(*s)
  20621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20622. }
  20623. type ResourcePolicyAggregatedListWarningData struct {
  20624. // Key: [Output Only] A key that provides more detail on the warning
  20625. // being returned. For example, for warnings where there are no results
  20626. // in a list request for a particular zone, this key might be scope and
  20627. // the key value might be the zone name. Other examples might be a key
  20628. // indicating a deprecated resource and a suggested replacement, or a
  20629. // warning about invalid network settings (for example, if an instance
  20630. // attempts to perform IP forwarding but is not enabled for IP
  20631. // forwarding).
  20632. Key string `json:"key,omitempty"`
  20633. // Value: [Output Only] A warning data value corresponding to the key.
  20634. Value string `json:"value,omitempty"`
  20635. // ForceSendFields is a list of field names (e.g. "Key") to
  20636. // unconditionally include in API requests. By default, fields with
  20637. // empty values are omitted from API requests. However, any non-pointer,
  20638. // non-interface field appearing in ForceSendFields will be sent to the
  20639. // server regardless of whether the field is empty or not. This may be
  20640. // used to include empty fields in Patch requests.
  20641. ForceSendFields []string `json:"-"`
  20642. // NullFields is a list of field names (e.g. "Key") to include in API
  20643. // requests with the JSON null value. By default, fields with empty
  20644. // values are omitted from API requests. However, any field with an
  20645. // empty value appearing in NullFields will be sent to the server as
  20646. // null. It is an error if a field in this list has a non-empty value.
  20647. // This may be used to include null fields in Patch requests.
  20648. NullFields []string `json:"-"`
  20649. }
  20650. func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20651. type NoMethod ResourcePolicyAggregatedListWarningData
  20652. raw := NoMethod(*s)
  20653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20654. }
  20655. // ResourcePolicyBackupSchedulePolicy: A backup schedule policy
  20656. // specifies when and how frequently snapshots are to be created for the
  20657. // target disk. Also specifies how many and how long these scheduled
  20658. // snapshots should be retained.
  20659. type ResourcePolicyBackupSchedulePolicy struct {
  20660. // RetentionPolicy: Retention policy applied to snapshots created by
  20661. // this resource policy.
  20662. RetentionPolicy *ResourcePolicyBackupSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  20663. // Schedule: A Vm Maintenance Policy specifies what kind of
  20664. // infrastructure maintenance we are allowed to perform on this VM and
  20665. // when. Schedule that is applied to disks covered by this policy.
  20666. Schedule *ResourcePolicyBackupSchedulePolicySchedule `json:"schedule,omitempty"`
  20667. // SnapshotProperties: Properties with which snapshots are created such
  20668. // as labels, encryption keys.
  20669. SnapshotProperties *ResourcePolicyBackupSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  20670. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  20671. // unconditionally include in API requests. By default, fields with
  20672. // empty values are omitted from API requests. However, any non-pointer,
  20673. // non-interface field appearing in ForceSendFields will be sent to the
  20674. // server regardless of whether the field is empty or not. This may be
  20675. // used to include empty fields in Patch requests.
  20676. ForceSendFields []string `json:"-"`
  20677. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  20678. // include in API requests with the JSON null value. By default, fields
  20679. // with empty values are omitted from API requests. However, any field
  20680. // with an empty value appearing in NullFields will be sent to the
  20681. // server as null. It is an error if a field in this list has a
  20682. // non-empty value. This may be used to include null fields in Patch
  20683. // requests.
  20684. NullFields []string `json:"-"`
  20685. }
  20686. func (s *ResourcePolicyBackupSchedulePolicy) MarshalJSON() ([]byte, error) {
  20687. type NoMethod ResourcePolicyBackupSchedulePolicy
  20688. raw := NoMethod(*s)
  20689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20690. }
  20691. // ResourcePolicyBackupSchedulePolicyRetentionPolicy: Policy for
  20692. // retention of scheduled snapshots.
  20693. type ResourcePolicyBackupSchedulePolicyRetentionPolicy struct {
  20694. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  20695. // kept.
  20696. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  20697. // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
  20698. // snapshots when the source disk is deleted.
  20699. //
  20700. // Possible values:
  20701. // "APPLY_RETENTION_POLICY"
  20702. // "KEEP_AUTO_SNAPSHOTS"
  20703. // "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
  20704. OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
  20705. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  20706. // unconditionally include in API requests. By default, fields with
  20707. // empty values are omitted from API requests. However, any non-pointer,
  20708. // non-interface field appearing in ForceSendFields will be sent to the
  20709. // server regardless of whether the field is empty or not. This may be
  20710. // used to include empty fields in Patch requests.
  20711. ForceSendFields []string `json:"-"`
  20712. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  20713. // include in API requests with the JSON null value. By default, fields
  20714. // with empty values are omitted from API requests. However, any field
  20715. // with an empty value appearing in NullFields will be sent to the
  20716. // server as null. It is an error if a field in this list has a
  20717. // non-empty value. This may be used to include null fields in Patch
  20718. // requests.
  20719. NullFields []string `json:"-"`
  20720. }
  20721. func (s *ResourcePolicyBackupSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  20722. type NoMethod ResourcePolicyBackupSchedulePolicyRetentionPolicy
  20723. raw := NoMethod(*s)
  20724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20725. }
  20726. // ResourcePolicyBackupSchedulePolicySchedule: A schedule for disks
  20727. // where the schedueled operations are performed.
  20728. type ResourcePolicyBackupSchedulePolicySchedule struct {
  20729. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  20730. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  20731. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  20732. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  20733. // unconditionally include in API requests. By default, fields with
  20734. // empty values are omitted from API requests. However, any non-pointer,
  20735. // non-interface field appearing in ForceSendFields will be sent to the
  20736. // server regardless of whether the field is empty or not. This may be
  20737. // used to include empty fields in Patch requests.
  20738. ForceSendFields []string `json:"-"`
  20739. // NullFields is a list of field names (e.g. "DailySchedule") to include
  20740. // in API requests with the JSON null value. By default, fields with
  20741. // empty values are omitted from API requests. However, any field with
  20742. // an empty value appearing in NullFields will be sent to the server as
  20743. // null. It is an error if a field in this list has a non-empty value.
  20744. // This may be used to include null fields in Patch requests.
  20745. NullFields []string `json:"-"`
  20746. }
  20747. func (s *ResourcePolicyBackupSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  20748. type NoMethod ResourcePolicyBackupSchedulePolicySchedule
  20749. raw := NoMethod(*s)
  20750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20751. }
  20752. // ResourcePolicyBackupSchedulePolicySnapshotProperties: Specified
  20753. // snapshot properties for scheduled snapshots created by this policy.
  20754. type ResourcePolicyBackupSchedulePolicySnapshotProperties struct {
  20755. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  20756. GuestFlush bool `json:"guestFlush,omitempty"`
  20757. // Labels: Labels to apply to scheduled snapshots. These can be later
  20758. // modified by the setLabels method. Label values may be empty.
  20759. Labels map[string]string `json:"labels,omitempty"`
  20760. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  20761. // unconditionally include in API requests. By default, fields with
  20762. // empty values are omitted from API requests. However, any non-pointer,
  20763. // non-interface field appearing in ForceSendFields will be sent to the
  20764. // server regardless of whether the field is empty or not. This may be
  20765. // used to include empty fields in Patch requests.
  20766. ForceSendFields []string `json:"-"`
  20767. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  20768. // API requests with the JSON null value. By default, fields with empty
  20769. // values are omitted from API requests. However, any field with an
  20770. // empty value appearing in NullFields will be sent to the server as
  20771. // null. It is an error if a field in this list has a non-empty value.
  20772. // This may be used to include null fields in Patch requests.
  20773. NullFields []string `json:"-"`
  20774. }
  20775. func (s *ResourcePolicyBackupSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  20776. type NoMethod ResourcePolicyBackupSchedulePolicySnapshotProperties
  20777. raw := NoMethod(*s)
  20778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20779. }
  20780. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  20781. type ResourcePolicyDailyCycle struct {
  20782. // DaysInCycle: Allows to define schedule that runs every nth day of the
  20783. // month.
  20784. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  20785. // Duration: [Output only] Duration of the time window, automatically
  20786. // chosen to be smallest possible in the given scenario.
  20787. Duration string `json:"duration,omitempty"`
  20788. // StartTime: Time within the window to start the operations. It must be
  20789. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  20790. StartTime string `json:"startTime,omitempty"`
  20791. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  20792. // unconditionally include in API requests. By default, fields with
  20793. // empty values are omitted from API requests. However, any non-pointer,
  20794. // non-interface field appearing in ForceSendFields will be sent to the
  20795. // server regardless of whether the field is empty or not. This may be
  20796. // used to include empty fields in Patch requests.
  20797. ForceSendFields []string `json:"-"`
  20798. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  20799. // in API requests with the JSON null value. By default, fields with
  20800. // empty values are omitted from API requests. However, any field with
  20801. // an empty value appearing in NullFields will be sent to the server as
  20802. // null. It is an error if a field in this list has a non-empty value.
  20803. // This may be used to include null fields in Patch requests.
  20804. NullFields []string `json:"-"`
  20805. }
  20806. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  20807. type NoMethod ResourcePolicyDailyCycle
  20808. raw := NoMethod(*s)
  20809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20810. }
  20811. // ResourcePolicyHourlyCycle: Time window specified for hourly
  20812. // operations.
  20813. type ResourcePolicyHourlyCycle struct {
  20814. // Duration: [Output only] Duration of the time window, automatically
  20815. // chosen to be smallest possible in the given scenario.
  20816. Duration string `json:"duration,omitempty"`
  20817. // HoursInCycle: Allows to define schedule that runs every nth hour.
  20818. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  20819. // StartTime: Time within the window to start the operations. It must be
  20820. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  20821. StartTime string `json:"startTime,omitempty"`
  20822. // ForceSendFields is a list of field names (e.g. "Duration") to
  20823. // unconditionally include in API requests. By default, fields with
  20824. // empty values are omitted from API requests. However, any non-pointer,
  20825. // non-interface field appearing in ForceSendFields will be sent to the
  20826. // server regardless of whether the field is empty or not. This may be
  20827. // used to include empty fields in Patch requests.
  20828. ForceSendFields []string `json:"-"`
  20829. // NullFields is a list of field names (e.g. "Duration") to include in
  20830. // API requests with the JSON null value. By default, fields with empty
  20831. // values are omitted from API requests. However, any field with an
  20832. // empty value appearing in NullFields will be sent to the server as
  20833. // null. It is an error if a field in this list has a non-empty value.
  20834. // This may be used to include null fields in Patch requests.
  20835. NullFields []string `json:"-"`
  20836. }
  20837. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  20838. type NoMethod ResourcePolicyHourlyCycle
  20839. raw := NoMethod(*s)
  20840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20841. }
  20842. type ResourcePolicyList struct {
  20843. Etag string `json:"etag,omitempty"`
  20844. // Id: [Output Only] The unique identifier for the resource. This
  20845. // identifier is defined by the server.
  20846. Id string `json:"id,omitempty"`
  20847. // Items: [Output Only] A list of ResourcePolicy resources.
  20848. Items []*ResourcePolicy `json:"items,omitempty"`
  20849. // Kind: [Output Only] Type of resource.Always
  20850. // compute#resourcePoliciesList for listsof resourcePolicies
  20851. Kind string `json:"kind,omitempty"`
  20852. // NextPageToken: [Output Only] This token allows you to get the next
  20853. // page of results for list requests. If the number of results is larger
  20854. // than maxResults, use the nextPageToken as a value for the query
  20855. // parameter pageToken in the next list request. Subsequent list
  20856. // requests will have their own nextPageToken to continue paging through
  20857. // the results.
  20858. NextPageToken string `json:"nextPageToken,omitempty"`
  20859. // SelfLink: [Output Only] Server-defined URL for this resource.
  20860. SelfLink string `json:"selfLink,omitempty"`
  20861. // Warning: [Output Only] Informational warning message.
  20862. Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
  20863. // ServerResponse contains the HTTP response code and headers from the
  20864. // server.
  20865. googleapi.ServerResponse `json:"-"`
  20866. // ForceSendFields is a list of field names (e.g. "Etag") to
  20867. // unconditionally include in API requests. By default, fields with
  20868. // empty values are omitted from API requests. However, any non-pointer,
  20869. // non-interface field appearing in ForceSendFields will be sent to the
  20870. // server regardless of whether the field is empty or not. This may be
  20871. // used to include empty fields in Patch requests.
  20872. ForceSendFields []string `json:"-"`
  20873. // NullFields is a list of field names (e.g. "Etag") to include in API
  20874. // requests with the JSON null value. By default, fields with empty
  20875. // values are omitted from API requests. However, any field with an
  20876. // empty value appearing in NullFields will be sent to the server as
  20877. // null. It is an error if a field in this list has a non-empty value.
  20878. // This may be used to include null fields in Patch requests.
  20879. NullFields []string `json:"-"`
  20880. }
  20881. func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
  20882. type NoMethod ResourcePolicyList
  20883. raw := NoMethod(*s)
  20884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20885. }
  20886. // ResourcePolicyListWarning: [Output Only] Informational warning
  20887. // message.
  20888. type ResourcePolicyListWarning struct {
  20889. // Code: [Output Only] A warning code, if applicable. For example,
  20890. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20891. // the response.
  20892. //
  20893. // Possible values:
  20894. // "CLEANUP_FAILED"
  20895. // "DEPRECATED_RESOURCE_USED"
  20896. // "DEPRECATED_TYPE_USED"
  20897. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20898. // "EXPERIMENTAL_TYPE_USED"
  20899. // "EXTERNAL_API_WARNING"
  20900. // "FIELD_VALUE_OVERRIDEN"
  20901. // "INJECTED_KERNELS_DEPRECATED"
  20902. // "MISSING_TYPE_DEPENDENCY"
  20903. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20904. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20905. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20906. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20907. // "NEXT_HOP_NOT_RUNNING"
  20908. // "NOT_CRITICAL_ERROR"
  20909. // "NO_RESULTS_ON_PAGE"
  20910. // "REQUIRED_TOS_AGREEMENT"
  20911. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20912. // "RESOURCE_NOT_DELETED"
  20913. // "SCHEMA_VALIDATION_IGNORED"
  20914. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20915. // "UNDECLARED_PROPERTIES"
  20916. // "UNREACHABLE"
  20917. Code string `json:"code,omitempty"`
  20918. // Data: [Output Only] Metadata about this warning in key: value format.
  20919. // For example:
  20920. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20921. Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
  20922. // Message: [Output Only] A human-readable description of the warning
  20923. // code.
  20924. Message string `json:"message,omitempty"`
  20925. // ForceSendFields is a list of field names (e.g. "Code") to
  20926. // unconditionally include in API requests. By default, fields with
  20927. // empty values are omitted from API requests. However, any non-pointer,
  20928. // non-interface field appearing in ForceSendFields will be sent to the
  20929. // server regardless of whether the field is empty or not. This may be
  20930. // used to include empty fields in Patch requests.
  20931. ForceSendFields []string `json:"-"`
  20932. // NullFields is a list of field names (e.g. "Code") to include in API
  20933. // requests with the JSON null value. By default, fields with empty
  20934. // values are omitted from API requests. However, any field with an
  20935. // empty value appearing in NullFields will be sent to the server as
  20936. // null. It is an error if a field in this list has a non-empty value.
  20937. // This may be used to include null fields in Patch requests.
  20938. NullFields []string `json:"-"`
  20939. }
  20940. func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
  20941. type NoMethod ResourcePolicyListWarning
  20942. raw := NoMethod(*s)
  20943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20944. }
  20945. type ResourcePolicyListWarningData struct {
  20946. // Key: [Output Only] A key that provides more detail on the warning
  20947. // being returned. For example, for warnings where there are no results
  20948. // in a list request for a particular zone, this key might be scope and
  20949. // the key value might be the zone name. Other examples might be a key
  20950. // indicating a deprecated resource and a suggested replacement, or a
  20951. // warning about invalid network settings (for example, if an instance
  20952. // attempts to perform IP forwarding but is not enabled for IP
  20953. // forwarding).
  20954. Key string `json:"key,omitempty"`
  20955. // Value: [Output Only] A warning data value corresponding to the key.
  20956. Value string `json:"value,omitempty"`
  20957. // ForceSendFields is a list of field names (e.g. "Key") to
  20958. // unconditionally include in API requests. By default, fields with
  20959. // empty values are omitted from API requests. However, any non-pointer,
  20960. // non-interface field appearing in ForceSendFields will be sent to the
  20961. // server regardless of whether the field is empty or not. This may be
  20962. // used to include empty fields in Patch requests.
  20963. ForceSendFields []string `json:"-"`
  20964. // NullFields is a list of field names (e.g. "Key") to include in API
  20965. // requests with the JSON null value. By default, fields with empty
  20966. // values are omitted from API requests. However, any field with an
  20967. // empty value appearing in NullFields will be sent to the server as
  20968. // null. It is an error if a field in this list has a non-empty value.
  20969. // This may be used to include null fields in Patch requests.
  20970. NullFields []string `json:"-"`
  20971. }
  20972. func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
  20973. type NoMethod ResourcePolicyListWarningData
  20974. raw := NoMethod(*s)
  20975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20976. }
  20977. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  20978. // operations.
  20979. type ResourcePolicyWeeklyCycle struct {
  20980. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  20981. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  20982. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
  20983. // unconditionally include in API requests. By default, fields with
  20984. // empty values are omitted from API requests. However, any non-pointer,
  20985. // non-interface field appearing in ForceSendFields will be sent to the
  20986. // server regardless of whether the field is empty or not. This may be
  20987. // used to include empty fields in Patch requests.
  20988. ForceSendFields []string `json:"-"`
  20989. // NullFields is a list of field names (e.g. "DayOfWeeks") to include in
  20990. // API requests with the JSON null value. By default, fields with empty
  20991. // values are omitted from API requests. However, any field with an
  20992. // empty value appearing in NullFields will be sent to the server as
  20993. // null. It is an error if a field in this list has a non-empty value.
  20994. // This may be used to include null fields in Patch requests.
  20995. NullFields []string `json:"-"`
  20996. }
  20997. func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  20998. type NoMethod ResourcePolicyWeeklyCycle
  20999. raw := NoMethod(*s)
  21000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21001. }
  21002. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  21003. // Day: Allows to define schedule that runs specified day of the week.
  21004. //
  21005. // Possible values:
  21006. // "FRIDAY"
  21007. // "INVALID"
  21008. // "MONDAY"
  21009. // "SATURDAY"
  21010. // "SUNDAY"
  21011. // "THURSDAY"
  21012. // "TUESDAY"
  21013. // "WEDNESDAY"
  21014. Day string `json:"day,omitempty"`
  21015. // Duration: [Output only] Duration of the time window, automatically
  21016. // chosen to be smallest possible in the given scenario.
  21017. Duration string `json:"duration,omitempty"`
  21018. // StartTime: Time within the window to start the operations. It must be
  21019. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  21020. StartTime string `json:"startTime,omitempty"`
  21021. // ForceSendFields is a list of field names (e.g. "Day") to
  21022. // unconditionally include in API requests. By default, fields with
  21023. // empty values are omitted from API requests. However, any non-pointer,
  21024. // non-interface field appearing in ForceSendFields will be sent to the
  21025. // server regardless of whether the field is empty or not. This may be
  21026. // used to include empty fields in Patch requests.
  21027. ForceSendFields []string `json:"-"`
  21028. // NullFields is a list of field names (e.g. "Day") to include in API
  21029. // requests with the JSON null value. By default, fields with empty
  21030. // values are omitted from API requests. However, any field with an
  21031. // empty value appearing in NullFields will be sent to the server as
  21032. // null. It is an error if a field in this list has a non-empty value.
  21033. // This may be used to include null fields in Patch requests.
  21034. NullFields []string `json:"-"`
  21035. }
  21036. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  21037. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  21038. raw := NoMethod(*s)
  21039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21040. }
  21041. // Route: Represents a Route resource. A route specifies how certain
  21042. // packets should be handled by the network. Routes are associated with
  21043. // instances by tags and the set of routes for a particular instance is
  21044. // called its routing table.
  21045. //
  21046. // For each packet leaving an instance, the system searches that
  21047. // instance's routing table for a single best matching route. Routes
  21048. // match packets by destination IP address, preferring smaller or more
  21049. // specific ranges over larger ones. If there is a tie, the system
  21050. // selects the route with the smallest priority value. If there is still
  21051. // a tie, it uses the layer three and four packet headers to select just
  21052. // one of the remaining matching routes. The packet is then forwarded as
  21053. // specified by the nextHop field of the winning route - either to
  21054. // another instance destination, an instance gateway, or a Google
  21055. // Compute Engine-operated gateway.
  21056. //
  21057. // Packets that do not match any route in the sending instance's routing
  21058. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  21059. // v1.routes ==)
  21060. type Route struct {
  21061. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21062. // format.
  21063. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21064. // Description: An optional description of this resource. Provide this
  21065. // property when you create the resource.
  21066. Description string `json:"description,omitempty"`
  21067. // DestRange: The destination range of outgoing packets that this route
  21068. // applies to. Only IPv4 is supported.
  21069. DestRange string `json:"destRange,omitempty"`
  21070. // Id: [Output Only] The unique identifier for the resource. This
  21071. // identifier is defined by the server.
  21072. Id uint64 `json:"id,omitempty,string"`
  21073. // Kind: [Output Only] Type of this resource. Always compute#routes for
  21074. // Route resources.
  21075. Kind string `json:"kind,omitempty"`
  21076. // Name: Name of the resource. Provided by the client when the resource
  21077. // is created. The name must be 1-63 characters long, and comply with
  21078. // RFC1035. Specifically, the name must be 1-63 characters long and
  21079. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21080. // the first character must be a lowercase letter, and all following
  21081. // characters must be a dash, lowercase letter, or digit, except the
  21082. // last character, which cannot be a dash.
  21083. Name string `json:"name,omitempty"`
  21084. // Network: Fully-qualified URL of the network that this route applies
  21085. // to.
  21086. Network string `json:"network,omitempty"`
  21087. // NextHopGateway: The URL to a gateway that should handle matching
  21088. // packets. You can only specify the internet gateway using a full or
  21089. // partial valid URL:
  21090. // projects/<project-id>/global/gateways/default-internet-gateway
  21091. NextHopGateway string `json:"nextHopGateway,omitempty"`
  21092. // NextHopIlb: The URL to a forwarding rule of type
  21093. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  21094. // can only specify the forwarding rule as a partial or full URL. For
  21095. // example, the following are all valid URLs:
  21096. // -
  21097. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  21098. // - regions/region/forwardingRules/forwardingRule Note that this can
  21099. // only be used when the destination_range is a public (non-RFC 1918) IP
  21100. // CIDR range.
  21101. NextHopIlb string `json:"nextHopIlb,omitempty"`
  21102. // NextHopInstance: The URL to an instance that should handle matching
  21103. // packets. You can specify this as a full or partial URL. For
  21104. // example:
  21105. // https://www.googleapis.com/compute/v1/projects/project/zones/
  21106. // zone/instances/
  21107. NextHopInstance string `json:"nextHopInstance,omitempty"`
  21108. // NextHopIp: The network IP address of an instance that should handle
  21109. // matching packets. Only IPv4 is supported.
  21110. NextHopIp string `json:"nextHopIp,omitempty"`
  21111. // NextHopNetwork: The URL of the local network if it should handle
  21112. // matching packets.
  21113. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  21114. // NextHopPeering: [Output Only] The network peering name that should
  21115. // handle matching packets, which should conform to RFC1035.
  21116. NextHopPeering string `json:"nextHopPeering,omitempty"`
  21117. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  21118. // packets.
  21119. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  21120. // Priority: The priority of this route. Priority is used to break ties
  21121. // in cases where there is more than one matching route of equal prefix
  21122. // length. In the case of two routes with equal prefix length, the one
  21123. // with the lowest-numbered priority value wins. Default value is 1000.
  21124. // Valid range is 0 through 65535.
  21125. Priority int64 `json:"priority,omitempty"`
  21126. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  21127. // resource.
  21128. SelfLink string `json:"selfLink,omitempty"`
  21129. // Tags: A list of instance tags to which this route applies.
  21130. Tags []string `json:"tags,omitempty"`
  21131. // Warnings: [Output Only] If potential misconfigurations are detected
  21132. // for this route, this field will be populated with warning messages.
  21133. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  21134. // ServerResponse contains the HTTP response code and headers from the
  21135. // server.
  21136. googleapi.ServerResponse `json:"-"`
  21137. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21138. // to unconditionally include in API requests. By default, fields with
  21139. // empty values are omitted from API requests. However, any non-pointer,
  21140. // non-interface field appearing in ForceSendFields will be sent to the
  21141. // server regardless of whether the field is empty or not. This may be
  21142. // used to include empty fields in Patch requests.
  21143. ForceSendFields []string `json:"-"`
  21144. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21145. // include in API requests with the JSON null value. By default, fields
  21146. // with empty values are omitted from API requests. However, any field
  21147. // with an empty value appearing in NullFields will be sent to the
  21148. // server as null. It is an error if a field in this list has a
  21149. // non-empty value. This may be used to include null fields in Patch
  21150. // requests.
  21151. NullFields []string `json:"-"`
  21152. }
  21153. func (s *Route) MarshalJSON() ([]byte, error) {
  21154. type NoMethod Route
  21155. raw := NoMethod(*s)
  21156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21157. }
  21158. type RouteWarnings struct {
  21159. // Code: [Output Only] A warning code, if applicable. For example,
  21160. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21161. // the response.
  21162. //
  21163. // Possible values:
  21164. // "CLEANUP_FAILED"
  21165. // "DEPRECATED_RESOURCE_USED"
  21166. // "DEPRECATED_TYPE_USED"
  21167. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21168. // "EXPERIMENTAL_TYPE_USED"
  21169. // "EXTERNAL_API_WARNING"
  21170. // "FIELD_VALUE_OVERRIDEN"
  21171. // "INJECTED_KERNELS_DEPRECATED"
  21172. // "MISSING_TYPE_DEPENDENCY"
  21173. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21174. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21175. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21176. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21177. // "NEXT_HOP_NOT_RUNNING"
  21178. // "NOT_CRITICAL_ERROR"
  21179. // "NO_RESULTS_ON_PAGE"
  21180. // "REQUIRED_TOS_AGREEMENT"
  21181. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21182. // "RESOURCE_NOT_DELETED"
  21183. // "SCHEMA_VALIDATION_IGNORED"
  21184. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21185. // "UNDECLARED_PROPERTIES"
  21186. // "UNREACHABLE"
  21187. Code string `json:"code,omitempty"`
  21188. // Data: [Output Only] Metadata about this warning in key: value format.
  21189. // For example:
  21190. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21191. Data []*RouteWarningsData `json:"data,omitempty"`
  21192. // Message: [Output Only] A human-readable description of the warning
  21193. // code.
  21194. Message string `json:"message,omitempty"`
  21195. // ForceSendFields is a list of field names (e.g. "Code") to
  21196. // unconditionally include in API requests. By default, fields with
  21197. // empty values are omitted from API requests. However, any non-pointer,
  21198. // non-interface field appearing in ForceSendFields will be sent to the
  21199. // server regardless of whether the field is empty or not. This may be
  21200. // used to include empty fields in Patch requests.
  21201. ForceSendFields []string `json:"-"`
  21202. // NullFields is a list of field names (e.g. "Code") to include in API
  21203. // requests with the JSON null value. By default, fields with empty
  21204. // values are omitted from API requests. However, any field with an
  21205. // empty value appearing in NullFields will be sent to the server as
  21206. // null. It is an error if a field in this list has a non-empty value.
  21207. // This may be used to include null fields in Patch requests.
  21208. NullFields []string `json:"-"`
  21209. }
  21210. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  21211. type NoMethod RouteWarnings
  21212. raw := NoMethod(*s)
  21213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21214. }
  21215. type RouteWarningsData struct {
  21216. // Key: [Output Only] A key that provides more detail on the warning
  21217. // being returned. For example, for warnings where there are no results
  21218. // in a list request for a particular zone, this key might be scope and
  21219. // the key value might be the zone name. Other examples might be a key
  21220. // indicating a deprecated resource and a suggested replacement, or a
  21221. // warning about invalid network settings (for example, if an instance
  21222. // attempts to perform IP forwarding but is not enabled for IP
  21223. // forwarding).
  21224. Key string `json:"key,omitempty"`
  21225. // Value: [Output Only] A warning data value corresponding to the key.
  21226. Value string `json:"value,omitempty"`
  21227. // ForceSendFields is a list of field names (e.g. "Key") to
  21228. // unconditionally include in API requests. By default, fields with
  21229. // empty values are omitted from API requests. However, any non-pointer,
  21230. // non-interface field appearing in ForceSendFields will be sent to the
  21231. // server regardless of whether the field is empty or not. This may be
  21232. // used to include empty fields in Patch requests.
  21233. ForceSendFields []string `json:"-"`
  21234. // NullFields is a list of field names (e.g. "Key") to include in API
  21235. // requests with the JSON null value. By default, fields with empty
  21236. // values are omitted from API requests. However, any field with an
  21237. // empty value appearing in NullFields will be sent to the server as
  21238. // null. It is an error if a field in this list has a non-empty value.
  21239. // This may be used to include null fields in Patch requests.
  21240. NullFields []string `json:"-"`
  21241. }
  21242. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  21243. type NoMethod RouteWarningsData
  21244. raw := NoMethod(*s)
  21245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21246. }
  21247. // RouteList: Contains a list of Route resources.
  21248. type RouteList struct {
  21249. // Id: [Output Only] Unique identifier for the resource; defined by the
  21250. // server.
  21251. Id string `json:"id,omitempty"`
  21252. // Items: A list of Route resources.
  21253. Items []*Route `json:"items,omitempty"`
  21254. // Kind: Type of resource.
  21255. Kind string `json:"kind,omitempty"`
  21256. // NextPageToken: [Output Only] This token allows you to get the next
  21257. // page of results for list requests. If the number of results is larger
  21258. // than maxResults, use the nextPageToken as a value for the query
  21259. // parameter pageToken in the next list request. Subsequent list
  21260. // requests will have their own nextPageToken to continue paging through
  21261. // the results.
  21262. NextPageToken string `json:"nextPageToken,omitempty"`
  21263. // SelfLink: [Output Only] Server-defined URL for this resource.
  21264. SelfLink string `json:"selfLink,omitempty"`
  21265. // Warning: [Output Only] Informational warning message.
  21266. Warning *RouteListWarning `json:"warning,omitempty"`
  21267. // ServerResponse contains the HTTP response code and headers from the
  21268. // server.
  21269. googleapi.ServerResponse `json:"-"`
  21270. // ForceSendFields is a list of field names (e.g. "Id") to
  21271. // unconditionally include in API requests. By default, fields with
  21272. // empty values are omitted from API requests. However, any non-pointer,
  21273. // non-interface field appearing in ForceSendFields will be sent to the
  21274. // server regardless of whether the field is empty or not. This may be
  21275. // used to include empty fields in Patch requests.
  21276. ForceSendFields []string `json:"-"`
  21277. // NullFields is a list of field names (e.g. "Id") to include in API
  21278. // requests with the JSON null value. By default, fields with empty
  21279. // values are omitted from API requests. However, any field with an
  21280. // empty value appearing in NullFields will be sent to the server as
  21281. // null. It is an error if a field in this list has a non-empty value.
  21282. // This may be used to include null fields in Patch requests.
  21283. NullFields []string `json:"-"`
  21284. }
  21285. func (s *RouteList) MarshalJSON() ([]byte, error) {
  21286. type NoMethod RouteList
  21287. raw := NoMethod(*s)
  21288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21289. }
  21290. // RouteListWarning: [Output Only] Informational warning message.
  21291. type RouteListWarning struct {
  21292. // Code: [Output Only] A warning code, if applicable. For example,
  21293. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21294. // the response.
  21295. //
  21296. // Possible values:
  21297. // "CLEANUP_FAILED"
  21298. // "DEPRECATED_RESOURCE_USED"
  21299. // "DEPRECATED_TYPE_USED"
  21300. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21301. // "EXPERIMENTAL_TYPE_USED"
  21302. // "EXTERNAL_API_WARNING"
  21303. // "FIELD_VALUE_OVERRIDEN"
  21304. // "INJECTED_KERNELS_DEPRECATED"
  21305. // "MISSING_TYPE_DEPENDENCY"
  21306. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21307. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21308. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21309. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21310. // "NEXT_HOP_NOT_RUNNING"
  21311. // "NOT_CRITICAL_ERROR"
  21312. // "NO_RESULTS_ON_PAGE"
  21313. // "REQUIRED_TOS_AGREEMENT"
  21314. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21315. // "RESOURCE_NOT_DELETED"
  21316. // "SCHEMA_VALIDATION_IGNORED"
  21317. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21318. // "UNDECLARED_PROPERTIES"
  21319. // "UNREACHABLE"
  21320. Code string `json:"code,omitempty"`
  21321. // Data: [Output Only] Metadata about this warning in key: value format.
  21322. // For example:
  21323. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21324. Data []*RouteListWarningData `json:"data,omitempty"`
  21325. // Message: [Output Only] A human-readable description of the warning
  21326. // code.
  21327. Message string `json:"message,omitempty"`
  21328. // ForceSendFields is a list of field names (e.g. "Code") to
  21329. // unconditionally include in API requests. By default, fields with
  21330. // empty values are omitted from API requests. However, any non-pointer,
  21331. // non-interface field appearing in ForceSendFields will be sent to the
  21332. // server regardless of whether the field is empty or not. This may be
  21333. // used to include empty fields in Patch requests.
  21334. ForceSendFields []string `json:"-"`
  21335. // NullFields is a list of field names (e.g. "Code") to include in API
  21336. // requests with the JSON null value. By default, fields with empty
  21337. // values are omitted from API requests. However, any field with an
  21338. // empty value appearing in NullFields will be sent to the server as
  21339. // null. It is an error if a field in this list has a non-empty value.
  21340. // This may be used to include null fields in Patch requests.
  21341. NullFields []string `json:"-"`
  21342. }
  21343. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  21344. type NoMethod RouteListWarning
  21345. raw := NoMethod(*s)
  21346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21347. }
  21348. type RouteListWarningData struct {
  21349. // Key: [Output Only] A key that provides more detail on the warning
  21350. // being returned. For example, for warnings where there are no results
  21351. // in a list request for a particular zone, this key might be scope and
  21352. // the key value might be the zone name. Other examples might be a key
  21353. // indicating a deprecated resource and a suggested replacement, or a
  21354. // warning about invalid network settings (for example, if an instance
  21355. // attempts to perform IP forwarding but is not enabled for IP
  21356. // forwarding).
  21357. Key string `json:"key,omitempty"`
  21358. // Value: [Output Only] A warning data value corresponding to the key.
  21359. Value string `json:"value,omitempty"`
  21360. // ForceSendFields is a list of field names (e.g. "Key") to
  21361. // unconditionally include in API requests. By default, fields with
  21362. // empty values are omitted from API requests. However, any non-pointer,
  21363. // non-interface field appearing in ForceSendFields will be sent to the
  21364. // server regardless of whether the field is empty or not. This may be
  21365. // used to include empty fields in Patch requests.
  21366. ForceSendFields []string `json:"-"`
  21367. // NullFields is a list of field names (e.g. "Key") to include in API
  21368. // requests with the JSON null value. By default, fields with empty
  21369. // values are omitted from API requests. However, any field with an
  21370. // empty value appearing in NullFields will be sent to the server as
  21371. // null. It is an error if a field in this list has a non-empty value.
  21372. // This may be used to include null fields in Patch requests.
  21373. NullFields []string `json:"-"`
  21374. }
  21375. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  21376. type NoMethod RouteListWarningData
  21377. raw := NoMethod(*s)
  21378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21379. }
  21380. // Router: Router resource.
  21381. type Router struct {
  21382. // Bgp: BGP information specific to this router.
  21383. Bgp *RouterBgp `json:"bgp,omitempty"`
  21384. // BgpPeers: BGP information that needs to be configured into the
  21385. // routing stack to establish the BGP peering. It must specify peer ASN
  21386. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  21387. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  21388. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21389. // format.
  21390. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21391. // Description: An optional description of this resource. Provide this
  21392. // property when you create the resource.
  21393. Description string `json:"description,omitempty"`
  21394. // Id: [Output Only] The unique identifier for the resource. This
  21395. // identifier is defined by the server.
  21396. Id uint64 `json:"id,omitempty,string"`
  21397. // Interfaces: Router interfaces. Each interface requires either one
  21398. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  21399. // range (e.g. ipRange), or both.
  21400. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  21401. // Kind: [Output Only] Type of resource. Always compute#router for
  21402. // routers.
  21403. Kind string `json:"kind,omitempty"`
  21404. // Name: Name of the resource. Provided by the client when the resource
  21405. // is created. The name must be 1-63 characters long, and comply with
  21406. // RFC1035. Specifically, the name must be 1-63 characters long and
  21407. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21408. // the first character must be a lowercase letter, and all following
  21409. // characters must be a dash, lowercase letter, or digit, except the
  21410. // last character, which cannot be a dash.
  21411. Name string `json:"name,omitempty"`
  21412. // Nats: A list of Nat services created in this router.
  21413. Nats []*RouterNat `json:"nats,omitempty"`
  21414. // Network: URI of the network to which this router belongs.
  21415. Network string `json:"network,omitempty"`
  21416. // Region: [Output Only] URI of the region where the router resides. You
  21417. // must specify this field as part of the HTTP request URL. It is not
  21418. // settable as a field in the request body.
  21419. Region string `json:"region,omitempty"`
  21420. // SelfLink: [Output Only] Server-defined URL for the resource.
  21421. SelfLink string `json:"selfLink,omitempty"`
  21422. // ServerResponse contains the HTTP response code and headers from the
  21423. // server.
  21424. googleapi.ServerResponse `json:"-"`
  21425. // ForceSendFields is a list of field names (e.g. "Bgp") to
  21426. // unconditionally include in API requests. By default, fields with
  21427. // empty values are omitted from API requests. However, any non-pointer,
  21428. // non-interface field appearing in ForceSendFields will be sent to the
  21429. // server regardless of whether the field is empty or not. This may be
  21430. // used to include empty fields in Patch requests.
  21431. ForceSendFields []string `json:"-"`
  21432. // NullFields is a list of field names (e.g. "Bgp") to include in API
  21433. // requests with the JSON null value. By default, fields with empty
  21434. // values are omitted from API requests. However, any field with an
  21435. // empty value appearing in NullFields will be sent to the server as
  21436. // null. It is an error if a field in this list has a non-empty value.
  21437. // This may be used to include null fields in Patch requests.
  21438. NullFields []string `json:"-"`
  21439. }
  21440. func (s *Router) MarshalJSON() ([]byte, error) {
  21441. type NoMethod Router
  21442. raw := NoMethod(*s)
  21443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21444. }
  21445. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  21446. // to advertise.
  21447. type RouterAdvertisedIpRange struct {
  21448. // Description: User-specified description for the IP range.
  21449. Description string `json:"description,omitempty"`
  21450. // Range: The IP range to advertise. The value must be a CIDR-formatted
  21451. // string.
  21452. Range string `json:"range,omitempty"`
  21453. // ForceSendFields is a list of field names (e.g. "Description") to
  21454. // unconditionally include in API requests. By default, fields with
  21455. // empty values are omitted from API requests. However, any non-pointer,
  21456. // non-interface field appearing in ForceSendFields will be sent to the
  21457. // server regardless of whether the field is empty or not. This may be
  21458. // used to include empty fields in Patch requests.
  21459. ForceSendFields []string `json:"-"`
  21460. // NullFields is a list of field names (e.g. "Description") to include
  21461. // in API requests with the JSON null value. By default, fields with
  21462. // empty values are omitted from API requests. However, any field with
  21463. // an empty value appearing in NullFields will be sent to the server as
  21464. // null. It is an error if a field in this list has a non-empty value.
  21465. // This may be used to include null fields in Patch requests.
  21466. NullFields []string `json:"-"`
  21467. }
  21468. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  21469. type NoMethod RouterAdvertisedIpRange
  21470. raw := NoMethod(*s)
  21471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21472. }
  21473. // RouterAggregatedList: Contains a list of routers.
  21474. type RouterAggregatedList struct {
  21475. // Id: [Output Only] Unique identifier for the resource; defined by the
  21476. // server.
  21477. Id string `json:"id,omitempty"`
  21478. // Items: A list of Router resources.
  21479. Items map[string]RoutersScopedList `json:"items,omitempty"`
  21480. // Kind: Type of resource.
  21481. Kind string `json:"kind,omitempty"`
  21482. // NextPageToken: [Output Only] This token allows you to get the next
  21483. // page of results for list requests. If the number of results is larger
  21484. // than maxResults, use the nextPageToken as a value for the query
  21485. // parameter pageToken in the next list request. Subsequent list
  21486. // requests will have their own nextPageToken to continue paging through
  21487. // the results.
  21488. NextPageToken string `json:"nextPageToken,omitempty"`
  21489. // SelfLink: [Output Only] Server-defined URL for this resource.
  21490. SelfLink string `json:"selfLink,omitempty"`
  21491. // Warning: [Output Only] Informational warning message.
  21492. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  21493. // ServerResponse contains the HTTP response code and headers from the
  21494. // server.
  21495. googleapi.ServerResponse `json:"-"`
  21496. // ForceSendFields is a list of field names (e.g. "Id") to
  21497. // unconditionally include in API requests. By default, fields with
  21498. // empty values are omitted from API requests. However, any non-pointer,
  21499. // non-interface field appearing in ForceSendFields will be sent to the
  21500. // server regardless of whether the field is empty or not. This may be
  21501. // used to include empty fields in Patch requests.
  21502. ForceSendFields []string `json:"-"`
  21503. // NullFields is a list of field names (e.g. "Id") to include in API
  21504. // requests with the JSON null value. By default, fields with empty
  21505. // values are omitted from API requests. However, any field with an
  21506. // empty value appearing in NullFields will be sent to the server as
  21507. // null. It is an error if a field in this list has a non-empty value.
  21508. // This may be used to include null fields in Patch requests.
  21509. NullFields []string `json:"-"`
  21510. }
  21511. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  21512. type NoMethod RouterAggregatedList
  21513. raw := NoMethod(*s)
  21514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21515. }
  21516. // RouterAggregatedListWarning: [Output Only] Informational warning
  21517. // message.
  21518. type RouterAggregatedListWarning struct {
  21519. // Code: [Output Only] A warning code, if applicable. For example,
  21520. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21521. // the response.
  21522. //
  21523. // Possible values:
  21524. // "CLEANUP_FAILED"
  21525. // "DEPRECATED_RESOURCE_USED"
  21526. // "DEPRECATED_TYPE_USED"
  21527. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21528. // "EXPERIMENTAL_TYPE_USED"
  21529. // "EXTERNAL_API_WARNING"
  21530. // "FIELD_VALUE_OVERRIDEN"
  21531. // "INJECTED_KERNELS_DEPRECATED"
  21532. // "MISSING_TYPE_DEPENDENCY"
  21533. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21534. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21535. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21536. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21537. // "NEXT_HOP_NOT_RUNNING"
  21538. // "NOT_CRITICAL_ERROR"
  21539. // "NO_RESULTS_ON_PAGE"
  21540. // "REQUIRED_TOS_AGREEMENT"
  21541. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21542. // "RESOURCE_NOT_DELETED"
  21543. // "SCHEMA_VALIDATION_IGNORED"
  21544. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21545. // "UNDECLARED_PROPERTIES"
  21546. // "UNREACHABLE"
  21547. Code string `json:"code,omitempty"`
  21548. // Data: [Output Only] Metadata about this warning in key: value format.
  21549. // For example:
  21550. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21551. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  21552. // Message: [Output Only] A human-readable description of the warning
  21553. // code.
  21554. Message string `json:"message,omitempty"`
  21555. // ForceSendFields is a list of field names (e.g. "Code") to
  21556. // unconditionally include in API requests. By default, fields with
  21557. // empty values are omitted from API requests. However, any non-pointer,
  21558. // non-interface field appearing in ForceSendFields will be sent to the
  21559. // server regardless of whether the field is empty or not. This may be
  21560. // used to include empty fields in Patch requests.
  21561. ForceSendFields []string `json:"-"`
  21562. // NullFields is a list of field names (e.g. "Code") to include in API
  21563. // requests with the JSON null value. By default, fields with empty
  21564. // values are omitted from API requests. However, any field with an
  21565. // empty value appearing in NullFields will be sent to the server as
  21566. // null. It is an error if a field in this list has a non-empty value.
  21567. // This may be used to include null fields in Patch requests.
  21568. NullFields []string `json:"-"`
  21569. }
  21570. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21571. type NoMethod RouterAggregatedListWarning
  21572. raw := NoMethod(*s)
  21573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21574. }
  21575. type RouterAggregatedListWarningData struct {
  21576. // Key: [Output Only] A key that provides more detail on the warning
  21577. // being returned. For example, for warnings where there are no results
  21578. // in a list request for a particular zone, this key might be scope and
  21579. // the key value might be the zone name. Other examples might be a key
  21580. // indicating a deprecated resource and a suggested replacement, or a
  21581. // warning about invalid network settings (for example, if an instance
  21582. // attempts to perform IP forwarding but is not enabled for IP
  21583. // forwarding).
  21584. Key string `json:"key,omitempty"`
  21585. // Value: [Output Only] A warning data value corresponding to the key.
  21586. Value string `json:"value,omitempty"`
  21587. // ForceSendFields is a list of field names (e.g. "Key") to
  21588. // unconditionally include in API requests. By default, fields with
  21589. // empty values are omitted from API requests. However, any non-pointer,
  21590. // non-interface field appearing in ForceSendFields will be sent to the
  21591. // server regardless of whether the field is empty or not. This may be
  21592. // used to include empty fields in Patch requests.
  21593. ForceSendFields []string `json:"-"`
  21594. // NullFields is a list of field names (e.g. "Key") to include in API
  21595. // requests with the JSON null value. By default, fields with empty
  21596. // values are omitted from API requests. However, any field with an
  21597. // empty value appearing in NullFields will be sent to the server as
  21598. // null. It is an error if a field in this list has a non-empty value.
  21599. // This may be used to include null fields in Patch requests.
  21600. NullFields []string `json:"-"`
  21601. }
  21602. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21603. type NoMethod RouterAggregatedListWarningData
  21604. raw := NoMethod(*s)
  21605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21606. }
  21607. type RouterBgp struct {
  21608. // AdvertiseMode: User-specified flag to indicate which mode to use for
  21609. // advertisement.
  21610. //
  21611. // Possible values:
  21612. // "CUSTOM"
  21613. // "DEFAULT"
  21614. AdvertiseMode string `json:"advertiseMode,omitempty"`
  21615. // AdvertisedGroups: User-specified list of prefix groups to advertise
  21616. // in custom mode. This field can only be populated if advertise_mode is
  21617. // CUSTOM and is advertised to all peers of the router. These groups
  21618. // will be advertised in addition to any specified prefixes. Leave this
  21619. // field blank to advertise no custom groups.
  21620. //
  21621. // Possible values:
  21622. // "ALL_SUBNETS"
  21623. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  21624. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  21625. // advertise in custom mode. This field can only be populated if
  21626. // advertise_mode is CUSTOM and is advertised to all peers of the
  21627. // router. These IP ranges will be advertised in addition to any
  21628. // specified groups. Leave this field blank to advertise no custom IP
  21629. // ranges.
  21630. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  21631. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  21632. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  21633. // this router resource. All VPN tunnels that link to this router will
  21634. // have the same local ASN.
  21635. Asn int64 `json:"asn,omitempty"`
  21636. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  21637. // unconditionally include in API requests. By default, fields with
  21638. // empty values are omitted from API requests. However, any non-pointer,
  21639. // non-interface field appearing in ForceSendFields will be sent to the
  21640. // server regardless of whether the field is empty or not. This may be
  21641. // used to include empty fields in Patch requests.
  21642. ForceSendFields []string `json:"-"`
  21643. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  21644. // in API requests with the JSON null value. By default, fields with
  21645. // empty values are omitted from API requests. However, any field with
  21646. // an empty value appearing in NullFields will be sent to the server as
  21647. // null. It is an error if a field in this list has a non-empty value.
  21648. // This may be used to include null fields in Patch requests.
  21649. NullFields []string `json:"-"`
  21650. }
  21651. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  21652. type NoMethod RouterBgp
  21653. raw := NoMethod(*s)
  21654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21655. }
  21656. type RouterBgpPeer struct {
  21657. // AdvertiseMode: User-specified flag to indicate which mode to use for
  21658. // advertisement.
  21659. //
  21660. // Possible values:
  21661. // "CUSTOM"
  21662. // "DEFAULT"
  21663. AdvertiseMode string `json:"advertiseMode,omitempty"`
  21664. // AdvertisedGroups: User-specified list of prefix groups to advertise
  21665. // in custom mode. This field can only be populated if advertise_mode is
  21666. // CUSTOM and overrides the list defined for the router (in Bgp
  21667. // message). These groups will be advertised in addition to any
  21668. // specified prefixes. Leave this field blank to advertise no custom
  21669. // groups.
  21670. //
  21671. // Possible values:
  21672. // "ALL_SUBNETS"
  21673. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  21674. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  21675. // advertise in custom mode. This field can only be populated if
  21676. // advertise_mode is CUSTOM and overrides the list defined for the
  21677. // router (in Bgp message). These IP ranges will be advertised in
  21678. // addition to any specified groups. Leave this field blank to advertise
  21679. // no custom IP ranges.
  21680. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  21681. // AdvertisedRoutePriority: The priority of routes advertised to this
  21682. // BGP peer. In the case where there is more than one matching route of
  21683. // maximum length, the routes with lowest priority value win.
  21684. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  21685. // InterfaceName: Name of the interface the BGP peer is associated with.
  21686. InterfaceName string `json:"interfaceName,omitempty"`
  21687. // IpAddress: IP address of the interface inside Google Cloud Platform.
  21688. // Only IPv4 is supported.
  21689. IpAddress string `json:"ipAddress,omitempty"`
  21690. // ManagementType: [Output Only] The resource that configures and
  21691. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  21692. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  21693. // that is configured and managed by Cloud Interconnect, specifically by
  21694. // an InterconnectAttachment of type PARTNER. Google will automatically
  21695. // create, update, and delete this type of BGP peer when the PARTNER
  21696. // InterconnectAttachment is created, updated, or deleted.
  21697. //
  21698. // Possible values:
  21699. // "MANAGED_BY_ATTACHMENT"
  21700. // "MANAGED_BY_USER"
  21701. ManagementType string `json:"managementType,omitempty"`
  21702. // Name: Name of this BGP peer. The name must be 1-63 characters long
  21703. // and comply with RFC1035.
  21704. Name string `json:"name,omitempty"`
  21705. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  21706. // this value can be different for every tunnel.
  21707. PeerAsn int64 `json:"peerAsn,omitempty"`
  21708. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  21709. // Only IPv4 is supported.
  21710. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  21711. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  21712. // unconditionally include in API requests. By default, fields with
  21713. // empty values are omitted from API requests. However, any non-pointer,
  21714. // non-interface field appearing in ForceSendFields will be sent to the
  21715. // server regardless of whether the field is empty or not. This may be
  21716. // used to include empty fields in Patch requests.
  21717. ForceSendFields []string `json:"-"`
  21718. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  21719. // in API requests with the JSON null value. By default, fields with
  21720. // empty values are omitted from API requests. However, any field with
  21721. // an empty value appearing in NullFields will be sent to the server as
  21722. // null. It is an error if a field in this list has a non-empty value.
  21723. // This may be used to include null fields in Patch requests.
  21724. NullFields []string `json:"-"`
  21725. }
  21726. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  21727. type NoMethod RouterBgpPeer
  21728. raw := NoMethod(*s)
  21729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21730. }
  21731. type RouterInterface struct {
  21732. // IpRange: IP address and range of the interface. The IP range must be
  21733. // in the RFC3927 link-local IP space. The value must be a
  21734. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  21735. // truncate the address as it represents the IP address of the
  21736. // interface.
  21737. IpRange string `json:"ipRange,omitempty"`
  21738. // LinkedInterconnectAttachment: URI of the linked interconnect
  21739. // attachment. It must be in the same region as the router. Each
  21740. // interface can have at most one linked resource and it could either be
  21741. // a VPN Tunnel or an interconnect attachment.
  21742. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  21743. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  21744. // region as the router. Each interface can have at most one linked
  21745. // resource and it could either be a VPN Tunnel or an interconnect
  21746. // attachment.
  21747. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  21748. // ManagementType: [Output Only] The resource that configures and
  21749. // manages this interface. MANAGED_BY_USER is the default value and can
  21750. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  21751. // interface that is configured and managed by Cloud Interconnect,
  21752. // specifically by an InterconnectAttachment of type PARTNER. Google
  21753. // will automatically create, update, and delete this type of interface
  21754. // when the PARTNER InterconnectAttachment is created, updated, or
  21755. // deleted.
  21756. //
  21757. // Possible values:
  21758. // "MANAGED_BY_ATTACHMENT"
  21759. // "MANAGED_BY_USER"
  21760. ManagementType string `json:"managementType,omitempty"`
  21761. // Name: Name of this interface entry. The name must be 1-63 characters
  21762. // long and comply with RFC1035.
  21763. Name string `json:"name,omitempty"`
  21764. // ForceSendFields is a list of field names (e.g. "IpRange") to
  21765. // unconditionally include in API requests. By default, fields with
  21766. // empty values are omitted from API requests. However, any non-pointer,
  21767. // non-interface field appearing in ForceSendFields will be sent to the
  21768. // server regardless of whether the field is empty or not. This may be
  21769. // used to include empty fields in Patch requests.
  21770. ForceSendFields []string `json:"-"`
  21771. // NullFields is a list of field names (e.g. "IpRange") to include in
  21772. // API requests with the JSON null value. By default, fields with empty
  21773. // values are omitted from API requests. However, any field with an
  21774. // empty value appearing in NullFields will be sent to the server as
  21775. // null. It is an error if a field in this list has a non-empty value.
  21776. // This may be used to include null fields in Patch requests.
  21777. NullFields []string `json:"-"`
  21778. }
  21779. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  21780. type NoMethod RouterInterface
  21781. raw := NoMethod(*s)
  21782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21783. }
  21784. // RouterList: Contains a list of Router resources.
  21785. type RouterList struct {
  21786. // Id: [Output Only] Unique identifier for the resource; defined by the
  21787. // server.
  21788. Id string `json:"id,omitempty"`
  21789. // Items: A list of Router resources.
  21790. Items []*Router `json:"items,omitempty"`
  21791. // Kind: [Output Only] Type of resource. Always compute#router for
  21792. // routers.
  21793. Kind string `json:"kind,omitempty"`
  21794. // NextPageToken: [Output Only] This token allows you to get the next
  21795. // page of results for list requests. If the number of results is larger
  21796. // than maxResults, use the nextPageToken as a value for the query
  21797. // parameter pageToken in the next list request. Subsequent list
  21798. // requests will have their own nextPageToken to continue paging through
  21799. // the results.
  21800. NextPageToken string `json:"nextPageToken,omitempty"`
  21801. // SelfLink: [Output Only] Server-defined URL for this resource.
  21802. SelfLink string `json:"selfLink,omitempty"`
  21803. // Warning: [Output Only] Informational warning message.
  21804. Warning *RouterListWarning `json:"warning,omitempty"`
  21805. // ServerResponse contains the HTTP response code and headers from the
  21806. // server.
  21807. googleapi.ServerResponse `json:"-"`
  21808. // ForceSendFields is a list of field names (e.g. "Id") to
  21809. // unconditionally include in API requests. By default, fields with
  21810. // empty values are omitted from API requests. However, any non-pointer,
  21811. // non-interface field appearing in ForceSendFields will be sent to the
  21812. // server regardless of whether the field is empty or not. This may be
  21813. // used to include empty fields in Patch requests.
  21814. ForceSendFields []string `json:"-"`
  21815. // NullFields is a list of field names (e.g. "Id") to include in API
  21816. // requests with the JSON null value. By default, fields with empty
  21817. // values are omitted from API requests. However, any field with an
  21818. // empty value appearing in NullFields will be sent to the server as
  21819. // null. It is an error if a field in this list has a non-empty value.
  21820. // This may be used to include null fields in Patch requests.
  21821. NullFields []string `json:"-"`
  21822. }
  21823. func (s *RouterList) MarshalJSON() ([]byte, error) {
  21824. type NoMethod RouterList
  21825. raw := NoMethod(*s)
  21826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21827. }
  21828. // RouterListWarning: [Output Only] Informational warning message.
  21829. type RouterListWarning struct {
  21830. // Code: [Output Only] A warning code, if applicable. For example,
  21831. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21832. // the response.
  21833. //
  21834. // Possible values:
  21835. // "CLEANUP_FAILED"
  21836. // "DEPRECATED_RESOURCE_USED"
  21837. // "DEPRECATED_TYPE_USED"
  21838. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21839. // "EXPERIMENTAL_TYPE_USED"
  21840. // "EXTERNAL_API_WARNING"
  21841. // "FIELD_VALUE_OVERRIDEN"
  21842. // "INJECTED_KERNELS_DEPRECATED"
  21843. // "MISSING_TYPE_DEPENDENCY"
  21844. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21845. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21846. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21847. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21848. // "NEXT_HOP_NOT_RUNNING"
  21849. // "NOT_CRITICAL_ERROR"
  21850. // "NO_RESULTS_ON_PAGE"
  21851. // "REQUIRED_TOS_AGREEMENT"
  21852. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21853. // "RESOURCE_NOT_DELETED"
  21854. // "SCHEMA_VALIDATION_IGNORED"
  21855. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21856. // "UNDECLARED_PROPERTIES"
  21857. // "UNREACHABLE"
  21858. Code string `json:"code,omitempty"`
  21859. // Data: [Output Only] Metadata about this warning in key: value format.
  21860. // For example:
  21861. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21862. Data []*RouterListWarningData `json:"data,omitempty"`
  21863. // Message: [Output Only] A human-readable description of the warning
  21864. // code.
  21865. Message string `json:"message,omitempty"`
  21866. // ForceSendFields is a list of field names (e.g. "Code") to
  21867. // unconditionally include in API requests. By default, fields with
  21868. // empty values are omitted from API requests. However, any non-pointer,
  21869. // non-interface field appearing in ForceSendFields will be sent to the
  21870. // server regardless of whether the field is empty or not. This may be
  21871. // used to include empty fields in Patch requests.
  21872. ForceSendFields []string `json:"-"`
  21873. // NullFields is a list of field names (e.g. "Code") to include in API
  21874. // requests with the JSON null value. By default, fields with empty
  21875. // values are omitted from API requests. However, any field with an
  21876. // empty value appearing in NullFields will be sent to the server as
  21877. // null. It is an error if a field in this list has a non-empty value.
  21878. // This may be used to include null fields in Patch requests.
  21879. NullFields []string `json:"-"`
  21880. }
  21881. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  21882. type NoMethod RouterListWarning
  21883. raw := NoMethod(*s)
  21884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21885. }
  21886. type RouterListWarningData struct {
  21887. // Key: [Output Only] A key that provides more detail on the warning
  21888. // being returned. For example, for warnings where there are no results
  21889. // in a list request for a particular zone, this key might be scope and
  21890. // the key value might be the zone name. Other examples might be a key
  21891. // indicating a deprecated resource and a suggested replacement, or a
  21892. // warning about invalid network settings (for example, if an instance
  21893. // attempts to perform IP forwarding but is not enabled for IP
  21894. // forwarding).
  21895. Key string `json:"key,omitempty"`
  21896. // Value: [Output Only] A warning data value corresponding to the key.
  21897. Value string `json:"value,omitempty"`
  21898. // ForceSendFields is a list of field names (e.g. "Key") to
  21899. // unconditionally include in API requests. By default, fields with
  21900. // empty values are omitted from API requests. However, any non-pointer,
  21901. // non-interface field appearing in ForceSendFields will be sent to the
  21902. // server regardless of whether the field is empty or not. This may be
  21903. // used to include empty fields in Patch requests.
  21904. ForceSendFields []string `json:"-"`
  21905. // NullFields is a list of field names (e.g. "Key") to include in API
  21906. // requests with the JSON null value. By default, fields with empty
  21907. // values are omitted from API requests. However, any field with an
  21908. // empty value appearing in NullFields will be sent to the server as
  21909. // null. It is an error if a field in this list has a non-empty value.
  21910. // This may be used to include null fields in Patch requests.
  21911. NullFields []string `json:"-"`
  21912. }
  21913. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  21914. type NoMethod RouterListWarningData
  21915. raw := NoMethod(*s)
  21916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21917. }
  21918. // RouterNat: Represents a Nat resource. It enables the VMs within the
  21919. // specified subnetworks to access Internet without external IP
  21920. // addresses. It specifies a list of subnetworks (and the ranges within)
  21921. // that want to use NAT. Customers can also provide the external IPs
  21922. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  21923. // no external IPs are provided.
  21924. type RouterNat struct {
  21925. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  21926. // Defaults to 30s if not set.
  21927. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  21928. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  21929. // NAT config. If not set, a default number of ports is allocated to a
  21930. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  21931. // of this field is 50, at least 64 ports will be allocated to a VM.
  21932. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  21933. // Name: Unique name of this Nat service. The name must be 1-63
  21934. // characters long and comply with RFC1035.
  21935. Name string `json:"name,omitempty"`
  21936. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  21937. // AUTO_ONLY, then nat_ip should be empty.
  21938. //
  21939. // Possible values:
  21940. // "AUTO_ONLY"
  21941. // "MANUAL_ONLY"
  21942. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  21943. // NatIps: A list of URLs of the IP resources used for this Nat service.
  21944. // These IPs must be valid static external IP addresses assigned to the
  21945. // project. max_length is subject to change post alpha.
  21946. NatIps []string `json:"natIps,omitempty"`
  21947. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  21948. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  21949. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  21950. // other Router.Nat section in any Router for this network in this
  21951. // region.
  21952. //
  21953. // Possible values:
  21954. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  21955. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  21956. // "LIST_OF_SUBNETWORKS"
  21957. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  21958. // Subnetworks: A list of Subnetwork resources whose traffic should be
  21959. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  21960. // is selected for the SubnetworkIpRangeToNatOption above.
  21961. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  21962. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  21963. // established connections. Defaults to 1200s if not set.
  21964. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  21965. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  21966. // connections. Defaults to 30s if not set.
  21967. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  21968. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  21969. // to 30s if not set.
  21970. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  21971. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  21972. // to unconditionally include in API requests. By default, fields with
  21973. // empty values are omitted from API requests. However, any non-pointer,
  21974. // non-interface field appearing in ForceSendFields will be sent to the
  21975. // server regardless of whether the field is empty or not. This may be
  21976. // used to include empty fields in Patch requests.
  21977. ForceSendFields []string `json:"-"`
  21978. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  21979. // include in API requests with the JSON null value. By default, fields
  21980. // with empty values are omitted from API requests. However, any field
  21981. // with an empty value appearing in NullFields will be sent to the
  21982. // server as null. It is an error if a field in this list has a
  21983. // non-empty value. This may be used to include null fields in Patch
  21984. // requests.
  21985. NullFields []string `json:"-"`
  21986. }
  21987. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  21988. type NoMethod RouterNat
  21989. raw := NoMethod(*s)
  21990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21991. }
  21992. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  21993. // for a subnetwork.
  21994. type RouterNatSubnetworkToNat struct {
  21995. // Name: URL for the subnetwork resource to use NAT.
  21996. Name string `json:"name,omitempty"`
  21997. // SecondaryIpRangeNames: A list of the secondary ranges of the
  21998. // Subnetwork that are allowed to use NAT. This can be populated only if
  21999. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  22000. // source_ip_ranges_to_nat.
  22001. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  22002. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  22003. // Subnetwork. All usages of single value are valid except
  22004. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  22005. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  22006. // Default: [ALL_IP_RANGES]
  22007. //
  22008. // Possible values:
  22009. // "ALL_IP_RANGES"
  22010. // "LIST_OF_SECONDARY_IP_RANGES"
  22011. // "PRIMARY_IP_RANGE"
  22012. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  22013. // ForceSendFields is a list of field names (e.g. "Name") to
  22014. // unconditionally include in API requests. By default, fields with
  22015. // empty values are omitted from API requests. However, any non-pointer,
  22016. // non-interface field appearing in ForceSendFields will be sent to the
  22017. // server regardless of whether the field is empty or not. This may be
  22018. // used to include empty fields in Patch requests.
  22019. ForceSendFields []string `json:"-"`
  22020. // NullFields is a list of field names (e.g. "Name") to include in API
  22021. // requests with the JSON null value. By default, fields with empty
  22022. // values are omitted from API requests. However, any field with an
  22023. // empty value appearing in NullFields will be sent to the server as
  22024. // null. It is an error if a field in this list has a non-empty value.
  22025. // This may be used to include null fields in Patch requests.
  22026. NullFields []string `json:"-"`
  22027. }
  22028. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  22029. type NoMethod RouterNatSubnetworkToNat
  22030. raw := NoMethod(*s)
  22031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22032. }
  22033. type RouterStatus struct {
  22034. // BestRoutes: Best routes for this router's network.
  22035. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  22036. // BestRoutesForRouter: Best routes learned by this router.
  22037. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  22038. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  22039. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  22040. // Network: URI of the network to which this router belongs.
  22041. Network string `json:"network,omitempty"`
  22042. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  22043. // unconditionally include in API requests. By default, fields with
  22044. // empty values are omitted from API requests. However, any non-pointer,
  22045. // non-interface field appearing in ForceSendFields will be sent to the
  22046. // server regardless of whether the field is empty or not. This may be
  22047. // used to include empty fields in Patch requests.
  22048. ForceSendFields []string `json:"-"`
  22049. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  22050. // API requests with the JSON null value. By default, fields with empty
  22051. // values are omitted from API requests. However, any field with an
  22052. // empty value appearing in NullFields will be sent to the server as
  22053. // null. It is an error if a field in this list has a non-empty value.
  22054. // This may be used to include null fields in Patch requests.
  22055. NullFields []string `json:"-"`
  22056. }
  22057. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  22058. type NoMethod RouterStatus
  22059. raw := NoMethod(*s)
  22060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22061. }
  22062. type RouterStatusBgpPeerStatus struct {
  22063. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  22064. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  22065. // IpAddress: IP address of the local BGP interface.
  22066. IpAddress string `json:"ipAddress,omitempty"`
  22067. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  22068. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  22069. // Name: Name of this BGP peer. Unique within the Routers resource.
  22070. Name string `json:"name,omitempty"`
  22071. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  22072. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  22073. // PeerIpAddress: IP address of the remote BGP interface.
  22074. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  22075. // State: BGP state as specified in RFC1771.
  22076. State string `json:"state,omitempty"`
  22077. // Status: Status of the BGP peer: {UP, DOWN}
  22078. //
  22079. // Possible values:
  22080. // "DOWN"
  22081. // "UNKNOWN"
  22082. // "UP"
  22083. Status string `json:"status,omitempty"`
  22084. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  22085. // days, 23 hours, 59 minutes, 59 seconds
  22086. Uptime string `json:"uptime,omitempty"`
  22087. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  22088. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  22089. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  22090. // unconditionally include in API requests. By default, fields with
  22091. // empty values are omitted from API requests. However, any non-pointer,
  22092. // non-interface field appearing in ForceSendFields will be sent to the
  22093. // server regardless of whether the field is empty or not. This may be
  22094. // used to include empty fields in Patch requests.
  22095. ForceSendFields []string `json:"-"`
  22096. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  22097. // include in API requests with the JSON null value. By default, fields
  22098. // with empty values are omitted from API requests. However, any field
  22099. // with an empty value appearing in NullFields will be sent to the
  22100. // server as null. It is an error if a field in this list has a
  22101. // non-empty value. This may be used to include null fields in Patch
  22102. // requests.
  22103. NullFields []string `json:"-"`
  22104. }
  22105. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  22106. type NoMethod RouterStatusBgpPeerStatus
  22107. raw := NoMethod(*s)
  22108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22109. }
  22110. // RouterStatusNatStatus: Status of a NAT contained in this router.
  22111. type RouterStatusNatStatus struct {
  22112. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  22113. // ["1.1.1.1", "129.2.16.89"]
  22114. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  22115. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  22116. // be greater than 0 only if user-specified IPs are NOT enough to allow
  22117. // all configured VMs to use NAT. This value is meaningful only when
  22118. // auto-allocation of NAT IPs is *not* used.
  22119. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  22120. // Name: Unique name of this NAT.
  22121. Name string `json:"name,omitempty"`
  22122. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  22123. // that can use NAT.
  22124. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  22125. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  22126. // reserved IP address resources.
  22127. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  22128. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  22129. // be raw IP strings like "179.12.26.133".
  22130. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  22131. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  22132. // to unconditionally include in API requests. By default, fields with
  22133. // empty values are omitted from API requests. However, any non-pointer,
  22134. // non-interface field appearing in ForceSendFields will be sent to the
  22135. // server regardless of whether the field is empty or not. This may be
  22136. // used to include empty fields in Patch requests.
  22137. ForceSendFields []string `json:"-"`
  22138. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  22139. // include in API requests with the JSON null value. By default, fields
  22140. // with empty values are omitted from API requests. However, any field
  22141. // with an empty value appearing in NullFields will be sent to the
  22142. // server as null. It is an error if a field in this list has a
  22143. // non-empty value. This may be used to include null fields in Patch
  22144. // requests.
  22145. NullFields []string `json:"-"`
  22146. }
  22147. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  22148. type NoMethod RouterStatusNatStatus
  22149. raw := NoMethod(*s)
  22150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22151. }
  22152. type RouterStatusResponse struct {
  22153. // Kind: Type of resource.
  22154. Kind string `json:"kind,omitempty"`
  22155. Result *RouterStatus `json:"result,omitempty"`
  22156. // ServerResponse contains the HTTP response code and headers from the
  22157. // server.
  22158. googleapi.ServerResponse `json:"-"`
  22159. // ForceSendFields is a list of field names (e.g. "Kind") to
  22160. // unconditionally include in API requests. By default, fields with
  22161. // empty values are omitted from API requests. However, any non-pointer,
  22162. // non-interface field appearing in ForceSendFields will be sent to the
  22163. // server regardless of whether the field is empty or not. This may be
  22164. // used to include empty fields in Patch requests.
  22165. ForceSendFields []string `json:"-"`
  22166. // NullFields is a list of field names (e.g. "Kind") to include in API
  22167. // requests with the JSON null value. By default, fields with empty
  22168. // values are omitted from API requests. However, any field with an
  22169. // empty value appearing in NullFields will be sent to the server as
  22170. // null. It is an error if a field in this list has a non-empty value.
  22171. // This may be used to include null fields in Patch requests.
  22172. NullFields []string `json:"-"`
  22173. }
  22174. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  22175. type NoMethod RouterStatusResponse
  22176. raw := NoMethod(*s)
  22177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22178. }
  22179. type RoutersPreviewResponse struct {
  22180. // Resource: Preview of given router.
  22181. Resource *Router `json:"resource,omitempty"`
  22182. // ServerResponse contains the HTTP response code and headers from the
  22183. // server.
  22184. googleapi.ServerResponse `json:"-"`
  22185. // ForceSendFields is a list of field names (e.g. "Resource") to
  22186. // unconditionally include in API requests. By default, fields with
  22187. // empty values are omitted from API requests. However, any non-pointer,
  22188. // non-interface field appearing in ForceSendFields will be sent to the
  22189. // server regardless of whether the field is empty or not. This may be
  22190. // used to include empty fields in Patch requests.
  22191. ForceSendFields []string `json:"-"`
  22192. // NullFields is a list of field names (e.g. "Resource") to include in
  22193. // API requests with the JSON null value. By default, fields with empty
  22194. // values are omitted from API requests. However, any field with an
  22195. // empty value appearing in NullFields will be sent to the server as
  22196. // null. It is an error if a field in this list has a non-empty value.
  22197. // This may be used to include null fields in Patch requests.
  22198. NullFields []string `json:"-"`
  22199. }
  22200. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  22201. type NoMethod RoutersPreviewResponse
  22202. raw := NoMethod(*s)
  22203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22204. }
  22205. type RoutersScopedList struct {
  22206. // Routers: A list of routers contained in this scope.
  22207. Routers []*Router `json:"routers,omitempty"`
  22208. // Warning: Informational warning which replaces the list of routers
  22209. // when the list is empty.
  22210. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  22211. // ForceSendFields is a list of field names (e.g. "Routers") to
  22212. // unconditionally include in API requests. By default, fields with
  22213. // empty values are omitted from API requests. However, any non-pointer,
  22214. // non-interface field appearing in ForceSendFields will be sent to the
  22215. // server regardless of whether the field is empty or not. This may be
  22216. // used to include empty fields in Patch requests.
  22217. ForceSendFields []string `json:"-"`
  22218. // NullFields is a list of field names (e.g. "Routers") to include in
  22219. // API requests with the JSON null value. By default, fields with empty
  22220. // values are omitted from API requests. However, any field with an
  22221. // empty value appearing in NullFields will be sent to the server as
  22222. // null. It is an error if a field in this list has a non-empty value.
  22223. // This may be used to include null fields in Patch requests.
  22224. NullFields []string `json:"-"`
  22225. }
  22226. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  22227. type NoMethod RoutersScopedList
  22228. raw := NoMethod(*s)
  22229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22230. }
  22231. // RoutersScopedListWarning: Informational warning which replaces the
  22232. // list of routers when the list is empty.
  22233. type RoutersScopedListWarning struct {
  22234. // Code: [Output Only] A warning code, if applicable. For example,
  22235. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22236. // the response.
  22237. //
  22238. // Possible values:
  22239. // "CLEANUP_FAILED"
  22240. // "DEPRECATED_RESOURCE_USED"
  22241. // "DEPRECATED_TYPE_USED"
  22242. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22243. // "EXPERIMENTAL_TYPE_USED"
  22244. // "EXTERNAL_API_WARNING"
  22245. // "FIELD_VALUE_OVERRIDEN"
  22246. // "INJECTED_KERNELS_DEPRECATED"
  22247. // "MISSING_TYPE_DEPENDENCY"
  22248. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22249. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22250. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22251. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22252. // "NEXT_HOP_NOT_RUNNING"
  22253. // "NOT_CRITICAL_ERROR"
  22254. // "NO_RESULTS_ON_PAGE"
  22255. // "REQUIRED_TOS_AGREEMENT"
  22256. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22257. // "RESOURCE_NOT_DELETED"
  22258. // "SCHEMA_VALIDATION_IGNORED"
  22259. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22260. // "UNDECLARED_PROPERTIES"
  22261. // "UNREACHABLE"
  22262. Code string `json:"code,omitempty"`
  22263. // Data: [Output Only] Metadata about this warning in key: value format.
  22264. // For example:
  22265. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22266. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  22267. // Message: [Output Only] A human-readable description of the warning
  22268. // code.
  22269. Message string `json:"message,omitempty"`
  22270. // ForceSendFields is a list of field names (e.g. "Code") to
  22271. // unconditionally include in API requests. By default, fields with
  22272. // empty values are omitted from API requests. However, any non-pointer,
  22273. // non-interface field appearing in ForceSendFields will be sent to the
  22274. // server regardless of whether the field is empty or not. This may be
  22275. // used to include empty fields in Patch requests.
  22276. ForceSendFields []string `json:"-"`
  22277. // NullFields is a list of field names (e.g. "Code") to include in API
  22278. // requests with the JSON null value. By default, fields with empty
  22279. // values are omitted from API requests. However, any field with an
  22280. // empty value appearing in NullFields will be sent to the server as
  22281. // null. It is an error if a field in this list has a non-empty value.
  22282. // This may be used to include null fields in Patch requests.
  22283. NullFields []string `json:"-"`
  22284. }
  22285. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  22286. type NoMethod RoutersScopedListWarning
  22287. raw := NoMethod(*s)
  22288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22289. }
  22290. type RoutersScopedListWarningData struct {
  22291. // Key: [Output Only] A key that provides more detail on the warning
  22292. // being returned. For example, for warnings where there are no results
  22293. // in a list request for a particular zone, this key might be scope and
  22294. // the key value might be the zone name. Other examples might be a key
  22295. // indicating a deprecated resource and a suggested replacement, or a
  22296. // warning about invalid network settings (for example, if an instance
  22297. // attempts to perform IP forwarding but is not enabled for IP
  22298. // forwarding).
  22299. Key string `json:"key,omitempty"`
  22300. // Value: [Output Only] A warning data value corresponding to the key.
  22301. Value string `json:"value,omitempty"`
  22302. // ForceSendFields is a list of field names (e.g. "Key") to
  22303. // unconditionally include in API requests. By default, fields with
  22304. // empty values are omitted from API requests. However, any non-pointer,
  22305. // non-interface field appearing in ForceSendFields will be sent to the
  22306. // server regardless of whether the field is empty or not. This may be
  22307. // used to include empty fields in Patch requests.
  22308. ForceSendFields []string `json:"-"`
  22309. // NullFields is a list of field names (e.g. "Key") to include in API
  22310. // requests with the JSON null value. By default, fields with empty
  22311. // values are omitted from API requests. However, any field with an
  22312. // empty value appearing in NullFields will be sent to the server as
  22313. // null. It is an error if a field in this list has a non-empty value.
  22314. // This may be used to include null fields in Patch requests.
  22315. NullFields []string `json:"-"`
  22316. }
  22317. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  22318. type NoMethod RoutersScopedListWarningData
  22319. raw := NoMethod(*s)
  22320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22321. }
  22322. // Rule: A rule to be applied in a Policy.
  22323. type Rule struct {
  22324. // Action: Required
  22325. //
  22326. // Possible values:
  22327. // "ALLOW"
  22328. // "ALLOW_WITH_LOG"
  22329. // "DENY"
  22330. // "DENY_WITH_LOG"
  22331. // "LOG"
  22332. // "NO_ACTION"
  22333. Action string `json:"action,omitempty"`
  22334. // Conditions: Additional restrictions that must be met. All conditions
  22335. // must pass for the rule to match.
  22336. Conditions []*Condition `json:"conditions,omitempty"`
  22337. // Description: Human-readable description of the rule.
  22338. Description string `json:"description,omitempty"`
  22339. // Ins: If one or more 'in' clauses are specified, the rule matches if
  22340. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  22341. Ins []string `json:"ins,omitempty"`
  22342. // LogConfigs: The config returned to callers of
  22343. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  22344. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  22345. // NotIns: If one or more 'not_in' clauses are specified, the rule
  22346. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  22347. // entries.
  22348. NotIns []string `json:"notIns,omitempty"`
  22349. // Permissions: A permission is a string of form '..' (e.g.,
  22350. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  22351. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  22352. Permissions []string `json:"permissions,omitempty"`
  22353. // ForceSendFields is a list of field names (e.g. "Action") to
  22354. // unconditionally include in API requests. By default, fields with
  22355. // empty values are omitted from API requests. However, any non-pointer,
  22356. // non-interface field appearing in ForceSendFields will be sent to the
  22357. // server regardless of whether the field is empty or not. This may be
  22358. // used to include empty fields in Patch requests.
  22359. ForceSendFields []string `json:"-"`
  22360. // NullFields is a list of field names (e.g. "Action") to include in API
  22361. // requests with the JSON null value. By default, fields with empty
  22362. // values are omitted from API requests. However, any field with an
  22363. // empty value appearing in NullFields will be sent to the server as
  22364. // null. It is an error if a field in this list has a non-empty value.
  22365. // This may be used to include null fields in Patch requests.
  22366. NullFields []string `json:"-"`
  22367. }
  22368. func (s *Rule) MarshalJSON() ([]byte, error) {
  22369. type NoMethod Rule
  22370. raw := NoMethod(*s)
  22371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22372. }
  22373. type SSLHealthCheck struct {
  22374. // Port: The TCP port number for the health check request. The default
  22375. // value is 443. Valid values are 1 through 65535.
  22376. Port int64 `json:"port,omitempty"`
  22377. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  22378. // both port and port_name are defined, port takes precedence.
  22379. PortName string `json:"portName,omitempty"`
  22380. // PortSpecification: Specifies how port is selected for health
  22381. // checking, can be one of following values:
  22382. // USE_FIXED_PORT: The port number in
  22383. // port
  22384. // is used for health checking.
  22385. // USE_NAMED_PORT: The
  22386. // portName
  22387. // is used for health checking.
  22388. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  22389. // each network endpoint is used for health checking. For other
  22390. // backends, the port or named port specified in the Backend Service is
  22391. // used for health checking.
  22392. //
  22393. //
  22394. // If not specified, SSL health check follows behavior specified
  22395. // in
  22396. // port
  22397. // and
  22398. // portName
  22399. // fields.
  22400. //
  22401. // Possible values:
  22402. // "USE_FIXED_PORT"
  22403. // "USE_NAMED_PORT"
  22404. // "USE_SERVING_PORT"
  22405. PortSpecification string `json:"portSpecification,omitempty"`
  22406. // ProxyHeader: Specifies the type of proxy header to append before
  22407. // sending data to the backend, either NONE or PROXY_V1. The default is
  22408. // NONE.
  22409. //
  22410. // Possible values:
  22411. // "NONE"
  22412. // "PROXY_V1"
  22413. ProxyHeader string `json:"proxyHeader,omitempty"`
  22414. // Request: The application data to send once the SSL connection has
  22415. // been established (default value is empty). If both request and
  22416. // response are empty, the connection establishment alone will indicate
  22417. // health. The request data can only be ASCII.
  22418. Request string `json:"request,omitempty"`
  22419. // Response: The bytes to match against the beginning of the response
  22420. // data. If left empty (the default value), any response will indicate
  22421. // health. The response data can only be ASCII.
  22422. Response string `json:"response,omitempty"`
  22423. // ForceSendFields is a list of field names (e.g. "Port") to
  22424. // unconditionally include in API requests. By default, fields with
  22425. // empty values are omitted from API requests. However, any non-pointer,
  22426. // non-interface field appearing in ForceSendFields will be sent to the
  22427. // server regardless of whether the field is empty or not. This may be
  22428. // used to include empty fields in Patch requests.
  22429. ForceSendFields []string `json:"-"`
  22430. // NullFields is a list of field names (e.g. "Port") to include in API
  22431. // requests with the JSON null value. By default, fields with empty
  22432. // values are omitted from API requests. However, any field with an
  22433. // empty value appearing in NullFields will be sent to the server as
  22434. // null. It is an error if a field in this list has a non-empty value.
  22435. // This may be used to include null fields in Patch requests.
  22436. NullFields []string `json:"-"`
  22437. }
  22438. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  22439. type NoMethod SSLHealthCheck
  22440. raw := NoMethod(*s)
  22441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22442. }
  22443. // Scheduling: Sets the scheduling options for an Instance.
  22444. type Scheduling struct {
  22445. // AutomaticRestart: Specifies whether the instance should be
  22446. // automatically restarted if it is terminated by Compute Engine (not
  22447. // terminated by a user). You can only set the automatic restart option
  22448. // for standard instances. Preemptible instances cannot be automatically
  22449. // restarted.
  22450. //
  22451. // By default, this is set to true so an instance is automatically
  22452. // restarted if it is terminated by Compute Engine.
  22453. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  22454. // NodeAffinities: A set of node affinity and anti-affinity.
  22455. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  22456. // OnHostMaintenance: Defines the maintenance behavior for this
  22457. // instance. For standard instances, the default behavior is MIGRATE.
  22458. // For preemptible instances, the default and only possible behavior is
  22459. // TERMINATE. For more information, see Setting Instance Scheduling
  22460. // Options.
  22461. //
  22462. // Possible values:
  22463. // "MIGRATE"
  22464. // "TERMINATE"
  22465. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  22466. // Preemptible: Defines whether the instance is preemptible. This can
  22467. // only be set during instance creation, it cannot be set or changed
  22468. // after the instance has been created.
  22469. Preemptible bool `json:"preemptible,omitempty"`
  22470. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  22471. // unconditionally include in API requests. By default, fields with
  22472. // empty values are omitted from API requests. However, any non-pointer,
  22473. // non-interface field appearing in ForceSendFields will be sent to the
  22474. // server regardless of whether the field is empty or not. This may be
  22475. // used to include empty fields in Patch requests.
  22476. ForceSendFields []string `json:"-"`
  22477. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  22478. // include in API requests with the JSON null value. By default, fields
  22479. // with empty values are omitted from API requests. However, any field
  22480. // with an empty value appearing in NullFields will be sent to the
  22481. // server as null. It is an error if a field in this list has a
  22482. // non-empty value. This may be used to include null fields in Patch
  22483. // requests.
  22484. NullFields []string `json:"-"`
  22485. }
  22486. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  22487. type NoMethod Scheduling
  22488. raw := NoMethod(*s)
  22489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22490. }
  22491. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  22492. // nodes onto which this Instance could be scheduled.
  22493. type SchedulingNodeAffinity struct {
  22494. // Key: Corresponds to the label key of Node resource.
  22495. Key string `json:"key,omitempty"`
  22496. // Operator: Defines the operation of node selection.
  22497. //
  22498. // Possible values:
  22499. // "IN"
  22500. // "NOT_IN"
  22501. // "OPERATOR_UNSPECIFIED"
  22502. Operator string `json:"operator,omitempty"`
  22503. // Values: Corresponds to the label values of Node resource.
  22504. Values []string `json:"values,omitempty"`
  22505. // ForceSendFields is a list of field names (e.g. "Key") to
  22506. // unconditionally include in API requests. By default, fields with
  22507. // empty values are omitted from API requests. However, any non-pointer,
  22508. // non-interface field appearing in ForceSendFields will be sent to the
  22509. // server regardless of whether the field is empty or not. This may be
  22510. // used to include empty fields in Patch requests.
  22511. ForceSendFields []string `json:"-"`
  22512. // NullFields is a list of field names (e.g. "Key") to include in API
  22513. // requests with the JSON null value. By default, fields with empty
  22514. // values are omitted from API requests. However, any field with an
  22515. // empty value appearing in NullFields will be sent to the server as
  22516. // null. It is an error if a field in this list has a non-empty value.
  22517. // This may be used to include null fields in Patch requests.
  22518. NullFields []string `json:"-"`
  22519. }
  22520. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  22521. type NoMethod SchedulingNodeAffinity
  22522. raw := NoMethod(*s)
  22523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22524. }
  22525. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  22526. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  22527. // ServerResponse contains the HTTP response code and headers from the
  22528. // server.
  22529. googleapi.ServerResponse `json:"-"`
  22530. // ForceSendFields is a list of field names (e.g.
  22531. // "PreconfiguredExpressionSets") to unconditionally include in API
  22532. // requests. By default, fields with empty values are omitted from API
  22533. // requests. However, any non-pointer, non-interface field appearing in
  22534. // ForceSendFields will be sent to the server regardless of whether the
  22535. // field is empty or not. This may be used to include empty fields in
  22536. // Patch requests.
  22537. ForceSendFields []string `json:"-"`
  22538. // NullFields is a list of field names (e.g.
  22539. // "PreconfiguredExpressionSets") to include in API requests with the
  22540. // JSON null value. By default, fields with empty values are omitted
  22541. // from API requests. However, any field with an empty value appearing
  22542. // in NullFields will be sent to the server as null. It is an error if a
  22543. // field in this list has a non-empty value. This may be used to include
  22544. // null fields in Patch requests.
  22545. NullFields []string `json:"-"`
  22546. }
  22547. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  22548. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  22549. raw := NoMethod(*s)
  22550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22551. }
  22552. type SecurityPoliciesWafConfig struct {
  22553. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  22554. // ForceSendFields is a list of field names (e.g. "WafRules") to
  22555. // unconditionally include in API requests. By default, fields with
  22556. // empty values are omitted from API requests. However, any non-pointer,
  22557. // non-interface field appearing in ForceSendFields will be sent to the
  22558. // server regardless of whether the field is empty or not. This may be
  22559. // used to include empty fields in Patch requests.
  22560. ForceSendFields []string `json:"-"`
  22561. // NullFields is a list of field names (e.g. "WafRules") to include in
  22562. // API requests with the JSON null value. By default, fields with empty
  22563. // values are omitted from API requests. However, any field with an
  22564. // empty value appearing in NullFields will be sent to the server as
  22565. // null. It is an error if a field in this list has a non-empty value.
  22566. // This may be used to include null fields in Patch requests.
  22567. NullFields []string `json:"-"`
  22568. }
  22569. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  22570. type NoMethod SecurityPoliciesWafConfig
  22571. raw := NoMethod(*s)
  22572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22573. }
  22574. // SecurityPolicy: A security policy is comprised of one or more rules.
  22575. // It can also be associated with one or more 'targets'. (==
  22576. // resource_for v1.securityPolicies ==) (== resource_for
  22577. // beta.securityPolicies ==)
  22578. type SecurityPolicy struct {
  22579. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22580. // format.
  22581. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22582. // Description: An optional description of this resource. Provide this
  22583. // property when you create the resource.
  22584. Description string `json:"description,omitempty"`
  22585. // Fingerprint: Specifies a fingerprint for this resource, which is
  22586. // essentially a hash of the metadata's contents and used for optimistic
  22587. // locking. The fingerprint is initially generated by Compute Engine and
  22588. // changes after every request to modify or update metadata. You must
  22589. // always provide an up-to-date fingerprint hash in order to update or
  22590. // change metadata, otherwise the request will fail with error 412
  22591. // conditionNotMet.
  22592. //
  22593. // To see the latest fingerprint, make get() request to the security
  22594. // policy.
  22595. Fingerprint string `json:"fingerprint,omitempty"`
  22596. // Id: [Output Only] The unique identifier for the resource. This
  22597. // identifier is defined by the server.
  22598. Id uint64 `json:"id,omitempty,string"`
  22599. // Kind: [Output only] Type of the resource. Always
  22600. // compute#securityPolicyfor security policies
  22601. Kind string `json:"kind,omitempty"`
  22602. // LabelFingerprint: A fingerprint for the labels being applied to this
  22603. // security policy, which is essentially a hash of the labels set used
  22604. // for optimistic locking. The fingerprint is initially generated by
  22605. // Compute Engine and changes after every request to modify or update
  22606. // labels. You must always provide an up-to-date fingerprint hash in
  22607. // order to update or change labels.
  22608. //
  22609. // To see the latest fingerprint, make get() request to the security
  22610. // policy.
  22611. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  22612. // Labels: Labels to apply to this security policy resource. These can
  22613. // be later modified by the setLabels method. Each label key/value must
  22614. // comply with RFC1035. Label values may be empty.
  22615. Labels map[string]string `json:"labels,omitempty"`
  22616. // Name: Name of the resource. Provided by the client when the resource
  22617. // is created. The name must be 1-63 characters long, and comply with
  22618. // RFC1035. Specifically, the name must be 1-63 characters long and
  22619. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22620. // the first character must be a lowercase letter, and all following
  22621. // characters must be a dash, lowercase letter, or digit, except the
  22622. // last character, which cannot be a dash.
  22623. Name string `json:"name,omitempty"`
  22624. // Rules: A list of rules that belong to this policy. There must always
  22625. // be a default rule (rule with priority 2147483647 and match "*"). If
  22626. // no rules are provided when creating a security policy, a default rule
  22627. // with action "allow" will be added.
  22628. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  22629. // SelfLink: [Output Only] Server-defined URL for the resource.
  22630. SelfLink string `json:"selfLink,omitempty"`
  22631. // ServerResponse contains the HTTP response code and headers from the
  22632. // server.
  22633. googleapi.ServerResponse `json:"-"`
  22634. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22635. // to unconditionally include in API requests. By default, fields with
  22636. // empty values are omitted from API requests. However, any non-pointer,
  22637. // non-interface field appearing in ForceSendFields will be sent to the
  22638. // server regardless of whether the field is empty or not. This may be
  22639. // used to include empty fields in Patch requests.
  22640. ForceSendFields []string `json:"-"`
  22641. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22642. // include in API requests with the JSON null value. By default, fields
  22643. // with empty values are omitted from API requests. However, any field
  22644. // with an empty value appearing in NullFields will be sent to the
  22645. // server as null. It is an error if a field in this list has a
  22646. // non-empty value. This may be used to include null fields in Patch
  22647. // requests.
  22648. NullFields []string `json:"-"`
  22649. }
  22650. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  22651. type NoMethod SecurityPolicy
  22652. raw := NoMethod(*s)
  22653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22654. }
  22655. type SecurityPolicyList struct {
  22656. // Id: [Output Only] Unique identifier for the resource; defined by the
  22657. // server.
  22658. Id string `json:"id,omitempty"`
  22659. // Items: A list of SecurityPolicy resources.
  22660. Items []*SecurityPolicy `json:"items,omitempty"`
  22661. // Kind: [Output Only] Type of resource. Always
  22662. // compute#securityPolicyList for listsof securityPolicies
  22663. Kind string `json:"kind,omitempty"`
  22664. // NextPageToken: [Output Only] This token allows you to get the next
  22665. // page of results for list requests. If the number of results is larger
  22666. // than maxResults, use the nextPageToken as a value for the query
  22667. // parameter pageToken in the next list request. Subsequent list
  22668. // requests will have their own nextPageToken to continue paging through
  22669. // the results.
  22670. NextPageToken string `json:"nextPageToken,omitempty"`
  22671. // Warning: [Output Only] Informational warning message.
  22672. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  22673. // ServerResponse contains the HTTP response code and headers from the
  22674. // server.
  22675. googleapi.ServerResponse `json:"-"`
  22676. // ForceSendFields is a list of field names (e.g. "Id") to
  22677. // unconditionally include in API requests. By default, fields with
  22678. // empty values are omitted from API requests. However, any non-pointer,
  22679. // non-interface field appearing in ForceSendFields will be sent to the
  22680. // server regardless of whether the field is empty or not. This may be
  22681. // used to include empty fields in Patch requests.
  22682. ForceSendFields []string `json:"-"`
  22683. // NullFields is a list of field names (e.g. "Id") to include in API
  22684. // requests with the JSON null value. By default, fields with empty
  22685. // values are omitted from API requests. However, any field with an
  22686. // empty value appearing in NullFields will be sent to the server as
  22687. // null. It is an error if a field in this list has a non-empty value.
  22688. // This may be used to include null fields in Patch requests.
  22689. NullFields []string `json:"-"`
  22690. }
  22691. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  22692. type NoMethod SecurityPolicyList
  22693. raw := NoMethod(*s)
  22694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22695. }
  22696. // SecurityPolicyListWarning: [Output Only] Informational warning
  22697. // message.
  22698. type SecurityPolicyListWarning struct {
  22699. // Code: [Output Only] A warning code, if applicable. For example,
  22700. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22701. // the response.
  22702. //
  22703. // Possible values:
  22704. // "CLEANUP_FAILED"
  22705. // "DEPRECATED_RESOURCE_USED"
  22706. // "DEPRECATED_TYPE_USED"
  22707. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22708. // "EXPERIMENTAL_TYPE_USED"
  22709. // "EXTERNAL_API_WARNING"
  22710. // "FIELD_VALUE_OVERRIDEN"
  22711. // "INJECTED_KERNELS_DEPRECATED"
  22712. // "MISSING_TYPE_DEPENDENCY"
  22713. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22714. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22715. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22716. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22717. // "NEXT_HOP_NOT_RUNNING"
  22718. // "NOT_CRITICAL_ERROR"
  22719. // "NO_RESULTS_ON_PAGE"
  22720. // "REQUIRED_TOS_AGREEMENT"
  22721. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22722. // "RESOURCE_NOT_DELETED"
  22723. // "SCHEMA_VALIDATION_IGNORED"
  22724. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22725. // "UNDECLARED_PROPERTIES"
  22726. // "UNREACHABLE"
  22727. Code string `json:"code,omitempty"`
  22728. // Data: [Output Only] Metadata about this warning in key: value format.
  22729. // For example:
  22730. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22731. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  22732. // Message: [Output Only] A human-readable description of the warning
  22733. // code.
  22734. Message string `json:"message,omitempty"`
  22735. // ForceSendFields is a list of field names (e.g. "Code") to
  22736. // unconditionally include in API requests. By default, fields with
  22737. // empty values are omitted from API requests. However, any non-pointer,
  22738. // non-interface field appearing in ForceSendFields will be sent to the
  22739. // server regardless of whether the field is empty or not. This may be
  22740. // used to include empty fields in Patch requests.
  22741. ForceSendFields []string `json:"-"`
  22742. // NullFields is a list of field names (e.g. "Code") to include in API
  22743. // requests with the JSON null value. By default, fields with empty
  22744. // values are omitted from API requests. However, any field with an
  22745. // empty value appearing in NullFields will be sent to the server as
  22746. // null. It is an error if a field in this list has a non-empty value.
  22747. // This may be used to include null fields in Patch requests.
  22748. NullFields []string `json:"-"`
  22749. }
  22750. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  22751. type NoMethod SecurityPolicyListWarning
  22752. raw := NoMethod(*s)
  22753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22754. }
  22755. type SecurityPolicyListWarningData struct {
  22756. // Key: [Output Only] A key that provides more detail on the warning
  22757. // being returned. For example, for warnings where there are no results
  22758. // in a list request for a particular zone, this key might be scope and
  22759. // the key value might be the zone name. Other examples might be a key
  22760. // indicating a deprecated resource and a suggested replacement, or a
  22761. // warning about invalid network settings (for example, if an instance
  22762. // attempts to perform IP forwarding but is not enabled for IP
  22763. // forwarding).
  22764. Key string `json:"key,omitempty"`
  22765. // Value: [Output Only] A warning data value corresponding to the key.
  22766. Value string `json:"value,omitempty"`
  22767. // ForceSendFields is a list of field names (e.g. "Key") to
  22768. // unconditionally include in API requests. By default, fields with
  22769. // empty values are omitted from API requests. However, any non-pointer,
  22770. // non-interface field appearing in ForceSendFields will be sent to the
  22771. // server regardless of whether the field is empty or not. This may be
  22772. // used to include empty fields in Patch requests.
  22773. ForceSendFields []string `json:"-"`
  22774. // NullFields is a list of field names (e.g. "Key") to include in API
  22775. // requests with the JSON null value. By default, fields with empty
  22776. // values are omitted from API requests. However, any field with an
  22777. // empty value appearing in NullFields will be sent to the server as
  22778. // null. It is an error if a field in this list has a non-empty value.
  22779. // This may be used to include null fields in Patch requests.
  22780. NullFields []string `json:"-"`
  22781. }
  22782. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  22783. type NoMethod SecurityPolicyListWarningData
  22784. raw := NoMethod(*s)
  22785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22786. }
  22787. type SecurityPolicyReference struct {
  22788. SecurityPolicy string `json:"securityPolicy,omitempty"`
  22789. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  22790. // unconditionally include in API requests. By default, fields with
  22791. // empty values are omitted from API requests. However, any non-pointer,
  22792. // non-interface field appearing in ForceSendFields will be sent to the
  22793. // server regardless of whether the field is empty or not. This may be
  22794. // used to include empty fields in Patch requests.
  22795. ForceSendFields []string `json:"-"`
  22796. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  22797. // include in API requests with the JSON null value. By default, fields
  22798. // with empty values are omitted from API requests. However, any field
  22799. // with an empty value appearing in NullFields will be sent to the
  22800. // server as null. It is an error if a field in this list has a
  22801. // non-empty value. This may be used to include null fields in Patch
  22802. // requests.
  22803. NullFields []string `json:"-"`
  22804. }
  22805. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  22806. type NoMethod SecurityPolicyReference
  22807. raw := NoMethod(*s)
  22808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22809. }
  22810. // SecurityPolicyRule: Represents a rule that describes one or more
  22811. // match conditions along with the action to be taken when traffic
  22812. // matches this condition (allow or deny).
  22813. type SecurityPolicyRule struct {
  22814. // Action: The Action to preform when the client connection triggers the
  22815. // rule. Can currently be either "allow" or "deny()" where valid values
  22816. // for status are 403, 404, and 502.
  22817. Action string `json:"action,omitempty"`
  22818. // Description: An optional description of this resource. Provide this
  22819. // property when you create the resource.
  22820. Description string `json:"description,omitempty"`
  22821. // Kind: [Output only] Type of the resource. Always
  22822. // compute#securityPolicyRule for security policy rules
  22823. Kind string `json:"kind,omitempty"`
  22824. // Match: A match condition that incoming traffic is evaluated against.
  22825. // If it evaluates to true, the corresponding ?action? is enforced.
  22826. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  22827. // Preview: If set to true, the specified action is not enforced.
  22828. Preview bool `json:"preview,omitempty"`
  22829. // Priority: An integer indicating the priority of a rule in the list.
  22830. // The priority must be a positive value between 0 and 2147483647. Rules
  22831. // are evaluated from highest to lowest priority where 0 is the highest
  22832. // priority and 2147483647 is the lowest prority.
  22833. Priority int64 `json:"priority,omitempty"`
  22834. // ServerResponse contains the HTTP response code and headers from the
  22835. // server.
  22836. googleapi.ServerResponse `json:"-"`
  22837. // ForceSendFields is a list of field names (e.g. "Action") to
  22838. // unconditionally include in API requests. By default, fields with
  22839. // empty values are omitted from API requests. However, any non-pointer,
  22840. // non-interface field appearing in ForceSendFields will be sent to the
  22841. // server regardless of whether the field is empty or not. This may be
  22842. // used to include empty fields in Patch requests.
  22843. ForceSendFields []string `json:"-"`
  22844. // NullFields is a list of field names (e.g. "Action") to include in API
  22845. // requests with the JSON null value. By default, fields with empty
  22846. // values are omitted from API requests. However, any field with an
  22847. // empty value appearing in NullFields will be sent to the server as
  22848. // null. It is an error if a field in this list has a non-empty value.
  22849. // This may be used to include null fields in Patch requests.
  22850. NullFields []string `json:"-"`
  22851. }
  22852. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  22853. type NoMethod SecurityPolicyRule
  22854. raw := NoMethod(*s)
  22855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22856. }
  22857. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  22858. // traffic is evaluated against. Exactly one field must be specified.
  22859. type SecurityPolicyRuleMatcher struct {
  22860. // Config: The configuration options available when specifying
  22861. // versioned_expr. This field must be specified if versioned_expr is
  22862. // specified and cannot be specified if versioned_expr is not specified.
  22863. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  22864. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  22865. // specify match criteria such as origin.ip, source.region_code and
  22866. // contents in the request header.
  22867. Expr *Expr `json:"expr,omitempty"`
  22868. // VersionedExpr: Preconfigured versioned expression. If this field is
  22869. // specified, config must also be specified. Available preconfigured
  22870. // expressions along with their requirements are: SRC_IPS_V1 - must
  22871. // specify the corresponding src_ip_range field in config.
  22872. //
  22873. // Possible values:
  22874. // "SRC_IPS_V1"
  22875. VersionedExpr string `json:"versionedExpr,omitempty"`
  22876. // ForceSendFields is a list of field names (e.g. "Config") to
  22877. // unconditionally include in API requests. By default, fields with
  22878. // empty values are omitted from API requests. However, any non-pointer,
  22879. // non-interface field appearing in ForceSendFields will be sent to the
  22880. // server regardless of whether the field is empty or not. This may be
  22881. // used to include empty fields in Patch requests.
  22882. ForceSendFields []string `json:"-"`
  22883. // NullFields is a list of field names (e.g. "Config") to include in API
  22884. // requests with the JSON null value. By default, fields with empty
  22885. // values are omitted from API requests. However, any field with an
  22886. // empty value appearing in NullFields will be sent to the server as
  22887. // null. It is an error if a field in this list has a non-empty value.
  22888. // This may be used to include null fields in Patch requests.
  22889. NullFields []string `json:"-"`
  22890. }
  22891. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  22892. type NoMethod SecurityPolicyRuleMatcher
  22893. raw := NoMethod(*s)
  22894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22895. }
  22896. type SecurityPolicyRuleMatcherConfig struct {
  22897. // SrcIpRanges: CIDR IP address range.
  22898. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  22899. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  22900. // unconditionally include in API requests. By default, fields with
  22901. // empty values are omitted from API requests. However, any non-pointer,
  22902. // non-interface field appearing in ForceSendFields will be sent to the
  22903. // server regardless of whether the field is empty or not. This may be
  22904. // used to include empty fields in Patch requests.
  22905. ForceSendFields []string `json:"-"`
  22906. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  22907. // in API requests with the JSON null value. By default, fields with
  22908. // empty values are omitted from API requests. However, any field with
  22909. // an empty value appearing in NullFields will be sent to the server as
  22910. // null. It is an error if a field in this list has a non-empty value.
  22911. // This may be used to include null fields in Patch requests.
  22912. NullFields []string `json:"-"`
  22913. }
  22914. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  22915. type NoMethod SecurityPolicyRuleMatcherConfig
  22916. raw := NoMethod(*s)
  22917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22918. }
  22919. // SerialPortOutput: An instance's serial console output.
  22920. type SerialPortOutput struct {
  22921. // Contents: [Output Only] The contents of the console output.
  22922. Contents string `json:"contents,omitempty"`
  22923. // Kind: [Output Only] Type of the resource. Always
  22924. // compute#serialPortOutput for serial port output.
  22925. Kind string `json:"kind,omitempty"`
  22926. // Next: [Output Only] The position of the next byte of content from the
  22927. // serial console output. Use this value in the next request as the
  22928. // start parameter.
  22929. Next int64 `json:"next,omitempty,string"`
  22930. // SelfLink: [Output Only] Server-defined URL for this resource.
  22931. SelfLink string `json:"selfLink,omitempty"`
  22932. // Start: The starting byte position of the output that was returned.
  22933. // This should match the start parameter sent with the request. If the
  22934. // serial console output exceeds the size of the buffer, older output
  22935. // will be overwritten by newer content and the start values will be
  22936. // mismatched.
  22937. Start int64 `json:"start,omitempty,string"`
  22938. // ServerResponse contains the HTTP response code and headers from the
  22939. // server.
  22940. googleapi.ServerResponse `json:"-"`
  22941. // ForceSendFields is a list of field names (e.g. "Contents") 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. "Contents") to include in
  22949. // API 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 *SerialPortOutput) MarshalJSON() ([]byte, error) {
  22957. type NoMethod SerialPortOutput
  22958. raw := NoMethod(*s)
  22959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22960. }
  22961. // ServiceAccount: A service account.
  22962. type ServiceAccount struct {
  22963. // Email: Email address of the service account.
  22964. Email string `json:"email,omitempty"`
  22965. // Scopes: The list of scopes to be made available for this service
  22966. // account.
  22967. Scopes []string `json:"scopes,omitempty"`
  22968. // ForceSendFields is a list of field names (e.g. "Email") to
  22969. // unconditionally include in API requests. By default, fields with
  22970. // empty values are omitted from API requests. However, any non-pointer,
  22971. // non-interface field appearing in ForceSendFields will be sent to the
  22972. // server regardless of whether the field is empty or not. This may be
  22973. // used to include empty fields in Patch requests.
  22974. ForceSendFields []string `json:"-"`
  22975. // NullFields is a list of field names (e.g. "Email") to include in API
  22976. // requests with the JSON null value. By default, fields with empty
  22977. // values are omitted from API requests. However, any field with an
  22978. // empty value appearing in NullFields will be sent to the server as
  22979. // null. It is an error if a field in this list has a non-empty value.
  22980. // This may be used to include null fields in Patch requests.
  22981. NullFields []string `json:"-"`
  22982. }
  22983. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  22984. type NoMethod ServiceAccount
  22985. raw := NoMethod(*s)
  22986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22987. }
  22988. // ShieldedVmConfig: A set of Shielded VM options.
  22989. type ShieldedVmConfig struct {
  22990. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  22991. // monitoring enabled.
  22992. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  22993. // EnableSecureBoot: Defines whether the instance has Secure Boot
  22994. // enabled.
  22995. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  22996. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  22997. EnableVtpm bool `json:"enableVtpm,omitempty"`
  22998. // ForceSendFields is a list of field names (e.g.
  22999. // "EnableIntegrityMonitoring") to unconditionally include in API
  23000. // requests. By default, fields with empty values are omitted from API
  23001. // requests. However, any non-pointer, non-interface field appearing in
  23002. // ForceSendFields will be sent to the server regardless of whether the
  23003. // field is empty or not. This may be used to include empty fields in
  23004. // Patch requests.
  23005. ForceSendFields []string `json:"-"`
  23006. // NullFields is a list of field names (e.g.
  23007. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  23008. // null value. By default, fields with empty values are omitted from API
  23009. // requests. However, any field with an empty value appearing in
  23010. // NullFields will be sent to the server as null. It is an error if a
  23011. // field in this list has a non-empty value. This may be used to include
  23012. // null fields in Patch requests.
  23013. NullFields []string `json:"-"`
  23014. }
  23015. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  23016. type NoMethod ShieldedVmConfig
  23017. raw := NoMethod(*s)
  23018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23019. }
  23020. // ShieldedVmIdentity: A shielded VM identity entry.
  23021. type ShieldedVmIdentity struct {
  23022. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded VM's
  23023. // vTPM.
  23024. EncryptionKey *ShieldedVmIdentityEntry `json:"encryptionKey,omitempty"`
  23025. // Kind: [Output Only] Type of the resource. Always
  23026. // compute#shieldedVmIdentity for shielded VM identity entry.
  23027. Kind string `json:"kind,omitempty"`
  23028. // SigningKey: An Attestation Key (AK) issued to the Shielded VM's vTPM.
  23029. SigningKey *ShieldedVmIdentityEntry `json:"signingKey,omitempty"`
  23030. // ServerResponse contains the HTTP response code and headers from the
  23031. // server.
  23032. googleapi.ServerResponse `json:"-"`
  23033. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  23034. // unconditionally include in API requests. By default, fields with
  23035. // empty values are omitted from API requests. However, any non-pointer,
  23036. // non-interface field appearing in ForceSendFields will be sent to the
  23037. // server regardless of whether the field is empty or not. This may be
  23038. // used to include empty fields in Patch requests.
  23039. ForceSendFields []string `json:"-"`
  23040. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  23041. // in API requests with the JSON null value. By default, fields with
  23042. // empty values are omitted from API requests. However, any field with
  23043. // an empty value appearing in NullFields will be sent to the server as
  23044. // null. It is an error if a field in this list has a non-empty value.
  23045. // This may be used to include null fields in Patch requests.
  23046. NullFields []string `json:"-"`
  23047. }
  23048. func (s *ShieldedVmIdentity) MarshalJSON() ([]byte, error) {
  23049. type NoMethod ShieldedVmIdentity
  23050. raw := NoMethod(*s)
  23051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23052. }
  23053. // ShieldedVmIdentityEntry: A Shielded VM Identity Entry.
  23054. type ShieldedVmIdentityEntry struct {
  23055. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  23056. EkCert string `json:"ekCert,omitempty"`
  23057. // EkPub: A PEM-encoded public key.
  23058. EkPub string `json:"ekPub,omitempty"`
  23059. // ForceSendFields is a list of field names (e.g. "EkCert") to
  23060. // unconditionally include in API requests. By default, fields with
  23061. // empty values are omitted from API requests. However, any non-pointer,
  23062. // non-interface field appearing in ForceSendFields will be sent to the
  23063. // server regardless of whether the field is empty or not. This may be
  23064. // used to include empty fields in Patch requests.
  23065. ForceSendFields []string `json:"-"`
  23066. // NullFields is a list of field names (e.g. "EkCert") to include in API
  23067. // requests with the JSON null value. By default, fields with empty
  23068. // values are omitted from API requests. However, any field with an
  23069. // empty value appearing in NullFields will be sent to the server as
  23070. // null. It is an error if a field in this list has a non-empty value.
  23071. // This may be used to include null fields in Patch requests.
  23072. NullFields []string `json:"-"`
  23073. }
  23074. func (s *ShieldedVmIdentityEntry) MarshalJSON() ([]byte, error) {
  23075. type NoMethod ShieldedVmIdentityEntry
  23076. raw := NoMethod(*s)
  23077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23078. }
  23079. // ShieldedVmIntegrityPolicy: The policy describes the baseline against
  23080. // which VM instance boot integrity is measured.
  23081. type ShieldedVmIntegrityPolicy struct {
  23082. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  23083. // the measurements from the VM instance's most recent boot.
  23084. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  23085. // ForceSendFields is a list of field names (e.g.
  23086. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  23087. // By default, fields with empty values are omitted from API requests.
  23088. // However, any non-pointer, non-interface field appearing in
  23089. // ForceSendFields will be sent to the server regardless of whether the
  23090. // field is empty or not. This may be used to include empty fields in
  23091. // Patch requests.
  23092. ForceSendFields []string `json:"-"`
  23093. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  23094. // include in API requests with the JSON null value. By default, fields
  23095. // with empty values are omitted from API requests. However, any field
  23096. // with an empty value appearing in NullFields will be sent to the
  23097. // server as null. It is an error if a field in this list has a
  23098. // non-empty value. This may be used to include null fields in Patch
  23099. // requests.
  23100. NullFields []string `json:"-"`
  23101. }
  23102. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  23103. type NoMethod ShieldedVmIntegrityPolicy
  23104. raw := NoMethod(*s)
  23105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23106. }
  23107. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  23108. // Cloud CDN Signed URLs
  23109. type SignedUrlKey struct {
  23110. // KeyName: Name of the key. The name must be 1-63 characters long, and
  23111. // comply with RFC1035. Specifically, the name must be 1-63 characters
  23112. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  23113. // which means the first character must be a lowercase letter, and all
  23114. // following characters must be a dash, lowercase letter, or digit,
  23115. // except the last character, which cannot be a dash.
  23116. KeyName string `json:"keyName,omitempty"`
  23117. // KeyValue: 128-bit key value used for signing the URL. The key value
  23118. // must be a valid RFC 4648 Section 5 base64url encoded string.
  23119. KeyValue string `json:"keyValue,omitempty"`
  23120. // ForceSendFields is a list of field names (e.g. "KeyName") 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. "KeyName") to include in
  23128. // API 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 *SignedUrlKey) MarshalJSON() ([]byte, error) {
  23136. type NoMethod SignedUrlKey
  23137. raw := NoMethod(*s)
  23138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23139. }
  23140. // Snapshot: A persistent disk snapshot resource. (== resource_for
  23141. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  23142. type Snapshot struct {
  23143. // AutoCreated: [Output Only] Set to true if snapshots are automatically
  23144. // by applying resource policy on the target disk.
  23145. AutoCreated bool `json:"autoCreated,omitempty"`
  23146. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23147. // format.
  23148. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23149. // Description: An optional description of this resource. Provide this
  23150. // property when you create the resource.
  23151. Description string `json:"description,omitempty"`
  23152. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  23153. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  23154. // Id: [Output Only] The unique identifier for the resource. This
  23155. // identifier is defined by the server.
  23156. Id uint64 `json:"id,omitempty,string"`
  23157. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  23158. // Snapshot resources.
  23159. Kind string `json:"kind,omitempty"`
  23160. // LabelFingerprint: A fingerprint for the labels being applied to this
  23161. // snapshot, which is essentially a hash of the labels set used for
  23162. // optimistic locking. The fingerprint is initially generated by Compute
  23163. // Engine and changes after every request to modify or update labels.
  23164. // You must always provide an up-to-date fingerprint hash in order to
  23165. // update or change labels, otherwise the request will fail with error
  23166. // 412 conditionNotMet.
  23167. //
  23168. // To see the latest fingerprint, make a get() request to retrieve a
  23169. // snapshot.
  23170. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  23171. // Labels: Labels to apply to this snapshot. These can be later modified
  23172. // by the setLabels method. Label values may be empty.
  23173. Labels map[string]string `json:"labels,omitempty"`
  23174. // LicenseCodes: [Output Only] Integer license codes indicating which
  23175. // licenses are attached to this snapshot.
  23176. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  23177. // Licenses: [Output Only] A list of public visible licenses that apply
  23178. // to this snapshot. This can be because the original image had licenses
  23179. // attached (such as a Windows image).
  23180. Licenses []string `json:"licenses,omitempty"`
  23181. // Name: Name of the resource; provided by the client when the resource
  23182. // is created. The name must be 1-63 characters long, and comply with
  23183. // RFC1035. Specifically, the name must be 1-63 characters long and
  23184. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23185. // the first character must be a lowercase letter, and all following
  23186. // characters must be a dash, lowercase letter, or digit, except the
  23187. // last character, which cannot be a dash.
  23188. Name string `json:"name,omitempty"`
  23189. // SelfLink: [Output Only] Server-defined URL for the resource.
  23190. SelfLink string `json:"selfLink,omitempty"`
  23191. // SnapshotEncryptionKey: Encrypts the snapshot using a
  23192. // customer-supplied encryption key.
  23193. //
  23194. // After you encrypt a snapshot using a customer-supplied key, you must
  23195. // provide the same key if you use the image later For example, you must
  23196. // provide the encryption key when you create a disk from the encrypted
  23197. // snapshot in a future request.
  23198. //
  23199. // Customer-supplied encryption keys do not protect access to metadata
  23200. // of the disk.
  23201. //
  23202. // If you do not provide an encryption key when creating the snapshot,
  23203. // then the snapshot will be encrypted using an automatically generated
  23204. // key and you do not need to provide a key to use the snapshot later.
  23205. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  23206. // SourceDisk: [Output Only] The source disk used to create this
  23207. // snapshot.
  23208. SourceDisk string `json:"sourceDisk,omitempty"`
  23209. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  23210. // source disk. Required if the source disk is protected by a
  23211. // customer-supplied encryption key.
  23212. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  23213. // SourceDiskId: [Output Only] The ID value of the disk used to create
  23214. // this snapshot. This value may be used to determine whether the
  23215. // snapshot was taken from the current or a previous instance of a given
  23216. // disk name.
  23217. SourceDiskId string `json:"sourceDiskId,omitempty"`
  23218. // Status: [Output Only] The status of the snapshot. This can be
  23219. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  23220. //
  23221. // Possible values:
  23222. // "CREATING"
  23223. // "DELETING"
  23224. // "FAILED"
  23225. // "READY"
  23226. // "UPLOADING"
  23227. Status string `json:"status,omitempty"`
  23228. // StorageBytes: [Output Only] A size of the storage used by the
  23229. // snapshot. As snapshots share storage, this number is expected to
  23230. // change with snapshot creation/deletion.
  23231. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  23232. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  23233. // is in a stable state or it is being adjusted as a result of shared
  23234. // storage reallocation. This status can either be UPDATING, meaning the
  23235. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  23236. // size of the snapshot is up-to-date.
  23237. //
  23238. // Possible values:
  23239. // "UPDATING"
  23240. // "UP_TO_DATE"
  23241. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  23242. // StorageLocations: GCS bucket storage location of the snapshot
  23243. // (regional or multi-regional).
  23244. StorageLocations []string `json:"storageLocations,omitempty"`
  23245. // ServerResponse contains the HTTP response code and headers from the
  23246. // server.
  23247. googleapi.ServerResponse `json:"-"`
  23248. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  23249. // unconditionally include in API requests. By default, fields with
  23250. // empty values are omitted from API requests. However, any non-pointer,
  23251. // non-interface field appearing in ForceSendFields will be sent to the
  23252. // server regardless of whether the field is empty or not. This may be
  23253. // used to include empty fields in Patch requests.
  23254. ForceSendFields []string `json:"-"`
  23255. // NullFields is a list of field names (e.g. "AutoCreated") to include
  23256. // in API requests with the JSON null value. By default, fields with
  23257. // empty values are omitted from API requests. However, any field with
  23258. // an empty value appearing in NullFields will be sent to the server as
  23259. // null. It is an error if a field in this list has a non-empty value.
  23260. // This may be used to include null fields in Patch requests.
  23261. NullFields []string `json:"-"`
  23262. }
  23263. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  23264. type NoMethod Snapshot
  23265. raw := NoMethod(*s)
  23266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23267. }
  23268. // SnapshotList: Contains a list of Snapshot resources.
  23269. type SnapshotList struct {
  23270. // Id: [Output Only] Unique identifier for the resource; defined by the
  23271. // server.
  23272. Id string `json:"id,omitempty"`
  23273. // Items: A list of Snapshot resources.
  23274. Items []*Snapshot `json:"items,omitempty"`
  23275. // Kind: Type of resource.
  23276. Kind string `json:"kind,omitempty"`
  23277. // NextPageToken: [Output Only] This token allows you to get the next
  23278. // page of results for list requests. If the number of results is larger
  23279. // than maxResults, use the nextPageToken as a value for the query
  23280. // parameter pageToken in the next list request. Subsequent list
  23281. // requests will have their own nextPageToken to continue paging through
  23282. // the results.
  23283. NextPageToken string `json:"nextPageToken,omitempty"`
  23284. // SelfLink: [Output Only] Server-defined URL for this resource.
  23285. SelfLink string `json:"selfLink,omitempty"`
  23286. // Warning: [Output Only] Informational warning message.
  23287. Warning *SnapshotListWarning `json:"warning,omitempty"`
  23288. // ServerResponse contains the HTTP response code and headers from the
  23289. // server.
  23290. googleapi.ServerResponse `json:"-"`
  23291. // ForceSendFields is a list of field names (e.g. "Id") to
  23292. // unconditionally include in API requests. By default, fields with
  23293. // empty values are omitted from API requests. However, any non-pointer,
  23294. // non-interface field appearing in ForceSendFields will be sent to the
  23295. // server regardless of whether the field is empty or not. This may be
  23296. // used to include empty fields in Patch requests.
  23297. ForceSendFields []string `json:"-"`
  23298. // NullFields is a list of field names (e.g. "Id") to include in API
  23299. // requests with the JSON null value. By default, fields with empty
  23300. // values are omitted from API requests. However, any field with an
  23301. // empty value appearing in NullFields will be sent to the server as
  23302. // null. It is an error if a field in this list has a non-empty value.
  23303. // This may be used to include null fields in Patch requests.
  23304. NullFields []string `json:"-"`
  23305. }
  23306. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  23307. type NoMethod SnapshotList
  23308. raw := NoMethod(*s)
  23309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23310. }
  23311. // SnapshotListWarning: [Output Only] Informational warning message.
  23312. type SnapshotListWarning struct {
  23313. // Code: [Output Only] A warning code, if applicable. For example,
  23314. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23315. // the response.
  23316. //
  23317. // Possible values:
  23318. // "CLEANUP_FAILED"
  23319. // "DEPRECATED_RESOURCE_USED"
  23320. // "DEPRECATED_TYPE_USED"
  23321. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23322. // "EXPERIMENTAL_TYPE_USED"
  23323. // "EXTERNAL_API_WARNING"
  23324. // "FIELD_VALUE_OVERRIDEN"
  23325. // "INJECTED_KERNELS_DEPRECATED"
  23326. // "MISSING_TYPE_DEPENDENCY"
  23327. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23328. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23329. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23330. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23331. // "NEXT_HOP_NOT_RUNNING"
  23332. // "NOT_CRITICAL_ERROR"
  23333. // "NO_RESULTS_ON_PAGE"
  23334. // "REQUIRED_TOS_AGREEMENT"
  23335. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23336. // "RESOURCE_NOT_DELETED"
  23337. // "SCHEMA_VALIDATION_IGNORED"
  23338. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23339. // "UNDECLARED_PROPERTIES"
  23340. // "UNREACHABLE"
  23341. Code string `json:"code,omitempty"`
  23342. // Data: [Output Only] Metadata about this warning in key: value format.
  23343. // For example:
  23344. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23345. Data []*SnapshotListWarningData `json:"data,omitempty"`
  23346. // Message: [Output Only] A human-readable description of the warning
  23347. // code.
  23348. Message string `json:"message,omitempty"`
  23349. // ForceSendFields is a list of field names (e.g. "Code") to
  23350. // unconditionally include in API requests. By default, fields with
  23351. // empty values are omitted from API requests. However, any non-pointer,
  23352. // non-interface field appearing in ForceSendFields will be sent to the
  23353. // server regardless of whether the field is empty or not. This may be
  23354. // used to include empty fields in Patch requests.
  23355. ForceSendFields []string `json:"-"`
  23356. // NullFields is a list of field names (e.g. "Code") to include in API
  23357. // requests with the JSON null value. By default, fields with empty
  23358. // values are omitted from API requests. However, any field with an
  23359. // empty value appearing in NullFields will be sent to the server as
  23360. // null. It is an error if a field in this list has a non-empty value.
  23361. // This may be used to include null fields in Patch requests.
  23362. NullFields []string `json:"-"`
  23363. }
  23364. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  23365. type NoMethod SnapshotListWarning
  23366. raw := NoMethod(*s)
  23367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23368. }
  23369. type SnapshotListWarningData struct {
  23370. // Key: [Output Only] A key that provides more detail on the warning
  23371. // being returned. For example, for warnings where there are no results
  23372. // in a list request for a particular zone, this key might be scope and
  23373. // the key value might be the zone name. Other examples might be a key
  23374. // indicating a deprecated resource and a suggested replacement, or a
  23375. // warning about invalid network settings (for example, if an instance
  23376. // attempts to perform IP forwarding but is not enabled for IP
  23377. // forwarding).
  23378. Key string `json:"key,omitempty"`
  23379. // Value: [Output Only] A warning data value corresponding to the key.
  23380. Value string `json:"value,omitempty"`
  23381. // ForceSendFields is a list of field names (e.g. "Key") to
  23382. // unconditionally include in API requests. By default, fields with
  23383. // empty values are omitted from API requests. However, any non-pointer,
  23384. // non-interface field appearing in ForceSendFields will be sent to the
  23385. // server regardless of whether the field is empty or not. This may be
  23386. // used to include empty fields in Patch requests.
  23387. ForceSendFields []string `json:"-"`
  23388. // NullFields is a list of field names (e.g. "Key") to include in API
  23389. // requests with the JSON null value. By default, fields with empty
  23390. // values are omitted from API requests. However, any field with an
  23391. // empty value appearing in NullFields will be sent to the server as
  23392. // null. It is an error if a field in this list has a non-empty value.
  23393. // This may be used to include null fields in Patch requests.
  23394. NullFields []string `json:"-"`
  23395. }
  23396. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  23397. type NoMethod SnapshotListWarningData
  23398. raw := NoMethod(*s)
  23399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23400. }
  23401. // SourceInstanceParams: A specification of the parameters to use when
  23402. // creating the instance template from a source instance.
  23403. type SourceInstanceParams struct {
  23404. // DiskConfigs: Attached disks configuration. If not provided, defaults
  23405. // are applied: For boot disk and any other R/W disks, new custom images
  23406. // will be created from each disk. For read-only disks, they will be
  23407. // attached in read-only mode. Local SSD disks will be created as blank
  23408. // volumes.
  23409. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  23410. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  23411. // unconditionally include in API requests. By default, fields with
  23412. // empty values are omitted from API requests. However, any non-pointer,
  23413. // non-interface field appearing in ForceSendFields will be sent to the
  23414. // server regardless of whether the field is empty or not. This may be
  23415. // used to include empty fields in Patch requests.
  23416. ForceSendFields []string `json:"-"`
  23417. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  23418. // in API requests with the JSON null value. By default, fields with
  23419. // empty values are omitted from API requests. However, any field with
  23420. // an empty value appearing in NullFields will be sent to the server as
  23421. // null. It is an error if a field in this list has a non-empty value.
  23422. // This may be used to include null fields in Patch requests.
  23423. NullFields []string `json:"-"`
  23424. }
  23425. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  23426. type NoMethod SourceInstanceParams
  23427. raw := NoMethod(*s)
  23428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23429. }
  23430. // SslCertificate: An SslCertificate resource. This resource provides a
  23431. // mechanism to upload an SSL key and certificate to the load balancer
  23432. // to serve secure connections from the user. (== resource_for
  23433. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  23434. type SslCertificate struct {
  23435. // Certificate: A local certificate file. The certificate must be in PEM
  23436. // format. The certificate chain must be no greater than 5 certs long.
  23437. // The chain must include at least one intermediate cert.
  23438. Certificate string `json:"certificate,omitempty"`
  23439. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23440. // format.
  23441. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23442. // Description: An optional description of this resource. Provide this
  23443. // property when you create the resource.
  23444. Description string `json:"description,omitempty"`
  23445. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  23446. ExpireTime string `json:"expireTime,omitempty"`
  23447. // Id: [Output Only] The unique identifier for the resource. This
  23448. // identifier is defined by the server.
  23449. Id uint64 `json:"id,omitempty,string"`
  23450. // Kind: [Output Only] Type of the resource. Always
  23451. // compute#sslCertificate for SSL certificates.
  23452. Kind string `json:"kind,omitempty"`
  23453. // Managed: Configuration and status of a managed SSL certificate.
  23454. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  23455. // Name: Name of the resource. Provided by the client when the resource
  23456. // is created. The name must be 1-63 characters long, and comply with
  23457. // RFC1035. Specifically, the name must be 1-63 characters long and
  23458. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23459. // the first character must be a lowercase letter, and all following
  23460. // characters must be a dash, lowercase letter, or digit, except the
  23461. // last character, which cannot be a dash.
  23462. Name string `json:"name,omitempty"`
  23463. // PrivateKey: A write-only private key in PEM format. Only insert
  23464. // requests will include this field.
  23465. PrivateKey string `json:"privateKey,omitempty"`
  23466. // SelfLink: [Output only] Server-defined URL for the resource.
  23467. SelfLink string `json:"selfLink,omitempty"`
  23468. // SelfManaged: Configuration and status of a self-managed SSL
  23469. // certificate.
  23470. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  23471. // SubjectAlternativeNames: [Output Only] Domains associated with the
  23472. // certificate via Subject Alternative Name.
  23473. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  23474. // Type: (Optional) Specifies the type of SSL certificate, either
  23475. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  23476. // self-managed and the fields certificate and private_key are used.
  23477. //
  23478. // Possible values:
  23479. // "MANAGED"
  23480. // "SELF_MANAGED"
  23481. // "TYPE_UNSPECIFIED"
  23482. Type string `json:"type,omitempty"`
  23483. // ServerResponse contains the HTTP response code and headers from the
  23484. // server.
  23485. googleapi.ServerResponse `json:"-"`
  23486. // ForceSendFields is a list of field names (e.g. "Certificate") to
  23487. // unconditionally include in API requests. By default, fields with
  23488. // empty values are omitted from API requests. However, any non-pointer,
  23489. // non-interface field appearing in ForceSendFields will be sent to the
  23490. // server regardless of whether the field is empty or not. This may be
  23491. // used to include empty fields in Patch requests.
  23492. ForceSendFields []string `json:"-"`
  23493. // NullFields is a list of field names (e.g. "Certificate") to include
  23494. // in API requests with the JSON null value. By default, fields with
  23495. // empty values are omitted from API requests. However, any field with
  23496. // an empty value appearing in NullFields will be sent to the server as
  23497. // null. It is an error if a field in this list has a non-empty value.
  23498. // This may be used to include null fields in Patch requests.
  23499. NullFields []string `json:"-"`
  23500. }
  23501. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  23502. type NoMethod SslCertificate
  23503. raw := NoMethod(*s)
  23504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23505. }
  23506. // SslCertificateList: Contains a list of SslCertificate resources.
  23507. type SslCertificateList struct {
  23508. // Id: [Output Only] Unique identifier for the resource; defined by the
  23509. // server.
  23510. Id string `json:"id,omitempty"`
  23511. // Items: A list of SslCertificate resources.
  23512. Items []*SslCertificate `json:"items,omitempty"`
  23513. // Kind: Type of resource.
  23514. Kind string `json:"kind,omitempty"`
  23515. // NextPageToken: [Output Only] This token allows you to get the next
  23516. // page of results for list requests. If the number of results is larger
  23517. // than maxResults, use the nextPageToken as a value for the query
  23518. // parameter pageToken in the next list request. Subsequent list
  23519. // requests will have their own nextPageToken to continue paging through
  23520. // the results.
  23521. NextPageToken string `json:"nextPageToken,omitempty"`
  23522. // SelfLink: [Output Only] Server-defined URL for this resource.
  23523. SelfLink string `json:"selfLink,omitempty"`
  23524. // Warning: [Output Only] Informational warning message.
  23525. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  23526. // ServerResponse contains the HTTP response code and headers from the
  23527. // server.
  23528. googleapi.ServerResponse `json:"-"`
  23529. // ForceSendFields is a list of field names (e.g. "Id") to
  23530. // unconditionally include in API requests. By default, fields with
  23531. // empty values are omitted from API requests. However, any non-pointer,
  23532. // non-interface field appearing in ForceSendFields will be sent to the
  23533. // server regardless of whether the field is empty or not. This may be
  23534. // used to include empty fields in Patch requests.
  23535. ForceSendFields []string `json:"-"`
  23536. // NullFields is a list of field names (e.g. "Id") to include in API
  23537. // requests with the JSON null value. By default, fields with empty
  23538. // values are omitted from API requests. However, any field with an
  23539. // empty value appearing in NullFields will be sent to the server as
  23540. // null. It is an error if a field in this list has a non-empty value.
  23541. // This may be used to include null fields in Patch requests.
  23542. NullFields []string `json:"-"`
  23543. }
  23544. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  23545. type NoMethod SslCertificateList
  23546. raw := NoMethod(*s)
  23547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23548. }
  23549. // SslCertificateListWarning: [Output Only] Informational warning
  23550. // message.
  23551. type SslCertificateListWarning struct {
  23552. // Code: [Output Only] A warning code, if applicable. For example,
  23553. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23554. // the response.
  23555. //
  23556. // Possible values:
  23557. // "CLEANUP_FAILED"
  23558. // "DEPRECATED_RESOURCE_USED"
  23559. // "DEPRECATED_TYPE_USED"
  23560. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23561. // "EXPERIMENTAL_TYPE_USED"
  23562. // "EXTERNAL_API_WARNING"
  23563. // "FIELD_VALUE_OVERRIDEN"
  23564. // "INJECTED_KERNELS_DEPRECATED"
  23565. // "MISSING_TYPE_DEPENDENCY"
  23566. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23567. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23568. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23569. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23570. // "NEXT_HOP_NOT_RUNNING"
  23571. // "NOT_CRITICAL_ERROR"
  23572. // "NO_RESULTS_ON_PAGE"
  23573. // "REQUIRED_TOS_AGREEMENT"
  23574. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23575. // "RESOURCE_NOT_DELETED"
  23576. // "SCHEMA_VALIDATION_IGNORED"
  23577. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23578. // "UNDECLARED_PROPERTIES"
  23579. // "UNREACHABLE"
  23580. Code string `json:"code,omitempty"`
  23581. // Data: [Output Only] Metadata about this warning in key: value format.
  23582. // For example:
  23583. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23584. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  23585. // Message: [Output Only] A human-readable description of the warning
  23586. // code.
  23587. Message string `json:"message,omitempty"`
  23588. // ForceSendFields is a list of field names (e.g. "Code") to
  23589. // unconditionally include in API requests. By default, fields with
  23590. // empty values are omitted from API requests. However, any non-pointer,
  23591. // non-interface field appearing in ForceSendFields will be sent to the
  23592. // server regardless of whether the field is empty or not. This may be
  23593. // used to include empty fields in Patch requests.
  23594. ForceSendFields []string `json:"-"`
  23595. // NullFields is a list of field names (e.g. "Code") to include in API
  23596. // requests with the JSON null value. By default, fields with empty
  23597. // values are omitted from API requests. However, any field with an
  23598. // empty value appearing in NullFields will be sent to the server as
  23599. // null. It is an error if a field in this list has a non-empty value.
  23600. // This may be used to include null fields in Patch requests.
  23601. NullFields []string `json:"-"`
  23602. }
  23603. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  23604. type NoMethod SslCertificateListWarning
  23605. raw := NoMethod(*s)
  23606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23607. }
  23608. type SslCertificateListWarningData struct {
  23609. // Key: [Output Only] A key that provides more detail on the warning
  23610. // being returned. For example, for warnings where there are no results
  23611. // in a list request for a particular zone, this key might be scope and
  23612. // the key value might be the zone name. Other examples might be a key
  23613. // indicating a deprecated resource and a suggested replacement, or a
  23614. // warning about invalid network settings (for example, if an instance
  23615. // attempts to perform IP forwarding but is not enabled for IP
  23616. // forwarding).
  23617. Key string `json:"key,omitempty"`
  23618. // Value: [Output Only] A warning data value corresponding to the key.
  23619. Value string `json:"value,omitempty"`
  23620. // ForceSendFields is a list of field names (e.g. "Key") to
  23621. // unconditionally include in API requests. By default, fields with
  23622. // empty values are omitted from API requests. However, any non-pointer,
  23623. // non-interface field appearing in ForceSendFields will be sent to the
  23624. // server regardless of whether the field is empty or not. This may be
  23625. // used to include empty fields in Patch requests.
  23626. ForceSendFields []string `json:"-"`
  23627. // NullFields is a list of field names (e.g. "Key") to include in API
  23628. // requests with the JSON null value. By default, fields with empty
  23629. // values are omitted from API requests. However, any field with an
  23630. // empty value appearing in NullFields will be sent to the server as
  23631. // null. It is an error if a field in this list has a non-empty value.
  23632. // This may be used to include null fields in Patch requests.
  23633. NullFields []string `json:"-"`
  23634. }
  23635. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  23636. type NoMethod SslCertificateListWarningData
  23637. raw := NoMethod(*s)
  23638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23639. }
  23640. // SslCertificateManagedSslCertificate: Configuration and status of a
  23641. // managed SSL certificate.
  23642. type SslCertificateManagedSslCertificate struct {
  23643. // DomainStatus: [Output only] Detailed statuses of the domains
  23644. // specified for managed certificate resource.
  23645. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  23646. // Domains: The domains for which a managed SSL certificate will be
  23647. // generated. Currently only single-domain certs are supported.
  23648. Domains []string `json:"domains,omitempty"`
  23649. // Status: [Output only] Status of the managed certificate resource.
  23650. //
  23651. // Possible values:
  23652. // "ACTIVE"
  23653. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  23654. // "PROVISIONING"
  23655. // "PROVISIONING_FAILED"
  23656. // "PROVISIONING_FAILED_PERMANENTLY"
  23657. // "RENEWAL_FAILED"
  23658. Status string `json:"status,omitempty"`
  23659. // ForceSendFields is a list of field names (e.g. "DomainStatus") to
  23660. // unconditionally include in API requests. By default, fields with
  23661. // empty values are omitted from API requests. However, any non-pointer,
  23662. // non-interface field appearing in ForceSendFields will be sent to the
  23663. // server regardless of whether the field is empty or not. This may be
  23664. // used to include empty fields in Patch requests.
  23665. ForceSendFields []string `json:"-"`
  23666. // NullFields is a list of field names (e.g. "DomainStatus") to include
  23667. // in API requests with the JSON null value. By default, fields with
  23668. // empty values are omitted from API requests. However, any field with
  23669. // an empty value appearing in NullFields will be sent to the server as
  23670. // null. It is an error if a field in this list has a non-empty value.
  23671. // This may be used to include null fields in Patch requests.
  23672. NullFields []string `json:"-"`
  23673. }
  23674. func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  23675. type NoMethod SslCertificateManagedSslCertificate
  23676. raw := NoMethod(*s)
  23677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23678. }
  23679. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  23680. // a self-managed SSL certificate.
  23681. type SslCertificateSelfManagedSslCertificate struct {
  23682. // Certificate: A local certificate file. The certificate must be in PEM
  23683. // format. The certificate chain must be no greater than 5 certs long.
  23684. // The chain must include at least one intermediate cert.
  23685. Certificate string `json:"certificate,omitempty"`
  23686. // PrivateKey: A write-only private key in PEM format. Only insert
  23687. // requests will include this field.
  23688. PrivateKey string `json:"privateKey,omitempty"`
  23689. // ForceSendFields is a list of field names (e.g. "Certificate") to
  23690. // unconditionally include in API requests. By default, fields with
  23691. // empty values are omitted from API requests. However, any non-pointer,
  23692. // non-interface field appearing in ForceSendFields will be sent to the
  23693. // server regardless of whether the field is empty or not. This may be
  23694. // used to include empty fields in Patch requests.
  23695. ForceSendFields []string `json:"-"`
  23696. // NullFields is a list of field names (e.g. "Certificate") to include
  23697. // in API requests with the JSON null value. By default, fields with
  23698. // empty values are omitted from API requests. However, any field with
  23699. // an empty value appearing in NullFields will be sent to the server as
  23700. // null. It is an error if a field in this list has a non-empty value.
  23701. // This may be used to include null fields in Patch requests.
  23702. NullFields []string `json:"-"`
  23703. }
  23704. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  23705. type NoMethod SslCertificateSelfManagedSslCertificate
  23706. raw := NoMethod(*s)
  23707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23708. }
  23709. type SslPoliciesList struct {
  23710. // Id: [Output Only] Unique identifier for the resource; defined by the
  23711. // server.
  23712. Id string `json:"id,omitempty"`
  23713. // Items: A list of SslPolicy resources.
  23714. Items []*SslPolicy `json:"items,omitempty"`
  23715. // Kind: [Output Only] Type of the resource. Always
  23716. // compute#sslPoliciesList for lists of sslPolicies.
  23717. Kind string `json:"kind,omitempty"`
  23718. // NextPageToken: [Output Only] This token allows you to get the next
  23719. // page of results for list requests. If the number of results is larger
  23720. // than maxResults, use the nextPageToken as a value for the query
  23721. // parameter pageToken in the next list request. Subsequent list
  23722. // requests will have their own nextPageToken to continue paging through
  23723. // the results.
  23724. NextPageToken string `json:"nextPageToken,omitempty"`
  23725. // SelfLink: [Output Only] Server-defined URL for this resource.
  23726. SelfLink string `json:"selfLink,omitempty"`
  23727. // Warning: [Output Only] Informational warning message.
  23728. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  23729. // ServerResponse contains the HTTP response code and headers from the
  23730. // server.
  23731. googleapi.ServerResponse `json:"-"`
  23732. // ForceSendFields is a list of field names (e.g. "Id") to
  23733. // unconditionally include in API requests. By default, fields with
  23734. // empty values are omitted from API requests. However, any non-pointer,
  23735. // non-interface field appearing in ForceSendFields will be sent to the
  23736. // server regardless of whether the field is empty or not. This may be
  23737. // used to include empty fields in Patch requests.
  23738. ForceSendFields []string `json:"-"`
  23739. // NullFields is a list of field names (e.g. "Id") to include in API
  23740. // requests with the JSON null value. By default, fields with empty
  23741. // values are omitted from API requests. However, any field with an
  23742. // empty value appearing in NullFields will be sent to the server as
  23743. // null. It is an error if a field in this list has a non-empty value.
  23744. // This may be used to include null fields in Patch requests.
  23745. NullFields []string `json:"-"`
  23746. }
  23747. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  23748. type NoMethod SslPoliciesList
  23749. raw := NoMethod(*s)
  23750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23751. }
  23752. // SslPoliciesListWarning: [Output Only] Informational warning message.
  23753. type SslPoliciesListWarning struct {
  23754. // Code: [Output Only] A warning code, if applicable. For example,
  23755. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23756. // the response.
  23757. //
  23758. // Possible values:
  23759. // "CLEANUP_FAILED"
  23760. // "DEPRECATED_RESOURCE_USED"
  23761. // "DEPRECATED_TYPE_USED"
  23762. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23763. // "EXPERIMENTAL_TYPE_USED"
  23764. // "EXTERNAL_API_WARNING"
  23765. // "FIELD_VALUE_OVERRIDEN"
  23766. // "INJECTED_KERNELS_DEPRECATED"
  23767. // "MISSING_TYPE_DEPENDENCY"
  23768. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23769. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23770. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23771. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23772. // "NEXT_HOP_NOT_RUNNING"
  23773. // "NOT_CRITICAL_ERROR"
  23774. // "NO_RESULTS_ON_PAGE"
  23775. // "REQUIRED_TOS_AGREEMENT"
  23776. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23777. // "RESOURCE_NOT_DELETED"
  23778. // "SCHEMA_VALIDATION_IGNORED"
  23779. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23780. // "UNDECLARED_PROPERTIES"
  23781. // "UNREACHABLE"
  23782. Code string `json:"code,omitempty"`
  23783. // Data: [Output Only] Metadata about this warning in key: value format.
  23784. // For example:
  23785. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23786. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  23787. // Message: [Output Only] A human-readable description of the warning
  23788. // code.
  23789. Message string `json:"message,omitempty"`
  23790. // ForceSendFields is a list of field names (e.g. "Code") to
  23791. // unconditionally include in API requests. By default, fields with
  23792. // empty values are omitted from API requests. However, any non-pointer,
  23793. // non-interface field appearing in ForceSendFields will be sent to the
  23794. // server regardless of whether the field is empty or not. This may be
  23795. // used to include empty fields in Patch requests.
  23796. ForceSendFields []string `json:"-"`
  23797. // NullFields is a list of field names (e.g. "Code") to include in API
  23798. // requests with the JSON null value. By default, fields with empty
  23799. // values are omitted from API requests. However, any field with an
  23800. // empty value appearing in NullFields will be sent to the server as
  23801. // null. It is an error if a field in this list has a non-empty value.
  23802. // This may be used to include null fields in Patch requests.
  23803. NullFields []string `json:"-"`
  23804. }
  23805. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  23806. type NoMethod SslPoliciesListWarning
  23807. raw := NoMethod(*s)
  23808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23809. }
  23810. type SslPoliciesListWarningData struct {
  23811. // Key: [Output Only] A key that provides more detail on the warning
  23812. // being returned. For example, for warnings where there are no results
  23813. // in a list request for a particular zone, this key might be scope and
  23814. // the key value might be the zone name. Other examples might be a key
  23815. // indicating a deprecated resource and a suggested replacement, or a
  23816. // warning about invalid network settings (for example, if an instance
  23817. // attempts to perform IP forwarding but is not enabled for IP
  23818. // forwarding).
  23819. Key string `json:"key,omitempty"`
  23820. // Value: [Output Only] A warning data value corresponding to the key.
  23821. Value string `json:"value,omitempty"`
  23822. // ForceSendFields is a list of field names (e.g. "Key") to
  23823. // unconditionally include in API requests. By default, fields with
  23824. // empty values are omitted from API requests. However, any non-pointer,
  23825. // non-interface field appearing in ForceSendFields will be sent to the
  23826. // server regardless of whether the field is empty or not. This may be
  23827. // used to include empty fields in Patch requests.
  23828. ForceSendFields []string `json:"-"`
  23829. // NullFields is a list of field names (e.g. "Key") to include in API
  23830. // requests with the JSON null value. By default, fields with empty
  23831. // values are omitted from API requests. However, any field with an
  23832. // empty value appearing in NullFields will be sent to the server as
  23833. // null. It is an error if a field in this list has a non-empty value.
  23834. // This may be used to include null fields in Patch requests.
  23835. NullFields []string `json:"-"`
  23836. }
  23837. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  23838. type NoMethod SslPoliciesListWarningData
  23839. raw := NoMethod(*s)
  23840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23841. }
  23842. type SslPoliciesListAvailableFeaturesResponse struct {
  23843. Features []string `json:"features,omitempty"`
  23844. // ServerResponse contains the HTTP response code and headers from the
  23845. // server.
  23846. googleapi.ServerResponse `json:"-"`
  23847. // ForceSendFields is a list of field names (e.g. "Features") to
  23848. // unconditionally include in API requests. By default, fields with
  23849. // empty values are omitted from API requests. However, any non-pointer,
  23850. // non-interface field appearing in ForceSendFields will be sent to the
  23851. // server regardless of whether the field is empty or not. This may be
  23852. // used to include empty fields in Patch requests.
  23853. ForceSendFields []string `json:"-"`
  23854. // NullFields is a list of field names (e.g. "Features") to include in
  23855. // API requests with the JSON null value. By default, fields with empty
  23856. // values are omitted from API requests. However, any field with an
  23857. // empty value appearing in NullFields will be sent to the server as
  23858. // null. It is an error if a field in this list has a non-empty value.
  23859. // This may be used to include null fields in Patch requests.
  23860. NullFields []string `json:"-"`
  23861. }
  23862. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  23863. type NoMethod SslPoliciesListAvailableFeaturesResponse
  23864. raw := NoMethod(*s)
  23865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23866. }
  23867. // SslPolicy: A SSL policy specifies the server-side support for SSL
  23868. // features. This can be attached to a TargetHttpsProxy or a
  23869. // TargetSslProxy. This affects connections between clients and the
  23870. // HTTPS or SSL proxy load balancer. They do not affect the connection
  23871. // between the load balancers and the backends.
  23872. type SslPolicy struct {
  23873. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23874. // format.
  23875. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23876. // CustomFeatures: A list of features enabled when the selected profile
  23877. // is CUSTOM. The
  23878. // - method returns the set of features that can be specified in this
  23879. // list. This field must be empty if the profile is not CUSTOM.
  23880. CustomFeatures []string `json:"customFeatures,omitempty"`
  23881. // Description: An optional description of this resource. Provide this
  23882. // property when you create the resource.
  23883. Description string `json:"description,omitempty"`
  23884. // EnabledFeatures: [Output Only] The list of features enabled in the
  23885. // SSL policy.
  23886. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  23887. // Fingerprint: Fingerprint of this resource. A hash of the contents
  23888. // stored in this object. This field is used in optimistic locking. This
  23889. // field will be ignored when inserting a SslPolicy. An up-to-date
  23890. // fingerprint must be provided in order to update the SslPolicy,
  23891. // otherwise the request will fail with error 412 conditionNotMet.
  23892. //
  23893. // To see the latest fingerprint, make a get() request to retrieve an
  23894. // SslPolicy.
  23895. Fingerprint string `json:"fingerprint,omitempty"`
  23896. // Id: [Output Only] The unique identifier for the resource. This
  23897. // identifier is defined by the server.
  23898. Id uint64 `json:"id,omitempty,string"`
  23899. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  23900. // SSL policies.
  23901. Kind string `json:"kind,omitempty"`
  23902. // MinTlsVersion: The minimum version of SSL protocol that can be used
  23903. // by the clients to establish a connection with the load balancer. This
  23904. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  23905. //
  23906. // Possible values:
  23907. // "TLS_1_0"
  23908. // "TLS_1_1"
  23909. // "TLS_1_2"
  23910. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  23911. // Name: Name of the resource. The name must be 1-63 characters long,
  23912. // and comply with RFC1035. Specifically, the name must be 1-63
  23913. // characters long and match the regular expression
  23914. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  23915. // a lowercase letter, and all following characters must be a dash,
  23916. // lowercase letter, or digit, except the last character, which cannot
  23917. // be a dash.
  23918. Name string `json:"name,omitempty"`
  23919. // Profile: Profile specifies the set of SSL features that can be used
  23920. // by the load balancer when negotiating SSL with clients. This can be
  23921. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  23922. // the set of SSL features to enable must be specified in the
  23923. // customFeatures field.
  23924. //
  23925. // Possible values:
  23926. // "COMPATIBLE"
  23927. // "CUSTOM"
  23928. // "MODERN"
  23929. // "RESTRICTED"
  23930. Profile string `json:"profile,omitempty"`
  23931. // SelfLink: [Output Only] Server-defined URL for the resource.
  23932. SelfLink string `json:"selfLink,omitempty"`
  23933. // Warnings: [Output Only] If potential misconfigurations are detected
  23934. // for this SSL policy, this field will be populated with warning
  23935. // messages.
  23936. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  23937. // ServerResponse contains the HTTP response code and headers from the
  23938. // server.
  23939. googleapi.ServerResponse `json:"-"`
  23940. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23941. // to unconditionally include in API requests. By default, fields with
  23942. // empty values are omitted from API requests. However, any non-pointer,
  23943. // non-interface field appearing in ForceSendFields will be sent to the
  23944. // server regardless of whether the field is empty or not. This may be
  23945. // used to include empty fields in Patch requests.
  23946. ForceSendFields []string `json:"-"`
  23947. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23948. // include in API requests with the JSON null value. By default, fields
  23949. // with empty values are omitted from API requests. However, any field
  23950. // with an empty value appearing in NullFields will be sent to the
  23951. // server as null. It is an error if a field in this list has a
  23952. // non-empty value. This may be used to include null fields in Patch
  23953. // requests.
  23954. NullFields []string `json:"-"`
  23955. }
  23956. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  23957. type NoMethod SslPolicy
  23958. raw := NoMethod(*s)
  23959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23960. }
  23961. type SslPolicyWarnings struct {
  23962. // Code: [Output Only] A warning code, if applicable. For example,
  23963. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23964. // the response.
  23965. //
  23966. // Possible values:
  23967. // "CLEANUP_FAILED"
  23968. // "DEPRECATED_RESOURCE_USED"
  23969. // "DEPRECATED_TYPE_USED"
  23970. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23971. // "EXPERIMENTAL_TYPE_USED"
  23972. // "EXTERNAL_API_WARNING"
  23973. // "FIELD_VALUE_OVERRIDEN"
  23974. // "INJECTED_KERNELS_DEPRECATED"
  23975. // "MISSING_TYPE_DEPENDENCY"
  23976. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23977. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23978. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23979. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23980. // "NEXT_HOP_NOT_RUNNING"
  23981. // "NOT_CRITICAL_ERROR"
  23982. // "NO_RESULTS_ON_PAGE"
  23983. // "REQUIRED_TOS_AGREEMENT"
  23984. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23985. // "RESOURCE_NOT_DELETED"
  23986. // "SCHEMA_VALIDATION_IGNORED"
  23987. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23988. // "UNDECLARED_PROPERTIES"
  23989. // "UNREACHABLE"
  23990. Code string `json:"code,omitempty"`
  23991. // Data: [Output Only] Metadata about this warning in key: value format.
  23992. // For example:
  23993. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23994. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  23995. // Message: [Output Only] A human-readable description of the warning
  23996. // code.
  23997. Message string `json:"message,omitempty"`
  23998. // ForceSendFields is a list of field names (e.g. "Code") to
  23999. // unconditionally include in API requests. By default, fields with
  24000. // empty values are omitted from API requests. However, any non-pointer,
  24001. // non-interface field appearing in ForceSendFields will be sent to the
  24002. // server regardless of whether the field is empty or not. This may be
  24003. // used to include empty fields in Patch requests.
  24004. ForceSendFields []string `json:"-"`
  24005. // NullFields is a list of field names (e.g. "Code") to include in API
  24006. // requests with the JSON null value. By default, fields with empty
  24007. // values are omitted from API requests. However, any field with an
  24008. // empty value appearing in NullFields will be sent to the server as
  24009. // null. It is an error if a field in this list has a non-empty value.
  24010. // This may be used to include null fields in Patch requests.
  24011. NullFields []string `json:"-"`
  24012. }
  24013. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  24014. type NoMethod SslPolicyWarnings
  24015. raw := NoMethod(*s)
  24016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24017. }
  24018. type SslPolicyWarningsData struct {
  24019. // Key: [Output Only] A key that provides more detail on the warning
  24020. // being returned. For example, for warnings where there are no results
  24021. // in a list request for a particular zone, this key might be scope and
  24022. // the key value might be the zone name. Other examples might be a key
  24023. // indicating a deprecated resource and a suggested replacement, or a
  24024. // warning about invalid network settings (for example, if an instance
  24025. // attempts to perform IP forwarding but is not enabled for IP
  24026. // forwarding).
  24027. Key string `json:"key,omitempty"`
  24028. // Value: [Output Only] A warning data value corresponding to the key.
  24029. Value string `json:"value,omitempty"`
  24030. // ForceSendFields is a list of field names (e.g. "Key") to
  24031. // unconditionally include in API requests. By default, fields with
  24032. // empty values are omitted from API requests. However, any non-pointer,
  24033. // non-interface field appearing in ForceSendFields will be sent to the
  24034. // server regardless of whether the field is empty or not. This may be
  24035. // used to include empty fields in Patch requests.
  24036. ForceSendFields []string `json:"-"`
  24037. // NullFields is a list of field names (e.g. "Key") to include in API
  24038. // requests with the JSON null value. By default, fields with empty
  24039. // values are omitted from API requests. However, any field with an
  24040. // empty value appearing in NullFields will be sent to the server as
  24041. // null. It is an error if a field in this list has a non-empty value.
  24042. // This may be used to include null fields in Patch requests.
  24043. NullFields []string `json:"-"`
  24044. }
  24045. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  24046. type NoMethod SslPolicyWarningsData
  24047. raw := NoMethod(*s)
  24048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24049. }
  24050. type SslPolicyReference struct {
  24051. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  24052. // to clear any existing SSL policy associated with the target proxy
  24053. // resource.
  24054. SslPolicy string `json:"sslPolicy,omitempty"`
  24055. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  24056. // unconditionally include in API requests. By default, fields with
  24057. // empty values are omitted from API requests. However, any non-pointer,
  24058. // non-interface field appearing in ForceSendFields will be sent to the
  24059. // server regardless of whether the field is empty or not. This may be
  24060. // used to include empty fields in Patch requests.
  24061. ForceSendFields []string `json:"-"`
  24062. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  24063. // API requests with the JSON null value. By default, fields with empty
  24064. // values are omitted from API requests. However, any field with an
  24065. // empty value appearing in NullFields will be sent to the server as
  24066. // null. It is an error if a field in this list has a non-empty value.
  24067. // This may be used to include null fields in Patch requests.
  24068. NullFields []string `json:"-"`
  24069. }
  24070. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  24071. type NoMethod SslPolicyReference
  24072. raw := NoMethod(*s)
  24073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24074. }
  24075. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  24076. // ==) (== resource_for v1.subnetworks ==)
  24077. type Subnetwork struct {
  24078. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  24079. // with static routes. Setting this to true allows this subnetwork's
  24080. // primary and secondary ranges to conflict with routes that have
  24081. // already been configured on the corresponding network. Static routes
  24082. // will take precedence over the subnetwork route if the route prefix
  24083. // length is at least as large as the subnetwork prefix length.
  24084. //
  24085. // Also, packets destined to IPs within subnetwork may contain
  24086. // private/sensitive data and are prevented from leaving the virtual
  24087. // network. Setting this field to true will disable this feature.
  24088. //
  24089. // The default value is false and applies to all existing subnetworks
  24090. // and automatically created subnetworks.
  24091. //
  24092. // This field cannot be set to true at resource creation time.
  24093. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  24094. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24095. // format.
  24096. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24097. // Description: An optional description of this resource. Provide this
  24098. // property when you create the resource. This field can be set only at
  24099. // resource creation time.
  24100. Description string `json:"description,omitempty"`
  24101. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  24102. // If this field is not explicitly set, it will not appear in get
  24103. // listings. If not set the default behavior is to disable flow logging.
  24104. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  24105. // Fingerprint: Fingerprint of this resource. A hash of the contents
  24106. // stored in this object. This field is used in optimistic locking. This
  24107. // field will be ignored when inserting a Subnetwork. An up-to-date
  24108. // fingerprint must be provided in order to update the Subnetwork,
  24109. // otherwise the request will fail with error 412 conditionNotMet.
  24110. //
  24111. // To see the latest fingerprint, make a get() request to retrieve a
  24112. // Subnetwork.
  24113. Fingerprint string `json:"fingerprint,omitempty"`
  24114. // GatewayAddress: [Output Only] The gateway address for default routes
  24115. // to reach destination addresses outside this subnetwork.
  24116. GatewayAddress string `json:"gatewayAddress,omitempty"`
  24117. // Id: [Output Only] The unique identifier for the resource. This
  24118. // identifier is defined by the server.
  24119. Id uint64 `json:"id,omitempty,string"`
  24120. // IpCidrRange: The range of internal addresses that are owned by this
  24121. // subnetwork. Provide this property when you create the subnetwork. For
  24122. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  24123. // non-overlapping within a network. Only IPv4 is supported. This field
  24124. // can be set only at resource creation time.
  24125. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24126. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  24127. // for Subnetwork resources.
  24128. Kind string `json:"kind,omitempty"`
  24129. // Name: The name of the resource, provided by the client when initially
  24130. // creating the resource. The name must be 1-63 characters long, and
  24131. // comply with RFC1035. Specifically, the name must be 1-63 characters
  24132. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  24133. // which means the first character must be a lowercase letter, and all
  24134. // following characters must be a dash, lowercase letter, or digit,
  24135. // except the last character, which cannot be a dash.
  24136. Name string `json:"name,omitempty"`
  24137. // Network: The URL of the network to which this subnetwork belongs,
  24138. // provided by the client when initially creating the subnetwork. Only
  24139. // networks that are in the distributed mode can have subnetworks. This
  24140. // field can be set only at resource creation time.
  24141. Network string `json:"network,omitempty"`
  24142. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  24143. // Google services without assigned external IP addresses. This field
  24144. // can be both set at resource creation time and updated using
  24145. // setPrivateIpGoogleAccess.
  24146. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  24147. // Region: URL of the region where the Subnetwork resides. This field
  24148. // can be set only at resource creation time.
  24149. Region string `json:"region,omitempty"`
  24150. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  24151. // for VM instances contained in this subnetwork. The primary IP of such
  24152. // VM must belong to the primary ipCidrRange of the subnetwork. The
  24153. // alias IPs may belong to either primary or secondary ranges. This
  24154. // field can be updated with a patch request.
  24155. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  24156. // SelfLink: [Output Only] Server-defined URL for the resource.
  24157. SelfLink string `json:"selfLink,omitempty"`
  24158. // ServerResponse contains the HTTP response code and headers from the
  24159. // server.
  24160. googleapi.ServerResponse `json:"-"`
  24161. // ForceSendFields is a list of field names (e.g.
  24162. // "AllowSubnetCidrRoutesOverlap") to unconditionally include in API
  24163. // requests. By default, fields with empty values are omitted from API
  24164. // requests. However, any non-pointer, non-interface field appearing in
  24165. // ForceSendFields will be sent to the server regardless of whether the
  24166. // field is empty or not. This may be used to include empty fields in
  24167. // Patch requests.
  24168. ForceSendFields []string `json:"-"`
  24169. // NullFields is a list of field names (e.g.
  24170. // "AllowSubnetCidrRoutesOverlap") to include in API requests with the
  24171. // JSON null value. By default, fields with empty values are omitted
  24172. // from API requests. However, any field with an empty value appearing
  24173. // in NullFields will be sent to the server as null. It is an error if a
  24174. // field in this list has a non-empty value. This may be used to include
  24175. // null fields in Patch requests.
  24176. NullFields []string `json:"-"`
  24177. }
  24178. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  24179. type NoMethod Subnetwork
  24180. raw := NoMethod(*s)
  24181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24182. }
  24183. type SubnetworkAggregatedList struct {
  24184. // Id: [Output Only] Unique identifier for the resource; defined by the
  24185. // server.
  24186. Id string `json:"id,omitempty"`
  24187. // Items: A list of SubnetworksScopedList resources.
  24188. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  24189. // Kind: [Output Only] Type of resource. Always
  24190. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  24191. Kind string `json:"kind,omitempty"`
  24192. // NextPageToken: [Output Only] This token allows you to get the next
  24193. // page of results for list requests. If the number of results is larger
  24194. // than maxResults, use the nextPageToken as a value for the query
  24195. // parameter pageToken in the next list request. Subsequent list
  24196. // requests will have their own nextPageToken to continue paging through
  24197. // the results.
  24198. NextPageToken string `json:"nextPageToken,omitempty"`
  24199. // SelfLink: [Output Only] Server-defined URL for this resource.
  24200. SelfLink string `json:"selfLink,omitempty"`
  24201. // Warning: [Output Only] Informational warning message.
  24202. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  24203. // ServerResponse contains the HTTP response code and headers from the
  24204. // server.
  24205. googleapi.ServerResponse `json:"-"`
  24206. // ForceSendFields is a list of field names (e.g. "Id") to
  24207. // unconditionally include in API requests. By default, fields with
  24208. // empty values are omitted from API requests. However, any non-pointer,
  24209. // non-interface field appearing in ForceSendFields will be sent to the
  24210. // server regardless of whether the field is empty or not. This may be
  24211. // used to include empty fields in Patch requests.
  24212. ForceSendFields []string `json:"-"`
  24213. // NullFields is a list of field names (e.g. "Id") to include in API
  24214. // requests with the JSON null value. By default, fields with empty
  24215. // values are omitted from API requests. However, any field with an
  24216. // empty value appearing in NullFields will be sent to the server as
  24217. // null. It is an error if a field in this list has a non-empty value.
  24218. // This may be used to include null fields in Patch requests.
  24219. NullFields []string `json:"-"`
  24220. }
  24221. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  24222. type NoMethod SubnetworkAggregatedList
  24223. raw := NoMethod(*s)
  24224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24225. }
  24226. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  24227. // message.
  24228. type SubnetworkAggregatedListWarning struct {
  24229. // Code: [Output Only] A warning code, if applicable. For example,
  24230. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24231. // the response.
  24232. //
  24233. // Possible values:
  24234. // "CLEANUP_FAILED"
  24235. // "DEPRECATED_RESOURCE_USED"
  24236. // "DEPRECATED_TYPE_USED"
  24237. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24238. // "EXPERIMENTAL_TYPE_USED"
  24239. // "EXTERNAL_API_WARNING"
  24240. // "FIELD_VALUE_OVERRIDEN"
  24241. // "INJECTED_KERNELS_DEPRECATED"
  24242. // "MISSING_TYPE_DEPENDENCY"
  24243. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24244. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24245. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24246. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24247. // "NEXT_HOP_NOT_RUNNING"
  24248. // "NOT_CRITICAL_ERROR"
  24249. // "NO_RESULTS_ON_PAGE"
  24250. // "REQUIRED_TOS_AGREEMENT"
  24251. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24252. // "RESOURCE_NOT_DELETED"
  24253. // "SCHEMA_VALIDATION_IGNORED"
  24254. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24255. // "UNDECLARED_PROPERTIES"
  24256. // "UNREACHABLE"
  24257. Code string `json:"code,omitempty"`
  24258. // Data: [Output Only] Metadata about this warning in key: value format.
  24259. // For example:
  24260. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24261. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  24262. // Message: [Output Only] A human-readable description of the warning
  24263. // code.
  24264. Message string `json:"message,omitempty"`
  24265. // ForceSendFields is a list of field names (e.g. "Code") to
  24266. // unconditionally include in API requests. By default, fields with
  24267. // empty values are omitted from API requests. However, any non-pointer,
  24268. // non-interface field appearing in ForceSendFields will be sent to the
  24269. // server regardless of whether the field is empty or not. This may be
  24270. // used to include empty fields in Patch requests.
  24271. ForceSendFields []string `json:"-"`
  24272. // NullFields is a list of field names (e.g. "Code") to include in API
  24273. // requests with the JSON null value. By default, fields with empty
  24274. // values are omitted from API requests. However, any field with an
  24275. // empty value appearing in NullFields will be sent to the server as
  24276. // null. It is an error if a field in this list has a non-empty value.
  24277. // This may be used to include null fields in Patch requests.
  24278. NullFields []string `json:"-"`
  24279. }
  24280. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  24281. type NoMethod SubnetworkAggregatedListWarning
  24282. raw := NoMethod(*s)
  24283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24284. }
  24285. type SubnetworkAggregatedListWarningData struct {
  24286. // Key: [Output Only] A key that provides more detail on the warning
  24287. // being returned. For example, for warnings where there are no results
  24288. // in a list request for a particular zone, this key might be scope and
  24289. // the key value might be the zone name. Other examples might be a key
  24290. // indicating a deprecated resource and a suggested replacement, or a
  24291. // warning about invalid network settings (for example, if an instance
  24292. // attempts to perform IP forwarding but is not enabled for IP
  24293. // forwarding).
  24294. Key string `json:"key,omitempty"`
  24295. // Value: [Output Only] A warning data value corresponding to the key.
  24296. Value string `json:"value,omitempty"`
  24297. // ForceSendFields is a list of field names (e.g. "Key") to
  24298. // unconditionally include in API requests. By default, fields with
  24299. // empty values are omitted from API requests. However, any non-pointer,
  24300. // non-interface field appearing in ForceSendFields will be sent to the
  24301. // server regardless of whether the field is empty or not. This may be
  24302. // used to include empty fields in Patch requests.
  24303. ForceSendFields []string `json:"-"`
  24304. // NullFields is a list of field names (e.g. "Key") to include in API
  24305. // requests with the JSON null value. By default, fields with empty
  24306. // values are omitted from API requests. However, any field with an
  24307. // empty value appearing in NullFields will be sent to the server as
  24308. // null. It is an error if a field in this list has a non-empty value.
  24309. // This may be used to include null fields in Patch requests.
  24310. NullFields []string `json:"-"`
  24311. }
  24312. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  24313. type NoMethod SubnetworkAggregatedListWarningData
  24314. raw := NoMethod(*s)
  24315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24316. }
  24317. // SubnetworkList: Contains a list of Subnetwork resources.
  24318. type SubnetworkList struct {
  24319. // Id: [Output Only] Unique identifier for the resource; defined by the
  24320. // server.
  24321. Id string `json:"id,omitempty"`
  24322. // Items: A list of Subnetwork resources.
  24323. Items []*Subnetwork `json:"items,omitempty"`
  24324. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  24325. // for lists of subnetworks.
  24326. Kind string `json:"kind,omitempty"`
  24327. // NextPageToken: [Output Only] This token allows you to get the next
  24328. // page of results for list requests. If the number of results is larger
  24329. // than maxResults, use the nextPageToken as a value for the query
  24330. // parameter pageToken in the next list request. Subsequent list
  24331. // requests will have their own nextPageToken to continue paging through
  24332. // the results.
  24333. NextPageToken string `json:"nextPageToken,omitempty"`
  24334. // SelfLink: [Output Only] Server-defined URL for this resource.
  24335. SelfLink string `json:"selfLink,omitempty"`
  24336. // Warning: [Output Only] Informational warning message.
  24337. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  24338. // ServerResponse contains the HTTP response code and headers from the
  24339. // server.
  24340. googleapi.ServerResponse `json:"-"`
  24341. // ForceSendFields is a list of field names (e.g. "Id") to
  24342. // unconditionally include in API requests. By default, fields with
  24343. // empty values are omitted from API requests. However, any non-pointer,
  24344. // non-interface field appearing in ForceSendFields will be sent to the
  24345. // server regardless of whether the field is empty or not. This may be
  24346. // used to include empty fields in Patch requests.
  24347. ForceSendFields []string `json:"-"`
  24348. // NullFields is a list of field names (e.g. "Id") to include in API
  24349. // requests with the JSON null value. By default, fields with empty
  24350. // values are omitted from API requests. However, any field with an
  24351. // empty value appearing in NullFields will be sent to the server as
  24352. // null. It is an error if a field in this list has a non-empty value.
  24353. // This may be used to include null fields in Patch requests.
  24354. NullFields []string `json:"-"`
  24355. }
  24356. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  24357. type NoMethod SubnetworkList
  24358. raw := NoMethod(*s)
  24359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24360. }
  24361. // SubnetworkListWarning: [Output Only] Informational warning message.
  24362. type SubnetworkListWarning struct {
  24363. // Code: [Output Only] A warning code, if applicable. For example,
  24364. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24365. // the response.
  24366. //
  24367. // Possible values:
  24368. // "CLEANUP_FAILED"
  24369. // "DEPRECATED_RESOURCE_USED"
  24370. // "DEPRECATED_TYPE_USED"
  24371. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24372. // "EXPERIMENTAL_TYPE_USED"
  24373. // "EXTERNAL_API_WARNING"
  24374. // "FIELD_VALUE_OVERRIDEN"
  24375. // "INJECTED_KERNELS_DEPRECATED"
  24376. // "MISSING_TYPE_DEPENDENCY"
  24377. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24378. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24379. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24380. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24381. // "NEXT_HOP_NOT_RUNNING"
  24382. // "NOT_CRITICAL_ERROR"
  24383. // "NO_RESULTS_ON_PAGE"
  24384. // "REQUIRED_TOS_AGREEMENT"
  24385. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24386. // "RESOURCE_NOT_DELETED"
  24387. // "SCHEMA_VALIDATION_IGNORED"
  24388. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24389. // "UNDECLARED_PROPERTIES"
  24390. // "UNREACHABLE"
  24391. Code string `json:"code,omitempty"`
  24392. // Data: [Output Only] Metadata about this warning in key: value format.
  24393. // For example:
  24394. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24395. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  24396. // Message: [Output Only] A human-readable description of the warning
  24397. // code.
  24398. Message string `json:"message,omitempty"`
  24399. // ForceSendFields is a list of field names (e.g. "Code") to
  24400. // unconditionally include in API requests. By default, fields with
  24401. // empty values are omitted from API requests. However, any non-pointer,
  24402. // non-interface field appearing in ForceSendFields will be sent to the
  24403. // server regardless of whether the field is empty or not. This may be
  24404. // used to include empty fields in Patch requests.
  24405. ForceSendFields []string `json:"-"`
  24406. // NullFields is a list of field names (e.g. "Code") to include in API
  24407. // requests with the JSON null value. By default, fields with empty
  24408. // values are omitted from API requests. However, any field with an
  24409. // empty value appearing in NullFields will be sent to the server as
  24410. // null. It is an error if a field in this list has a non-empty value.
  24411. // This may be used to include null fields in Patch requests.
  24412. NullFields []string `json:"-"`
  24413. }
  24414. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  24415. type NoMethod SubnetworkListWarning
  24416. raw := NoMethod(*s)
  24417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24418. }
  24419. type SubnetworkListWarningData struct {
  24420. // Key: [Output Only] A key that provides more detail on the warning
  24421. // being returned. For example, for warnings where there are no results
  24422. // in a list request for a particular zone, this key might be scope and
  24423. // the key value might be the zone name. Other examples might be a key
  24424. // indicating a deprecated resource and a suggested replacement, or a
  24425. // warning about invalid network settings (for example, if an instance
  24426. // attempts to perform IP forwarding but is not enabled for IP
  24427. // forwarding).
  24428. Key string `json:"key,omitempty"`
  24429. // Value: [Output Only] A warning data value corresponding to the key.
  24430. Value string `json:"value,omitempty"`
  24431. // ForceSendFields is a list of field names (e.g. "Key") to
  24432. // unconditionally include in API requests. By default, fields with
  24433. // empty values are omitted from API requests. However, any non-pointer,
  24434. // non-interface field appearing in ForceSendFields will be sent to the
  24435. // server regardless of whether the field is empty or not. This may be
  24436. // used to include empty fields in Patch requests.
  24437. ForceSendFields []string `json:"-"`
  24438. // NullFields is a list of field names (e.g. "Key") to include in API
  24439. // requests with the JSON null value. By default, fields with empty
  24440. // values are omitted from API requests. However, any field with an
  24441. // empty value appearing in NullFields will be sent to the server as
  24442. // null. It is an error if a field in this list has a non-empty value.
  24443. // This may be used to include null fields in Patch requests.
  24444. NullFields []string `json:"-"`
  24445. }
  24446. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  24447. type NoMethod SubnetworkListWarningData
  24448. raw := NoMethod(*s)
  24449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24450. }
  24451. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  24452. // subnetwork.
  24453. type SubnetworkSecondaryRange struct {
  24454. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  24455. // secondary range. Provide this property when you create the
  24456. // subnetwork. Ranges must be unique and non-overlapping with all
  24457. // primary and secondary IP ranges within a network. Only IPv4 is
  24458. // supported.
  24459. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24460. // RangeName: The name associated with this subnetwork secondary range,
  24461. // used when adding an alias IP range to a VM instance. The name must be
  24462. // 1-63 characters long, and comply with RFC1035. The name must be
  24463. // unique within the subnetwork.
  24464. RangeName string `json:"rangeName,omitempty"`
  24465. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24466. // unconditionally include in API requests. By default, fields with
  24467. // empty values are omitted from API requests. However, any non-pointer,
  24468. // non-interface field appearing in ForceSendFields will be sent to the
  24469. // server regardless of whether the field is empty or not. This may be
  24470. // used to include empty fields in Patch requests.
  24471. ForceSendFields []string `json:"-"`
  24472. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24473. // in API requests with the JSON null value. By default, fields with
  24474. // empty values are omitted from API requests. However, any field with
  24475. // an empty value appearing in NullFields will be sent to the server as
  24476. // null. It is an error if a field in this list has a non-empty value.
  24477. // This may be used to include null fields in Patch requests.
  24478. NullFields []string `json:"-"`
  24479. }
  24480. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  24481. type NoMethod SubnetworkSecondaryRange
  24482. raw := NoMethod(*s)
  24483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24484. }
  24485. type SubnetworksExpandIpCidrRangeRequest struct {
  24486. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  24487. // that are legal on this Subnetwork. This range should be disjoint from
  24488. // other subnetworks within this network. This range can only be larger
  24489. // than (i.e. a superset of) the range previously defined before the
  24490. // update.
  24491. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24492. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24493. // unconditionally include in API requests. By default, fields with
  24494. // empty values are omitted from API requests. However, any non-pointer,
  24495. // non-interface field appearing in ForceSendFields will be sent to the
  24496. // server regardless of whether the field is empty or not. This may be
  24497. // used to include empty fields in Patch requests.
  24498. ForceSendFields []string `json:"-"`
  24499. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24500. // in API requests with the JSON null value. By default, fields with
  24501. // empty values are omitted from API requests. However, any field with
  24502. // an empty value appearing in NullFields will be sent to the server as
  24503. // null. It is an error if a field in this list has a non-empty value.
  24504. // This may be used to include null fields in Patch requests.
  24505. NullFields []string `json:"-"`
  24506. }
  24507. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  24508. type NoMethod SubnetworksExpandIpCidrRangeRequest
  24509. raw := NoMethod(*s)
  24510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24511. }
  24512. type SubnetworksScopedList struct {
  24513. // Subnetworks: A list of subnetworks contained in this scope.
  24514. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  24515. // Warning: An informational warning that appears when the list of
  24516. // addresses is empty.
  24517. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  24518. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  24519. // unconditionally include in API requests. By default, fields with
  24520. // empty values are omitted from API requests. However, any non-pointer,
  24521. // non-interface field appearing in ForceSendFields will be sent to the
  24522. // server regardless of whether the field is empty or not. This may be
  24523. // used to include empty fields in Patch requests.
  24524. ForceSendFields []string `json:"-"`
  24525. // NullFields is a list of field names (e.g. "Subnetworks") to include
  24526. // in API requests with the JSON null value. By default, fields with
  24527. // empty values are omitted from API requests. However, any field with
  24528. // an empty value appearing in NullFields will be sent to the server as
  24529. // null. It is an error if a field in this list has a non-empty value.
  24530. // This may be used to include null fields in Patch requests.
  24531. NullFields []string `json:"-"`
  24532. }
  24533. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  24534. type NoMethod SubnetworksScopedList
  24535. raw := NoMethod(*s)
  24536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24537. }
  24538. // SubnetworksScopedListWarning: An informational warning that appears
  24539. // when the list of addresses is empty.
  24540. type SubnetworksScopedListWarning struct {
  24541. // Code: [Output Only] A warning code, if applicable. For example,
  24542. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24543. // the response.
  24544. //
  24545. // Possible values:
  24546. // "CLEANUP_FAILED"
  24547. // "DEPRECATED_RESOURCE_USED"
  24548. // "DEPRECATED_TYPE_USED"
  24549. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24550. // "EXPERIMENTAL_TYPE_USED"
  24551. // "EXTERNAL_API_WARNING"
  24552. // "FIELD_VALUE_OVERRIDEN"
  24553. // "INJECTED_KERNELS_DEPRECATED"
  24554. // "MISSING_TYPE_DEPENDENCY"
  24555. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24556. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24557. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24558. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24559. // "NEXT_HOP_NOT_RUNNING"
  24560. // "NOT_CRITICAL_ERROR"
  24561. // "NO_RESULTS_ON_PAGE"
  24562. // "REQUIRED_TOS_AGREEMENT"
  24563. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24564. // "RESOURCE_NOT_DELETED"
  24565. // "SCHEMA_VALIDATION_IGNORED"
  24566. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24567. // "UNDECLARED_PROPERTIES"
  24568. // "UNREACHABLE"
  24569. Code string `json:"code,omitempty"`
  24570. // Data: [Output Only] Metadata about this warning in key: value format.
  24571. // For example:
  24572. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24573. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  24574. // Message: [Output Only] A human-readable description of the warning
  24575. // code.
  24576. Message string `json:"message,omitempty"`
  24577. // ForceSendFields is a list of field names (e.g. "Code") to
  24578. // unconditionally include in API requests. By default, fields with
  24579. // empty values are omitted from API requests. However, any non-pointer,
  24580. // non-interface field appearing in ForceSendFields will be sent to the
  24581. // server regardless of whether the field is empty or not. This may be
  24582. // used to include empty fields in Patch requests.
  24583. ForceSendFields []string `json:"-"`
  24584. // NullFields is a list of field names (e.g. "Code") to include in API
  24585. // requests with the JSON null value. By default, fields with empty
  24586. // values are omitted from API requests. However, any field with an
  24587. // empty value appearing in NullFields will be sent to the server as
  24588. // null. It is an error if a field in this list has a non-empty value.
  24589. // This may be used to include null fields in Patch requests.
  24590. NullFields []string `json:"-"`
  24591. }
  24592. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  24593. type NoMethod SubnetworksScopedListWarning
  24594. raw := NoMethod(*s)
  24595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24596. }
  24597. type SubnetworksScopedListWarningData struct {
  24598. // Key: [Output Only] A key that provides more detail on the warning
  24599. // being returned. For example, for warnings where there are no results
  24600. // in a list request for a particular zone, this key might be scope and
  24601. // the key value might be the zone name. Other examples might be a key
  24602. // indicating a deprecated resource and a suggested replacement, or a
  24603. // warning about invalid network settings (for example, if an instance
  24604. // attempts to perform IP forwarding but is not enabled for IP
  24605. // forwarding).
  24606. Key string `json:"key,omitempty"`
  24607. // Value: [Output Only] A warning data value corresponding to the key.
  24608. Value string `json:"value,omitempty"`
  24609. // ForceSendFields is a list of field names (e.g. "Key") to
  24610. // unconditionally include in API requests. By default, fields with
  24611. // empty values are omitted from API requests. However, any non-pointer,
  24612. // non-interface field appearing in ForceSendFields will be sent to the
  24613. // server regardless of whether the field is empty or not. This may be
  24614. // used to include empty fields in Patch requests.
  24615. ForceSendFields []string `json:"-"`
  24616. // NullFields is a list of field names (e.g. "Key") to include in API
  24617. // requests with the JSON null value. By default, fields with empty
  24618. // values are omitted from API requests. However, any field with an
  24619. // empty value appearing in NullFields will be sent to the server as
  24620. // null. It is an error if a field in this list has a non-empty value.
  24621. // This may be used to include null fields in Patch requests.
  24622. NullFields []string `json:"-"`
  24623. }
  24624. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  24625. type NoMethod SubnetworksScopedListWarningData
  24626. raw := NoMethod(*s)
  24627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24628. }
  24629. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  24630. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  24631. // ForceSendFields is a list of field names (e.g.
  24632. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  24633. // By default, fields with empty values are omitted from API requests.
  24634. // However, any non-pointer, non-interface field appearing in
  24635. // ForceSendFields will be sent to the server regardless of whether the
  24636. // field is empty or not. This may be used to include empty fields in
  24637. // Patch requests.
  24638. ForceSendFields []string `json:"-"`
  24639. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  24640. // include in API requests with the JSON null value. By default, fields
  24641. // with empty values are omitted from API requests. However, any field
  24642. // with an empty value appearing in NullFields will be sent to the
  24643. // server as null. It is an error if a field in this list has a
  24644. // non-empty value. This may be used to include null fields in Patch
  24645. // requests.
  24646. NullFields []string `json:"-"`
  24647. }
  24648. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  24649. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  24650. raw := NoMethod(*s)
  24651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24652. }
  24653. type TCPHealthCheck struct {
  24654. // Port: The TCP port number for the health check request. The default
  24655. // value is 80. Valid values are 1 through 65535.
  24656. Port int64 `json:"port,omitempty"`
  24657. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  24658. // both port and port_name are defined, port takes precedence.
  24659. PortName string `json:"portName,omitempty"`
  24660. // PortSpecification: Specifies how port is selected for health
  24661. // checking, can be one of following values:
  24662. // USE_FIXED_PORT: The port number in
  24663. // port
  24664. // is used for health checking.
  24665. // USE_NAMED_PORT: The
  24666. // portName
  24667. // is used for health checking.
  24668. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  24669. // each network endpoint is used for health checking. For other
  24670. // backends, the port or named port specified in the Backend Service is
  24671. // used for health checking.
  24672. //
  24673. //
  24674. // If not specified, TCP health check follows behavior specified
  24675. // in
  24676. // port
  24677. // and
  24678. // portName
  24679. // fields.
  24680. //
  24681. // Possible values:
  24682. // "USE_FIXED_PORT"
  24683. // "USE_NAMED_PORT"
  24684. // "USE_SERVING_PORT"
  24685. PortSpecification string `json:"portSpecification,omitempty"`
  24686. // ProxyHeader: Specifies the type of proxy header to append before
  24687. // sending data to the backend, either NONE or PROXY_V1. The default is
  24688. // NONE.
  24689. //
  24690. // Possible values:
  24691. // "NONE"
  24692. // "PROXY_V1"
  24693. ProxyHeader string `json:"proxyHeader,omitempty"`
  24694. // Request: The application data to send once the TCP connection has
  24695. // been established (default value is empty). If both request and
  24696. // response are empty, the connection establishment alone will indicate
  24697. // health. The request data can only be ASCII.
  24698. Request string `json:"request,omitempty"`
  24699. // Response: The bytes to match against the beginning of the response
  24700. // data. If left empty (the default value), any response will indicate
  24701. // health. The response data can only be ASCII.
  24702. Response string `json:"response,omitempty"`
  24703. // ForceSendFields is a list of field names (e.g. "Port") to
  24704. // unconditionally include in API requests. By default, fields with
  24705. // empty values are omitted from API requests. However, any non-pointer,
  24706. // non-interface field appearing in ForceSendFields will be sent to the
  24707. // server regardless of whether the field is empty or not. This may be
  24708. // used to include empty fields in Patch requests.
  24709. ForceSendFields []string `json:"-"`
  24710. // NullFields is a list of field names (e.g. "Port") to include in API
  24711. // requests with the JSON null value. By default, fields with empty
  24712. // values are omitted from API requests. However, any field with an
  24713. // empty value appearing in NullFields will be sent to the server as
  24714. // null. It is an error if a field in this list has a non-empty value.
  24715. // This may be used to include null fields in Patch requests.
  24716. NullFields []string `json:"-"`
  24717. }
  24718. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  24719. type NoMethod TCPHealthCheck
  24720. raw := NoMethod(*s)
  24721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24722. }
  24723. // Tags: A set of instance tags.
  24724. type Tags struct {
  24725. // Fingerprint: Specifies a fingerprint for this request, which is
  24726. // essentially a hash of the tags' contents and used for optimistic
  24727. // locking. The fingerprint is initially generated by Compute Engine and
  24728. // changes after every request to modify or update tags. You must always
  24729. // provide an up-to-date fingerprint hash in order to update or change
  24730. // tags.
  24731. //
  24732. // To see the latest fingerprint, make get() request to the instance.
  24733. Fingerprint string `json:"fingerprint,omitempty"`
  24734. // Items: An array of tags. Each tag must be 1-63 characters long, and
  24735. // comply with RFC1035.
  24736. Items []string `json:"items,omitempty"`
  24737. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  24738. // unconditionally include in API requests. By default, fields with
  24739. // empty values are omitted from API requests. However, any non-pointer,
  24740. // non-interface field appearing in ForceSendFields will be sent to the
  24741. // server regardless of whether the field is empty or not. This may be
  24742. // used to include empty fields in Patch requests.
  24743. ForceSendFields []string `json:"-"`
  24744. // NullFields is a list of field names (e.g. "Fingerprint") to include
  24745. // in API requests with the JSON null value. By default, fields with
  24746. // empty values are omitted from API requests. However, any field with
  24747. // an empty value appearing in NullFields will be sent to the server as
  24748. // null. It is an error if a field in this list has a non-empty value.
  24749. // This may be used to include null fields in Patch requests.
  24750. NullFields []string `json:"-"`
  24751. }
  24752. func (s *Tags) MarshalJSON() ([]byte, error) {
  24753. type NoMethod Tags
  24754. raw := NoMethod(*s)
  24755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24756. }
  24757. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  24758. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  24759. // resource_for v1.targetHttpProxies ==)
  24760. type TargetHttpProxy struct {
  24761. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24762. // format.
  24763. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24764. // Description: An optional description of this resource. Provide this
  24765. // property when you create the resource.
  24766. Description string `json:"description,omitempty"`
  24767. // Id: [Output Only] The unique identifier for the resource. This
  24768. // identifier is defined by the server.
  24769. Id uint64 `json:"id,omitempty,string"`
  24770. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  24771. // for target HTTP proxies.
  24772. Kind string `json:"kind,omitempty"`
  24773. // Name: Name of the resource. Provided by the client when the resource
  24774. // is created. The name must be 1-63 characters long, and comply with
  24775. // RFC1035. Specifically, the name must be 1-63 characters long and
  24776. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24777. // the first character must be a lowercase letter, and all following
  24778. // characters must be a dash, lowercase letter, or digit, except the
  24779. // last character, which cannot be a dash.
  24780. Name string `json:"name,omitempty"`
  24781. // SelfLink: [Output Only] Server-defined URL for the resource.
  24782. SelfLink string `json:"selfLink,omitempty"`
  24783. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  24784. // to the BackendService.
  24785. UrlMap string `json:"urlMap,omitempty"`
  24786. // ServerResponse contains the HTTP response code and headers from the
  24787. // server.
  24788. googleapi.ServerResponse `json:"-"`
  24789. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24790. // to unconditionally include in API requests. By default, fields with
  24791. // empty values are omitted from API requests. However, any non-pointer,
  24792. // non-interface field appearing in ForceSendFields will be sent to the
  24793. // server regardless of whether the field is empty or not. This may be
  24794. // used to include empty fields in Patch requests.
  24795. ForceSendFields []string `json:"-"`
  24796. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24797. // include in API requests with the JSON null value. By default, fields
  24798. // with empty values are omitted from API requests. However, any field
  24799. // with an empty value appearing in NullFields will be sent to the
  24800. // server as null. It is an error if a field in this list has a
  24801. // non-empty value. This may be used to include null fields in Patch
  24802. // requests.
  24803. NullFields []string `json:"-"`
  24804. }
  24805. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  24806. type NoMethod TargetHttpProxy
  24807. raw := NoMethod(*s)
  24808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24809. }
  24810. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  24811. type TargetHttpProxyList struct {
  24812. // Id: [Output Only] Unique identifier for the resource; defined by the
  24813. // server.
  24814. Id string `json:"id,omitempty"`
  24815. // Items: A list of TargetHttpProxy resources.
  24816. Items []*TargetHttpProxy `json:"items,omitempty"`
  24817. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  24818. // of target HTTP proxies.
  24819. Kind string `json:"kind,omitempty"`
  24820. // NextPageToken: [Output Only] This token allows you to get the next
  24821. // page of results for list requests. If the number of results is larger
  24822. // than maxResults, use the nextPageToken as a value for the query
  24823. // parameter pageToken in the next list request. Subsequent list
  24824. // requests will have their own nextPageToken to continue paging through
  24825. // the results.
  24826. NextPageToken string `json:"nextPageToken,omitempty"`
  24827. // SelfLink: [Output Only] Server-defined URL for this resource.
  24828. SelfLink string `json:"selfLink,omitempty"`
  24829. // Warning: [Output Only] Informational warning message.
  24830. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  24831. // ServerResponse contains the HTTP response code and headers from the
  24832. // server.
  24833. googleapi.ServerResponse `json:"-"`
  24834. // ForceSendFields is a list of field names (e.g. "Id") to
  24835. // unconditionally include in API requests. By default, fields with
  24836. // empty values are omitted from API requests. However, any non-pointer,
  24837. // non-interface field appearing in ForceSendFields will be sent to the
  24838. // server regardless of whether the field is empty or not. This may be
  24839. // used to include empty fields in Patch requests.
  24840. ForceSendFields []string `json:"-"`
  24841. // NullFields is a list of field names (e.g. "Id") to include in API
  24842. // requests with the JSON null value. By default, fields with empty
  24843. // values are omitted from API requests. However, any field with an
  24844. // empty value appearing in NullFields will be sent to the server as
  24845. // null. It is an error if a field in this list has a non-empty value.
  24846. // This may be used to include null fields in Patch requests.
  24847. NullFields []string `json:"-"`
  24848. }
  24849. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  24850. type NoMethod TargetHttpProxyList
  24851. raw := NoMethod(*s)
  24852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24853. }
  24854. // TargetHttpProxyListWarning: [Output Only] Informational warning
  24855. // message.
  24856. type TargetHttpProxyListWarning struct {
  24857. // Code: [Output Only] A warning code, if applicable. For example,
  24858. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24859. // the response.
  24860. //
  24861. // Possible values:
  24862. // "CLEANUP_FAILED"
  24863. // "DEPRECATED_RESOURCE_USED"
  24864. // "DEPRECATED_TYPE_USED"
  24865. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24866. // "EXPERIMENTAL_TYPE_USED"
  24867. // "EXTERNAL_API_WARNING"
  24868. // "FIELD_VALUE_OVERRIDEN"
  24869. // "INJECTED_KERNELS_DEPRECATED"
  24870. // "MISSING_TYPE_DEPENDENCY"
  24871. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24872. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24873. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24874. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24875. // "NEXT_HOP_NOT_RUNNING"
  24876. // "NOT_CRITICAL_ERROR"
  24877. // "NO_RESULTS_ON_PAGE"
  24878. // "REQUIRED_TOS_AGREEMENT"
  24879. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24880. // "RESOURCE_NOT_DELETED"
  24881. // "SCHEMA_VALIDATION_IGNORED"
  24882. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24883. // "UNDECLARED_PROPERTIES"
  24884. // "UNREACHABLE"
  24885. Code string `json:"code,omitempty"`
  24886. // Data: [Output Only] Metadata about this warning in key: value format.
  24887. // For example:
  24888. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24889. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  24890. // Message: [Output Only] A human-readable description of the warning
  24891. // code.
  24892. Message string `json:"message,omitempty"`
  24893. // ForceSendFields is a list of field names (e.g. "Code") to
  24894. // unconditionally include in API requests. By default, fields with
  24895. // empty values are omitted from API requests. However, any non-pointer,
  24896. // non-interface field appearing in ForceSendFields will be sent to the
  24897. // server regardless of whether the field is empty or not. This may be
  24898. // used to include empty fields in Patch requests.
  24899. ForceSendFields []string `json:"-"`
  24900. // NullFields is a list of field names (e.g. "Code") to include in API
  24901. // requests with the JSON null value. By default, fields with empty
  24902. // values are omitted from API requests. However, any field with an
  24903. // empty value appearing in NullFields will be sent to the server as
  24904. // null. It is an error if a field in this list has a non-empty value.
  24905. // This may be used to include null fields in Patch requests.
  24906. NullFields []string `json:"-"`
  24907. }
  24908. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  24909. type NoMethod TargetHttpProxyListWarning
  24910. raw := NoMethod(*s)
  24911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24912. }
  24913. type TargetHttpProxyListWarningData struct {
  24914. // Key: [Output Only] A key that provides more detail on the warning
  24915. // being returned. For example, for warnings where there are no results
  24916. // in a list request for a particular zone, this key might be scope and
  24917. // the key value might be the zone name. Other examples might be a key
  24918. // indicating a deprecated resource and a suggested replacement, or a
  24919. // warning about invalid network settings (for example, if an instance
  24920. // attempts to perform IP forwarding but is not enabled for IP
  24921. // forwarding).
  24922. Key string `json:"key,omitempty"`
  24923. // Value: [Output Only] A warning data value corresponding to the key.
  24924. Value string `json:"value,omitempty"`
  24925. // ForceSendFields is a list of field names (e.g. "Key") to
  24926. // unconditionally include in API requests. By default, fields with
  24927. // empty values are omitted from API requests. However, any non-pointer,
  24928. // non-interface field appearing in ForceSendFields will be sent to the
  24929. // server regardless of whether the field is empty or not. This may be
  24930. // used to include empty fields in Patch requests.
  24931. ForceSendFields []string `json:"-"`
  24932. // NullFields is a list of field names (e.g. "Key") to include in API
  24933. // requests with the JSON null value. By default, fields with empty
  24934. // values are omitted from API requests. However, any field with an
  24935. // empty value appearing in NullFields will be sent to the server as
  24936. // null. It is an error if a field in this list has a non-empty value.
  24937. // This may be used to include null fields in Patch requests.
  24938. NullFields []string `json:"-"`
  24939. }
  24940. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  24941. type NoMethod TargetHttpProxyListWarningData
  24942. raw := NoMethod(*s)
  24943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24944. }
  24945. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  24946. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  24947. //
  24948. // Possible values:
  24949. // "DISABLE"
  24950. // "ENABLE"
  24951. // "NONE"
  24952. QuicOverride string `json:"quicOverride,omitempty"`
  24953. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  24954. // unconditionally include in API requests. By default, fields with
  24955. // empty values are omitted from API requests. However, any non-pointer,
  24956. // non-interface field appearing in ForceSendFields will be sent to the
  24957. // server regardless of whether the field is empty or not. This may be
  24958. // used to include empty fields in Patch requests.
  24959. ForceSendFields []string `json:"-"`
  24960. // NullFields is a list of field names (e.g. "QuicOverride") to include
  24961. // in API requests with the JSON null value. By default, fields with
  24962. // empty values are omitted from API requests. However, any field with
  24963. // an empty value appearing in NullFields will be sent to the server as
  24964. // null. It is an error if a field in this list has a non-empty value.
  24965. // This may be used to include null fields in Patch requests.
  24966. NullFields []string `json:"-"`
  24967. }
  24968. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  24969. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  24970. raw := NoMethod(*s)
  24971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24972. }
  24973. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  24974. // SslCertificates: New set of SslCertificate resources to associate
  24975. // with this TargetHttpsProxy resource. Currently exactly one
  24976. // SslCertificate resource must be specified.
  24977. SslCertificates []string `json:"sslCertificates,omitempty"`
  24978. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  24979. // unconditionally include in API requests. By default, fields with
  24980. // empty values are omitted from API requests. However, any non-pointer,
  24981. // non-interface field appearing in ForceSendFields will be sent to the
  24982. // server regardless of whether the field is empty or not. This may be
  24983. // used to include empty fields in Patch requests.
  24984. ForceSendFields []string `json:"-"`
  24985. // NullFields is a list of field names (e.g. "SslCertificates") to
  24986. // include in API requests with the JSON null value. By default, fields
  24987. // with empty values are omitted from API requests. However, any field
  24988. // with an empty value appearing in NullFields will be sent to the
  24989. // server as null. It is an error if a field in this list has a
  24990. // non-empty value. This may be used to include null fields in Patch
  24991. // requests.
  24992. NullFields []string `json:"-"`
  24993. }
  24994. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  24995. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  24996. raw := NoMethod(*s)
  24997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24998. }
  24999. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  25000. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  25001. // resource_for v1.targetHttpsProxies ==)
  25002. type TargetHttpsProxy struct {
  25003. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25004. // format.
  25005. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25006. // Description: An optional description of this resource. Provide this
  25007. // property when you create the resource.
  25008. Description string `json:"description,omitempty"`
  25009. // Id: [Output Only] The unique identifier for the resource. This
  25010. // identifier is defined by the server.
  25011. Id uint64 `json:"id,omitempty,string"`
  25012. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  25013. // for target HTTPS proxies.
  25014. Kind string `json:"kind,omitempty"`
  25015. // Name: Name of the resource. Provided by the client when the resource
  25016. // is created. The name must be 1-63 characters long, and comply with
  25017. // RFC1035. Specifically, the name must be 1-63 characters long and
  25018. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25019. // the first character must be a lowercase letter, and all following
  25020. // characters must be a dash, lowercase letter, or digit, except the
  25021. // last character, which cannot be a dash.
  25022. Name string `json:"name,omitempty"`
  25023. // QuicOverride: Specifies the QUIC override policy for this
  25024. // TargetHttpsProxy resource. This determines whether the load balancer
  25025. // will attempt to negotiate QUIC with clients or not. Can specify one
  25026. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  25027. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  25028. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  25029. // overrides, which is equivalent to DISABLE. Not specifying this field
  25030. // is equivalent to specifying NONE.
  25031. //
  25032. // Possible values:
  25033. // "DISABLE"
  25034. // "ENABLE"
  25035. // "NONE"
  25036. QuicOverride string `json:"quicOverride,omitempty"`
  25037. // SelfLink: [Output Only] Server-defined URL for the resource.
  25038. SelfLink string `json:"selfLink,omitempty"`
  25039. // SslCertificates: URLs to SslCertificate resources that are used to
  25040. // authenticate connections between users and the load balancer. At
  25041. // least one SSL certificate must be specified. Currently, you may
  25042. // specify up to 15 SSL certificates.
  25043. SslCertificates []string `json:"sslCertificates,omitempty"`
  25044. // SslPolicy: URL of SslPolicy resource that will be associated with the
  25045. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  25046. // will not have any SSL policy configured.
  25047. SslPolicy string `json:"sslPolicy,omitempty"`
  25048. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  25049. // that defines the mapping from URL to the BackendService. For example,
  25050. // the following are all valid URLs for specifying a URL map:
  25051. // -
  25052. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  25053. // - projects/project/global/urlMaps/url-map
  25054. // - global/urlMaps/url-map
  25055. UrlMap string `json:"urlMap,omitempty"`
  25056. // ServerResponse contains the HTTP response code and headers from the
  25057. // server.
  25058. googleapi.ServerResponse `json:"-"`
  25059. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25060. // to unconditionally include in API requests. By default, fields with
  25061. // empty values are omitted from API requests. However, any non-pointer,
  25062. // non-interface field appearing in ForceSendFields will be sent to the
  25063. // server regardless of whether the field is empty or not. This may be
  25064. // used to include empty fields in Patch requests.
  25065. ForceSendFields []string `json:"-"`
  25066. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25067. // include in API requests with the JSON null value. By default, fields
  25068. // with empty values are omitted from API requests. However, any field
  25069. // with an empty value appearing in NullFields will be sent to the
  25070. // server as null. It is an error if a field in this list has a
  25071. // non-empty value. This may be used to include null fields in Patch
  25072. // requests.
  25073. NullFields []string `json:"-"`
  25074. }
  25075. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  25076. type NoMethod TargetHttpsProxy
  25077. raw := NoMethod(*s)
  25078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25079. }
  25080. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  25081. type TargetHttpsProxyList struct {
  25082. // Id: [Output Only] Unique identifier for the resource; defined by the
  25083. // server.
  25084. Id string `json:"id,omitempty"`
  25085. // Items: A list of TargetHttpsProxy resources.
  25086. Items []*TargetHttpsProxy `json:"items,omitempty"`
  25087. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  25088. // of target HTTPS proxies.
  25089. Kind string `json:"kind,omitempty"`
  25090. // NextPageToken: [Output Only] This token allows you to get the next
  25091. // page of results for list requests. If the number of results is larger
  25092. // than maxResults, use the nextPageToken as a value for the query
  25093. // parameter pageToken in the next list request. Subsequent list
  25094. // requests will have their own nextPageToken to continue paging through
  25095. // the results.
  25096. NextPageToken string `json:"nextPageToken,omitempty"`
  25097. // SelfLink: [Output Only] Server-defined URL for this resource.
  25098. SelfLink string `json:"selfLink,omitempty"`
  25099. // Warning: [Output Only] Informational warning message.
  25100. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  25101. // ServerResponse contains the HTTP response code and headers from the
  25102. // server.
  25103. googleapi.ServerResponse `json:"-"`
  25104. // ForceSendFields is a list of field names (e.g. "Id") to
  25105. // unconditionally include in API requests. By default, fields with
  25106. // empty values are omitted from API requests. However, any non-pointer,
  25107. // non-interface field appearing in ForceSendFields will be sent to the
  25108. // server regardless of whether the field is empty or not. This may be
  25109. // used to include empty fields in Patch requests.
  25110. ForceSendFields []string `json:"-"`
  25111. // NullFields is a list of field names (e.g. "Id") to include in API
  25112. // requests with the JSON null value. By default, fields with empty
  25113. // values are omitted from API requests. However, any field with an
  25114. // empty value appearing in NullFields will be sent to the server as
  25115. // null. It is an error if a field in this list has a non-empty value.
  25116. // This may be used to include null fields in Patch requests.
  25117. NullFields []string `json:"-"`
  25118. }
  25119. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  25120. type NoMethod TargetHttpsProxyList
  25121. raw := NoMethod(*s)
  25122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25123. }
  25124. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  25125. // message.
  25126. type TargetHttpsProxyListWarning struct {
  25127. // Code: [Output Only] A warning code, if applicable. For example,
  25128. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25129. // the response.
  25130. //
  25131. // Possible values:
  25132. // "CLEANUP_FAILED"
  25133. // "DEPRECATED_RESOURCE_USED"
  25134. // "DEPRECATED_TYPE_USED"
  25135. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25136. // "EXPERIMENTAL_TYPE_USED"
  25137. // "EXTERNAL_API_WARNING"
  25138. // "FIELD_VALUE_OVERRIDEN"
  25139. // "INJECTED_KERNELS_DEPRECATED"
  25140. // "MISSING_TYPE_DEPENDENCY"
  25141. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25142. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25143. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25144. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25145. // "NEXT_HOP_NOT_RUNNING"
  25146. // "NOT_CRITICAL_ERROR"
  25147. // "NO_RESULTS_ON_PAGE"
  25148. // "REQUIRED_TOS_AGREEMENT"
  25149. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25150. // "RESOURCE_NOT_DELETED"
  25151. // "SCHEMA_VALIDATION_IGNORED"
  25152. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25153. // "UNDECLARED_PROPERTIES"
  25154. // "UNREACHABLE"
  25155. Code string `json:"code,omitempty"`
  25156. // Data: [Output Only] Metadata about this warning in key: value format.
  25157. // For example:
  25158. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25159. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  25160. // Message: [Output Only] A human-readable description of the warning
  25161. // code.
  25162. Message string `json:"message,omitempty"`
  25163. // ForceSendFields is a list of field names (e.g. "Code") to
  25164. // unconditionally include in API requests. By default, fields with
  25165. // empty values are omitted from API requests. However, any non-pointer,
  25166. // non-interface field appearing in ForceSendFields will be sent to the
  25167. // server regardless of whether the field is empty or not. This may be
  25168. // used to include empty fields in Patch requests.
  25169. ForceSendFields []string `json:"-"`
  25170. // NullFields is a list of field names (e.g. "Code") to include in API
  25171. // requests with the JSON null value. By default, fields with empty
  25172. // values are omitted from API requests. However, any field with an
  25173. // empty value appearing in NullFields will be sent to the server as
  25174. // null. It is an error if a field in this list has a non-empty value.
  25175. // This may be used to include null fields in Patch requests.
  25176. NullFields []string `json:"-"`
  25177. }
  25178. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  25179. type NoMethod TargetHttpsProxyListWarning
  25180. raw := NoMethod(*s)
  25181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25182. }
  25183. type TargetHttpsProxyListWarningData struct {
  25184. // Key: [Output Only] A key that provides more detail on the warning
  25185. // being returned. For example, for warnings where there are no results
  25186. // in a list request for a particular zone, this key might be scope and
  25187. // the key value might be the zone name. Other examples might be a key
  25188. // indicating a deprecated resource and a suggested replacement, or a
  25189. // warning about invalid network settings (for example, if an instance
  25190. // attempts to perform IP forwarding but is not enabled for IP
  25191. // forwarding).
  25192. Key string `json:"key,omitempty"`
  25193. // Value: [Output Only] A warning data value corresponding to the key.
  25194. Value string `json:"value,omitempty"`
  25195. // ForceSendFields is a list of field names (e.g. "Key") to
  25196. // unconditionally include in API requests. By default, fields with
  25197. // empty values are omitted from API requests. However, any non-pointer,
  25198. // non-interface field appearing in ForceSendFields will be sent to the
  25199. // server regardless of whether the field is empty or not. This may be
  25200. // used to include empty fields in Patch requests.
  25201. ForceSendFields []string `json:"-"`
  25202. // NullFields is a list of field names (e.g. "Key") to include in API
  25203. // requests with the JSON null value. By default, fields with empty
  25204. // values are omitted from API requests. However, any field with an
  25205. // empty value appearing in NullFields will be sent to the server as
  25206. // null. It is an error if a field in this list has a non-empty value.
  25207. // This may be used to include null fields in Patch requests.
  25208. NullFields []string `json:"-"`
  25209. }
  25210. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  25211. type NoMethod TargetHttpsProxyListWarningData
  25212. raw := NoMethod(*s)
  25213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25214. }
  25215. // TargetInstance: A TargetInstance resource. This resource defines an
  25216. // endpoint instance that terminates traffic of certain protocols. (==
  25217. // resource_for beta.targetInstances ==) (== resource_for
  25218. // v1.targetInstances ==)
  25219. type TargetInstance struct {
  25220. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25221. // format.
  25222. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25223. // Description: An optional description of this resource. Provide this
  25224. // property when you create the resource.
  25225. Description string `json:"description,omitempty"`
  25226. // Id: [Output Only] The unique identifier for the resource. This
  25227. // identifier is defined by the server.
  25228. Id uint64 `json:"id,omitempty,string"`
  25229. // Instance: A URL to the virtual machine instance that handles traffic
  25230. // for this target instance. When creating a target instance, you can
  25231. // provide the fully-qualified URL or a valid partial URL to the desired
  25232. // virtual machine. For example, the following are all valid URLs:
  25233. // -
  25234. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  25235. // - projects/project/zones/zone/instances/instance
  25236. // - zones/zone/instances/instance
  25237. Instance string `json:"instance,omitempty"`
  25238. // Kind: [Output Only] The type of the resource. Always
  25239. // compute#targetInstance for target instances.
  25240. Kind string `json:"kind,omitempty"`
  25241. // Name: Name of the resource. Provided by the client when the resource
  25242. // is created. The name must be 1-63 characters long, and comply with
  25243. // RFC1035. Specifically, the name must be 1-63 characters long and
  25244. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25245. // the first character must be a lowercase letter, and all following
  25246. // characters must be a dash, lowercase letter, or digit, except the
  25247. // last character, which cannot be a dash.
  25248. Name string `json:"name,omitempty"`
  25249. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  25250. // Currently only NO_NAT (default value) is supported.
  25251. //
  25252. // Possible values:
  25253. // "NO_NAT"
  25254. NatPolicy string `json:"natPolicy,omitempty"`
  25255. // SelfLink: [Output Only] Server-defined URL for the resource.
  25256. SelfLink string `json:"selfLink,omitempty"`
  25257. // Zone: [Output Only] URL of the zone where the target instance
  25258. // resides. You must specify this field as part of the HTTP request URL.
  25259. // It is not settable as a field in the request body.
  25260. Zone string `json:"zone,omitempty"`
  25261. // ServerResponse contains the HTTP response code and headers from the
  25262. // server.
  25263. googleapi.ServerResponse `json:"-"`
  25264. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25265. // to unconditionally include in API requests. By default, fields with
  25266. // empty values are omitted from API requests. However, any non-pointer,
  25267. // non-interface field appearing in ForceSendFields will be sent to the
  25268. // server regardless of whether the field is empty or not. This may be
  25269. // used to include empty fields in Patch requests.
  25270. ForceSendFields []string `json:"-"`
  25271. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25272. // include in API requests with the JSON null value. By default, fields
  25273. // with empty values are omitted from API requests. However, any field
  25274. // with an empty value appearing in NullFields will be sent to the
  25275. // server as null. It is an error if a field in this list has a
  25276. // non-empty value. This may be used to include null fields in Patch
  25277. // requests.
  25278. NullFields []string `json:"-"`
  25279. }
  25280. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  25281. type NoMethod TargetInstance
  25282. raw := NoMethod(*s)
  25283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25284. }
  25285. type TargetInstanceAggregatedList struct {
  25286. // Id: [Output Only] Unique identifier for the resource; defined by the
  25287. // server.
  25288. Id string `json:"id,omitempty"`
  25289. // Items: A list of TargetInstance resources.
  25290. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  25291. // Kind: Type of resource.
  25292. Kind string `json:"kind,omitempty"`
  25293. // NextPageToken: [Output Only] This token allows you to get the next
  25294. // page of results for list requests. If the number of results is larger
  25295. // than maxResults, use the nextPageToken as a value for the query
  25296. // parameter pageToken in the next list request. Subsequent list
  25297. // requests will have their own nextPageToken to continue paging through
  25298. // the results.
  25299. NextPageToken string `json:"nextPageToken,omitempty"`
  25300. // SelfLink: [Output Only] Server-defined URL for this resource.
  25301. SelfLink string `json:"selfLink,omitempty"`
  25302. // Warning: [Output Only] Informational warning message.
  25303. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  25304. // ServerResponse contains the HTTP response code and headers from the
  25305. // server.
  25306. googleapi.ServerResponse `json:"-"`
  25307. // ForceSendFields is a list of field names (e.g. "Id") to
  25308. // unconditionally include in API requests. By default, fields with
  25309. // empty values are omitted from API requests. However, any non-pointer,
  25310. // non-interface field appearing in ForceSendFields will be sent to the
  25311. // server regardless of whether the field is empty or not. This may be
  25312. // used to include empty fields in Patch requests.
  25313. ForceSendFields []string `json:"-"`
  25314. // NullFields is a list of field names (e.g. "Id") to include in API
  25315. // requests with the JSON null value. By default, fields with empty
  25316. // values are omitted from API requests. However, any field with an
  25317. // empty value appearing in NullFields will be sent to the server as
  25318. // null. It is an error if a field in this list has a non-empty value.
  25319. // This may be used to include null fields in Patch requests.
  25320. NullFields []string `json:"-"`
  25321. }
  25322. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  25323. type NoMethod TargetInstanceAggregatedList
  25324. raw := NoMethod(*s)
  25325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25326. }
  25327. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  25328. // warning message.
  25329. type TargetInstanceAggregatedListWarning struct {
  25330. // Code: [Output Only] A warning code, if applicable. For example,
  25331. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25332. // the response.
  25333. //
  25334. // Possible values:
  25335. // "CLEANUP_FAILED"
  25336. // "DEPRECATED_RESOURCE_USED"
  25337. // "DEPRECATED_TYPE_USED"
  25338. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25339. // "EXPERIMENTAL_TYPE_USED"
  25340. // "EXTERNAL_API_WARNING"
  25341. // "FIELD_VALUE_OVERRIDEN"
  25342. // "INJECTED_KERNELS_DEPRECATED"
  25343. // "MISSING_TYPE_DEPENDENCY"
  25344. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25345. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25346. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25347. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25348. // "NEXT_HOP_NOT_RUNNING"
  25349. // "NOT_CRITICAL_ERROR"
  25350. // "NO_RESULTS_ON_PAGE"
  25351. // "REQUIRED_TOS_AGREEMENT"
  25352. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25353. // "RESOURCE_NOT_DELETED"
  25354. // "SCHEMA_VALIDATION_IGNORED"
  25355. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25356. // "UNDECLARED_PROPERTIES"
  25357. // "UNREACHABLE"
  25358. Code string `json:"code,omitempty"`
  25359. // Data: [Output Only] Metadata about this warning in key: value format.
  25360. // For example:
  25361. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25362. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  25363. // Message: [Output Only] A human-readable description of the warning
  25364. // code.
  25365. Message string `json:"message,omitempty"`
  25366. // ForceSendFields is a list of field names (e.g. "Code") to
  25367. // unconditionally include in API requests. By default, fields with
  25368. // empty values are omitted from API requests. However, any non-pointer,
  25369. // non-interface field appearing in ForceSendFields will be sent to the
  25370. // server regardless of whether the field is empty or not. This may be
  25371. // used to include empty fields in Patch requests.
  25372. ForceSendFields []string `json:"-"`
  25373. // NullFields is a list of field names (e.g. "Code") to include in API
  25374. // requests with the JSON null value. By default, fields with empty
  25375. // values are omitted from API requests. However, any field with an
  25376. // empty value appearing in NullFields will be sent to the server as
  25377. // null. It is an error if a field in this list has a non-empty value.
  25378. // This may be used to include null fields in Patch requests.
  25379. NullFields []string `json:"-"`
  25380. }
  25381. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25382. type NoMethod TargetInstanceAggregatedListWarning
  25383. raw := NoMethod(*s)
  25384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25385. }
  25386. type TargetInstanceAggregatedListWarningData struct {
  25387. // Key: [Output Only] A key that provides more detail on the warning
  25388. // being returned. For example, for warnings where there are no results
  25389. // in a list request for a particular zone, this key might be scope and
  25390. // the key value might be the zone name. Other examples might be a key
  25391. // indicating a deprecated resource and a suggested replacement, or a
  25392. // warning about invalid network settings (for example, if an instance
  25393. // attempts to perform IP forwarding but is not enabled for IP
  25394. // forwarding).
  25395. Key string `json:"key,omitempty"`
  25396. // Value: [Output Only] A warning data value corresponding to the key.
  25397. Value string `json:"value,omitempty"`
  25398. // ForceSendFields is a list of field names (e.g. "Key") to
  25399. // unconditionally include in API requests. By default, fields with
  25400. // empty values are omitted from API requests. However, any non-pointer,
  25401. // non-interface field appearing in ForceSendFields will be sent to the
  25402. // server regardless of whether the field is empty or not. This may be
  25403. // used to include empty fields in Patch requests.
  25404. ForceSendFields []string `json:"-"`
  25405. // NullFields is a list of field names (e.g. "Key") to include in API
  25406. // requests with the JSON null value. By default, fields with empty
  25407. // values are omitted from API requests. However, any field with an
  25408. // empty value appearing in NullFields will be sent to the server as
  25409. // null. It is an error if a field in this list has a non-empty value.
  25410. // This may be used to include null fields in Patch requests.
  25411. NullFields []string `json:"-"`
  25412. }
  25413. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25414. type NoMethod TargetInstanceAggregatedListWarningData
  25415. raw := NoMethod(*s)
  25416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25417. }
  25418. // TargetInstanceList: Contains a list of TargetInstance resources.
  25419. type TargetInstanceList struct {
  25420. // Id: [Output Only] Unique identifier for the resource; defined by the
  25421. // server.
  25422. Id string `json:"id,omitempty"`
  25423. // Items: A list of TargetInstance resources.
  25424. Items []*TargetInstance `json:"items,omitempty"`
  25425. // Kind: Type of resource.
  25426. Kind string `json:"kind,omitempty"`
  25427. // NextPageToken: [Output Only] This token allows you to get the next
  25428. // page of results for list requests. If the number of results is larger
  25429. // than maxResults, use the nextPageToken as a value for the query
  25430. // parameter pageToken in the next list request. Subsequent list
  25431. // requests will have their own nextPageToken to continue paging through
  25432. // the results.
  25433. NextPageToken string `json:"nextPageToken,omitempty"`
  25434. // SelfLink: [Output Only] Server-defined URL for this resource.
  25435. SelfLink string `json:"selfLink,omitempty"`
  25436. // Warning: [Output Only] Informational warning message.
  25437. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  25438. // ServerResponse contains the HTTP response code and headers from the
  25439. // server.
  25440. googleapi.ServerResponse `json:"-"`
  25441. // ForceSendFields is a list of field names (e.g. "Id") to
  25442. // unconditionally include in API requests. By default, fields with
  25443. // empty values are omitted from API requests. However, any non-pointer,
  25444. // non-interface field appearing in ForceSendFields will be sent to the
  25445. // server regardless of whether the field is empty or not. This may be
  25446. // used to include empty fields in Patch requests.
  25447. ForceSendFields []string `json:"-"`
  25448. // NullFields is a list of field names (e.g. "Id") to include in API
  25449. // requests with the JSON null value. By default, fields with empty
  25450. // values are omitted from API requests. However, any field with an
  25451. // empty value appearing in NullFields will be sent to the server as
  25452. // null. It is an error if a field in this list has a non-empty value.
  25453. // This may be used to include null fields in Patch requests.
  25454. NullFields []string `json:"-"`
  25455. }
  25456. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  25457. type NoMethod TargetInstanceList
  25458. raw := NoMethod(*s)
  25459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25460. }
  25461. // TargetInstanceListWarning: [Output Only] Informational warning
  25462. // message.
  25463. type TargetInstanceListWarning struct {
  25464. // Code: [Output Only] A warning code, if applicable. For example,
  25465. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25466. // the response.
  25467. //
  25468. // Possible values:
  25469. // "CLEANUP_FAILED"
  25470. // "DEPRECATED_RESOURCE_USED"
  25471. // "DEPRECATED_TYPE_USED"
  25472. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25473. // "EXPERIMENTAL_TYPE_USED"
  25474. // "EXTERNAL_API_WARNING"
  25475. // "FIELD_VALUE_OVERRIDEN"
  25476. // "INJECTED_KERNELS_DEPRECATED"
  25477. // "MISSING_TYPE_DEPENDENCY"
  25478. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25479. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25480. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25481. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25482. // "NEXT_HOP_NOT_RUNNING"
  25483. // "NOT_CRITICAL_ERROR"
  25484. // "NO_RESULTS_ON_PAGE"
  25485. // "REQUIRED_TOS_AGREEMENT"
  25486. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25487. // "RESOURCE_NOT_DELETED"
  25488. // "SCHEMA_VALIDATION_IGNORED"
  25489. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25490. // "UNDECLARED_PROPERTIES"
  25491. // "UNREACHABLE"
  25492. Code string `json:"code,omitempty"`
  25493. // Data: [Output Only] Metadata about this warning in key: value format.
  25494. // For example:
  25495. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25496. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  25497. // Message: [Output Only] A human-readable description of the warning
  25498. // code.
  25499. Message string `json:"message,omitempty"`
  25500. // ForceSendFields is a list of field names (e.g. "Code") to
  25501. // unconditionally include in API requests. By default, fields with
  25502. // empty values are omitted from API requests. However, any non-pointer,
  25503. // non-interface field appearing in ForceSendFields will be sent to the
  25504. // server regardless of whether the field is empty or not. This may be
  25505. // used to include empty fields in Patch requests.
  25506. ForceSendFields []string `json:"-"`
  25507. // NullFields is a list of field names (e.g. "Code") to include in API
  25508. // requests with the JSON null value. By default, fields with empty
  25509. // values are omitted from API requests. However, any field with an
  25510. // empty value appearing in NullFields will be sent to the server as
  25511. // null. It is an error if a field in this list has a non-empty value.
  25512. // This may be used to include null fields in Patch requests.
  25513. NullFields []string `json:"-"`
  25514. }
  25515. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  25516. type NoMethod TargetInstanceListWarning
  25517. raw := NoMethod(*s)
  25518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25519. }
  25520. type TargetInstanceListWarningData struct {
  25521. // Key: [Output Only] A key that provides more detail on the warning
  25522. // being returned. For example, for warnings where there are no results
  25523. // in a list request for a particular zone, this key might be scope and
  25524. // the key value might be the zone name. Other examples might be a key
  25525. // indicating a deprecated resource and a suggested replacement, or a
  25526. // warning about invalid network settings (for example, if an instance
  25527. // attempts to perform IP forwarding but is not enabled for IP
  25528. // forwarding).
  25529. Key string `json:"key,omitempty"`
  25530. // Value: [Output Only] A warning data value corresponding to the key.
  25531. Value string `json:"value,omitempty"`
  25532. // ForceSendFields is a list of field names (e.g. "Key") to
  25533. // unconditionally include in API requests. By default, fields with
  25534. // empty values are omitted from API requests. However, any non-pointer,
  25535. // non-interface field appearing in ForceSendFields will be sent to the
  25536. // server regardless of whether the field is empty or not. This may be
  25537. // used to include empty fields in Patch requests.
  25538. ForceSendFields []string `json:"-"`
  25539. // NullFields is a list of field names (e.g. "Key") to include in API
  25540. // requests with the JSON null value. By default, fields with empty
  25541. // values are omitted from API requests. However, any field with an
  25542. // empty value appearing in NullFields will be sent to the server as
  25543. // null. It is an error if a field in this list has a non-empty value.
  25544. // This may be used to include null fields in Patch requests.
  25545. NullFields []string `json:"-"`
  25546. }
  25547. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  25548. type NoMethod TargetInstanceListWarningData
  25549. raw := NoMethod(*s)
  25550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25551. }
  25552. type TargetInstancesScopedList struct {
  25553. // TargetInstances: A list of target instances contained in this scope.
  25554. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  25555. // Warning: Informational warning which replaces the list of addresses
  25556. // when the list is empty.
  25557. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  25558. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  25559. // unconditionally include in API requests. By default, fields with
  25560. // empty values are omitted from API requests. However, any non-pointer,
  25561. // non-interface field appearing in ForceSendFields will be sent to the
  25562. // server regardless of whether the field is empty or not. This may be
  25563. // used to include empty fields in Patch requests.
  25564. ForceSendFields []string `json:"-"`
  25565. // NullFields is a list of field names (e.g. "TargetInstances") to
  25566. // include in API requests with the JSON null value. By default, fields
  25567. // with empty values are omitted from API requests. However, any field
  25568. // with an empty value appearing in NullFields will be sent to the
  25569. // server as null. It is an error if a field in this list has a
  25570. // non-empty value. This may be used to include null fields in Patch
  25571. // requests.
  25572. NullFields []string `json:"-"`
  25573. }
  25574. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  25575. type NoMethod TargetInstancesScopedList
  25576. raw := NoMethod(*s)
  25577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25578. }
  25579. // TargetInstancesScopedListWarning: Informational warning which
  25580. // replaces the list of addresses when the list is empty.
  25581. type TargetInstancesScopedListWarning struct {
  25582. // Code: [Output Only] A warning code, if applicable. For example,
  25583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25584. // the response.
  25585. //
  25586. // Possible values:
  25587. // "CLEANUP_FAILED"
  25588. // "DEPRECATED_RESOURCE_USED"
  25589. // "DEPRECATED_TYPE_USED"
  25590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25591. // "EXPERIMENTAL_TYPE_USED"
  25592. // "EXTERNAL_API_WARNING"
  25593. // "FIELD_VALUE_OVERRIDEN"
  25594. // "INJECTED_KERNELS_DEPRECATED"
  25595. // "MISSING_TYPE_DEPENDENCY"
  25596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25600. // "NEXT_HOP_NOT_RUNNING"
  25601. // "NOT_CRITICAL_ERROR"
  25602. // "NO_RESULTS_ON_PAGE"
  25603. // "REQUIRED_TOS_AGREEMENT"
  25604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25605. // "RESOURCE_NOT_DELETED"
  25606. // "SCHEMA_VALIDATION_IGNORED"
  25607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25608. // "UNDECLARED_PROPERTIES"
  25609. // "UNREACHABLE"
  25610. Code string `json:"code,omitempty"`
  25611. // Data: [Output Only] Metadata about this warning in key: value format.
  25612. // For example:
  25613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25614. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  25615. // Message: [Output Only] A human-readable description of the warning
  25616. // code.
  25617. Message string `json:"message,omitempty"`
  25618. // ForceSendFields is a list of field names (e.g. "Code") to
  25619. // unconditionally include in API requests. By default, fields with
  25620. // empty values are omitted from API requests. However, any non-pointer,
  25621. // non-interface field appearing in ForceSendFields will be sent to the
  25622. // server regardless of whether the field is empty or not. This may be
  25623. // used to include empty fields in Patch requests.
  25624. ForceSendFields []string `json:"-"`
  25625. // NullFields is a list of field names (e.g. "Code") to include in API
  25626. // requests with the JSON null value. By default, fields with empty
  25627. // values are omitted from API requests. However, any field with an
  25628. // empty value appearing in NullFields will be sent to the server as
  25629. // null. It is an error if a field in this list has a non-empty value.
  25630. // This may be used to include null fields in Patch requests.
  25631. NullFields []string `json:"-"`
  25632. }
  25633. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  25634. type NoMethod TargetInstancesScopedListWarning
  25635. raw := NoMethod(*s)
  25636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25637. }
  25638. type TargetInstancesScopedListWarningData struct {
  25639. // Key: [Output Only] A key that provides more detail on the warning
  25640. // being returned. For example, for warnings where there are no results
  25641. // in a list request for a particular zone, this key might be scope and
  25642. // the key value might be the zone name. Other examples might be a key
  25643. // indicating a deprecated resource and a suggested replacement, or a
  25644. // warning about invalid network settings (for example, if an instance
  25645. // attempts to perform IP forwarding but is not enabled for IP
  25646. // forwarding).
  25647. Key string `json:"key,omitempty"`
  25648. // Value: [Output Only] A warning data value corresponding to the key.
  25649. Value string `json:"value,omitempty"`
  25650. // ForceSendFields is a list of field names (e.g. "Key") to
  25651. // unconditionally include in API requests. By default, fields with
  25652. // empty values are omitted from API requests. However, any non-pointer,
  25653. // non-interface field appearing in ForceSendFields will be sent to the
  25654. // server regardless of whether the field is empty or not. This may be
  25655. // used to include empty fields in Patch requests.
  25656. ForceSendFields []string `json:"-"`
  25657. // NullFields is a list of field names (e.g. "Key") to include in API
  25658. // requests with the JSON null value. By default, fields with empty
  25659. // values are omitted from API requests. However, any field with an
  25660. // empty value appearing in NullFields will be sent to the server as
  25661. // null. It is an error if a field in this list has a non-empty value.
  25662. // This may be used to include null fields in Patch requests.
  25663. NullFields []string `json:"-"`
  25664. }
  25665. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  25666. type NoMethod TargetInstancesScopedListWarningData
  25667. raw := NoMethod(*s)
  25668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25669. }
  25670. // TargetPool: A TargetPool resource. This resource defines a pool of
  25671. // instances, an associated HttpHealthCheck resource, and the fallback
  25672. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  25673. // v1.targetPools ==)
  25674. type TargetPool struct {
  25675. // BackupPool: This field is applicable only when the containing target
  25676. // pool is serving a forwarding rule as the primary pool, and its
  25677. // failoverRatio field is properly set to a value between [0,
  25678. // 1].
  25679. //
  25680. // backupPool and failoverRatio together define the fallback behavior of
  25681. // the primary target pool: if the ratio of the healthy instances in the
  25682. // primary pool is at or below failoverRatio, traffic arriving at the
  25683. // load-balanced IP will be directed to the backup pool.
  25684. //
  25685. // In case where failoverRatio and backupPool are not set, or all the
  25686. // instances in the backup pool are unhealthy, the traffic will be
  25687. // directed back to the primary pool in the "force" mode, where traffic
  25688. // will be spread to the healthy instances with the best effort, or to
  25689. // all instances when no instance is healthy.
  25690. BackupPool string `json:"backupPool,omitempty"`
  25691. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25692. // format.
  25693. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25694. // Description: An optional description of this resource. Provide this
  25695. // property when you create the resource.
  25696. Description string `json:"description,omitempty"`
  25697. // FailoverRatio: This field is applicable only when the containing
  25698. // target pool is serving a forwarding rule as the primary pool (i.e.,
  25699. // not as a backup pool to some other target pool). The value of the
  25700. // field must be in [0, 1].
  25701. //
  25702. // If set, backupPool must also be set. They together define the
  25703. // fallback behavior of the primary target pool: if the ratio of the
  25704. // healthy instances in the primary pool is at or below this number,
  25705. // traffic arriving at the load-balanced IP will be directed to the
  25706. // backup pool.
  25707. //
  25708. // In case where failoverRatio is not set or all the instances in the
  25709. // backup pool are unhealthy, the traffic will be directed back to the
  25710. // primary pool in the "force" mode, where traffic will be spread to the
  25711. // healthy instances with the best effort, or to all instances when no
  25712. // instance is healthy.
  25713. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  25714. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  25715. // instance in this pool is considered healthy if and only if the health
  25716. // checks pass. An empty list means all member instances will be
  25717. // considered healthy at all times. Only HttpHealthChecks are supported.
  25718. // Only one health check may be specified.
  25719. HealthChecks []string `json:"healthChecks,omitempty"`
  25720. // Id: [Output Only] The unique identifier for the resource. This
  25721. // identifier is defined by the server.
  25722. Id uint64 `json:"id,omitempty,string"`
  25723. // Instances: A list of resource URLs to the virtual machine instances
  25724. // serving this pool. They must live in zones contained in the same
  25725. // region as this pool.
  25726. Instances []string `json:"instances,omitempty"`
  25727. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  25728. // for target pools.
  25729. Kind string `json:"kind,omitempty"`
  25730. // Name: Name of the resource. Provided by the client when the resource
  25731. // is created. The name must be 1-63 characters long, and comply with
  25732. // RFC1035. Specifically, the name must be 1-63 characters long and
  25733. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25734. // the first character must be a lowercase letter, and all following
  25735. // characters must be a dash, lowercase letter, or digit, except the
  25736. // last character, which cannot be a dash.
  25737. Name string `json:"name,omitempty"`
  25738. // Region: [Output Only] URL of the region where the target pool
  25739. // resides.
  25740. Region string `json:"region,omitempty"`
  25741. // SelfLink: [Output Only] Server-defined URL for the resource.
  25742. SelfLink string `json:"selfLink,omitempty"`
  25743. // SessionAffinity: Session affinity option, must be one of the
  25744. // following values:
  25745. // NONE: Connections from the same client IP may go to any instance in
  25746. // the pool.
  25747. // CLIENT_IP: Connections from the same client IP will go to the same
  25748. // instance in the pool while that instance remains
  25749. // healthy.
  25750. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  25751. // protocol will go to the same instance in the pool while that instance
  25752. // remains healthy.
  25753. //
  25754. // Possible values:
  25755. // "CLIENT_IP"
  25756. // "CLIENT_IP_PORT_PROTO"
  25757. // "CLIENT_IP_PROTO"
  25758. // "GENERATED_COOKIE"
  25759. // "NONE"
  25760. SessionAffinity string `json:"sessionAffinity,omitempty"`
  25761. // ServerResponse contains the HTTP response code and headers from the
  25762. // server.
  25763. googleapi.ServerResponse `json:"-"`
  25764. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  25765. // unconditionally include in API requests. By default, fields with
  25766. // empty values are omitted from API requests. However, any non-pointer,
  25767. // non-interface field appearing in ForceSendFields will be sent to the
  25768. // server regardless of whether the field is empty or not. This may be
  25769. // used to include empty fields in Patch requests.
  25770. ForceSendFields []string `json:"-"`
  25771. // NullFields is a list of field names (e.g. "BackupPool") to include in
  25772. // API requests with the JSON null value. By default, fields with empty
  25773. // values are omitted from API requests. However, any field with an
  25774. // empty value appearing in NullFields will be sent to the server as
  25775. // null. It is an error if a field in this list has a non-empty value.
  25776. // This may be used to include null fields in Patch requests.
  25777. NullFields []string `json:"-"`
  25778. }
  25779. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  25780. type NoMethod TargetPool
  25781. raw := NoMethod(*s)
  25782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25783. }
  25784. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  25785. type NoMethod TargetPool
  25786. var s1 struct {
  25787. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  25788. *NoMethod
  25789. }
  25790. s1.NoMethod = (*NoMethod)(s)
  25791. if err := json.Unmarshal(data, &s1); err != nil {
  25792. return err
  25793. }
  25794. s.FailoverRatio = float64(s1.FailoverRatio)
  25795. return nil
  25796. }
  25797. type TargetPoolAggregatedList struct {
  25798. // Id: [Output Only] Unique identifier for the resource; defined by the
  25799. // server.
  25800. Id string `json:"id,omitempty"`
  25801. // Items: A list of TargetPool resources.
  25802. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  25803. // Kind: [Output Only] Type of resource. Always
  25804. // compute#targetPoolAggregatedList for aggregated lists of target
  25805. // pools.
  25806. Kind string `json:"kind,omitempty"`
  25807. // NextPageToken: [Output Only] This token allows you to get the next
  25808. // page of results for list requests. If the number of results is larger
  25809. // than maxResults, use the nextPageToken as a value for the query
  25810. // parameter pageToken in the next list request. Subsequent list
  25811. // requests will have their own nextPageToken to continue paging through
  25812. // the results.
  25813. NextPageToken string `json:"nextPageToken,omitempty"`
  25814. // SelfLink: [Output Only] Server-defined URL for this resource.
  25815. SelfLink string `json:"selfLink,omitempty"`
  25816. // Warning: [Output Only] Informational warning message.
  25817. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  25818. // ServerResponse contains the HTTP response code and headers from the
  25819. // server.
  25820. googleapi.ServerResponse `json:"-"`
  25821. // ForceSendFields is a list of field names (e.g. "Id") to
  25822. // unconditionally include in API requests. By default, fields with
  25823. // empty values are omitted from API requests. However, any non-pointer,
  25824. // non-interface field appearing in ForceSendFields will be sent to the
  25825. // server regardless of whether the field is empty or not. This may be
  25826. // used to include empty fields in Patch requests.
  25827. ForceSendFields []string `json:"-"`
  25828. // NullFields is a list of field names (e.g. "Id") to include in API
  25829. // requests with the JSON null value. By default, fields with empty
  25830. // values are omitted from API requests. However, any field with an
  25831. // empty value appearing in NullFields will be sent to the server as
  25832. // null. It is an error if a field in this list has a non-empty value.
  25833. // This may be used to include null fields in Patch requests.
  25834. NullFields []string `json:"-"`
  25835. }
  25836. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  25837. type NoMethod TargetPoolAggregatedList
  25838. raw := NoMethod(*s)
  25839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25840. }
  25841. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  25842. // message.
  25843. type TargetPoolAggregatedListWarning struct {
  25844. // Code: [Output Only] A warning code, if applicable. For example,
  25845. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25846. // the response.
  25847. //
  25848. // Possible values:
  25849. // "CLEANUP_FAILED"
  25850. // "DEPRECATED_RESOURCE_USED"
  25851. // "DEPRECATED_TYPE_USED"
  25852. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25853. // "EXPERIMENTAL_TYPE_USED"
  25854. // "EXTERNAL_API_WARNING"
  25855. // "FIELD_VALUE_OVERRIDEN"
  25856. // "INJECTED_KERNELS_DEPRECATED"
  25857. // "MISSING_TYPE_DEPENDENCY"
  25858. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25859. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25860. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25861. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25862. // "NEXT_HOP_NOT_RUNNING"
  25863. // "NOT_CRITICAL_ERROR"
  25864. // "NO_RESULTS_ON_PAGE"
  25865. // "REQUIRED_TOS_AGREEMENT"
  25866. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25867. // "RESOURCE_NOT_DELETED"
  25868. // "SCHEMA_VALIDATION_IGNORED"
  25869. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25870. // "UNDECLARED_PROPERTIES"
  25871. // "UNREACHABLE"
  25872. Code string `json:"code,omitempty"`
  25873. // Data: [Output Only] Metadata about this warning in key: value format.
  25874. // For example:
  25875. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25876. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  25877. // Message: [Output Only] A human-readable description of the warning
  25878. // code.
  25879. Message string `json:"message,omitempty"`
  25880. // ForceSendFields is a list of field names (e.g. "Code") to
  25881. // unconditionally include in API requests. By default, fields with
  25882. // empty values are omitted from API requests. However, any non-pointer,
  25883. // non-interface field appearing in ForceSendFields will be sent to the
  25884. // server regardless of whether the field is empty or not. This may be
  25885. // used to include empty fields in Patch requests.
  25886. ForceSendFields []string `json:"-"`
  25887. // NullFields is a list of field names (e.g. "Code") to include in API
  25888. // requests with the JSON null value. By default, fields with empty
  25889. // values are omitted from API requests. However, any field with an
  25890. // empty value appearing in NullFields will be sent to the server as
  25891. // null. It is an error if a field in this list has a non-empty value.
  25892. // This may be used to include null fields in Patch requests.
  25893. NullFields []string `json:"-"`
  25894. }
  25895. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25896. type NoMethod TargetPoolAggregatedListWarning
  25897. raw := NoMethod(*s)
  25898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25899. }
  25900. type TargetPoolAggregatedListWarningData struct {
  25901. // Key: [Output Only] A key that provides more detail on the warning
  25902. // being returned. For example, for warnings where there are no results
  25903. // in a list request for a particular zone, this key might be scope and
  25904. // the key value might be the zone name. Other examples might be a key
  25905. // indicating a deprecated resource and a suggested replacement, or a
  25906. // warning about invalid network settings (for example, if an instance
  25907. // attempts to perform IP forwarding but is not enabled for IP
  25908. // forwarding).
  25909. Key string `json:"key,omitempty"`
  25910. // Value: [Output Only] A warning data value corresponding to the key.
  25911. Value string `json:"value,omitempty"`
  25912. // ForceSendFields is a list of field names (e.g. "Key") to
  25913. // unconditionally include in API requests. By default, fields with
  25914. // empty values are omitted from API requests. However, any non-pointer,
  25915. // non-interface field appearing in ForceSendFields will be sent to the
  25916. // server regardless of whether the field is empty or not. This may be
  25917. // used to include empty fields in Patch requests.
  25918. ForceSendFields []string `json:"-"`
  25919. // NullFields is a list of field names (e.g. "Key") to include in API
  25920. // requests with the JSON null value. By default, fields with empty
  25921. // values are omitted from API requests. However, any field with an
  25922. // empty value appearing in NullFields will be sent to the server as
  25923. // null. It is an error if a field in this list has a non-empty value.
  25924. // This may be used to include null fields in Patch requests.
  25925. NullFields []string `json:"-"`
  25926. }
  25927. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25928. type NoMethod TargetPoolAggregatedListWarningData
  25929. raw := NoMethod(*s)
  25930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25931. }
  25932. type TargetPoolInstanceHealth struct {
  25933. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  25934. // Kind: [Output Only] Type of resource. Always
  25935. // compute#targetPoolInstanceHealth when checking the health of an
  25936. // instance.
  25937. Kind string `json:"kind,omitempty"`
  25938. // ServerResponse contains the HTTP response code and headers from the
  25939. // server.
  25940. googleapi.ServerResponse `json:"-"`
  25941. // ForceSendFields is a list of field names (e.g. "HealthStatus") 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. "HealthStatus") to include
  25949. // in API requests with the JSON null value. By default, fields with
  25950. // empty values are omitted from API requests. However, any field with
  25951. // an 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 *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  25957. type NoMethod TargetPoolInstanceHealth
  25958. raw := NoMethod(*s)
  25959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25960. }
  25961. // TargetPoolList: Contains a list of TargetPool resources.
  25962. type TargetPoolList struct {
  25963. // Id: [Output Only] Unique identifier for the resource; defined by the
  25964. // server.
  25965. Id string `json:"id,omitempty"`
  25966. // Items: A list of TargetPool resources.
  25967. Items []*TargetPool `json:"items,omitempty"`
  25968. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  25969. // for lists of target pools.
  25970. Kind string `json:"kind,omitempty"`
  25971. // NextPageToken: [Output Only] This token allows you to get the next
  25972. // page of results for list requests. If the number of results is larger
  25973. // than maxResults, use the nextPageToken as a value for the query
  25974. // parameter pageToken in the next list request. Subsequent list
  25975. // requests will have their own nextPageToken to continue paging through
  25976. // the results.
  25977. NextPageToken string `json:"nextPageToken,omitempty"`
  25978. // SelfLink: [Output Only] Server-defined URL for this resource.
  25979. SelfLink string `json:"selfLink,omitempty"`
  25980. // Warning: [Output Only] Informational warning message.
  25981. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  25982. // ServerResponse contains the HTTP response code and headers from the
  25983. // server.
  25984. googleapi.ServerResponse `json:"-"`
  25985. // ForceSendFields is a list of field names (e.g. "Id") to
  25986. // unconditionally include in API requests. By default, fields with
  25987. // empty values are omitted from API requests. However, any non-pointer,
  25988. // non-interface field appearing in ForceSendFields will be sent to the
  25989. // server regardless of whether the field is empty or not. This may be
  25990. // used to include empty fields in Patch requests.
  25991. ForceSendFields []string `json:"-"`
  25992. // NullFields is a list of field names (e.g. "Id") to include in API
  25993. // requests with the JSON null value. By default, fields with empty
  25994. // values are omitted from API requests. However, any field with an
  25995. // empty value appearing in NullFields will be sent to the server as
  25996. // null. It is an error if a field in this list has a non-empty value.
  25997. // This may be used to include null fields in Patch requests.
  25998. NullFields []string `json:"-"`
  25999. }
  26000. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  26001. type NoMethod TargetPoolList
  26002. raw := NoMethod(*s)
  26003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26004. }
  26005. // TargetPoolListWarning: [Output Only] Informational warning message.
  26006. type TargetPoolListWarning struct {
  26007. // Code: [Output Only] A warning code, if applicable. For example,
  26008. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26009. // the response.
  26010. //
  26011. // Possible values:
  26012. // "CLEANUP_FAILED"
  26013. // "DEPRECATED_RESOURCE_USED"
  26014. // "DEPRECATED_TYPE_USED"
  26015. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26016. // "EXPERIMENTAL_TYPE_USED"
  26017. // "EXTERNAL_API_WARNING"
  26018. // "FIELD_VALUE_OVERRIDEN"
  26019. // "INJECTED_KERNELS_DEPRECATED"
  26020. // "MISSING_TYPE_DEPENDENCY"
  26021. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26022. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26023. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26024. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26025. // "NEXT_HOP_NOT_RUNNING"
  26026. // "NOT_CRITICAL_ERROR"
  26027. // "NO_RESULTS_ON_PAGE"
  26028. // "REQUIRED_TOS_AGREEMENT"
  26029. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26030. // "RESOURCE_NOT_DELETED"
  26031. // "SCHEMA_VALIDATION_IGNORED"
  26032. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26033. // "UNDECLARED_PROPERTIES"
  26034. // "UNREACHABLE"
  26035. Code string `json:"code,omitempty"`
  26036. // Data: [Output Only] Metadata about this warning in key: value format.
  26037. // For example:
  26038. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26039. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  26040. // Message: [Output Only] A human-readable description of the warning
  26041. // code.
  26042. Message string `json:"message,omitempty"`
  26043. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") to include in API
  26051. // requests with the JSON null value. By default, fields with empty
  26052. // values are omitted from API requests. However, any field with an
  26053. // empty value appearing in NullFields will be sent to the server as
  26054. // null. It is an error if a field in this list has a non-empty value.
  26055. // This may be used to include null fields in Patch requests.
  26056. NullFields []string `json:"-"`
  26057. }
  26058. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  26059. type NoMethod TargetPoolListWarning
  26060. raw := NoMethod(*s)
  26061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26062. }
  26063. type TargetPoolListWarningData struct {
  26064. // Key: [Output Only] A key that provides more detail on the warning
  26065. // being returned. For example, for warnings where there are no results
  26066. // in a list request for a particular zone, this key might be scope and
  26067. // the key value might be the zone name. Other examples might be a key
  26068. // indicating a deprecated resource and a suggested replacement, or a
  26069. // warning about invalid network settings (for example, if an instance
  26070. // attempts to perform IP forwarding but is not enabled for IP
  26071. // forwarding).
  26072. Key string `json:"key,omitempty"`
  26073. // Value: [Output Only] A warning data value corresponding to the key.
  26074. Value string `json:"value,omitempty"`
  26075. // ForceSendFields is a list of field names (e.g. "Key") to
  26076. // unconditionally include in API requests. By default, fields with
  26077. // empty values are omitted from API requests. However, any non-pointer,
  26078. // non-interface field appearing in ForceSendFields will be sent to the
  26079. // server regardless of whether the field is empty or not. This may be
  26080. // used to include empty fields in Patch requests.
  26081. ForceSendFields []string `json:"-"`
  26082. // NullFields is a list of field names (e.g. "Key") to include in API
  26083. // requests with the JSON null value. By default, fields with empty
  26084. // values are omitted from API requests. However, any field with an
  26085. // empty value appearing in NullFields will be sent to the server as
  26086. // null. It is an error if a field in this list has a non-empty value.
  26087. // This may be used to include null fields in Patch requests.
  26088. NullFields []string `json:"-"`
  26089. }
  26090. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  26091. type NoMethod TargetPoolListWarningData
  26092. raw := NoMethod(*s)
  26093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26094. }
  26095. type TargetPoolsAddHealthCheckRequest struct {
  26096. // HealthChecks: The HttpHealthCheck to add to the target pool.
  26097. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  26098. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  26099. // unconditionally include in API requests. By default, fields with
  26100. // empty values are omitted from API requests. However, any non-pointer,
  26101. // non-interface field appearing in ForceSendFields will be sent to the
  26102. // server regardless of whether the field is empty or not. This may be
  26103. // used to include empty fields in Patch requests.
  26104. ForceSendFields []string `json:"-"`
  26105. // NullFields is a list of field names (e.g. "HealthChecks") to include
  26106. // in API requests with the JSON null value. By default, fields with
  26107. // empty values are omitted from API requests. However, any field with
  26108. // an empty value appearing in NullFields will be sent to the server as
  26109. // null. It is an error if a field in this list has a non-empty value.
  26110. // This may be used to include null fields in Patch requests.
  26111. NullFields []string `json:"-"`
  26112. }
  26113. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  26114. type NoMethod TargetPoolsAddHealthCheckRequest
  26115. raw := NoMethod(*s)
  26116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26117. }
  26118. type TargetPoolsAddInstanceRequest struct {
  26119. // Instances: A full or partial URL to an instance to add to this target
  26120. // pool. This can be a full or partial URL. For example, the following
  26121. // are valid URLs:
  26122. // -
  26123. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  26124. // - projects/project-id/zones/zone/instances/instance-name
  26125. // - zones/zone/instances/instance-name
  26126. Instances []*InstanceReference `json:"instances,omitempty"`
  26127. // ForceSendFields is a list of field names (e.g. "Instances") to
  26128. // unconditionally include in API requests. By default, fields with
  26129. // empty values are omitted from API requests. However, any non-pointer,
  26130. // non-interface field appearing in ForceSendFields will be sent to the
  26131. // server regardless of whether the field is empty or not. This may be
  26132. // used to include empty fields in Patch requests.
  26133. ForceSendFields []string `json:"-"`
  26134. // NullFields is a list of field names (e.g. "Instances") to include in
  26135. // API requests with the JSON null value. By default, fields with empty
  26136. // values are omitted from API requests. However, any field with an
  26137. // empty value appearing in NullFields will be sent to the server as
  26138. // null. It is an error if a field in this list has a non-empty value.
  26139. // This may be used to include null fields in Patch requests.
  26140. NullFields []string `json:"-"`
  26141. }
  26142. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  26143. type NoMethod TargetPoolsAddInstanceRequest
  26144. raw := NoMethod(*s)
  26145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26146. }
  26147. type TargetPoolsRemoveHealthCheckRequest struct {
  26148. // HealthChecks: Health check URL to be removed. This can be a full or
  26149. // valid partial URL. For example, the following are valid URLs:
  26150. // -
  26151. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  26152. // - projects/project/global/httpHealthChecks/health-check
  26153. // - global/httpHealthChecks/health-check
  26154. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  26155. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  26156. // unconditionally include in API requests. By default, fields with
  26157. // empty values are omitted from API requests. However, any non-pointer,
  26158. // non-interface field appearing in ForceSendFields will be sent to the
  26159. // server regardless of whether the field is empty or not. This may be
  26160. // used to include empty fields in Patch requests.
  26161. ForceSendFields []string `json:"-"`
  26162. // NullFields is a list of field names (e.g. "HealthChecks") to include
  26163. // in API requests with the JSON null value. By default, fields with
  26164. // empty values are omitted from API requests. However, any field with
  26165. // an empty value appearing in NullFields will be sent to the server as
  26166. // null. It is an error if a field in this list has a non-empty value.
  26167. // This may be used to include null fields in Patch requests.
  26168. NullFields []string `json:"-"`
  26169. }
  26170. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  26171. type NoMethod TargetPoolsRemoveHealthCheckRequest
  26172. raw := NoMethod(*s)
  26173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26174. }
  26175. type TargetPoolsRemoveInstanceRequest struct {
  26176. // Instances: URLs of the instances to be removed from target pool.
  26177. Instances []*InstanceReference `json:"instances,omitempty"`
  26178. // ForceSendFields is a list of field names (e.g. "Instances") to
  26179. // unconditionally include in API requests. By default, fields with
  26180. // empty values are omitted from API requests. However, any non-pointer,
  26181. // non-interface field appearing in ForceSendFields will be sent to the
  26182. // server regardless of whether the field is empty or not. This may be
  26183. // used to include empty fields in Patch requests.
  26184. ForceSendFields []string `json:"-"`
  26185. // NullFields is a list of field names (e.g. "Instances") to include in
  26186. // API requests with the JSON null value. By default, fields with empty
  26187. // values are omitted from API requests. However, any field with an
  26188. // empty value appearing in NullFields will be sent to the server as
  26189. // null. It is an error if a field in this list has a non-empty value.
  26190. // This may be used to include null fields in Patch requests.
  26191. NullFields []string `json:"-"`
  26192. }
  26193. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  26194. type NoMethod TargetPoolsRemoveInstanceRequest
  26195. raw := NoMethod(*s)
  26196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26197. }
  26198. type TargetPoolsScopedList struct {
  26199. // TargetPools: A list of target pools contained in this scope.
  26200. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  26201. // Warning: Informational warning which replaces the list of addresses
  26202. // when the list is empty.
  26203. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  26204. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  26205. // unconditionally include in API requests. By default, fields with
  26206. // empty values are omitted from API requests. However, any non-pointer,
  26207. // non-interface field appearing in ForceSendFields will be sent to the
  26208. // server regardless of whether the field is empty or not. This may be
  26209. // used to include empty fields in Patch requests.
  26210. ForceSendFields []string `json:"-"`
  26211. // NullFields is a list of field names (e.g. "TargetPools") to include
  26212. // in API requests with the JSON null value. By default, fields with
  26213. // empty values are omitted from API requests. However, any field with
  26214. // an empty value appearing in NullFields will be sent to the server as
  26215. // null. It is an error if a field in this list has a non-empty value.
  26216. // This may be used to include null fields in Patch requests.
  26217. NullFields []string `json:"-"`
  26218. }
  26219. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  26220. type NoMethod TargetPoolsScopedList
  26221. raw := NoMethod(*s)
  26222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26223. }
  26224. // TargetPoolsScopedListWarning: Informational warning which replaces
  26225. // the list of addresses when the list is empty.
  26226. type TargetPoolsScopedListWarning struct {
  26227. // Code: [Output Only] A warning code, if applicable. For example,
  26228. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26229. // the response.
  26230. //
  26231. // Possible values:
  26232. // "CLEANUP_FAILED"
  26233. // "DEPRECATED_RESOURCE_USED"
  26234. // "DEPRECATED_TYPE_USED"
  26235. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26236. // "EXPERIMENTAL_TYPE_USED"
  26237. // "EXTERNAL_API_WARNING"
  26238. // "FIELD_VALUE_OVERRIDEN"
  26239. // "INJECTED_KERNELS_DEPRECATED"
  26240. // "MISSING_TYPE_DEPENDENCY"
  26241. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26242. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26243. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26244. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26245. // "NEXT_HOP_NOT_RUNNING"
  26246. // "NOT_CRITICAL_ERROR"
  26247. // "NO_RESULTS_ON_PAGE"
  26248. // "REQUIRED_TOS_AGREEMENT"
  26249. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26250. // "RESOURCE_NOT_DELETED"
  26251. // "SCHEMA_VALIDATION_IGNORED"
  26252. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26253. // "UNDECLARED_PROPERTIES"
  26254. // "UNREACHABLE"
  26255. Code string `json:"code,omitempty"`
  26256. // Data: [Output Only] Metadata about this warning in key: value format.
  26257. // For example:
  26258. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26259. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  26260. // Message: [Output Only] A human-readable description of the warning
  26261. // code.
  26262. Message string `json:"message,omitempty"`
  26263. // ForceSendFields is a list of field names (e.g. "Code") to
  26264. // unconditionally include in API requests. By default, fields with
  26265. // empty values are omitted from API requests. However, any non-pointer,
  26266. // non-interface field appearing in ForceSendFields will be sent to the
  26267. // server regardless of whether the field is empty or not. This may be
  26268. // used to include empty fields in Patch requests.
  26269. ForceSendFields []string `json:"-"`
  26270. // NullFields is a list of field names (e.g. "Code") to include in API
  26271. // requests with the JSON null value. By default, fields with empty
  26272. // values are omitted from API requests. However, any field with an
  26273. // empty value appearing in NullFields will be sent to the server as
  26274. // null. It is an error if a field in this list has a non-empty value.
  26275. // This may be used to include null fields in Patch requests.
  26276. NullFields []string `json:"-"`
  26277. }
  26278. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  26279. type NoMethod TargetPoolsScopedListWarning
  26280. raw := NoMethod(*s)
  26281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26282. }
  26283. type TargetPoolsScopedListWarningData struct {
  26284. // Key: [Output Only] A key that provides more detail on the warning
  26285. // being returned. For example, for warnings where there are no results
  26286. // in a list request for a particular zone, this key might be scope and
  26287. // the key value might be the zone name. Other examples might be a key
  26288. // indicating a deprecated resource and a suggested replacement, or a
  26289. // warning about invalid network settings (for example, if an instance
  26290. // attempts to perform IP forwarding but is not enabled for IP
  26291. // forwarding).
  26292. Key string `json:"key,omitempty"`
  26293. // Value: [Output Only] A warning data value corresponding to the key.
  26294. Value string `json:"value,omitempty"`
  26295. // ForceSendFields is a list of field names (e.g. "Key") to
  26296. // 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. "Key") to include in API
  26303. // requests with the JSON null value. By default, fields with empty
  26304. // values are omitted from API requests. However, any field with an
  26305. // empty value appearing in NullFields will be sent to the server as
  26306. // null. It is an error if a field in this list has a non-empty value.
  26307. // This may be used to include null fields in Patch requests.
  26308. NullFields []string `json:"-"`
  26309. }
  26310. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  26311. type NoMethod TargetPoolsScopedListWarningData
  26312. raw := NoMethod(*s)
  26313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26314. }
  26315. type TargetReference struct {
  26316. Target string `json:"target,omitempty"`
  26317. // ForceSendFields is a list of field names (e.g. "Target") to
  26318. // unconditionally include in API requests. By default, fields with
  26319. // empty values are omitted from API requests. However, any non-pointer,
  26320. // non-interface field appearing in ForceSendFields will be sent to the
  26321. // server regardless of whether the field is empty or not. This may be
  26322. // used to include empty fields in Patch requests.
  26323. ForceSendFields []string `json:"-"`
  26324. // NullFields is a list of field names (e.g. "Target") to include in API
  26325. // requests with the JSON null value. By default, fields with empty
  26326. // values are omitted from API requests. However, any field with an
  26327. // empty value appearing in NullFields will be sent to the server as
  26328. // null. It is an error if a field in this list has a non-empty value.
  26329. // This may be used to include null fields in Patch requests.
  26330. NullFields []string `json:"-"`
  26331. }
  26332. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  26333. type NoMethod TargetReference
  26334. raw := NoMethod(*s)
  26335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26336. }
  26337. type TargetSslProxiesSetBackendServiceRequest struct {
  26338. // Service: The URL of the new BackendService resource for the
  26339. // targetSslProxy.
  26340. Service string `json:"service,omitempty"`
  26341. // ForceSendFields is a list of field names (e.g. "Service") to
  26342. // unconditionally include in API requests. By default, fields with
  26343. // empty values are omitted from API requests. However, any non-pointer,
  26344. // non-interface field appearing in ForceSendFields will be sent to the
  26345. // server regardless of whether the field is empty or not. This may be
  26346. // used to include empty fields in Patch requests.
  26347. ForceSendFields []string `json:"-"`
  26348. // NullFields is a list of field names (e.g. "Service") to include in
  26349. // API requests with the JSON null value. By default, fields with empty
  26350. // values are omitted from API requests. However, any field with an
  26351. // empty value appearing in NullFields will be sent to the server as
  26352. // null. It is an error if a field in this list has a non-empty value.
  26353. // This may be used to include null fields in Patch requests.
  26354. NullFields []string `json:"-"`
  26355. }
  26356. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  26357. type NoMethod TargetSslProxiesSetBackendServiceRequest
  26358. raw := NoMethod(*s)
  26359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26360. }
  26361. type TargetSslProxiesSetProxyHeaderRequest struct {
  26362. // ProxyHeader: The new type of proxy header to append before sending
  26363. // data to the backend. NONE or PROXY_V1 are allowed.
  26364. //
  26365. // Possible values:
  26366. // "NONE"
  26367. // "PROXY_V1"
  26368. ProxyHeader string `json:"proxyHeader,omitempty"`
  26369. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  26370. // unconditionally include in API requests. By default, fields with
  26371. // empty values are omitted from API requests. However, any non-pointer,
  26372. // non-interface field appearing in ForceSendFields will be sent to the
  26373. // server regardless of whether the field is empty or not. This may be
  26374. // used to include empty fields in Patch requests.
  26375. ForceSendFields []string `json:"-"`
  26376. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  26377. // in API requests with the JSON null value. By default, fields with
  26378. // empty values are omitted from API requests. However, any field with
  26379. // an empty value appearing in NullFields will be sent to the server as
  26380. // null. It is an error if a field in this list has a non-empty value.
  26381. // This may be used to include null fields in Patch requests.
  26382. NullFields []string `json:"-"`
  26383. }
  26384. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  26385. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  26386. raw := NoMethod(*s)
  26387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26388. }
  26389. type TargetSslProxiesSetSslCertificatesRequest struct {
  26390. // SslCertificates: New set of URLs to SslCertificate resources to
  26391. // associate with this TargetSslProxy. Currently exactly one ssl
  26392. // certificate must be specified.
  26393. SslCertificates []string `json:"sslCertificates,omitempty"`
  26394. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  26395. // unconditionally include in API requests. By default, fields with
  26396. // empty values are omitted from API requests. However, any non-pointer,
  26397. // non-interface field appearing in ForceSendFields will be sent to the
  26398. // server regardless of whether the field is empty or not. This may be
  26399. // used to include empty fields in Patch requests.
  26400. ForceSendFields []string `json:"-"`
  26401. // NullFields is a list of field names (e.g. "SslCertificates") to
  26402. // include in API requests with the JSON null value. By default, fields
  26403. // with empty values are omitted from API requests. However, any field
  26404. // with an empty value appearing in NullFields will be sent to the
  26405. // server as null. It is an error if a field in this list has a
  26406. // non-empty value. This may be used to include null fields in Patch
  26407. // requests.
  26408. NullFields []string `json:"-"`
  26409. }
  26410. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  26411. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  26412. raw := NoMethod(*s)
  26413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26414. }
  26415. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  26416. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  26417. // resource_for v1.targetSslProxies ==)
  26418. type TargetSslProxy struct {
  26419. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26420. // format.
  26421. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26422. // Description: An optional description of this resource. Provide this
  26423. // property when you create the resource.
  26424. Description string `json:"description,omitempty"`
  26425. // Id: [Output Only] The unique identifier for the resource. This
  26426. // identifier is defined by the server.
  26427. Id uint64 `json:"id,omitempty,string"`
  26428. // Kind: [Output Only] Type of the resource. Always
  26429. // compute#targetSslProxy for target SSL proxies.
  26430. Kind string `json:"kind,omitempty"`
  26431. // Name: Name of the resource. Provided by the client when the resource
  26432. // is created. The name must be 1-63 characters long, and comply with
  26433. // RFC1035. Specifically, the name must be 1-63 characters long and
  26434. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26435. // the first character must be a lowercase letter, and all following
  26436. // characters must be a dash, lowercase letter, or digit, except the
  26437. // last character, which cannot be a dash.
  26438. Name string `json:"name,omitempty"`
  26439. // ProxyHeader: Specifies the type of proxy header to append before
  26440. // sending data to the backend, either NONE or PROXY_V1. The default is
  26441. // NONE.
  26442. //
  26443. // Possible values:
  26444. // "NONE"
  26445. // "PROXY_V1"
  26446. ProxyHeader string `json:"proxyHeader,omitempty"`
  26447. // SelfLink: [Output Only] Server-defined URL for the resource.
  26448. SelfLink string `json:"selfLink,omitempty"`
  26449. // Service: URL to the BackendService resource.
  26450. Service string `json:"service,omitempty"`
  26451. // SslCertificates: URLs to SslCertificate resources that are used to
  26452. // authenticate connections to Backends. At least one SSL certificate
  26453. // must be specified. Currently, you may specify up to 15 SSL
  26454. // certificates.
  26455. SslCertificates []string `json:"sslCertificates,omitempty"`
  26456. // SslPolicy: URL of SslPolicy resource that will be associated with the
  26457. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  26458. // not have any SSL policy configured.
  26459. SslPolicy string `json:"sslPolicy,omitempty"`
  26460. // ServerResponse contains the HTTP response code and headers from the
  26461. // server.
  26462. googleapi.ServerResponse `json:"-"`
  26463. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26464. // to unconditionally include in API requests. By default, fields with
  26465. // empty values are omitted from API requests. However, any non-pointer,
  26466. // non-interface field appearing in ForceSendFields will be sent to the
  26467. // server regardless of whether the field is empty or not. This may be
  26468. // used to include empty fields in Patch requests.
  26469. ForceSendFields []string `json:"-"`
  26470. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26471. // include in API requests with the JSON null value. By default, fields
  26472. // with empty values are omitted from API requests. However, any field
  26473. // with an empty value appearing in NullFields will be sent to the
  26474. // server as null. It is an error if a field in this list has a
  26475. // non-empty value. This may be used to include null fields in Patch
  26476. // requests.
  26477. NullFields []string `json:"-"`
  26478. }
  26479. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  26480. type NoMethod TargetSslProxy
  26481. raw := NoMethod(*s)
  26482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26483. }
  26484. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  26485. type TargetSslProxyList struct {
  26486. // Id: [Output Only] Unique identifier for the resource; defined by the
  26487. // server.
  26488. Id string `json:"id,omitempty"`
  26489. // Items: A list of TargetSslProxy resources.
  26490. Items []*TargetSslProxy `json:"items,omitempty"`
  26491. // Kind: Type of resource.
  26492. Kind string `json:"kind,omitempty"`
  26493. // NextPageToken: [Output Only] This token allows you to get the next
  26494. // page of results for list requests. If the number of results is larger
  26495. // than maxResults, use the nextPageToken as a value for the query
  26496. // parameter pageToken in the next list request. Subsequent list
  26497. // requests will have their own nextPageToken to continue paging through
  26498. // the results.
  26499. NextPageToken string `json:"nextPageToken,omitempty"`
  26500. // SelfLink: [Output Only] Server-defined URL for this resource.
  26501. SelfLink string `json:"selfLink,omitempty"`
  26502. // Warning: [Output Only] Informational warning message.
  26503. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  26504. // ServerResponse contains the HTTP response code and headers from the
  26505. // server.
  26506. googleapi.ServerResponse `json:"-"`
  26507. // ForceSendFields is a list of field names (e.g. "Id") to
  26508. // unconditionally include in API requests. By default, fields with
  26509. // empty values are omitted from API requests. However, any non-pointer,
  26510. // non-interface field appearing in ForceSendFields will be sent to the
  26511. // server regardless of whether the field is empty or not. This may be
  26512. // used to include empty fields in Patch requests.
  26513. ForceSendFields []string `json:"-"`
  26514. // NullFields is a list of field names (e.g. "Id") to include in API
  26515. // requests with the JSON null value. By default, fields with empty
  26516. // values are omitted from API requests. However, any field with an
  26517. // empty value appearing in NullFields will be sent to the server as
  26518. // null. It is an error if a field in this list has a non-empty value.
  26519. // This may be used to include null fields in Patch requests.
  26520. NullFields []string `json:"-"`
  26521. }
  26522. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  26523. type NoMethod TargetSslProxyList
  26524. raw := NoMethod(*s)
  26525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26526. }
  26527. // TargetSslProxyListWarning: [Output Only] Informational warning
  26528. // message.
  26529. type TargetSslProxyListWarning struct {
  26530. // Code: [Output Only] A warning code, if applicable. For example,
  26531. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26532. // the response.
  26533. //
  26534. // Possible values:
  26535. // "CLEANUP_FAILED"
  26536. // "DEPRECATED_RESOURCE_USED"
  26537. // "DEPRECATED_TYPE_USED"
  26538. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26539. // "EXPERIMENTAL_TYPE_USED"
  26540. // "EXTERNAL_API_WARNING"
  26541. // "FIELD_VALUE_OVERRIDEN"
  26542. // "INJECTED_KERNELS_DEPRECATED"
  26543. // "MISSING_TYPE_DEPENDENCY"
  26544. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26545. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26546. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26547. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26548. // "NEXT_HOP_NOT_RUNNING"
  26549. // "NOT_CRITICAL_ERROR"
  26550. // "NO_RESULTS_ON_PAGE"
  26551. // "REQUIRED_TOS_AGREEMENT"
  26552. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26553. // "RESOURCE_NOT_DELETED"
  26554. // "SCHEMA_VALIDATION_IGNORED"
  26555. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26556. // "UNDECLARED_PROPERTIES"
  26557. // "UNREACHABLE"
  26558. Code string `json:"code,omitempty"`
  26559. // Data: [Output Only] Metadata about this warning in key: value format.
  26560. // For example:
  26561. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26562. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  26563. // Message: [Output Only] A human-readable description of the warning
  26564. // code.
  26565. Message string `json:"message,omitempty"`
  26566. // ForceSendFields is a list of field names (e.g. "Code") to
  26567. // unconditionally include in API requests. By default, fields with
  26568. // empty values are omitted from API requests. However, any non-pointer,
  26569. // non-interface field appearing in ForceSendFields will be sent to the
  26570. // server regardless of whether the field is empty or not. This may be
  26571. // used to include empty fields in Patch requests.
  26572. ForceSendFields []string `json:"-"`
  26573. // NullFields is a list of field names (e.g. "Code") to include in API
  26574. // requests with the JSON null value. By default, fields with empty
  26575. // values are omitted from API requests. However, any field with an
  26576. // empty value appearing in NullFields will be sent to the server as
  26577. // null. It is an error if a field in this list has a non-empty value.
  26578. // This may be used to include null fields in Patch requests.
  26579. NullFields []string `json:"-"`
  26580. }
  26581. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  26582. type NoMethod TargetSslProxyListWarning
  26583. raw := NoMethod(*s)
  26584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26585. }
  26586. type TargetSslProxyListWarningData struct {
  26587. // Key: [Output Only] A key that provides more detail on the warning
  26588. // being returned. For example, for warnings where there are no results
  26589. // in a list request for a particular zone, this key might be scope and
  26590. // the key value might be the zone name. Other examples might be a key
  26591. // indicating a deprecated resource and a suggested replacement, or a
  26592. // warning about invalid network settings (for example, if an instance
  26593. // attempts to perform IP forwarding but is not enabled for IP
  26594. // forwarding).
  26595. Key string `json:"key,omitempty"`
  26596. // Value: [Output Only] A warning data value corresponding to the key.
  26597. Value string `json:"value,omitempty"`
  26598. // ForceSendFields is a list of field names (e.g. "Key") to
  26599. // unconditionally include in API requests. By default, fields with
  26600. // empty values are omitted from API requests. However, any non-pointer,
  26601. // non-interface field appearing in ForceSendFields will be sent to the
  26602. // server regardless of whether the field is empty or not. This may be
  26603. // used to include empty fields in Patch requests.
  26604. ForceSendFields []string `json:"-"`
  26605. // NullFields is a list of field names (e.g. "Key") to include in API
  26606. // requests with the JSON null value. By default, fields with empty
  26607. // values are omitted from API requests. However, any field with an
  26608. // empty value appearing in NullFields will be sent to the server as
  26609. // null. It is an error if a field in this list has a non-empty value.
  26610. // This may be used to include null fields in Patch requests.
  26611. NullFields []string `json:"-"`
  26612. }
  26613. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  26614. type NoMethod TargetSslProxyListWarningData
  26615. raw := NoMethod(*s)
  26616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26617. }
  26618. type TargetTcpProxiesSetBackendServiceRequest struct {
  26619. // Service: The URL of the new BackendService resource for the
  26620. // targetTcpProxy.
  26621. Service string `json:"service,omitempty"`
  26622. // ForceSendFields is a list of field names (e.g. "Service") to
  26623. // unconditionally include in API requests. By default, fields with
  26624. // empty values are omitted from API requests. However, any non-pointer,
  26625. // non-interface field appearing in ForceSendFields will be sent to the
  26626. // server regardless of whether the field is empty or not. This may be
  26627. // used to include empty fields in Patch requests.
  26628. ForceSendFields []string `json:"-"`
  26629. // NullFields is a list of field names (e.g. "Service") to include in
  26630. // API requests with the JSON null value. By default, fields with empty
  26631. // values are omitted from API requests. However, any field with an
  26632. // empty value appearing in NullFields will be sent to the server as
  26633. // null. It is an error if a field in this list has a non-empty value.
  26634. // This may be used to include null fields in Patch requests.
  26635. NullFields []string `json:"-"`
  26636. }
  26637. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  26638. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  26639. raw := NoMethod(*s)
  26640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26641. }
  26642. type TargetTcpProxiesSetProxyHeaderRequest struct {
  26643. // ProxyHeader: The new type of proxy header to append before sending
  26644. // data to the backend. NONE or PROXY_V1 are allowed.
  26645. //
  26646. // Possible values:
  26647. // "NONE"
  26648. // "PROXY_V1"
  26649. ProxyHeader string `json:"proxyHeader,omitempty"`
  26650. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  26651. // unconditionally include in API requests. By default, fields with
  26652. // empty values are omitted from API requests. However, any non-pointer,
  26653. // non-interface field appearing in ForceSendFields will be sent to the
  26654. // server regardless of whether the field is empty or not. This may be
  26655. // used to include empty fields in Patch requests.
  26656. ForceSendFields []string `json:"-"`
  26657. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  26658. // in API requests with the JSON null value. By default, fields with
  26659. // empty values are omitted from API requests. However, any field with
  26660. // an empty value appearing in NullFields will be sent to the server as
  26661. // null. It is an error if a field in this list has a non-empty value.
  26662. // This may be used to include null fields in Patch requests.
  26663. NullFields []string `json:"-"`
  26664. }
  26665. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  26666. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  26667. raw := NoMethod(*s)
  26668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26669. }
  26670. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  26671. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  26672. // resource_for v1.targetTcpProxies ==)
  26673. type TargetTcpProxy struct {
  26674. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26675. // format.
  26676. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26677. // Description: An optional description of this resource. Provide this
  26678. // property when you create the resource.
  26679. Description string `json:"description,omitempty"`
  26680. // Id: [Output Only] The unique identifier for the resource. This
  26681. // identifier is defined by the server.
  26682. Id uint64 `json:"id,omitempty,string"`
  26683. // Kind: [Output Only] Type of the resource. Always
  26684. // compute#targetTcpProxy for target TCP proxies.
  26685. Kind string `json:"kind,omitempty"`
  26686. // Name: Name of the resource. Provided by the client when the resource
  26687. // is created. The name must be 1-63 characters long, and comply with
  26688. // RFC1035. Specifically, the name must be 1-63 characters long and
  26689. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26690. // the first character must be a lowercase letter, and all following
  26691. // characters must be a dash, lowercase letter, or digit, except the
  26692. // last character, which cannot be a dash.
  26693. Name string `json:"name,omitempty"`
  26694. // ProxyHeader: Specifies the type of proxy header to append before
  26695. // sending data to the backend, either NONE or PROXY_V1. The default is
  26696. // NONE.
  26697. //
  26698. // Possible values:
  26699. // "NONE"
  26700. // "PROXY_V1"
  26701. ProxyHeader string `json:"proxyHeader,omitempty"`
  26702. // SelfLink: [Output Only] Server-defined URL for the resource.
  26703. SelfLink string `json:"selfLink,omitempty"`
  26704. // Service: URL to the BackendService resource.
  26705. Service string `json:"service,omitempty"`
  26706. // ServerResponse contains the HTTP response code and headers from the
  26707. // server.
  26708. googleapi.ServerResponse `json:"-"`
  26709. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26710. // to unconditionally include in API requests. By default, fields with
  26711. // empty values are omitted from API requests. However, any non-pointer,
  26712. // non-interface field appearing in ForceSendFields will be sent to the
  26713. // server regardless of whether the field is empty or not. This may be
  26714. // used to include empty fields in Patch requests.
  26715. ForceSendFields []string `json:"-"`
  26716. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26717. // include in API requests with the JSON null value. By default, fields
  26718. // with empty values are omitted from API requests. However, any field
  26719. // with an empty value appearing in NullFields will be sent to the
  26720. // server as null. It is an error if a field in this list has a
  26721. // non-empty value. This may be used to include null fields in Patch
  26722. // requests.
  26723. NullFields []string `json:"-"`
  26724. }
  26725. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  26726. type NoMethod TargetTcpProxy
  26727. raw := NoMethod(*s)
  26728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26729. }
  26730. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  26731. type TargetTcpProxyList struct {
  26732. // Id: [Output Only] Unique identifier for the resource; defined by the
  26733. // server.
  26734. Id string `json:"id,omitempty"`
  26735. // Items: A list of TargetTcpProxy resources.
  26736. Items []*TargetTcpProxy `json:"items,omitempty"`
  26737. // Kind: Type of resource.
  26738. Kind string `json:"kind,omitempty"`
  26739. // NextPageToken: [Output Only] This token allows you to get the next
  26740. // page of results for list requests. If the number of results is larger
  26741. // than maxResults, use the nextPageToken as a value for the query
  26742. // parameter pageToken in the next list request. Subsequent list
  26743. // requests will have their own nextPageToken to continue paging through
  26744. // the results.
  26745. NextPageToken string `json:"nextPageToken,omitempty"`
  26746. // SelfLink: [Output Only] Server-defined URL for this resource.
  26747. SelfLink string `json:"selfLink,omitempty"`
  26748. // Warning: [Output Only] Informational warning message.
  26749. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  26750. // ServerResponse contains the HTTP response code and headers from the
  26751. // server.
  26752. googleapi.ServerResponse `json:"-"`
  26753. // ForceSendFields is a list of field names (e.g. "Id") to
  26754. // unconditionally include in API requests. By default, fields with
  26755. // empty values are omitted from API requests. However, any non-pointer,
  26756. // non-interface field appearing in ForceSendFields will be sent to the
  26757. // server regardless of whether the field is empty or not. This may be
  26758. // used to include empty fields in Patch requests.
  26759. ForceSendFields []string `json:"-"`
  26760. // NullFields is a list of field names (e.g. "Id") to include in API
  26761. // requests with the JSON null value. By default, fields with empty
  26762. // values are omitted from API requests. However, any field with an
  26763. // empty value appearing in NullFields will be sent to the server as
  26764. // null. It is an error if a field in this list has a non-empty value.
  26765. // This may be used to include null fields in Patch requests.
  26766. NullFields []string `json:"-"`
  26767. }
  26768. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  26769. type NoMethod TargetTcpProxyList
  26770. raw := NoMethod(*s)
  26771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26772. }
  26773. // TargetTcpProxyListWarning: [Output Only] Informational warning
  26774. // message.
  26775. type TargetTcpProxyListWarning struct {
  26776. // Code: [Output Only] A warning code, if applicable. For example,
  26777. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26778. // the response.
  26779. //
  26780. // Possible values:
  26781. // "CLEANUP_FAILED"
  26782. // "DEPRECATED_RESOURCE_USED"
  26783. // "DEPRECATED_TYPE_USED"
  26784. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26785. // "EXPERIMENTAL_TYPE_USED"
  26786. // "EXTERNAL_API_WARNING"
  26787. // "FIELD_VALUE_OVERRIDEN"
  26788. // "INJECTED_KERNELS_DEPRECATED"
  26789. // "MISSING_TYPE_DEPENDENCY"
  26790. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26791. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26792. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26793. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26794. // "NEXT_HOP_NOT_RUNNING"
  26795. // "NOT_CRITICAL_ERROR"
  26796. // "NO_RESULTS_ON_PAGE"
  26797. // "REQUIRED_TOS_AGREEMENT"
  26798. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26799. // "RESOURCE_NOT_DELETED"
  26800. // "SCHEMA_VALIDATION_IGNORED"
  26801. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26802. // "UNDECLARED_PROPERTIES"
  26803. // "UNREACHABLE"
  26804. Code string `json:"code,omitempty"`
  26805. // Data: [Output Only] Metadata about this warning in key: value format.
  26806. // For example:
  26807. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26808. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  26809. // Message: [Output Only] A human-readable description of the warning
  26810. // code.
  26811. Message string `json:"message,omitempty"`
  26812. // ForceSendFields is a list of field names (e.g. "Code") to
  26813. // unconditionally include in API requests. By default, fields with
  26814. // empty values are omitted from API requests. However, any non-pointer,
  26815. // non-interface field appearing in ForceSendFields will be sent to the
  26816. // server regardless of whether the field is empty or not. This may be
  26817. // used to include empty fields in Patch requests.
  26818. ForceSendFields []string `json:"-"`
  26819. // NullFields is a list of field names (e.g. "Code") to include in API
  26820. // requests with the JSON null value. By default, fields with empty
  26821. // values are omitted from API requests. However, any field with an
  26822. // empty value appearing in NullFields will be sent to the server as
  26823. // null. It is an error if a field in this list has a non-empty value.
  26824. // This may be used to include null fields in Patch requests.
  26825. NullFields []string `json:"-"`
  26826. }
  26827. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  26828. type NoMethod TargetTcpProxyListWarning
  26829. raw := NoMethod(*s)
  26830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26831. }
  26832. type TargetTcpProxyListWarningData struct {
  26833. // Key: [Output Only] A key that provides more detail on the warning
  26834. // being returned. For example, for warnings where there are no results
  26835. // in a list request for a particular zone, this key might be scope and
  26836. // the key value might be the zone name. Other examples might be a key
  26837. // indicating a deprecated resource and a suggested replacement, or a
  26838. // warning about invalid network settings (for example, if an instance
  26839. // attempts to perform IP forwarding but is not enabled for IP
  26840. // forwarding).
  26841. Key string `json:"key,omitempty"`
  26842. // Value: [Output Only] A warning data value corresponding to the key.
  26843. Value string `json:"value,omitempty"`
  26844. // ForceSendFields is a list of field names (e.g. "Key") to
  26845. // unconditionally include in API requests. By default, fields with
  26846. // empty values are omitted from API requests. However, any non-pointer,
  26847. // non-interface field appearing in ForceSendFields will be sent to the
  26848. // server regardless of whether the field is empty or not. This may be
  26849. // used to include empty fields in Patch requests.
  26850. ForceSendFields []string `json:"-"`
  26851. // NullFields is a list of field names (e.g. "Key") to include in API
  26852. // requests with the JSON null value. By default, fields with empty
  26853. // values are omitted from API requests. However, any field with an
  26854. // empty value appearing in NullFields will be sent to the server as
  26855. // null. It is an error if a field in this list has a non-empty value.
  26856. // This may be used to include null fields in Patch requests.
  26857. NullFields []string `json:"-"`
  26858. }
  26859. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  26860. type NoMethod TargetTcpProxyListWarningData
  26861. raw := NoMethod(*s)
  26862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26863. }
  26864. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  26865. // resource_for beta.targetVpnGateways ==) (== resource_for
  26866. // v1.targetVpnGateways ==)
  26867. type TargetVpnGateway struct {
  26868. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26869. // format.
  26870. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26871. // Description: An optional description of this resource. Provide this
  26872. // property when you create the resource.
  26873. Description string `json:"description,omitempty"`
  26874. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  26875. // resources. ForwardingRules are created using
  26876. // compute.forwardingRules.insert and associated to a VPN gateway.
  26877. ForwardingRules []string `json:"forwardingRules,omitempty"`
  26878. // Id: [Output Only] The unique identifier for the resource. This
  26879. // identifier is defined by the server.
  26880. Id uint64 `json:"id,omitempty,string"`
  26881. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  26882. // for target VPN gateways.
  26883. Kind string `json:"kind,omitempty"`
  26884. // LabelFingerprint: A fingerprint for the labels being applied to this
  26885. // TargetVpnGateway, which is essentially a hash of the labels set used
  26886. // for optimistic locking. The fingerprint is initially generated by
  26887. // Compute Engine and changes after every request to modify or update
  26888. // labels. You must always provide an up-to-date fingerprint hash in
  26889. // order to update or change labels, otherwise the request will fail
  26890. // with error 412 conditionNotMet.
  26891. //
  26892. // To see the latest fingerprint, make a get() request to retrieve a
  26893. // TargetVpnGateway.
  26894. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  26895. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  26896. // be later modified by the setLabels method. Each label key/value must
  26897. // comply with RFC1035. Label values may be empty.
  26898. Labels map[string]string `json:"labels,omitempty"`
  26899. // Name: Name of the resource. Provided by the client when the resource
  26900. // is created. The name must be 1-63 characters long, and comply with
  26901. // RFC1035. Specifically, the name must be 1-63 characters long and
  26902. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26903. // the first character must be a lowercase letter, and all following
  26904. // characters must be a dash, lowercase letter, or digit, except the
  26905. // last character, which cannot be a dash.
  26906. Name string `json:"name,omitempty"`
  26907. // Network: URL of the network to which this VPN gateway is attached.
  26908. // Provided by the client when the VPN gateway is created.
  26909. Network string `json:"network,omitempty"`
  26910. // Region: [Output Only] URL of the region where the target VPN gateway
  26911. // resides. You must specify this field as part of the HTTP request URL.
  26912. // It is not settable as a field in the request body.
  26913. Region string `json:"region,omitempty"`
  26914. // SelfLink: [Output Only] Server-defined URL for the resource.
  26915. SelfLink string `json:"selfLink,omitempty"`
  26916. // Status: [Output Only] The status of the VPN gateway.
  26917. //
  26918. // Possible values:
  26919. // "CREATING"
  26920. // "DELETING"
  26921. // "FAILED"
  26922. // "READY"
  26923. Status string `json:"status,omitempty"`
  26924. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  26925. // VpnTunnels are created using compute.vpntunnels.insert method and
  26926. // associated to a VPN gateway.
  26927. Tunnels []string `json:"tunnels,omitempty"`
  26928. // ServerResponse contains the HTTP response code and headers from the
  26929. // server.
  26930. googleapi.ServerResponse `json:"-"`
  26931. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26932. // to unconditionally include in API requests. By default, fields with
  26933. // empty values are omitted from API requests. However, any non-pointer,
  26934. // non-interface field appearing in ForceSendFields will be sent to the
  26935. // server regardless of whether the field is empty or not. This may be
  26936. // used to include empty fields in Patch requests.
  26937. ForceSendFields []string `json:"-"`
  26938. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26939. // include in API requests with the JSON null value. By default, fields
  26940. // with empty values are omitted from API requests. However, any field
  26941. // with an empty value appearing in NullFields will be sent to the
  26942. // server as null. It is an error if a field in this list has a
  26943. // non-empty value. This may be used to include null fields in Patch
  26944. // requests.
  26945. NullFields []string `json:"-"`
  26946. }
  26947. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  26948. type NoMethod TargetVpnGateway
  26949. raw := NoMethod(*s)
  26950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26951. }
  26952. type TargetVpnGatewayAggregatedList struct {
  26953. // Id: [Output Only] Unique identifier for the resource; defined by the
  26954. // server.
  26955. Id string `json:"id,omitempty"`
  26956. // Items: A list of TargetVpnGateway resources.
  26957. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  26958. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  26959. // for target VPN gateways.
  26960. Kind string `json:"kind,omitempty"`
  26961. // NextPageToken: [Output Only] This token allows you to get the next
  26962. // page of results for list requests. If the number of results is larger
  26963. // than maxResults, use the nextPageToken as a value for the query
  26964. // parameter pageToken in the next list request. Subsequent list
  26965. // requests will have their own nextPageToken to continue paging through
  26966. // the results.
  26967. NextPageToken string `json:"nextPageToken,omitempty"`
  26968. // SelfLink: [Output Only] Server-defined URL for this resource.
  26969. SelfLink string `json:"selfLink,omitempty"`
  26970. // Warning: [Output Only] Informational warning message.
  26971. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  26972. // ServerResponse contains the HTTP response code and headers from the
  26973. // server.
  26974. googleapi.ServerResponse `json:"-"`
  26975. // ForceSendFields is a list of field names (e.g. "Id") to
  26976. // unconditionally include in API requests. By default, fields with
  26977. // empty values are omitted from API requests. However, any non-pointer,
  26978. // non-interface field appearing in ForceSendFields will be sent to the
  26979. // server regardless of whether the field is empty or not. This may be
  26980. // used to include empty fields in Patch requests.
  26981. ForceSendFields []string `json:"-"`
  26982. // NullFields is a list of field names (e.g. "Id") to include in API
  26983. // requests with the JSON null value. By default, fields with empty
  26984. // values are omitted from API requests. However, any field with an
  26985. // empty value appearing in NullFields will be sent to the server as
  26986. // null. It is an error if a field in this list has a non-empty value.
  26987. // This may be used to include null fields in Patch requests.
  26988. NullFields []string `json:"-"`
  26989. }
  26990. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  26991. type NoMethod TargetVpnGatewayAggregatedList
  26992. raw := NoMethod(*s)
  26993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26994. }
  26995. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  26996. // warning message.
  26997. type TargetVpnGatewayAggregatedListWarning struct {
  26998. // Code: [Output Only] A warning code, if applicable. For example,
  26999. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27000. // the response.
  27001. //
  27002. // Possible values:
  27003. // "CLEANUP_FAILED"
  27004. // "DEPRECATED_RESOURCE_USED"
  27005. // "DEPRECATED_TYPE_USED"
  27006. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27007. // "EXPERIMENTAL_TYPE_USED"
  27008. // "EXTERNAL_API_WARNING"
  27009. // "FIELD_VALUE_OVERRIDEN"
  27010. // "INJECTED_KERNELS_DEPRECATED"
  27011. // "MISSING_TYPE_DEPENDENCY"
  27012. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27013. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27014. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27015. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27016. // "NEXT_HOP_NOT_RUNNING"
  27017. // "NOT_CRITICAL_ERROR"
  27018. // "NO_RESULTS_ON_PAGE"
  27019. // "REQUIRED_TOS_AGREEMENT"
  27020. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27021. // "RESOURCE_NOT_DELETED"
  27022. // "SCHEMA_VALIDATION_IGNORED"
  27023. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27024. // "UNDECLARED_PROPERTIES"
  27025. // "UNREACHABLE"
  27026. Code string `json:"code,omitempty"`
  27027. // Data: [Output Only] Metadata about this warning in key: value format.
  27028. // For example:
  27029. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27030. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  27031. // Message: [Output Only] A human-readable description of the warning
  27032. // code.
  27033. Message string `json:"message,omitempty"`
  27034. // ForceSendFields is a list of field names (e.g. "Code") to
  27035. // unconditionally include in API requests. By default, fields with
  27036. // empty values are omitted from API requests. However, any non-pointer,
  27037. // non-interface field appearing in ForceSendFields will be sent to the
  27038. // server regardless of whether the field is empty or not. This may be
  27039. // used to include empty fields in Patch requests.
  27040. ForceSendFields []string `json:"-"`
  27041. // NullFields is a list of field names (e.g. "Code") to include in API
  27042. // requests with the JSON null value. By default, fields with empty
  27043. // values are omitted from API requests. However, any field with an
  27044. // empty value appearing in NullFields will be sent to the server as
  27045. // null. It is an error if a field in this list has a non-empty value.
  27046. // This may be used to include null fields in Patch requests.
  27047. NullFields []string `json:"-"`
  27048. }
  27049. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27050. type NoMethod TargetVpnGatewayAggregatedListWarning
  27051. raw := NoMethod(*s)
  27052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27053. }
  27054. type TargetVpnGatewayAggregatedListWarningData struct {
  27055. // Key: [Output Only] A key that provides more detail on the warning
  27056. // being returned. For example, for warnings where there are no results
  27057. // in a list request for a particular zone, this key might be scope and
  27058. // the key value might be the zone name. Other examples might be a key
  27059. // indicating a deprecated resource and a suggested replacement, or a
  27060. // warning about invalid network settings (for example, if an instance
  27061. // attempts to perform IP forwarding but is not enabled for IP
  27062. // forwarding).
  27063. Key string `json:"key,omitempty"`
  27064. // Value: [Output Only] A warning data value corresponding to the key.
  27065. Value string `json:"value,omitempty"`
  27066. // ForceSendFields is a list of field names (e.g. "Key") to
  27067. // unconditionally include in API requests. By default, fields with
  27068. // empty values are omitted from API requests. However, any non-pointer,
  27069. // non-interface field appearing in ForceSendFields will be sent to the
  27070. // server regardless of whether the field is empty or not. This may be
  27071. // used to include empty fields in Patch requests.
  27072. ForceSendFields []string `json:"-"`
  27073. // NullFields is a list of field names (e.g. "Key") to include in API
  27074. // requests with the JSON null value. By default, fields with empty
  27075. // values are omitted from API requests. However, any field with an
  27076. // empty value appearing in NullFields will be sent to the server as
  27077. // null. It is an error if a field in this list has a non-empty value.
  27078. // This may be used to include null fields in Patch requests.
  27079. NullFields []string `json:"-"`
  27080. }
  27081. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27082. type NoMethod TargetVpnGatewayAggregatedListWarningData
  27083. raw := NoMethod(*s)
  27084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27085. }
  27086. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  27087. type TargetVpnGatewayList struct {
  27088. // Id: [Output Only] Unique identifier for the resource; defined by the
  27089. // server.
  27090. Id string `json:"id,omitempty"`
  27091. // Items: A list of TargetVpnGateway resources.
  27092. Items []*TargetVpnGateway `json:"items,omitempty"`
  27093. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  27094. // for target VPN gateways.
  27095. Kind string `json:"kind,omitempty"`
  27096. // NextPageToken: [Output Only] This token allows you to get the next
  27097. // page of results for list requests. If the number of results is larger
  27098. // than maxResults, use the nextPageToken as a value for the query
  27099. // parameter pageToken in the next list request. Subsequent list
  27100. // requests will have their own nextPageToken to continue paging through
  27101. // the results.
  27102. NextPageToken string `json:"nextPageToken,omitempty"`
  27103. // SelfLink: [Output Only] Server-defined URL for this resource.
  27104. SelfLink string `json:"selfLink,omitempty"`
  27105. // Warning: [Output Only] Informational warning message.
  27106. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  27107. // ServerResponse contains the HTTP response code and headers from the
  27108. // server.
  27109. googleapi.ServerResponse `json:"-"`
  27110. // ForceSendFields is a list of field names (e.g. "Id") to
  27111. // unconditionally include in API requests. By default, fields with
  27112. // empty values are omitted from API requests. However, any non-pointer,
  27113. // non-interface field appearing in ForceSendFields will be sent to the
  27114. // server regardless of whether the field is empty or not. This may be
  27115. // used to include empty fields in Patch requests.
  27116. ForceSendFields []string `json:"-"`
  27117. // NullFields is a list of field names (e.g. "Id") to include in API
  27118. // requests with the JSON null value. By default, fields with empty
  27119. // values are omitted from API requests. However, any field with an
  27120. // empty value appearing in NullFields will be sent to the server as
  27121. // null. It is an error if a field in this list has a non-empty value.
  27122. // This may be used to include null fields in Patch requests.
  27123. NullFields []string `json:"-"`
  27124. }
  27125. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  27126. type NoMethod TargetVpnGatewayList
  27127. raw := NoMethod(*s)
  27128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27129. }
  27130. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  27131. // message.
  27132. type TargetVpnGatewayListWarning struct {
  27133. // Code: [Output Only] A warning code, if applicable. For example,
  27134. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27135. // the response.
  27136. //
  27137. // Possible values:
  27138. // "CLEANUP_FAILED"
  27139. // "DEPRECATED_RESOURCE_USED"
  27140. // "DEPRECATED_TYPE_USED"
  27141. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27142. // "EXPERIMENTAL_TYPE_USED"
  27143. // "EXTERNAL_API_WARNING"
  27144. // "FIELD_VALUE_OVERRIDEN"
  27145. // "INJECTED_KERNELS_DEPRECATED"
  27146. // "MISSING_TYPE_DEPENDENCY"
  27147. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27148. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27149. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27150. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27151. // "NEXT_HOP_NOT_RUNNING"
  27152. // "NOT_CRITICAL_ERROR"
  27153. // "NO_RESULTS_ON_PAGE"
  27154. // "REQUIRED_TOS_AGREEMENT"
  27155. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27156. // "RESOURCE_NOT_DELETED"
  27157. // "SCHEMA_VALIDATION_IGNORED"
  27158. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27159. // "UNDECLARED_PROPERTIES"
  27160. // "UNREACHABLE"
  27161. Code string `json:"code,omitempty"`
  27162. // Data: [Output Only] Metadata about this warning in key: value format.
  27163. // For example:
  27164. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27165. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  27166. // Message: [Output Only] A human-readable description of the warning
  27167. // code.
  27168. Message string `json:"message,omitempty"`
  27169. // ForceSendFields is a list of field names (e.g. "Code") to
  27170. // unconditionally include in API requests. By default, fields with
  27171. // empty values are omitted from API requests. However, any non-pointer,
  27172. // non-interface field appearing in ForceSendFields will be sent to the
  27173. // server regardless of whether the field is empty or not. This may be
  27174. // used to include empty fields in Patch requests.
  27175. ForceSendFields []string `json:"-"`
  27176. // NullFields is a list of field names (e.g. "Code") to include in API
  27177. // requests with the JSON null value. By default, fields with empty
  27178. // values are omitted from API requests. However, any field with an
  27179. // empty value appearing in NullFields will be sent to the server as
  27180. // null. It is an error if a field in this list has a non-empty value.
  27181. // This may be used to include null fields in Patch requests.
  27182. NullFields []string `json:"-"`
  27183. }
  27184. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  27185. type NoMethod TargetVpnGatewayListWarning
  27186. raw := NoMethod(*s)
  27187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27188. }
  27189. type TargetVpnGatewayListWarningData struct {
  27190. // Key: [Output Only] A key that provides more detail on the warning
  27191. // being returned. For example, for warnings where there are no results
  27192. // in a list request for a particular zone, this key might be scope and
  27193. // the key value might be the zone name. Other examples might be a key
  27194. // indicating a deprecated resource and a suggested replacement, or a
  27195. // warning about invalid network settings (for example, if an instance
  27196. // attempts to perform IP forwarding but is not enabled for IP
  27197. // forwarding).
  27198. Key string `json:"key,omitempty"`
  27199. // Value: [Output Only] A warning data value corresponding to the key.
  27200. Value string `json:"value,omitempty"`
  27201. // ForceSendFields is a list of field names (e.g. "Key") to
  27202. // unconditionally include in API requests. By default, fields with
  27203. // empty values are omitted from API requests. However, any non-pointer,
  27204. // non-interface field appearing in ForceSendFields will be sent to the
  27205. // server regardless of whether the field is empty or not. This may be
  27206. // used to include empty fields in Patch requests.
  27207. ForceSendFields []string `json:"-"`
  27208. // NullFields is a list of field names (e.g. "Key") to include in API
  27209. // requests with the JSON null value. By default, fields with empty
  27210. // values are omitted from API requests. However, any field with an
  27211. // empty value appearing in NullFields will be sent to the server as
  27212. // null. It is an error if a field in this list has a non-empty value.
  27213. // This may be used to include null fields in Patch requests.
  27214. NullFields []string `json:"-"`
  27215. }
  27216. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  27217. type NoMethod TargetVpnGatewayListWarningData
  27218. raw := NoMethod(*s)
  27219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27220. }
  27221. type TargetVpnGatewaysScopedList struct {
  27222. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  27223. // contained in this scope.
  27224. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  27225. // Warning: [Output Only] Informational warning which replaces the list
  27226. // of addresses when the list is empty.
  27227. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  27228. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  27229. // to unconditionally include in API requests. By default, fields with
  27230. // empty values are omitted from API requests. However, any non-pointer,
  27231. // non-interface field appearing in ForceSendFields will be sent to the
  27232. // server regardless of whether the field is empty or not. This may be
  27233. // used to include empty fields in Patch requests.
  27234. ForceSendFields []string `json:"-"`
  27235. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  27236. // include in API requests with the JSON null value. By default, fields
  27237. // with empty values are omitted from API requests. However, any field
  27238. // with an empty value appearing in NullFields will be sent to the
  27239. // server as null. It is an error if a field in this list has a
  27240. // non-empty value. This may be used to include null fields in Patch
  27241. // requests.
  27242. NullFields []string `json:"-"`
  27243. }
  27244. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  27245. type NoMethod TargetVpnGatewaysScopedList
  27246. raw := NoMethod(*s)
  27247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27248. }
  27249. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  27250. // warning which replaces the list of addresses when the list is empty.
  27251. type TargetVpnGatewaysScopedListWarning struct {
  27252. // Code: [Output Only] A warning code, if applicable. For example,
  27253. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27254. // the response.
  27255. //
  27256. // Possible values:
  27257. // "CLEANUP_FAILED"
  27258. // "DEPRECATED_RESOURCE_USED"
  27259. // "DEPRECATED_TYPE_USED"
  27260. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27261. // "EXPERIMENTAL_TYPE_USED"
  27262. // "EXTERNAL_API_WARNING"
  27263. // "FIELD_VALUE_OVERRIDEN"
  27264. // "INJECTED_KERNELS_DEPRECATED"
  27265. // "MISSING_TYPE_DEPENDENCY"
  27266. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27267. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27268. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27269. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27270. // "NEXT_HOP_NOT_RUNNING"
  27271. // "NOT_CRITICAL_ERROR"
  27272. // "NO_RESULTS_ON_PAGE"
  27273. // "REQUIRED_TOS_AGREEMENT"
  27274. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27275. // "RESOURCE_NOT_DELETED"
  27276. // "SCHEMA_VALIDATION_IGNORED"
  27277. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27278. // "UNDECLARED_PROPERTIES"
  27279. // "UNREACHABLE"
  27280. Code string `json:"code,omitempty"`
  27281. // Data: [Output Only] Metadata about this warning in key: value format.
  27282. // For example:
  27283. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27284. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  27285. // Message: [Output Only] A human-readable description of the warning
  27286. // code.
  27287. Message string `json:"message,omitempty"`
  27288. // ForceSendFields is a list of field names (e.g. "Code") to
  27289. // unconditionally include in API requests. By default, fields with
  27290. // empty values are omitted from API requests. However, any non-pointer,
  27291. // non-interface field appearing in ForceSendFields will be sent to the
  27292. // server regardless of whether the field is empty or not. This may be
  27293. // used to include empty fields in Patch requests.
  27294. ForceSendFields []string `json:"-"`
  27295. // NullFields is a list of field names (e.g. "Code") to include in API
  27296. // requests with the JSON null value. By default, fields with empty
  27297. // values are omitted from API requests. However, any field with an
  27298. // empty value appearing in NullFields will be sent to the server as
  27299. // null. It is an error if a field in this list has a non-empty value.
  27300. // This may be used to include null fields in Patch requests.
  27301. NullFields []string `json:"-"`
  27302. }
  27303. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  27304. type NoMethod TargetVpnGatewaysScopedListWarning
  27305. raw := NoMethod(*s)
  27306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27307. }
  27308. type TargetVpnGatewaysScopedListWarningData struct {
  27309. // Key: [Output Only] A key that provides more detail on the warning
  27310. // being returned. For example, for warnings where there are no results
  27311. // in a list request for a particular zone, this key might be scope and
  27312. // the key value might be the zone name. Other examples might be a key
  27313. // indicating a deprecated resource and a suggested replacement, or a
  27314. // warning about invalid network settings (for example, if an instance
  27315. // attempts to perform IP forwarding but is not enabled for IP
  27316. // forwarding).
  27317. Key string `json:"key,omitempty"`
  27318. // Value: [Output Only] A warning data value corresponding to the key.
  27319. Value string `json:"value,omitempty"`
  27320. // ForceSendFields is a list of field names (e.g. "Key") to
  27321. // unconditionally include in API requests. By default, fields with
  27322. // empty values are omitted from API requests. However, any non-pointer,
  27323. // non-interface field appearing in ForceSendFields will be sent to the
  27324. // server regardless of whether the field is empty or not. This may be
  27325. // used to include empty fields in Patch requests.
  27326. ForceSendFields []string `json:"-"`
  27327. // NullFields is a list of field names (e.g. "Key") to include in API
  27328. // requests with the JSON null value. By default, fields with empty
  27329. // values are omitted from API requests. However, any field with an
  27330. // empty value appearing in NullFields will be sent to the server as
  27331. // null. It is an error if a field in this list has a non-empty value.
  27332. // This may be used to include null fields in Patch requests.
  27333. NullFields []string `json:"-"`
  27334. }
  27335. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  27336. type NoMethod TargetVpnGatewaysScopedListWarningData
  27337. raw := NoMethod(*s)
  27338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27339. }
  27340. type TestFailure struct {
  27341. ActualService string `json:"actualService,omitempty"`
  27342. ExpectedService string `json:"expectedService,omitempty"`
  27343. Host string `json:"host,omitempty"`
  27344. Path string `json:"path,omitempty"`
  27345. // ForceSendFields is a list of field names (e.g. "ActualService") to
  27346. // unconditionally include in API requests. By default, fields with
  27347. // empty values are omitted from API requests. However, any non-pointer,
  27348. // non-interface field appearing in ForceSendFields will be sent to the
  27349. // server regardless of whether the field is empty or not. This may be
  27350. // used to include empty fields in Patch requests.
  27351. ForceSendFields []string `json:"-"`
  27352. // NullFields is a list of field names (e.g. "ActualService") to include
  27353. // in API requests with the JSON null value. By default, fields with
  27354. // empty values are omitted from API requests. However, any field with
  27355. // an empty value appearing in NullFields will be sent to the server as
  27356. // null. It is an error if a field in this list has a non-empty value.
  27357. // This may be used to include null fields in Patch requests.
  27358. NullFields []string `json:"-"`
  27359. }
  27360. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  27361. type NoMethod TestFailure
  27362. raw := NoMethod(*s)
  27363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27364. }
  27365. type TestPermissionsRequest struct {
  27366. // Permissions: The set of permissions to check for the 'resource'.
  27367. // Permissions with wildcards (such as '*' or 'storage.*') are not
  27368. // allowed.
  27369. Permissions []string `json:"permissions,omitempty"`
  27370. // ForceSendFields is a list of field names (e.g. "Permissions") to
  27371. // unconditionally include in API requests. By default, fields with
  27372. // empty values are omitted from API requests. However, any non-pointer,
  27373. // non-interface field appearing in ForceSendFields will be sent to the
  27374. // server regardless of whether the field is empty or not. This may be
  27375. // used to include empty fields in Patch requests.
  27376. ForceSendFields []string `json:"-"`
  27377. // NullFields is a list of field names (e.g. "Permissions") to include
  27378. // in API requests with the JSON null value. By default, fields with
  27379. // empty values are omitted from API requests. However, any field with
  27380. // an empty value appearing in NullFields will be sent to the server as
  27381. // null. It is an error if a field in this list has a non-empty value.
  27382. // This may be used to include null fields in Patch requests.
  27383. NullFields []string `json:"-"`
  27384. }
  27385. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  27386. type NoMethod TestPermissionsRequest
  27387. raw := NoMethod(*s)
  27388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27389. }
  27390. type TestPermissionsResponse struct {
  27391. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  27392. // the caller is allowed.
  27393. Permissions []string `json:"permissions,omitempty"`
  27394. // ServerResponse contains the HTTP response code and headers from the
  27395. // server.
  27396. googleapi.ServerResponse `json:"-"`
  27397. // ForceSendFields is a list of field names (e.g. "Permissions") to
  27398. // unconditionally include in API requests. By default, fields with
  27399. // empty values are omitted from API requests. However, any non-pointer,
  27400. // non-interface field appearing in ForceSendFields will be sent to the
  27401. // server regardless of whether the field is empty or not. This may be
  27402. // used to include empty fields in Patch requests.
  27403. ForceSendFields []string `json:"-"`
  27404. // NullFields is a list of field names (e.g. "Permissions") to include
  27405. // in API requests with the JSON null value. By default, fields with
  27406. // empty values are omitted from API requests. However, any field with
  27407. // an empty value appearing in NullFields will be sent to the server as
  27408. // null. It is an error if a field in this list has a non-empty value.
  27409. // This may be used to include null fields in Patch requests.
  27410. NullFields []string `json:"-"`
  27411. }
  27412. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  27413. type NoMethod TestPermissionsResponse
  27414. raw := NoMethod(*s)
  27415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27416. }
  27417. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  27418. // to the BackendService resource, based on the "longest-match" of the
  27419. // URL's host and path.
  27420. type UrlMap struct {
  27421. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27422. // format.
  27423. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27424. // DefaultService: The URL of the backendService resource if none of the
  27425. // hostRules match.
  27426. // Use defaultService instead of defaultRouteAction when simple routing
  27427. // to a backendService is desired and other advanced capabilities like
  27428. // traffic splitting and rewrites are not required.
  27429. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  27430. // should must be set.
  27431. DefaultService string `json:"defaultService,omitempty"`
  27432. // Description: An optional description of this resource. Provide this
  27433. // property when you create the resource.
  27434. Description string `json:"description,omitempty"`
  27435. // Fingerprint: Fingerprint of this resource. A hash of the contents
  27436. // stored in this object. This field is used in optimistic locking. This
  27437. // field will be ignored when inserting a UrlMap. An up-to-date
  27438. // fingerprint must be provided in order to update the UrlMap, otherwise
  27439. // the request will fail with error 412 conditionNotMet.
  27440. //
  27441. // To see the latest fingerprint, make a get() request to retrieve a
  27442. // UrlMap.
  27443. Fingerprint string `json:"fingerprint,omitempty"`
  27444. // HostRules: The list of HostRules to use against the URL.
  27445. HostRules []*HostRule `json:"hostRules,omitempty"`
  27446. // Id: [Output Only] The unique identifier for the resource. This
  27447. // identifier is defined by the server.
  27448. Id uint64 `json:"id,omitempty,string"`
  27449. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  27450. // url maps.
  27451. Kind string `json:"kind,omitempty"`
  27452. // Name: Name of the resource. Provided by the client when the resource
  27453. // is created. The name must be 1-63 characters long, and comply with
  27454. // RFC1035. Specifically, the name must be 1-63 characters long and
  27455. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27456. // the first character must be a lowercase letter, and all following
  27457. // characters must be a dash, lowercase letter, or digit, except the
  27458. // last character, which cannot be a dash.
  27459. Name string `json:"name,omitempty"`
  27460. // PathMatchers: The list of named PathMatchers to use against the URL.
  27461. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  27462. // SelfLink: [Output Only] Server-defined URL for the resource.
  27463. SelfLink string `json:"selfLink,omitempty"`
  27464. // Tests: The list of expected URL mapping tests. Request to update this
  27465. // UrlMap will succeed only if all of the test cases pass. You can
  27466. // specify a maximum of 100 tests per UrlMap.
  27467. Tests []*UrlMapTest `json:"tests,omitempty"`
  27468. // ServerResponse contains the HTTP response code and headers from the
  27469. // server.
  27470. googleapi.ServerResponse `json:"-"`
  27471. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27472. // to unconditionally include in API requests. By default, fields with
  27473. // empty values are omitted from API requests. However, any non-pointer,
  27474. // non-interface field appearing in ForceSendFields will be sent to the
  27475. // server regardless of whether the field is empty or not. This may be
  27476. // used to include empty fields in Patch requests.
  27477. ForceSendFields []string `json:"-"`
  27478. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27479. // include in API requests with the JSON null value. By default, fields
  27480. // with empty values are omitted from API requests. However, any field
  27481. // with an empty value appearing in NullFields will be sent to the
  27482. // server as null. It is an error if a field in this list has a
  27483. // non-empty value. This may be used to include null fields in Patch
  27484. // requests.
  27485. NullFields []string `json:"-"`
  27486. }
  27487. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  27488. type NoMethod UrlMap
  27489. raw := NoMethod(*s)
  27490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27491. }
  27492. // UrlMapList: Contains a list of UrlMap resources.
  27493. type UrlMapList struct {
  27494. // Id: [Output Only] Unique identifier for the resource; defined by the
  27495. // server.
  27496. Id string `json:"id,omitempty"`
  27497. // Items: A list of UrlMap resources.
  27498. Items []*UrlMap `json:"items,omitempty"`
  27499. // Kind: Type of resource.
  27500. Kind string `json:"kind,omitempty"`
  27501. // NextPageToken: [Output Only] This token allows you to get the next
  27502. // page of results for list requests. If the number of results is larger
  27503. // than maxResults, use the nextPageToken as a value for the query
  27504. // parameter pageToken in the next list request. Subsequent list
  27505. // requests will have their own nextPageToken to continue paging through
  27506. // the results.
  27507. NextPageToken string `json:"nextPageToken,omitempty"`
  27508. // SelfLink: [Output Only] Server-defined URL for this resource.
  27509. SelfLink string `json:"selfLink,omitempty"`
  27510. // Warning: [Output Only] Informational warning message.
  27511. Warning *UrlMapListWarning `json:"warning,omitempty"`
  27512. // ServerResponse contains the HTTP response code and headers from the
  27513. // server.
  27514. googleapi.ServerResponse `json:"-"`
  27515. // ForceSendFields is a list of field names (e.g. "Id") to
  27516. // unconditionally include in API requests. By default, fields with
  27517. // empty values are omitted from API requests. However, any non-pointer,
  27518. // non-interface field appearing in ForceSendFields will be sent to the
  27519. // server regardless of whether the field is empty or not. This may be
  27520. // used to include empty fields in Patch requests.
  27521. ForceSendFields []string `json:"-"`
  27522. // NullFields is a list of field names (e.g. "Id") to include in API
  27523. // requests with the JSON null value. By default, fields with empty
  27524. // values are omitted from API requests. However, any field with an
  27525. // empty value appearing in NullFields will be sent to the server as
  27526. // null. It is an error if a field in this list has a non-empty value.
  27527. // This may be used to include null fields in Patch requests.
  27528. NullFields []string `json:"-"`
  27529. }
  27530. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  27531. type NoMethod UrlMapList
  27532. raw := NoMethod(*s)
  27533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27534. }
  27535. // UrlMapListWarning: [Output Only] Informational warning message.
  27536. type UrlMapListWarning struct {
  27537. // Code: [Output Only] A warning code, if applicable. For example,
  27538. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27539. // the response.
  27540. //
  27541. // Possible values:
  27542. // "CLEANUP_FAILED"
  27543. // "DEPRECATED_RESOURCE_USED"
  27544. // "DEPRECATED_TYPE_USED"
  27545. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27546. // "EXPERIMENTAL_TYPE_USED"
  27547. // "EXTERNAL_API_WARNING"
  27548. // "FIELD_VALUE_OVERRIDEN"
  27549. // "INJECTED_KERNELS_DEPRECATED"
  27550. // "MISSING_TYPE_DEPENDENCY"
  27551. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27552. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27553. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27554. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27555. // "NEXT_HOP_NOT_RUNNING"
  27556. // "NOT_CRITICAL_ERROR"
  27557. // "NO_RESULTS_ON_PAGE"
  27558. // "REQUIRED_TOS_AGREEMENT"
  27559. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27560. // "RESOURCE_NOT_DELETED"
  27561. // "SCHEMA_VALIDATION_IGNORED"
  27562. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27563. // "UNDECLARED_PROPERTIES"
  27564. // "UNREACHABLE"
  27565. Code string `json:"code,omitempty"`
  27566. // Data: [Output Only] Metadata about this warning in key: value format.
  27567. // For example:
  27568. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27569. Data []*UrlMapListWarningData `json:"data,omitempty"`
  27570. // Message: [Output Only] A human-readable description of the warning
  27571. // code.
  27572. Message string `json:"message,omitempty"`
  27573. // ForceSendFields is a list of field names (e.g. "Code") to
  27574. // unconditionally include in API requests. By default, fields with
  27575. // empty values are omitted from API requests. However, any non-pointer,
  27576. // non-interface field appearing in ForceSendFields will be sent to the
  27577. // server regardless of whether the field is empty or not. This may be
  27578. // used to include empty fields in Patch requests.
  27579. ForceSendFields []string `json:"-"`
  27580. // NullFields is a list of field names (e.g. "Code") to include in API
  27581. // requests with the JSON null value. By default, fields with empty
  27582. // values are omitted from API requests. However, any field with an
  27583. // empty value appearing in NullFields will be sent to the server as
  27584. // null. It is an error if a field in this list has a non-empty value.
  27585. // This may be used to include null fields in Patch requests.
  27586. NullFields []string `json:"-"`
  27587. }
  27588. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  27589. type NoMethod UrlMapListWarning
  27590. raw := NoMethod(*s)
  27591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27592. }
  27593. type UrlMapListWarningData struct {
  27594. // Key: [Output Only] A key that provides more detail on the warning
  27595. // being returned. For example, for warnings where there are no results
  27596. // in a list request for a particular zone, this key might be scope and
  27597. // the key value might be the zone name. Other examples might be a key
  27598. // indicating a deprecated resource and a suggested replacement, or a
  27599. // warning about invalid network settings (for example, if an instance
  27600. // attempts to perform IP forwarding but is not enabled for IP
  27601. // forwarding).
  27602. Key string `json:"key,omitempty"`
  27603. // Value: [Output Only] A warning data value corresponding to the key.
  27604. Value string `json:"value,omitempty"`
  27605. // ForceSendFields is a list of field names (e.g. "Key") to
  27606. // unconditionally include in API requests. By default, fields with
  27607. // empty values are omitted from API requests. However, any non-pointer,
  27608. // non-interface field appearing in ForceSendFields will be sent to the
  27609. // server regardless of whether the field is empty or not. This may be
  27610. // used to include empty fields in Patch requests.
  27611. ForceSendFields []string `json:"-"`
  27612. // NullFields is a list of field names (e.g. "Key") to include in API
  27613. // requests with the JSON null value. By default, fields with empty
  27614. // values are omitted from API requests. However, any field with an
  27615. // empty value appearing in NullFields will be sent to the server as
  27616. // null. It is an error if a field in this list has a non-empty value.
  27617. // This may be used to include null fields in Patch requests.
  27618. NullFields []string `json:"-"`
  27619. }
  27620. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  27621. type NoMethod UrlMapListWarningData
  27622. raw := NoMethod(*s)
  27623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27624. }
  27625. type UrlMapReference struct {
  27626. UrlMap string `json:"urlMap,omitempty"`
  27627. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  27628. // unconditionally include in API requests. By default, fields with
  27629. // empty values are omitted from API requests. However, any non-pointer,
  27630. // non-interface field appearing in ForceSendFields will be sent to the
  27631. // server regardless of whether the field is empty or not. This may be
  27632. // used to include empty fields in Patch requests.
  27633. ForceSendFields []string `json:"-"`
  27634. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  27635. // requests with the JSON null value. By default, fields with empty
  27636. // values are omitted from API requests. However, any field with an
  27637. // empty value appearing in NullFields will be sent to the server as
  27638. // null. It is an error if a field in this list has a non-empty value.
  27639. // This may be used to include null fields in Patch requests.
  27640. NullFields []string `json:"-"`
  27641. }
  27642. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  27643. type NoMethod UrlMapReference
  27644. raw := NoMethod(*s)
  27645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27646. }
  27647. // UrlMapTest: Message for the expected URL mappings.
  27648. type UrlMapTest struct {
  27649. // Description: Description of this test case.
  27650. Description string `json:"description,omitempty"`
  27651. // Host: Host portion of the URL.
  27652. Host string `json:"host,omitempty"`
  27653. // Path: Path portion of the URL.
  27654. Path string `json:"path,omitempty"`
  27655. // Service: Expected BackendService resource the given URL should be
  27656. // mapped to.
  27657. Service string `json:"service,omitempty"`
  27658. // ForceSendFields is a list of field names (e.g. "Description") to
  27659. // unconditionally include in API requests. By default, fields with
  27660. // empty values are omitted from API requests. However, any non-pointer,
  27661. // non-interface field appearing in ForceSendFields will be sent to the
  27662. // server regardless of whether the field is empty or not. This may be
  27663. // used to include empty fields in Patch requests.
  27664. ForceSendFields []string `json:"-"`
  27665. // NullFields is a list of field names (e.g. "Description") to include
  27666. // in API requests with the JSON null value. By default, fields with
  27667. // empty values are omitted from API requests. However, any field with
  27668. // an empty value appearing in NullFields will be sent to the server as
  27669. // null. It is an error if a field in this list has a non-empty value.
  27670. // This may be used to include null fields in Patch requests.
  27671. NullFields []string `json:"-"`
  27672. }
  27673. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  27674. type NoMethod UrlMapTest
  27675. raw := NoMethod(*s)
  27676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27677. }
  27678. // UrlMapValidationResult: Message representing the validation result
  27679. // for a UrlMap.
  27680. type UrlMapValidationResult struct {
  27681. LoadErrors []string `json:"loadErrors,omitempty"`
  27682. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  27683. // If false, 'loadErrors' indicates the reasons.
  27684. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  27685. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  27686. // TestPassed: If successfully loaded, this field indicates whether the
  27687. // test passed. If false, 'testFailures's indicate the reason of
  27688. // failure.
  27689. TestPassed bool `json:"testPassed,omitempty"`
  27690. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  27691. // unconditionally include in API requests. By default, fields with
  27692. // empty values are omitted from API requests. However, any non-pointer,
  27693. // non-interface field appearing in ForceSendFields will be sent to the
  27694. // server regardless of whether the field is empty or not. This may be
  27695. // used to include empty fields in Patch requests.
  27696. ForceSendFields []string `json:"-"`
  27697. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  27698. // API requests with the JSON null value. By default, fields with empty
  27699. // values are omitted from API requests. However, any field with an
  27700. // empty value appearing in NullFields will be sent to the server as
  27701. // null. It is an error if a field in this list has a non-empty value.
  27702. // This may be used to include null fields in Patch requests.
  27703. NullFields []string `json:"-"`
  27704. }
  27705. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  27706. type NoMethod UrlMapValidationResult
  27707. raw := NoMethod(*s)
  27708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27709. }
  27710. type UrlMapsValidateRequest struct {
  27711. // Resource: Content of the UrlMap to be validated.
  27712. Resource *UrlMap `json:"resource,omitempty"`
  27713. // ForceSendFields is a list of field names (e.g. "Resource") to
  27714. // unconditionally include in API requests. By default, fields with
  27715. // empty values are omitted from API requests. However, any non-pointer,
  27716. // non-interface field appearing in ForceSendFields will be sent to the
  27717. // server regardless of whether the field is empty or not. This may be
  27718. // used to include empty fields in Patch requests.
  27719. ForceSendFields []string `json:"-"`
  27720. // NullFields is a list of field names (e.g. "Resource") to include in
  27721. // API requests with the JSON null value. By default, fields with empty
  27722. // values are omitted from API requests. However, any field with an
  27723. // empty value appearing in NullFields will be sent to the server as
  27724. // null. It is an error if a field in this list has a non-empty value.
  27725. // This may be used to include null fields in Patch requests.
  27726. NullFields []string `json:"-"`
  27727. }
  27728. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  27729. type NoMethod UrlMapsValidateRequest
  27730. raw := NoMethod(*s)
  27731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27732. }
  27733. type UrlMapsValidateResponse struct {
  27734. Result *UrlMapValidationResult `json:"result,omitempty"`
  27735. // ServerResponse contains the HTTP response code and headers from the
  27736. // server.
  27737. googleapi.ServerResponse `json:"-"`
  27738. // ForceSendFields is a list of field names (e.g. "Result") to
  27739. // unconditionally include in API requests. By default, fields with
  27740. // empty values are omitted from API requests. However, any non-pointer,
  27741. // non-interface field appearing in ForceSendFields will be sent to the
  27742. // server regardless of whether the field is empty or not. This may be
  27743. // used to include empty fields in Patch requests.
  27744. ForceSendFields []string `json:"-"`
  27745. // NullFields is a list of field names (e.g. "Result") to include in API
  27746. // requests with the JSON null value. By default, fields with empty
  27747. // values are omitted from API requests. However, any field with an
  27748. // empty value appearing in NullFields will be sent to the server as
  27749. // null. It is an error if a field in this list has a non-empty value.
  27750. // This may be used to include null fields in Patch requests.
  27751. NullFields []string `json:"-"`
  27752. }
  27753. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  27754. type NoMethod UrlMapsValidateResponse
  27755. raw := NoMethod(*s)
  27756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27757. }
  27758. // UsableSubnetwork: Subnetwork which the current user has
  27759. // compute.subnetworks.use permission on.
  27760. type UsableSubnetwork struct {
  27761. // IpCidrRange: The range of internal addresses that are owned by this
  27762. // subnetwork.
  27763. IpCidrRange string `json:"ipCidrRange,omitempty"`
  27764. // Network: Network URL.
  27765. Network string `json:"network,omitempty"`
  27766. // SecondaryIpRanges: Secondary IP ranges.
  27767. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  27768. // Subnetwork: Subnetwork URL.
  27769. Subnetwork string `json:"subnetwork,omitempty"`
  27770. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  27771. // unconditionally include in API requests. By default, fields with
  27772. // empty values are omitted from API requests. However, any non-pointer,
  27773. // non-interface field appearing in ForceSendFields will be sent to the
  27774. // server regardless of whether the field is empty or not. This may be
  27775. // used to include empty fields in Patch requests.
  27776. ForceSendFields []string `json:"-"`
  27777. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  27778. // in API requests with the JSON null value. By default, fields with
  27779. // empty values are omitted from API requests. However, any field with
  27780. // an empty value appearing in NullFields will be sent to the server as
  27781. // null. It is an error if a field in this list has a non-empty value.
  27782. // This may be used to include null fields in Patch requests.
  27783. NullFields []string `json:"-"`
  27784. }
  27785. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  27786. type NoMethod UsableSubnetwork
  27787. raw := NoMethod(*s)
  27788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27789. }
  27790. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  27791. // subnetwork.
  27792. type UsableSubnetworkSecondaryRange struct {
  27793. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  27794. // secondary range.
  27795. IpCidrRange string `json:"ipCidrRange,omitempty"`
  27796. // RangeName: The name associated with this subnetwork secondary range,
  27797. // used when adding an alias IP range to a VM instance. The name must be
  27798. // 1-63 characters long, and comply with RFC1035. The name must be
  27799. // unique within the subnetwork.
  27800. RangeName string `json:"rangeName,omitempty"`
  27801. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  27802. // unconditionally include in API requests. By default, fields with
  27803. // empty values are omitted from API requests. However, any non-pointer,
  27804. // non-interface field appearing in ForceSendFields will be sent to the
  27805. // server regardless of whether the field is empty or not. This may be
  27806. // used to include empty fields in Patch requests.
  27807. ForceSendFields []string `json:"-"`
  27808. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  27809. // in API requests with the JSON null value. By default, fields with
  27810. // empty values are omitted from API requests. However, any field with
  27811. // an empty value appearing in NullFields will be sent to the server as
  27812. // null. It is an error if a field in this list has a non-empty value.
  27813. // This may be used to include null fields in Patch requests.
  27814. NullFields []string `json:"-"`
  27815. }
  27816. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  27817. type NoMethod UsableSubnetworkSecondaryRange
  27818. raw := NoMethod(*s)
  27819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27820. }
  27821. type UsableSubnetworksAggregatedList struct {
  27822. // Id: [Output Only] The unique identifier for the resource. This
  27823. // identifier is defined by the server.
  27824. Id string `json:"id,omitempty"`
  27825. // Items: [Output] A list of usable subnetwork URLs.
  27826. Items []*UsableSubnetwork `json:"items,omitempty"`
  27827. // Kind: [Output Only] Type of resource. Always
  27828. // compute#usableSubnetworksAggregatedList for aggregated lists of
  27829. // usable subnetworks.
  27830. Kind string `json:"kind,omitempty"`
  27831. // NextPageToken: [Output Only] This token allows you to get the next
  27832. // page of results for list requests. If the number of results is larger
  27833. // than maxResults, use the nextPageToken as a value for the query
  27834. // parameter pageToken in the next list request. Subsequent list
  27835. // requests will have their own nextPageToken to continue paging through
  27836. // the results.
  27837. NextPageToken string `json:"nextPageToken,omitempty"`
  27838. // SelfLink: [Output Only] Server-defined URL for this resource.
  27839. SelfLink string `json:"selfLink,omitempty"`
  27840. // Warning: [Output Only] Informational warning message.
  27841. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  27842. // ServerResponse contains the HTTP response code and headers from the
  27843. // server.
  27844. googleapi.ServerResponse `json:"-"`
  27845. // ForceSendFields is a list of field names (e.g. "Id") to
  27846. // unconditionally include in API requests. By default, fields with
  27847. // empty values are omitted from API requests. However, any non-pointer,
  27848. // non-interface field appearing in ForceSendFields will be sent to the
  27849. // server regardless of whether the field is empty or not. This may be
  27850. // used to include empty fields in Patch requests.
  27851. ForceSendFields []string `json:"-"`
  27852. // NullFields is a list of field names (e.g. "Id") to include in API
  27853. // requests with the JSON null value. By default, fields with empty
  27854. // values are omitted from API requests. However, any field with an
  27855. // empty value appearing in NullFields will be sent to the server as
  27856. // null. It is an error if a field in this list has a non-empty value.
  27857. // This may be used to include null fields in Patch requests.
  27858. NullFields []string `json:"-"`
  27859. }
  27860. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  27861. type NoMethod UsableSubnetworksAggregatedList
  27862. raw := NoMethod(*s)
  27863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27864. }
  27865. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  27866. // warning message.
  27867. type UsableSubnetworksAggregatedListWarning struct {
  27868. // Code: [Output Only] A warning code, if applicable. For example,
  27869. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27870. // the response.
  27871. //
  27872. // Possible values:
  27873. // "CLEANUP_FAILED"
  27874. // "DEPRECATED_RESOURCE_USED"
  27875. // "DEPRECATED_TYPE_USED"
  27876. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27877. // "EXPERIMENTAL_TYPE_USED"
  27878. // "EXTERNAL_API_WARNING"
  27879. // "FIELD_VALUE_OVERRIDEN"
  27880. // "INJECTED_KERNELS_DEPRECATED"
  27881. // "MISSING_TYPE_DEPENDENCY"
  27882. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27883. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27884. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27885. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27886. // "NEXT_HOP_NOT_RUNNING"
  27887. // "NOT_CRITICAL_ERROR"
  27888. // "NO_RESULTS_ON_PAGE"
  27889. // "REQUIRED_TOS_AGREEMENT"
  27890. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27891. // "RESOURCE_NOT_DELETED"
  27892. // "SCHEMA_VALIDATION_IGNORED"
  27893. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27894. // "UNDECLARED_PROPERTIES"
  27895. // "UNREACHABLE"
  27896. Code string `json:"code,omitempty"`
  27897. // Data: [Output Only] Metadata about this warning in key: value format.
  27898. // For example:
  27899. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27900. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  27901. // Message: [Output Only] A human-readable description of the warning
  27902. // code.
  27903. Message string `json:"message,omitempty"`
  27904. // ForceSendFields is a list of field names (e.g. "Code") to
  27905. // unconditionally include in API requests. By default, fields with
  27906. // empty values are omitted from API requests. However, any non-pointer,
  27907. // non-interface field appearing in ForceSendFields will be sent to the
  27908. // server regardless of whether the field is empty or not. This may be
  27909. // used to include empty fields in Patch requests.
  27910. ForceSendFields []string `json:"-"`
  27911. // NullFields is a list of field names (e.g. "Code") to include in API
  27912. // requests with the JSON null value. By default, fields with empty
  27913. // values are omitted from API requests. However, any field with an
  27914. // empty value appearing in NullFields will be sent to the server as
  27915. // null. It is an error if a field in this list has a non-empty value.
  27916. // This may be used to include null fields in Patch requests.
  27917. NullFields []string `json:"-"`
  27918. }
  27919. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27920. type NoMethod UsableSubnetworksAggregatedListWarning
  27921. raw := NoMethod(*s)
  27922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27923. }
  27924. type UsableSubnetworksAggregatedListWarningData struct {
  27925. // Key: [Output Only] A key that provides more detail on the warning
  27926. // being returned. For example, for warnings where there are no results
  27927. // in a list request for a particular zone, this key might be scope and
  27928. // the key value might be the zone name. Other examples might be a key
  27929. // indicating a deprecated resource and a suggested replacement, or a
  27930. // warning about invalid network settings (for example, if an instance
  27931. // attempts to perform IP forwarding but is not enabled for IP
  27932. // forwarding).
  27933. Key string `json:"key,omitempty"`
  27934. // Value: [Output Only] A warning data value corresponding to the key.
  27935. Value string `json:"value,omitempty"`
  27936. // ForceSendFields is a list of field names (e.g. "Key") to
  27937. // unconditionally include in API requests. By default, fields with
  27938. // empty values are omitted from API requests. However, any non-pointer,
  27939. // non-interface field appearing in ForceSendFields will be sent to the
  27940. // server regardless of whether the field is empty or not. This may be
  27941. // used to include empty fields in Patch requests.
  27942. ForceSendFields []string `json:"-"`
  27943. // NullFields is a list of field names (e.g. "Key") to include in API
  27944. // requests with the JSON null value. By default, fields with empty
  27945. // values are omitted from API requests. However, any field with an
  27946. // empty value appearing in NullFields will be sent to the server as
  27947. // null. It is an error if a field in this list has a non-empty value.
  27948. // This may be used to include null fields in Patch requests.
  27949. NullFields []string `json:"-"`
  27950. }
  27951. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27952. type NoMethod UsableSubnetworksAggregatedListWarningData
  27953. raw := NoMethod(*s)
  27954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27955. }
  27956. // UsageExportLocation: The location in Cloud Storage and naming method
  27957. // of the daily usage report. Contains bucket_name and report_name
  27958. // prefix.
  27959. type UsageExportLocation struct {
  27960. // BucketName: The name of an existing bucket in Cloud Storage where the
  27961. // usage report object is stored. The Google Service Account is granted
  27962. // write access to this bucket. This can either be the bucket name by
  27963. // itself, such as example-bucket, or the bucket name with gs:// or
  27964. // https://storage.googleapis.com/ in front of it, such as
  27965. // gs://example-bucket.
  27966. BucketName string `json:"bucketName,omitempty"`
  27967. // ReportNamePrefix: An optional prefix for the name of the usage report
  27968. // object stored in bucketName. If not supplied, defaults to usage. The
  27969. // report is stored as a CSV file named
  27970. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  27971. // usage according to Pacific Time. If you supply a prefix, it should
  27972. // conform to Cloud Storage object naming conventions.
  27973. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  27974. // ForceSendFields is a list of field names (e.g. "BucketName") to
  27975. // unconditionally include in API requests. By default, fields with
  27976. // empty values are omitted from API requests. However, any non-pointer,
  27977. // non-interface field appearing in ForceSendFields will be sent to the
  27978. // server regardless of whether the field is empty or not. This may be
  27979. // used to include empty fields in Patch requests.
  27980. ForceSendFields []string `json:"-"`
  27981. // NullFields is a list of field names (e.g. "BucketName") to include in
  27982. // API requests with the JSON null value. By default, fields with empty
  27983. // values are omitted from API requests. However, any field with an
  27984. // empty value appearing in NullFields will be sent to the server as
  27985. // null. It is an error if a field in this list has a non-empty value.
  27986. // This may be used to include null fields in Patch requests.
  27987. NullFields []string `json:"-"`
  27988. }
  27989. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  27990. type NoMethod UsageExportLocation
  27991. raw := NoMethod(*s)
  27992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27993. }
  27994. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  27995. // endpoint (i.e., NIC).
  27996. type VmEndpointNatMappings struct {
  27997. // InstanceName: Name of the VM instance which the endpoint belongs to
  27998. InstanceName string `json:"instanceName,omitempty"`
  27999. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  28000. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  28001. // unconditionally include in API requests. By default, fields with
  28002. // empty values are omitted from API requests. However, any non-pointer,
  28003. // non-interface field appearing in ForceSendFields will be sent to the
  28004. // server regardless of whether the field is empty or not. This may be
  28005. // used to include empty fields in Patch requests.
  28006. ForceSendFields []string `json:"-"`
  28007. // NullFields is a list of field names (e.g. "InstanceName") to include
  28008. // in API requests with the JSON null value. By default, fields with
  28009. // empty values are omitted from API requests. However, any field with
  28010. // an empty value appearing in NullFields will be sent to the server as
  28011. // null. It is an error if a field in this list has a non-empty value.
  28012. // This may be used to include null fields in Patch requests.
  28013. NullFields []string `json:"-"`
  28014. }
  28015. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  28016. type NoMethod VmEndpointNatMappings
  28017. raw := NoMethod(*s)
  28018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28019. }
  28020. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  28021. // mapping for an interface of this endpoint.
  28022. type VmEndpointNatMappingsInterfaceNatMappings struct {
  28023. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  28024. // this interface. These ranges are inclusive, that is, both the first
  28025. // and the last ports can be used for NAT. Example:
  28026. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  28027. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  28028. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  28029. // to this interface. It equals to the aggregated port number in the
  28030. // field nat_ip_port_ranges.
  28031. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  28032. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  28033. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  28034. // "192.168.5.0/24".
  28035. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  28036. // SourceVirtualIp: Primary IP of the VM for this NIC.
  28037. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  28038. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  28039. // unconditionally include in API requests. By default, fields with
  28040. // empty values are omitted from API requests. However, any non-pointer,
  28041. // non-interface field appearing in ForceSendFields will be sent to the
  28042. // server regardless of whether the field is empty or not. This may be
  28043. // used to include empty fields in Patch requests.
  28044. ForceSendFields []string `json:"-"`
  28045. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  28046. // include in API requests with the JSON null value. By default, fields
  28047. // with empty values are omitted from API requests. However, any field
  28048. // with an empty value appearing in NullFields will be sent to the
  28049. // server as null. It is an error if a field in this list has a
  28050. // non-empty value. This may be used to include null fields in Patch
  28051. // requests.
  28052. NullFields []string `json:"-"`
  28053. }
  28054. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  28055. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  28056. raw := NoMethod(*s)
  28057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28058. }
  28059. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  28060. type VmEndpointNatMappingsList struct {
  28061. // Id: [Output Only] The unique identifier for the resource. This
  28062. // identifier is defined by the server.
  28063. Id string `json:"id,omitempty"`
  28064. // Kind: [Output Only] Type of resource. Always
  28065. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  28066. // endpoints.
  28067. Kind string `json:"kind,omitempty"`
  28068. // NextPageToken: [Output Only] This token allows you to get the next
  28069. // page of results for list requests. If the number of results is larger
  28070. // than maxResults, use the nextPageToken as a value for the query
  28071. // parameter pageToken in the next list request. Subsequent list
  28072. // requests will have their own nextPageToken to continue paging through
  28073. // the results.
  28074. NextPageToken string `json:"nextPageToken,omitempty"`
  28075. // Result: [Output Only] A list of Nat mapping information of VM
  28076. // endpoints.
  28077. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  28078. // SelfLink: [Output Only] Server-defined URL for this resource.
  28079. SelfLink string `json:"selfLink,omitempty"`
  28080. // Warning: [Output Only] Informational warning message.
  28081. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  28082. // ServerResponse contains the HTTP response code and headers from the
  28083. // server.
  28084. googleapi.ServerResponse `json:"-"`
  28085. // ForceSendFields is a list of field names (e.g. "Id") to
  28086. // unconditionally include in API requests. By default, fields with
  28087. // empty values are omitted from API requests. However, any non-pointer,
  28088. // non-interface field appearing in ForceSendFields will be sent to the
  28089. // server regardless of whether the field is empty or not. This may be
  28090. // used to include empty fields in Patch requests.
  28091. ForceSendFields []string `json:"-"`
  28092. // NullFields is a list of field names (e.g. "Id") to include in API
  28093. // requests with the JSON null value. By default, fields with empty
  28094. // values are omitted from API requests. However, any field with an
  28095. // empty value appearing in NullFields will be sent to the server as
  28096. // null. It is an error if a field in this list has a non-empty value.
  28097. // This may be used to include null fields in Patch requests.
  28098. NullFields []string `json:"-"`
  28099. }
  28100. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  28101. type NoMethod VmEndpointNatMappingsList
  28102. raw := NoMethod(*s)
  28103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28104. }
  28105. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  28106. // message.
  28107. type VmEndpointNatMappingsListWarning struct {
  28108. // Code: [Output Only] A warning code, if applicable. For example,
  28109. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28110. // the response.
  28111. //
  28112. // Possible values:
  28113. // "CLEANUP_FAILED"
  28114. // "DEPRECATED_RESOURCE_USED"
  28115. // "DEPRECATED_TYPE_USED"
  28116. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28117. // "EXPERIMENTAL_TYPE_USED"
  28118. // "EXTERNAL_API_WARNING"
  28119. // "FIELD_VALUE_OVERRIDEN"
  28120. // "INJECTED_KERNELS_DEPRECATED"
  28121. // "MISSING_TYPE_DEPENDENCY"
  28122. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28123. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28124. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28125. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28126. // "NEXT_HOP_NOT_RUNNING"
  28127. // "NOT_CRITICAL_ERROR"
  28128. // "NO_RESULTS_ON_PAGE"
  28129. // "REQUIRED_TOS_AGREEMENT"
  28130. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28131. // "RESOURCE_NOT_DELETED"
  28132. // "SCHEMA_VALIDATION_IGNORED"
  28133. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28134. // "UNDECLARED_PROPERTIES"
  28135. // "UNREACHABLE"
  28136. Code string `json:"code,omitempty"`
  28137. // Data: [Output Only] Metadata about this warning in key: value format.
  28138. // For example:
  28139. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28140. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  28141. // Message: [Output Only] A human-readable description of the warning
  28142. // code.
  28143. Message string `json:"message,omitempty"`
  28144. // ForceSendFields is a list of field names (e.g. "Code") to
  28145. // unconditionally include in API requests. By default, fields with
  28146. // empty values are omitted from API requests. However, any non-pointer,
  28147. // non-interface field appearing in ForceSendFields will be sent to the
  28148. // server regardless of whether the field is empty or not. This may be
  28149. // used to include empty fields in Patch requests.
  28150. ForceSendFields []string `json:"-"`
  28151. // NullFields is a list of field names (e.g. "Code") to include in API
  28152. // requests with the JSON null value. By default, fields with empty
  28153. // values are omitted from API requests. However, any field with an
  28154. // empty value appearing in NullFields will be sent to the server as
  28155. // null. It is an error if a field in this list has a non-empty value.
  28156. // This may be used to include null fields in Patch requests.
  28157. NullFields []string `json:"-"`
  28158. }
  28159. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  28160. type NoMethod VmEndpointNatMappingsListWarning
  28161. raw := NoMethod(*s)
  28162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28163. }
  28164. type VmEndpointNatMappingsListWarningData struct {
  28165. // Key: [Output Only] A key that provides more detail on the warning
  28166. // being returned. For example, for warnings where there are no results
  28167. // in a list request for a particular zone, this key might be scope and
  28168. // the key value might be the zone name. Other examples might be a key
  28169. // indicating a deprecated resource and a suggested replacement, or a
  28170. // warning about invalid network settings (for example, if an instance
  28171. // attempts to perform IP forwarding but is not enabled for IP
  28172. // forwarding).
  28173. Key string `json:"key,omitempty"`
  28174. // Value: [Output Only] A warning data value corresponding to the key.
  28175. Value string `json:"value,omitempty"`
  28176. // ForceSendFields is a list of field names (e.g. "Key") to
  28177. // unconditionally include in API requests. By default, fields with
  28178. // empty values are omitted from API requests. However, any non-pointer,
  28179. // non-interface field appearing in ForceSendFields will be sent to the
  28180. // server regardless of whether the field is empty or not. This may be
  28181. // used to include empty fields in Patch requests.
  28182. ForceSendFields []string `json:"-"`
  28183. // NullFields is a list of field names (e.g. "Key") to include in API
  28184. // requests with the JSON null value. By default, fields with empty
  28185. // values are omitted from API requests. However, any field with an
  28186. // empty value appearing in NullFields will be sent to the server as
  28187. // null. It is an error if a field in this list has a non-empty value.
  28188. // This may be used to include null fields in Patch requests.
  28189. NullFields []string `json:"-"`
  28190. }
  28191. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  28192. type NoMethod VmEndpointNatMappingsListWarningData
  28193. raw := NoMethod(*s)
  28194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28195. }
  28196. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  28197. // (== resource_for v1.vpnTunnels ==)
  28198. type VpnTunnel struct {
  28199. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28200. // format.
  28201. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28202. // Description: An optional description of this resource. Provide this
  28203. // property when you create the resource.
  28204. Description string `json:"description,omitempty"`
  28205. // DetailedStatus: [Output Only] Detailed status message for the VPN
  28206. // tunnel.
  28207. DetailedStatus string `json:"detailedStatus,omitempty"`
  28208. // Id: [Output Only] The unique identifier for the resource. This
  28209. // identifier is defined by the server.
  28210. Id uint64 `json:"id,omitempty,string"`
  28211. // IkeVersion: IKE protocol version to use when establishing the VPN
  28212. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  28213. // Default version is 2.
  28214. IkeVersion int64 `json:"ikeVersion,omitempty"`
  28215. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  28216. // VPN tunnels.
  28217. Kind string `json:"kind,omitempty"`
  28218. // LabelFingerprint: A fingerprint for the labels being applied to this
  28219. // VpnTunnel, which is essentially a hash of the labels set used for
  28220. // optimistic locking. The fingerprint is initially generated by Compute
  28221. // Engine and changes after every request to modify or update labels.
  28222. // You must always provide an up-to-date fingerprint hash in order to
  28223. // update or change labels, otherwise the request will fail with error
  28224. // 412 conditionNotMet.
  28225. //
  28226. // To see the latest fingerprint, make a get() request to retrieve a
  28227. // VpnTunnel.
  28228. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  28229. // Labels: Labels to apply to this VpnTunnel. These can be later
  28230. // modified by the setLabels method. Each label key/value pair must
  28231. // comply with RFC1035. Label values may be empty.
  28232. Labels map[string]string `json:"labels,omitempty"`
  28233. // LocalTrafficSelector: Local traffic selector to use when establishing
  28234. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  28235. // formatted string, for example: 192.168.0.0/16. The ranges should be
  28236. // disjoint. Only IPv4 is supported.
  28237. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  28238. // Name: Name of the resource. Provided by the client when the resource
  28239. // is created. The name must be 1-63 characters long, and comply with
  28240. // RFC1035. Specifically, the name must be 1-63 characters long and
  28241. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28242. // the first character must be a lowercase letter, and all following
  28243. // characters must be a dash, lowercase letter, or digit, except the
  28244. // last character, which cannot be a dash.
  28245. Name string `json:"name,omitempty"`
  28246. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  28247. PeerIp string `json:"peerIp,omitempty"`
  28248. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  28249. // You must specify this field as part of the HTTP request URL. It is
  28250. // not settable as a field in the request body.
  28251. Region string `json:"region,omitempty"`
  28252. // RemoteTrafficSelector: Remote traffic selectors to use when
  28253. // establishing the VPN tunnel with peer VPN gateway. The value should
  28254. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  28255. // should be disjoint. Only IPv4 is supported.
  28256. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  28257. // Router: URL of router resource to be used for dynamic routing.
  28258. Router string `json:"router,omitempty"`
  28259. // SelfLink: [Output Only] Server-defined URL for the resource.
  28260. SelfLink string `json:"selfLink,omitempty"`
  28261. // SharedSecret: Shared secret used to set the secure session between
  28262. // the Cloud VPN gateway and the peer VPN gateway.
  28263. SharedSecret string `json:"sharedSecret,omitempty"`
  28264. // SharedSecretHash: Hash of the shared secret.
  28265. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  28266. // Status: [Output Only] The status of the VPN tunnel.
  28267. //
  28268. // Possible values:
  28269. // "ALLOCATING_RESOURCES"
  28270. // "AUTHORIZATION_ERROR"
  28271. // "DEPROVISIONING"
  28272. // "ESTABLISHED"
  28273. // "FAILED"
  28274. // "FIRST_HANDSHAKE"
  28275. // "NEGOTIATION_FAILURE"
  28276. // "NETWORK_ERROR"
  28277. // "NO_INCOMING_PACKETS"
  28278. // "PROVISIONING"
  28279. // "REJECTED"
  28280. // "WAITING_FOR_FULL_CONFIG"
  28281. Status string `json:"status,omitempty"`
  28282. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  28283. // tunnel is associated. Provided by the client when the VPN tunnel is
  28284. // created.
  28285. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  28286. // ServerResponse contains the HTTP response code and headers from the
  28287. // server.
  28288. googleapi.ServerResponse `json:"-"`
  28289. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28290. // to unconditionally include in API requests. By default, fields with
  28291. // empty values are omitted from API requests. However, any non-pointer,
  28292. // non-interface field appearing in ForceSendFields will be sent to the
  28293. // server regardless of whether the field is empty or not. This may be
  28294. // used to include empty fields in Patch requests.
  28295. ForceSendFields []string `json:"-"`
  28296. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28297. // include in API requests with the JSON null value. By default, fields
  28298. // with empty values are omitted from API requests. However, any field
  28299. // with an empty value appearing in NullFields will be sent to the
  28300. // server as null. It is an error if a field in this list has a
  28301. // non-empty value. This may be used to include null fields in Patch
  28302. // requests.
  28303. NullFields []string `json:"-"`
  28304. }
  28305. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  28306. type NoMethod VpnTunnel
  28307. raw := NoMethod(*s)
  28308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28309. }
  28310. type VpnTunnelAggregatedList struct {
  28311. // Id: [Output Only] Unique identifier for the resource; defined by the
  28312. // server.
  28313. Id string `json:"id,omitempty"`
  28314. // Items: A list of VpnTunnelsScopedList resources.
  28315. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  28316. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  28317. // VPN tunnels.
  28318. Kind string `json:"kind,omitempty"`
  28319. // NextPageToken: [Output Only] This token allows you to get the next
  28320. // page of results for list requests. If the number of results is larger
  28321. // than maxResults, use the nextPageToken as a value for the query
  28322. // parameter pageToken in the next list request. Subsequent list
  28323. // requests will have their own nextPageToken to continue paging through
  28324. // the results.
  28325. NextPageToken string `json:"nextPageToken,omitempty"`
  28326. // SelfLink: [Output Only] Server-defined URL for this resource.
  28327. SelfLink string `json:"selfLink,omitempty"`
  28328. // Warning: [Output Only] Informational warning message.
  28329. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  28330. // ServerResponse contains the HTTP response code and headers from the
  28331. // server.
  28332. googleapi.ServerResponse `json:"-"`
  28333. // ForceSendFields is a list of field names (e.g. "Id") to
  28334. // unconditionally include in API requests. By default, fields with
  28335. // empty values are omitted from API requests. However, any non-pointer,
  28336. // non-interface field appearing in ForceSendFields will be sent to the
  28337. // server regardless of whether the field is empty or not. This may be
  28338. // used to include empty fields in Patch requests.
  28339. ForceSendFields []string `json:"-"`
  28340. // NullFields is a list of field names (e.g. "Id") to include in API
  28341. // requests with the JSON null value. By default, fields with empty
  28342. // values are omitted from API requests. However, any field with an
  28343. // empty value appearing in NullFields will be sent to the server as
  28344. // null. It is an error if a field in this list has a non-empty value.
  28345. // This may be used to include null fields in Patch requests.
  28346. NullFields []string `json:"-"`
  28347. }
  28348. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  28349. type NoMethod VpnTunnelAggregatedList
  28350. raw := NoMethod(*s)
  28351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28352. }
  28353. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  28354. // message.
  28355. type VpnTunnelAggregatedListWarning struct {
  28356. // Code: [Output Only] A warning code, if applicable. For example,
  28357. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28358. // the response.
  28359. //
  28360. // Possible values:
  28361. // "CLEANUP_FAILED"
  28362. // "DEPRECATED_RESOURCE_USED"
  28363. // "DEPRECATED_TYPE_USED"
  28364. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28365. // "EXPERIMENTAL_TYPE_USED"
  28366. // "EXTERNAL_API_WARNING"
  28367. // "FIELD_VALUE_OVERRIDEN"
  28368. // "INJECTED_KERNELS_DEPRECATED"
  28369. // "MISSING_TYPE_DEPENDENCY"
  28370. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28371. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28372. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28373. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28374. // "NEXT_HOP_NOT_RUNNING"
  28375. // "NOT_CRITICAL_ERROR"
  28376. // "NO_RESULTS_ON_PAGE"
  28377. // "REQUIRED_TOS_AGREEMENT"
  28378. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28379. // "RESOURCE_NOT_DELETED"
  28380. // "SCHEMA_VALIDATION_IGNORED"
  28381. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28382. // "UNDECLARED_PROPERTIES"
  28383. // "UNREACHABLE"
  28384. Code string `json:"code,omitempty"`
  28385. // Data: [Output Only] Metadata about this warning in key: value format.
  28386. // For example:
  28387. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28388. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  28389. // Message: [Output Only] A human-readable description of the warning
  28390. // code.
  28391. Message string `json:"message,omitempty"`
  28392. // ForceSendFields is a list of field names (e.g. "Code") to
  28393. // unconditionally include in API requests. By default, fields with
  28394. // empty values are omitted from API requests. However, any non-pointer,
  28395. // non-interface field appearing in ForceSendFields will be sent to the
  28396. // server regardless of whether the field is empty or not. This may be
  28397. // used to include empty fields in Patch requests.
  28398. ForceSendFields []string `json:"-"`
  28399. // NullFields is a list of field names (e.g. "Code") to include in API
  28400. // requests with the JSON null value. By default, fields with empty
  28401. // values are omitted from API requests. However, any field with an
  28402. // empty value appearing in NullFields will be sent to the server as
  28403. // null. It is an error if a field in this list has a non-empty value.
  28404. // This may be used to include null fields in Patch requests.
  28405. NullFields []string `json:"-"`
  28406. }
  28407. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  28408. type NoMethod VpnTunnelAggregatedListWarning
  28409. raw := NoMethod(*s)
  28410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28411. }
  28412. type VpnTunnelAggregatedListWarningData struct {
  28413. // Key: [Output Only] A key that provides more detail on the warning
  28414. // being returned. For example, for warnings where there are no results
  28415. // in a list request for a particular zone, this key might be scope and
  28416. // the key value might be the zone name. Other examples might be a key
  28417. // indicating a deprecated resource and a suggested replacement, or a
  28418. // warning about invalid network settings (for example, if an instance
  28419. // attempts to perform IP forwarding but is not enabled for IP
  28420. // forwarding).
  28421. Key string `json:"key,omitempty"`
  28422. // Value: [Output Only] A warning data value corresponding to the key.
  28423. Value string `json:"value,omitempty"`
  28424. // ForceSendFields is a list of field names (e.g. "Key") to
  28425. // unconditionally include in API requests. By default, fields with
  28426. // empty values are omitted from API requests. However, any non-pointer,
  28427. // non-interface field appearing in ForceSendFields will be sent to the
  28428. // server regardless of whether the field is empty or not. This may be
  28429. // used to include empty fields in Patch requests.
  28430. ForceSendFields []string `json:"-"`
  28431. // NullFields is a list of field names (e.g. "Key") to include in API
  28432. // requests with the JSON null value. By default, fields with empty
  28433. // values are omitted from API requests. However, any field with an
  28434. // empty value appearing in NullFields will be sent to the server as
  28435. // null. It is an error if a field in this list has a non-empty value.
  28436. // This may be used to include null fields in Patch requests.
  28437. NullFields []string `json:"-"`
  28438. }
  28439. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  28440. type NoMethod VpnTunnelAggregatedListWarningData
  28441. raw := NoMethod(*s)
  28442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28443. }
  28444. // VpnTunnelList: Contains a list of VpnTunnel resources.
  28445. type VpnTunnelList struct {
  28446. // Id: [Output Only] Unique identifier for the resource; defined by the
  28447. // server.
  28448. Id string `json:"id,omitempty"`
  28449. // Items: A list of VpnTunnel resources.
  28450. Items []*VpnTunnel `json:"items,omitempty"`
  28451. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  28452. // VPN tunnels.
  28453. Kind string `json:"kind,omitempty"`
  28454. // NextPageToken: [Output Only] This token allows you to get the next
  28455. // page of results for list requests. If the number of results is larger
  28456. // than maxResults, use the nextPageToken as a value for the query
  28457. // parameter pageToken in the next list request. Subsequent list
  28458. // requests will have their own nextPageToken to continue paging through
  28459. // the results.
  28460. NextPageToken string `json:"nextPageToken,omitempty"`
  28461. // SelfLink: [Output Only] Server-defined URL for this resource.
  28462. SelfLink string `json:"selfLink,omitempty"`
  28463. // Warning: [Output Only] Informational warning message.
  28464. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  28465. // ServerResponse contains the HTTP response code and headers from the
  28466. // server.
  28467. googleapi.ServerResponse `json:"-"`
  28468. // ForceSendFields is a list of field names (e.g. "Id") to
  28469. // unconditionally include in API requests. By default, fields with
  28470. // empty values are omitted from API requests. However, any non-pointer,
  28471. // non-interface field appearing in ForceSendFields will be sent to the
  28472. // server regardless of whether the field is empty or not. This may be
  28473. // used to include empty fields in Patch requests.
  28474. ForceSendFields []string `json:"-"`
  28475. // NullFields is a list of field names (e.g. "Id") to include in API
  28476. // requests with the JSON null value. By default, fields with empty
  28477. // values are omitted from API requests. However, any field with an
  28478. // empty value appearing in NullFields will be sent to the server as
  28479. // null. It is an error if a field in this list has a non-empty value.
  28480. // This may be used to include null fields in Patch requests.
  28481. NullFields []string `json:"-"`
  28482. }
  28483. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  28484. type NoMethod VpnTunnelList
  28485. raw := NoMethod(*s)
  28486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28487. }
  28488. // VpnTunnelListWarning: [Output Only] Informational warning message.
  28489. type VpnTunnelListWarning struct {
  28490. // Code: [Output Only] A warning code, if applicable. For example,
  28491. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28492. // the response.
  28493. //
  28494. // Possible values:
  28495. // "CLEANUP_FAILED"
  28496. // "DEPRECATED_RESOURCE_USED"
  28497. // "DEPRECATED_TYPE_USED"
  28498. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28499. // "EXPERIMENTAL_TYPE_USED"
  28500. // "EXTERNAL_API_WARNING"
  28501. // "FIELD_VALUE_OVERRIDEN"
  28502. // "INJECTED_KERNELS_DEPRECATED"
  28503. // "MISSING_TYPE_DEPENDENCY"
  28504. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28505. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28506. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28507. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28508. // "NEXT_HOP_NOT_RUNNING"
  28509. // "NOT_CRITICAL_ERROR"
  28510. // "NO_RESULTS_ON_PAGE"
  28511. // "REQUIRED_TOS_AGREEMENT"
  28512. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28513. // "RESOURCE_NOT_DELETED"
  28514. // "SCHEMA_VALIDATION_IGNORED"
  28515. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28516. // "UNDECLARED_PROPERTIES"
  28517. // "UNREACHABLE"
  28518. Code string `json:"code,omitempty"`
  28519. // Data: [Output Only] Metadata about this warning in key: value format.
  28520. // For example:
  28521. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28522. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  28523. // Message: [Output Only] A human-readable description of the warning
  28524. // code.
  28525. Message string `json:"message,omitempty"`
  28526. // ForceSendFields is a list of field names (e.g. "Code") to
  28527. // unconditionally include in API requests. By default, fields with
  28528. // empty values are omitted from API requests. However, any non-pointer,
  28529. // non-interface field appearing in ForceSendFields will be sent to the
  28530. // server regardless of whether the field is empty or not. This may be
  28531. // used to include empty fields in Patch requests.
  28532. ForceSendFields []string `json:"-"`
  28533. // NullFields is a list of field names (e.g. "Code") to include in API
  28534. // requests with the JSON null value. By default, fields with empty
  28535. // values are omitted from API requests. However, any field with an
  28536. // empty value appearing in NullFields will be sent to the server as
  28537. // null. It is an error if a field in this list has a non-empty value.
  28538. // This may be used to include null fields in Patch requests.
  28539. NullFields []string `json:"-"`
  28540. }
  28541. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  28542. type NoMethod VpnTunnelListWarning
  28543. raw := NoMethod(*s)
  28544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28545. }
  28546. type VpnTunnelListWarningData struct {
  28547. // Key: [Output Only] A key that provides more detail on the warning
  28548. // being returned. For example, for warnings where there are no results
  28549. // in a list request for a particular zone, this key might be scope and
  28550. // the key value might be the zone name. Other examples might be a key
  28551. // indicating a deprecated resource and a suggested replacement, or a
  28552. // warning about invalid network settings (for example, if an instance
  28553. // attempts to perform IP forwarding but is not enabled for IP
  28554. // forwarding).
  28555. Key string `json:"key,omitempty"`
  28556. // Value: [Output Only] A warning data value corresponding to the key.
  28557. Value string `json:"value,omitempty"`
  28558. // ForceSendFields is a list of field names (e.g. "Key") to
  28559. // unconditionally include in API requests. By default, fields with
  28560. // empty values are omitted from API requests. However, any non-pointer,
  28561. // non-interface field appearing in ForceSendFields will be sent to the
  28562. // server regardless of whether the field is empty or not. This may be
  28563. // used to include empty fields in Patch requests.
  28564. ForceSendFields []string `json:"-"`
  28565. // NullFields is a list of field names (e.g. "Key") to include in API
  28566. // requests with the JSON null value. By default, fields with empty
  28567. // values are omitted from API requests. However, any field with an
  28568. // empty value appearing in NullFields will be sent to the server as
  28569. // null. It is an error if a field in this list has a non-empty value.
  28570. // This may be used to include null fields in Patch requests.
  28571. NullFields []string `json:"-"`
  28572. }
  28573. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  28574. type NoMethod VpnTunnelListWarningData
  28575. raw := NoMethod(*s)
  28576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28577. }
  28578. type VpnTunnelsScopedList struct {
  28579. // VpnTunnels: A list of vpn tunnels contained in this scope.
  28580. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  28581. // Warning: Informational warning which replaces the list of addresses
  28582. // when the list is empty.
  28583. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  28584. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  28585. // unconditionally include in API requests. By default, fields with
  28586. // empty values are omitted from API requests. However, any non-pointer,
  28587. // non-interface field appearing in ForceSendFields will be sent to the
  28588. // server regardless of whether the field is empty or not. This may be
  28589. // used to include empty fields in Patch requests.
  28590. ForceSendFields []string `json:"-"`
  28591. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  28592. // API requests with the JSON null value. By default, fields with empty
  28593. // values are omitted from API requests. However, any field with an
  28594. // empty value appearing in NullFields will be sent to the server as
  28595. // null. It is an error if a field in this list has a non-empty value.
  28596. // This may be used to include null fields in Patch requests.
  28597. NullFields []string `json:"-"`
  28598. }
  28599. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  28600. type NoMethod VpnTunnelsScopedList
  28601. raw := NoMethod(*s)
  28602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28603. }
  28604. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  28605. // list of addresses when the list is empty.
  28606. type VpnTunnelsScopedListWarning struct {
  28607. // Code: [Output Only] A warning code, if applicable. For example,
  28608. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28609. // the response.
  28610. //
  28611. // Possible values:
  28612. // "CLEANUP_FAILED"
  28613. // "DEPRECATED_RESOURCE_USED"
  28614. // "DEPRECATED_TYPE_USED"
  28615. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28616. // "EXPERIMENTAL_TYPE_USED"
  28617. // "EXTERNAL_API_WARNING"
  28618. // "FIELD_VALUE_OVERRIDEN"
  28619. // "INJECTED_KERNELS_DEPRECATED"
  28620. // "MISSING_TYPE_DEPENDENCY"
  28621. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28622. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28623. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28624. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28625. // "NEXT_HOP_NOT_RUNNING"
  28626. // "NOT_CRITICAL_ERROR"
  28627. // "NO_RESULTS_ON_PAGE"
  28628. // "REQUIRED_TOS_AGREEMENT"
  28629. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28630. // "RESOURCE_NOT_DELETED"
  28631. // "SCHEMA_VALIDATION_IGNORED"
  28632. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28633. // "UNDECLARED_PROPERTIES"
  28634. // "UNREACHABLE"
  28635. Code string `json:"code,omitempty"`
  28636. // Data: [Output Only] Metadata about this warning in key: value format.
  28637. // For example:
  28638. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28639. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  28640. // Message: [Output Only] A human-readable description of the warning
  28641. // code.
  28642. Message string `json:"message,omitempty"`
  28643. // ForceSendFields is a list of field names (e.g. "Code") to
  28644. // unconditionally include in API requests. By default, fields with
  28645. // empty values are omitted from API requests. However, any non-pointer,
  28646. // non-interface field appearing in ForceSendFields will be sent to the
  28647. // server regardless of whether the field is empty or not. This may be
  28648. // used to include empty fields in Patch requests.
  28649. ForceSendFields []string `json:"-"`
  28650. // NullFields is a list of field names (e.g. "Code") to include in API
  28651. // requests with the JSON null value. By default, fields with empty
  28652. // values are omitted from API requests. However, any field with an
  28653. // empty value appearing in NullFields will be sent to the server as
  28654. // null. It is an error if a field in this list has a non-empty value.
  28655. // This may be used to include null fields in Patch requests.
  28656. NullFields []string `json:"-"`
  28657. }
  28658. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  28659. type NoMethod VpnTunnelsScopedListWarning
  28660. raw := NoMethod(*s)
  28661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28662. }
  28663. type VpnTunnelsScopedListWarningData struct {
  28664. // Key: [Output Only] A key that provides more detail on the warning
  28665. // being returned. For example, for warnings where there are no results
  28666. // in a list request for a particular zone, this key might be scope and
  28667. // the key value might be the zone name. Other examples might be a key
  28668. // indicating a deprecated resource and a suggested replacement, or a
  28669. // warning about invalid network settings (for example, if an instance
  28670. // attempts to perform IP forwarding but is not enabled for IP
  28671. // forwarding).
  28672. Key string `json:"key,omitempty"`
  28673. // Value: [Output Only] A warning data value corresponding to the key.
  28674. Value string `json:"value,omitempty"`
  28675. // ForceSendFields is a list of field names (e.g. "Key") to
  28676. // unconditionally include in API requests. By default, fields with
  28677. // empty values are omitted from API requests. However, any non-pointer,
  28678. // non-interface field appearing in ForceSendFields will be sent to the
  28679. // server regardless of whether the field is empty or not. This may be
  28680. // used to include empty fields in Patch requests.
  28681. ForceSendFields []string `json:"-"`
  28682. // NullFields is a list of field names (e.g. "Key") to include in API
  28683. // requests with the JSON null value. By default, fields with empty
  28684. // values are omitted from API requests. However, any field with an
  28685. // empty value appearing in NullFields will be sent to the server as
  28686. // null. It is an error if a field in this list has a non-empty value.
  28687. // This may be used to include null fields in Patch requests.
  28688. NullFields []string `json:"-"`
  28689. }
  28690. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  28691. type NoMethod VpnTunnelsScopedListWarningData
  28692. raw := NoMethod(*s)
  28693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28694. }
  28695. type WafExpressionSet struct {
  28696. // Aliases: A list of alternate IDs. The format should be: - E.g.
  28697. // XSS-stable Generic suffix like "stable" is particularly useful if a
  28698. // policy likes to avail newer set of expressions without having to
  28699. // change the policy. A given alias name can't be used for more than one
  28700. // entity set.
  28701. Aliases []string `json:"aliases,omitempty"`
  28702. // Expressions: List of available expressions.
  28703. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  28704. // Id: Google specified expression set ID. The format should be: - E.g.
  28705. // XSS-20170329
  28706. Id string `json:"id,omitempty"`
  28707. // ForceSendFields is a list of field names (e.g. "Aliases") to
  28708. // unconditionally include in API requests. By default, fields with
  28709. // empty values are omitted from API requests. However, any non-pointer,
  28710. // non-interface field appearing in ForceSendFields will be sent to the
  28711. // server regardless of whether the field is empty or not. This may be
  28712. // used to include empty fields in Patch requests.
  28713. ForceSendFields []string `json:"-"`
  28714. // NullFields is a list of field names (e.g. "Aliases") to include in
  28715. // API requests with the JSON null value. By default, fields with empty
  28716. // values are omitted from API requests. However, any field with an
  28717. // empty value appearing in NullFields will be sent to the server as
  28718. // null. It is an error if a field in this list has a non-empty value.
  28719. // This may be used to include null fields in Patch requests.
  28720. NullFields []string `json:"-"`
  28721. }
  28722. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  28723. type NoMethod WafExpressionSet
  28724. raw := NoMethod(*s)
  28725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28726. }
  28727. type WafExpressionSetExpression struct {
  28728. // Id: Expression ID should uniquely identify the origin of the
  28729. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  28730. // rule set version 2.9.1 rule id 973337. The ID could be used to
  28731. // determine the individual attack definition that has been detected. It
  28732. // could also be used to exclude it from the policy in case of false
  28733. // positive.
  28734. Id string `json:"id,omitempty"`
  28735. // ForceSendFields is a list of field names (e.g. "Id") to
  28736. // unconditionally include in API requests. By default, fields with
  28737. // empty values are omitted from API requests. However, any non-pointer,
  28738. // non-interface field appearing in ForceSendFields will be sent to the
  28739. // server regardless of whether the field is empty or not. This may be
  28740. // used to include empty fields in Patch requests.
  28741. ForceSendFields []string `json:"-"`
  28742. // NullFields is a list of field names (e.g. "Id") to include in API
  28743. // requests with the JSON null value. By default, fields with empty
  28744. // values are omitted from API requests. However, any field with an
  28745. // empty value appearing in NullFields will be sent to the server as
  28746. // null. It is an error if a field in this list has a non-empty value.
  28747. // This may be used to include null fields in Patch requests.
  28748. NullFields []string `json:"-"`
  28749. }
  28750. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  28751. type NoMethod WafExpressionSetExpression
  28752. raw := NoMethod(*s)
  28753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28754. }
  28755. type XpnHostList struct {
  28756. // Id: [Output Only] Unique identifier for the resource; defined by the
  28757. // server.
  28758. Id string `json:"id,omitempty"`
  28759. // Items: [Output Only] A list of shared VPC host project URLs.
  28760. Items []*Project `json:"items,omitempty"`
  28761. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  28762. // lists of shared VPC hosts.
  28763. Kind string `json:"kind,omitempty"`
  28764. // NextPageToken: [Output Only] This token allows you to get the next
  28765. // page of results for list requests. If the number of results is larger
  28766. // than maxResults, use the nextPageToken as a value for the query
  28767. // parameter pageToken in the next list request. Subsequent list
  28768. // requests will have their own nextPageToken to continue paging through
  28769. // the results.
  28770. NextPageToken string `json:"nextPageToken,omitempty"`
  28771. // SelfLink: [Output Only] Server-defined URL for this resource.
  28772. SelfLink string `json:"selfLink,omitempty"`
  28773. // Warning: [Output Only] Informational warning message.
  28774. Warning *XpnHostListWarning `json:"warning,omitempty"`
  28775. // ServerResponse contains the HTTP response code and headers from the
  28776. // server.
  28777. googleapi.ServerResponse `json:"-"`
  28778. // ForceSendFields is a list of field names (e.g. "Id") to
  28779. // unconditionally include in API requests. By default, fields with
  28780. // empty values are omitted from API requests. However, any non-pointer,
  28781. // non-interface field appearing in ForceSendFields will be sent to the
  28782. // server regardless of whether the field is empty or not. This may be
  28783. // used to include empty fields in Patch requests.
  28784. ForceSendFields []string `json:"-"`
  28785. // NullFields is a list of field names (e.g. "Id") to include in API
  28786. // requests with the JSON null value. By default, fields with empty
  28787. // values are omitted from API requests. However, any field with an
  28788. // empty value appearing in NullFields will be sent to the server as
  28789. // null. It is an error if a field in this list has a non-empty value.
  28790. // This may be used to include null fields in Patch requests.
  28791. NullFields []string `json:"-"`
  28792. }
  28793. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  28794. type NoMethod XpnHostList
  28795. raw := NoMethod(*s)
  28796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28797. }
  28798. // XpnHostListWarning: [Output Only] Informational warning message.
  28799. type XpnHostListWarning struct {
  28800. // Code: [Output Only] A warning code, if applicable. For example,
  28801. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28802. // the response.
  28803. //
  28804. // Possible values:
  28805. // "CLEANUP_FAILED"
  28806. // "DEPRECATED_RESOURCE_USED"
  28807. // "DEPRECATED_TYPE_USED"
  28808. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28809. // "EXPERIMENTAL_TYPE_USED"
  28810. // "EXTERNAL_API_WARNING"
  28811. // "FIELD_VALUE_OVERRIDEN"
  28812. // "INJECTED_KERNELS_DEPRECATED"
  28813. // "MISSING_TYPE_DEPENDENCY"
  28814. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28815. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28816. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28817. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28818. // "NEXT_HOP_NOT_RUNNING"
  28819. // "NOT_CRITICAL_ERROR"
  28820. // "NO_RESULTS_ON_PAGE"
  28821. // "REQUIRED_TOS_AGREEMENT"
  28822. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28823. // "RESOURCE_NOT_DELETED"
  28824. // "SCHEMA_VALIDATION_IGNORED"
  28825. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28826. // "UNDECLARED_PROPERTIES"
  28827. // "UNREACHABLE"
  28828. Code string `json:"code,omitempty"`
  28829. // Data: [Output Only] Metadata about this warning in key: value format.
  28830. // For example:
  28831. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28832. Data []*XpnHostListWarningData `json:"data,omitempty"`
  28833. // Message: [Output Only] A human-readable description of the warning
  28834. // code.
  28835. Message string `json:"message,omitempty"`
  28836. // ForceSendFields is a list of field names (e.g. "Code") to
  28837. // unconditionally include in API requests. By default, fields with
  28838. // empty values are omitted from API requests. However, any non-pointer,
  28839. // non-interface field appearing in ForceSendFields will be sent to the
  28840. // server regardless of whether the field is empty or not. This may be
  28841. // used to include empty fields in Patch requests.
  28842. ForceSendFields []string `json:"-"`
  28843. // NullFields is a list of field names (e.g. "Code") to include in API
  28844. // requests with the JSON null value. By default, fields with empty
  28845. // values are omitted from API requests. However, any field with an
  28846. // empty value appearing in NullFields will be sent to the server as
  28847. // null. It is an error if a field in this list has a non-empty value.
  28848. // This may be used to include null fields in Patch requests.
  28849. NullFields []string `json:"-"`
  28850. }
  28851. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  28852. type NoMethod XpnHostListWarning
  28853. raw := NoMethod(*s)
  28854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28855. }
  28856. type XpnHostListWarningData struct {
  28857. // Key: [Output Only] A key that provides more detail on the warning
  28858. // being returned. For example, for warnings where there are no results
  28859. // in a list request for a particular zone, this key might be scope and
  28860. // the key value might be the zone name. Other examples might be a key
  28861. // indicating a deprecated resource and a suggested replacement, or a
  28862. // warning about invalid network settings (for example, if an instance
  28863. // attempts to perform IP forwarding but is not enabled for IP
  28864. // forwarding).
  28865. Key string `json:"key,omitempty"`
  28866. // Value: [Output Only] A warning data value corresponding to the key.
  28867. Value string `json:"value,omitempty"`
  28868. // ForceSendFields is a list of field names (e.g. "Key") to
  28869. // unconditionally include in API requests. By default, fields with
  28870. // empty values are omitted from API requests. However, any non-pointer,
  28871. // non-interface field appearing in ForceSendFields will be sent to the
  28872. // server regardless of whether the field is empty or not. This may be
  28873. // used to include empty fields in Patch requests.
  28874. ForceSendFields []string `json:"-"`
  28875. // NullFields is a list of field names (e.g. "Key") to include in API
  28876. // requests with the JSON null value. By default, fields with empty
  28877. // values are omitted from API requests. However, any field with an
  28878. // empty value appearing in NullFields will be sent to the server as
  28879. // null. It is an error if a field in this list has a non-empty value.
  28880. // This may be used to include null fields in Patch requests.
  28881. NullFields []string `json:"-"`
  28882. }
  28883. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  28884. type NoMethod XpnHostListWarningData
  28885. raw := NoMethod(*s)
  28886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28887. }
  28888. // XpnResourceId: Service resource (a.k.a service project) ID.
  28889. type XpnResourceId struct {
  28890. // Id: The ID of the service resource. In the case of projects, this
  28891. // field supports project id (e.g., my-project-123) and project number
  28892. // (e.g. 12345678).
  28893. Id string `json:"id,omitempty"`
  28894. // Type: The type of the service resource.
  28895. //
  28896. // Possible values:
  28897. // "PROJECT"
  28898. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  28899. Type string `json:"type,omitempty"`
  28900. // ForceSendFields is a list of field names (e.g. "Id") to
  28901. // unconditionally include in API requests. By default, fields with
  28902. // empty values are omitted from API requests. However, any non-pointer,
  28903. // non-interface field appearing in ForceSendFields will be sent to the
  28904. // server regardless of whether the field is empty or not. This may be
  28905. // used to include empty fields in Patch requests.
  28906. ForceSendFields []string `json:"-"`
  28907. // NullFields is a list of field names (e.g. "Id") to include in API
  28908. // requests with the JSON null value. By default, fields with empty
  28909. // values are omitted from API requests. However, any field with an
  28910. // empty value appearing in NullFields will be sent to the server as
  28911. // null. It is an error if a field in this list has a non-empty value.
  28912. // This may be used to include null fields in Patch requests.
  28913. NullFields []string `json:"-"`
  28914. }
  28915. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  28916. type NoMethod XpnResourceId
  28917. raw := NoMethod(*s)
  28918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28919. }
  28920. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  28921. // resource_for v1.zones ==)
  28922. type Zone struct {
  28923. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  28924. // selections for the zone.
  28925. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  28926. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28927. // format.
  28928. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28929. // Deprecated: [Output Only] The deprecation status associated with this
  28930. // zone.
  28931. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  28932. // Description: [Output Only] Textual description of the resource.
  28933. Description string `json:"description,omitempty"`
  28934. // Id: [Output Only] The unique identifier for the resource. This
  28935. // identifier is defined by the server.
  28936. Id uint64 `json:"id,omitempty,string"`
  28937. // Kind: [Output Only] Type of the resource. Always compute#zone for
  28938. // zones.
  28939. Kind string `json:"kind,omitempty"`
  28940. // Name: [Output Only] Name of the resource.
  28941. Name string `json:"name,omitempty"`
  28942. // Region: [Output Only] Full URL reference to the region which hosts
  28943. // the zone.
  28944. Region string `json:"region,omitempty"`
  28945. // SelfLink: [Output Only] Server-defined URL for the resource.
  28946. SelfLink string `json:"selfLink,omitempty"`
  28947. // Status: [Output Only] Status of the zone, either UP or DOWN.
  28948. //
  28949. // Possible values:
  28950. // "DOWN"
  28951. // "UP"
  28952. Status string `json:"status,omitempty"`
  28953. // ServerResponse contains the HTTP response code and headers from the
  28954. // server.
  28955. googleapi.ServerResponse `json:"-"`
  28956. // ForceSendFields is a list of field names (e.g.
  28957. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  28958. // By default, fields with empty values are omitted from API requests.
  28959. // However, any non-pointer, non-interface field appearing in
  28960. // ForceSendFields will be sent to the server regardless of whether the
  28961. // field is empty or not. This may be used to include empty fields in
  28962. // Patch requests.
  28963. ForceSendFields []string `json:"-"`
  28964. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  28965. // include in API requests with the JSON null value. By default, fields
  28966. // with empty values are omitted from API requests. However, any field
  28967. // with an empty value appearing in NullFields will be sent to the
  28968. // server as null. It is an error if a field in this list has a
  28969. // non-empty value. This may be used to include null fields in Patch
  28970. // requests.
  28971. NullFields []string `json:"-"`
  28972. }
  28973. func (s *Zone) MarshalJSON() ([]byte, error) {
  28974. type NoMethod Zone
  28975. raw := NoMethod(*s)
  28976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28977. }
  28978. // ZoneList: Contains a list of zone resources.
  28979. type ZoneList struct {
  28980. // Id: [Output Only] Unique identifier for the resource; defined by the
  28981. // server.
  28982. Id string `json:"id,omitempty"`
  28983. // Items: A list of Zone resources.
  28984. Items []*Zone `json:"items,omitempty"`
  28985. // Kind: Type of resource.
  28986. Kind string `json:"kind,omitempty"`
  28987. // NextPageToken: [Output Only] This token allows you to get the next
  28988. // page of results for list requests. If the number of results is larger
  28989. // than maxResults, use the nextPageToken as a value for the query
  28990. // parameter pageToken in the next list request. Subsequent list
  28991. // requests will have their own nextPageToken to continue paging through
  28992. // the results.
  28993. NextPageToken string `json:"nextPageToken,omitempty"`
  28994. // SelfLink: [Output Only] Server-defined URL for this resource.
  28995. SelfLink string `json:"selfLink,omitempty"`
  28996. // Warning: [Output Only] Informational warning message.
  28997. Warning *ZoneListWarning `json:"warning,omitempty"`
  28998. // ServerResponse contains the HTTP response code and headers from the
  28999. // server.
  29000. googleapi.ServerResponse `json:"-"`
  29001. // ForceSendFields is a list of field names (e.g. "Id") to
  29002. // unconditionally include in API requests. By default, fields with
  29003. // empty values are omitted from API requests. However, any non-pointer,
  29004. // non-interface field appearing in ForceSendFields will be sent to the
  29005. // server regardless of whether the field is empty or not. This may be
  29006. // used to include empty fields in Patch requests.
  29007. ForceSendFields []string `json:"-"`
  29008. // NullFields is a list of field names (e.g. "Id") to include in API
  29009. // requests with the JSON null value. By default, fields with empty
  29010. // values are omitted from API requests. However, any field with an
  29011. // empty value appearing in NullFields will be sent to the server as
  29012. // null. It is an error if a field in this list has a non-empty value.
  29013. // This may be used to include null fields in Patch requests.
  29014. NullFields []string `json:"-"`
  29015. }
  29016. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  29017. type NoMethod ZoneList
  29018. raw := NoMethod(*s)
  29019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29020. }
  29021. // ZoneListWarning: [Output Only] Informational warning message.
  29022. type ZoneListWarning struct {
  29023. // Code: [Output Only] A warning code, if applicable. For example,
  29024. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29025. // the response.
  29026. //
  29027. // Possible values:
  29028. // "CLEANUP_FAILED"
  29029. // "DEPRECATED_RESOURCE_USED"
  29030. // "DEPRECATED_TYPE_USED"
  29031. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29032. // "EXPERIMENTAL_TYPE_USED"
  29033. // "EXTERNAL_API_WARNING"
  29034. // "FIELD_VALUE_OVERRIDEN"
  29035. // "INJECTED_KERNELS_DEPRECATED"
  29036. // "MISSING_TYPE_DEPENDENCY"
  29037. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29038. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29039. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29040. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29041. // "NEXT_HOP_NOT_RUNNING"
  29042. // "NOT_CRITICAL_ERROR"
  29043. // "NO_RESULTS_ON_PAGE"
  29044. // "REQUIRED_TOS_AGREEMENT"
  29045. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29046. // "RESOURCE_NOT_DELETED"
  29047. // "SCHEMA_VALIDATION_IGNORED"
  29048. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29049. // "UNDECLARED_PROPERTIES"
  29050. // "UNREACHABLE"
  29051. Code string `json:"code,omitempty"`
  29052. // Data: [Output Only] Metadata about this warning in key: value format.
  29053. // For example:
  29054. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29055. Data []*ZoneListWarningData `json:"data,omitempty"`
  29056. // Message: [Output Only] A human-readable description of the warning
  29057. // code.
  29058. Message string `json:"message,omitempty"`
  29059. // ForceSendFields is a list of field names (e.g. "Code") to
  29060. // unconditionally include in API requests. By default, fields with
  29061. // empty values are omitted from API requests. However, any non-pointer,
  29062. // non-interface field appearing in ForceSendFields will be sent to the
  29063. // server regardless of whether the field is empty or not. This may be
  29064. // used to include empty fields in Patch requests.
  29065. ForceSendFields []string `json:"-"`
  29066. // NullFields is a list of field names (e.g. "Code") to include in API
  29067. // requests with the JSON null value. By default, fields with empty
  29068. // values are omitted from API requests. However, any field with an
  29069. // empty value appearing in NullFields will be sent to the server as
  29070. // null. It is an error if a field in this list has a non-empty value.
  29071. // This may be used to include null fields in Patch requests.
  29072. NullFields []string `json:"-"`
  29073. }
  29074. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  29075. type NoMethod ZoneListWarning
  29076. raw := NoMethod(*s)
  29077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29078. }
  29079. type ZoneListWarningData struct {
  29080. // Key: [Output Only] A key that provides more detail on the warning
  29081. // being returned. For example, for warnings where there are no results
  29082. // in a list request for a particular zone, this key might be scope and
  29083. // the key value might be the zone name. Other examples might be a key
  29084. // indicating a deprecated resource and a suggested replacement, or a
  29085. // warning about invalid network settings (for example, if an instance
  29086. // attempts to perform IP forwarding but is not enabled for IP
  29087. // forwarding).
  29088. Key string `json:"key,omitempty"`
  29089. // Value: [Output Only] A warning data value corresponding to the key.
  29090. Value string `json:"value,omitempty"`
  29091. // ForceSendFields is a list of field names (e.g. "Key") to
  29092. // unconditionally include in API requests. By default, fields with
  29093. // empty values are omitted from API requests. However, any non-pointer,
  29094. // non-interface field appearing in ForceSendFields will be sent to the
  29095. // server regardless of whether the field is empty or not. This may be
  29096. // used to include empty fields in Patch requests.
  29097. ForceSendFields []string `json:"-"`
  29098. // NullFields is a list of field names (e.g. "Key") to include in API
  29099. // requests with the JSON null value. By default, fields with empty
  29100. // values are omitted from API requests. However, any field with an
  29101. // empty value appearing in NullFields will be sent to the server as
  29102. // null. It is an error if a field in this list has a non-empty value.
  29103. // This may be used to include null fields in Patch requests.
  29104. NullFields []string `json:"-"`
  29105. }
  29106. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  29107. type NoMethod ZoneListWarningData
  29108. raw := NoMethod(*s)
  29109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29110. }
  29111. type ZoneSetLabelsRequest struct {
  29112. // LabelFingerprint: The fingerprint of the previous set of labels for
  29113. // this resource, used to detect conflicts. The fingerprint is initially
  29114. // generated by Compute Engine and changes after every request to modify
  29115. // or update labels. You must always provide an up-to-date fingerprint
  29116. // hash in order to update or change labels. Make a get() request to the
  29117. // resource to get the latest fingerprint.
  29118. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29119. // Labels: The labels to set for this resource.
  29120. Labels map[string]string `json:"labels,omitempty"`
  29121. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  29122. // unconditionally include in API requests. By default, fields with
  29123. // empty values are omitted from API requests. However, any non-pointer,
  29124. // non-interface field appearing in ForceSendFields will be sent to the
  29125. // server regardless of whether the field is empty or not. This may be
  29126. // used to include empty fields in Patch requests.
  29127. ForceSendFields []string `json:"-"`
  29128. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  29129. // include in API requests with the JSON null value. By default, fields
  29130. // with empty values are omitted from API requests. However, any field
  29131. // with an empty value appearing in NullFields will be sent to the
  29132. // server as null. It is an error if a field in this list has a
  29133. // non-empty value. This may be used to include null fields in Patch
  29134. // requests.
  29135. NullFields []string `json:"-"`
  29136. }
  29137. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  29138. type NoMethod ZoneSetLabelsRequest
  29139. raw := NoMethod(*s)
  29140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29141. }
  29142. type ZoneSetPolicyRequest struct {
  29143. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  29144. // Deprecated. Use 'policy' to specify bindings.
  29145. Bindings []*Binding `json:"bindings,omitempty"`
  29146. // Etag: Flatten Policy to create a backward compatible wire-format.
  29147. // Deprecated. Use 'policy' to specify the etag.
  29148. Etag string `json:"etag,omitempty"`
  29149. // Policy: REQUIRED: The complete policy to be applied to the
  29150. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  29151. // empty policy is in general a valid policy but certain services (like
  29152. // Projects) might reject them.
  29153. Policy *Policy `json:"policy,omitempty"`
  29154. // ForceSendFields is a list of field names (e.g. "Bindings") to
  29155. // unconditionally include in API requests. By default, fields with
  29156. // empty values are omitted from API requests. However, any non-pointer,
  29157. // non-interface field appearing in ForceSendFields will be sent to the
  29158. // server regardless of whether the field is empty or not. This may be
  29159. // used to include empty fields in Patch requests.
  29160. ForceSendFields []string `json:"-"`
  29161. // NullFields is a list of field names (e.g. "Bindings") to include in
  29162. // API requests with the JSON null value. By default, fields with empty
  29163. // values are omitted from API requests. However, any field with an
  29164. // empty value appearing in NullFields will be sent to the server as
  29165. // null. It is an error if a field in this list has a non-empty value.
  29166. // This may be used to include null fields in Patch requests.
  29167. NullFields []string `json:"-"`
  29168. }
  29169. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  29170. type NoMethod ZoneSetPolicyRequest
  29171. raw := NoMethod(*s)
  29172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29173. }
  29174. // method id "compute.acceleratorTypes.aggregatedList":
  29175. type AcceleratorTypesAggregatedListCall struct {
  29176. s *Service
  29177. project string
  29178. urlParams_ gensupport.URLParams
  29179. ifNoneMatch_ string
  29180. ctx_ context.Context
  29181. header_ http.Header
  29182. }
  29183. // AggregatedList: Retrieves an aggregated list of accelerator types.
  29184. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  29185. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29186. c.project = project
  29187. return c
  29188. }
  29189. // Filter sets the optional parameter "filter": A filter expression that
  29190. // filters resources listed in the response. The expression must specify
  29191. // the field name, a comparison operator, and the value that you want to
  29192. // use for filtering. The value must be a string, a number, or a
  29193. // boolean. The comparison operator must be either =, !=, >, or <.
  29194. //
  29195. // For example, if you are filtering Compute Engine instances, you can
  29196. // exclude instances named example-instance by specifying name !=
  29197. // example-instance.
  29198. //
  29199. // You can also filter nested fields. For example, you could specify
  29200. // scheduling.automaticRestart = false to include instances only if they
  29201. // are not scheduled for automatic restarts. You can use filtering on
  29202. // nested fields to filter based on resource labels.
  29203. //
  29204. // To filter on multiple expressions, provide each separate expression
  29205. // within parentheses. For example, (scheduling.automaticRestart = true)
  29206. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29207. // AND expression. However, you can include AND and OR expressions
  29208. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29209. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29210. // true).
  29211. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  29212. c.urlParams_.Set("filter", filter)
  29213. return c
  29214. }
  29215. // MaxResults sets the optional parameter "maxResults": The maximum
  29216. // number of results per page that should be returned. If the number of
  29217. // available results is larger than maxResults, Compute Engine returns a
  29218. // nextPageToken that can be used to get the next page of results in
  29219. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29220. // (Default: 500)
  29221. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  29222. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29223. return c
  29224. }
  29225. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29226. // a certain order. By default, results are returned in alphanumerical
  29227. // order based on the resource name.
  29228. //
  29229. // You can also sort results in descending order based on the creation
  29230. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29231. // based on the creationTimestamp field in reverse chronological order
  29232. // (newest result first). Use this to sort resources like operations so
  29233. // that the newest operation is returned first.
  29234. //
  29235. // Currently, only sorting by name or creationTimestamp desc is
  29236. // supported.
  29237. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  29238. c.urlParams_.Set("orderBy", orderBy)
  29239. return c
  29240. }
  29241. // PageToken sets the optional parameter "pageToken": Specifies a page
  29242. // token to use. Set pageToken to the nextPageToken returned by a
  29243. // previous list request to get the next page of results.
  29244. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  29245. c.urlParams_.Set("pageToken", pageToken)
  29246. return c
  29247. }
  29248. // Fields allows partial responses to be retrieved. See
  29249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29250. // for more information.
  29251. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  29252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29253. return c
  29254. }
  29255. // IfNoneMatch sets the optional parameter which makes the operation
  29256. // fail if the object's ETag matches the given value. This is useful for
  29257. // getting updates only after the object has changed since the last
  29258. // request. Use googleapi.IsNotModified to check whether the response
  29259. // error from Do is the result of In-None-Match.
  29260. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  29261. c.ifNoneMatch_ = entityTag
  29262. return c
  29263. }
  29264. // Context sets the context to be used in this call's Do method. Any
  29265. // pending HTTP request will be aborted if the provided context is
  29266. // canceled.
  29267. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  29268. c.ctx_ = ctx
  29269. return c
  29270. }
  29271. // Header returns an http.Header that can be modified by the caller to
  29272. // add HTTP headers to the request.
  29273. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  29274. if c.header_ == nil {
  29275. c.header_ = make(http.Header)
  29276. }
  29277. return c.header_
  29278. }
  29279. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  29280. reqHeaders := make(http.Header)
  29281. for k, v := range c.header_ {
  29282. reqHeaders[k] = v
  29283. }
  29284. reqHeaders.Set("User-Agent", c.s.userAgent())
  29285. if c.ifNoneMatch_ != "" {
  29286. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29287. }
  29288. var body io.Reader = nil
  29289. c.urlParams_.Set("alt", alt)
  29290. c.urlParams_.Set("prettyPrint", "false")
  29291. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  29292. urls += "?" + c.urlParams_.Encode()
  29293. req, err := http.NewRequest("GET", urls, body)
  29294. if err != nil {
  29295. return nil, err
  29296. }
  29297. req.Header = reqHeaders
  29298. googleapi.Expand(req.URL, map[string]string{
  29299. "project": c.project,
  29300. })
  29301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29302. }
  29303. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  29304. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  29305. // non-nil. Any non-2xx status code is an error. Response headers are in
  29306. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  29307. // response was returned at all) in error.(*googleapi.Error).Header. Use
  29308. // googleapi.IsNotModified to check whether the returned error was
  29309. // because http.StatusNotModified was returned.
  29310. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  29311. gensupport.SetOptions(c.urlParams_, opts...)
  29312. res, err := c.doRequest("json")
  29313. if res != nil && res.StatusCode == http.StatusNotModified {
  29314. if res.Body != nil {
  29315. res.Body.Close()
  29316. }
  29317. return nil, &googleapi.Error{
  29318. Code: res.StatusCode,
  29319. Header: res.Header,
  29320. }
  29321. }
  29322. if err != nil {
  29323. return nil, err
  29324. }
  29325. defer googleapi.CloseBody(res)
  29326. if err := googleapi.CheckResponse(res); err != nil {
  29327. return nil, err
  29328. }
  29329. ret := &AcceleratorTypeAggregatedList{
  29330. ServerResponse: googleapi.ServerResponse{
  29331. Header: res.Header,
  29332. HTTPStatusCode: res.StatusCode,
  29333. },
  29334. }
  29335. target := &ret
  29336. if err := gensupport.DecodeResponse(target, res); err != nil {
  29337. return nil, err
  29338. }
  29339. return ret, nil
  29340. // {
  29341. // "description": "Retrieves an aggregated list of accelerator types.",
  29342. // "httpMethod": "GET",
  29343. // "id": "compute.acceleratorTypes.aggregatedList",
  29344. // "parameterOrder": [
  29345. // "project"
  29346. // ],
  29347. // "parameters": {
  29348. // "filter": {
  29349. // "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).",
  29350. // "location": "query",
  29351. // "type": "string"
  29352. // },
  29353. // "maxResults": {
  29354. // "default": "500",
  29355. // "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)",
  29356. // "format": "uint32",
  29357. // "location": "query",
  29358. // "minimum": "0",
  29359. // "type": "integer"
  29360. // },
  29361. // "orderBy": {
  29362. // "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.",
  29363. // "location": "query",
  29364. // "type": "string"
  29365. // },
  29366. // "pageToken": {
  29367. // "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.",
  29368. // "location": "query",
  29369. // "type": "string"
  29370. // },
  29371. // "project": {
  29372. // "description": "Project ID for this request.",
  29373. // "location": "path",
  29374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29375. // "required": true,
  29376. // "type": "string"
  29377. // }
  29378. // },
  29379. // "path": "{project}/aggregated/acceleratorTypes",
  29380. // "response": {
  29381. // "$ref": "AcceleratorTypeAggregatedList"
  29382. // },
  29383. // "scopes": [
  29384. // "https://www.googleapis.com/auth/cloud-platform",
  29385. // "https://www.googleapis.com/auth/compute",
  29386. // "https://www.googleapis.com/auth/compute.readonly"
  29387. // ]
  29388. // }
  29389. }
  29390. // Pages invokes f for each page of results.
  29391. // A non-nil error returned from f will halt the iteration.
  29392. // The provided context supersedes any context provided to the Context method.
  29393. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  29394. c.ctx_ = ctx
  29395. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29396. for {
  29397. x, err := c.Do()
  29398. if err != nil {
  29399. return err
  29400. }
  29401. if err := f(x); err != nil {
  29402. return err
  29403. }
  29404. if x.NextPageToken == "" {
  29405. return nil
  29406. }
  29407. c.PageToken(x.NextPageToken)
  29408. }
  29409. }
  29410. // method id "compute.acceleratorTypes.get":
  29411. type AcceleratorTypesGetCall struct {
  29412. s *Service
  29413. project string
  29414. zone string
  29415. acceleratorType string
  29416. urlParams_ gensupport.URLParams
  29417. ifNoneMatch_ string
  29418. ctx_ context.Context
  29419. header_ http.Header
  29420. }
  29421. // Get: Returns the specified accelerator type.
  29422. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  29423. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29424. c.project = project
  29425. c.zone = zone
  29426. c.acceleratorType = acceleratorType
  29427. return c
  29428. }
  29429. // Fields allows partial responses to be retrieved. See
  29430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29431. // for more information.
  29432. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  29433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29434. return c
  29435. }
  29436. // IfNoneMatch sets the optional parameter which makes the operation
  29437. // fail if the object's ETag matches the given value. This is useful for
  29438. // getting updates only after the object has changed since the last
  29439. // request. Use googleapi.IsNotModified to check whether the response
  29440. // error from Do is the result of In-None-Match.
  29441. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  29442. c.ifNoneMatch_ = entityTag
  29443. return c
  29444. }
  29445. // Context sets the context to be used in this call's Do method. Any
  29446. // pending HTTP request will be aborted if the provided context is
  29447. // canceled.
  29448. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  29449. c.ctx_ = ctx
  29450. return c
  29451. }
  29452. // Header returns an http.Header that can be modified by the caller to
  29453. // add HTTP headers to the request.
  29454. func (c *AcceleratorTypesGetCall) Header() http.Header {
  29455. if c.header_ == nil {
  29456. c.header_ = make(http.Header)
  29457. }
  29458. return c.header_
  29459. }
  29460. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  29461. reqHeaders := make(http.Header)
  29462. for k, v := range c.header_ {
  29463. reqHeaders[k] = v
  29464. }
  29465. reqHeaders.Set("User-Agent", c.s.userAgent())
  29466. if c.ifNoneMatch_ != "" {
  29467. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29468. }
  29469. var body io.Reader = nil
  29470. c.urlParams_.Set("alt", alt)
  29471. c.urlParams_.Set("prettyPrint", "false")
  29472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  29473. urls += "?" + c.urlParams_.Encode()
  29474. req, err := http.NewRequest("GET", urls, body)
  29475. if err != nil {
  29476. return nil, err
  29477. }
  29478. req.Header = reqHeaders
  29479. googleapi.Expand(req.URL, map[string]string{
  29480. "project": c.project,
  29481. "zone": c.zone,
  29482. "acceleratorType": c.acceleratorType,
  29483. })
  29484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29485. }
  29486. // Do executes the "compute.acceleratorTypes.get" call.
  29487. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  29488. // status code is an error. Response headers are in either
  29489. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  29490. // at all) in error.(*googleapi.Error).Header. Use
  29491. // googleapi.IsNotModified to check whether the returned error was
  29492. // because http.StatusNotModified was returned.
  29493. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  29494. gensupport.SetOptions(c.urlParams_, opts...)
  29495. res, err := c.doRequest("json")
  29496. if res != nil && res.StatusCode == http.StatusNotModified {
  29497. if res.Body != nil {
  29498. res.Body.Close()
  29499. }
  29500. return nil, &googleapi.Error{
  29501. Code: res.StatusCode,
  29502. Header: res.Header,
  29503. }
  29504. }
  29505. if err != nil {
  29506. return nil, err
  29507. }
  29508. defer googleapi.CloseBody(res)
  29509. if err := googleapi.CheckResponse(res); err != nil {
  29510. return nil, err
  29511. }
  29512. ret := &AcceleratorType{
  29513. ServerResponse: googleapi.ServerResponse{
  29514. Header: res.Header,
  29515. HTTPStatusCode: res.StatusCode,
  29516. },
  29517. }
  29518. target := &ret
  29519. if err := gensupport.DecodeResponse(target, res); err != nil {
  29520. return nil, err
  29521. }
  29522. return ret, nil
  29523. // {
  29524. // "description": "Returns the specified accelerator type.",
  29525. // "httpMethod": "GET",
  29526. // "id": "compute.acceleratorTypes.get",
  29527. // "parameterOrder": [
  29528. // "project",
  29529. // "zone",
  29530. // "acceleratorType"
  29531. // ],
  29532. // "parameters": {
  29533. // "acceleratorType": {
  29534. // "description": "Name of the accelerator type to return.",
  29535. // "location": "path",
  29536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29537. // "required": true,
  29538. // "type": "string"
  29539. // },
  29540. // "project": {
  29541. // "description": "Project ID for this request.",
  29542. // "location": "path",
  29543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29544. // "required": true,
  29545. // "type": "string"
  29546. // },
  29547. // "zone": {
  29548. // "description": "The name of the zone for this request.",
  29549. // "location": "path",
  29550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29551. // "required": true,
  29552. // "type": "string"
  29553. // }
  29554. // },
  29555. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  29556. // "response": {
  29557. // "$ref": "AcceleratorType"
  29558. // },
  29559. // "scopes": [
  29560. // "https://www.googleapis.com/auth/cloud-platform",
  29561. // "https://www.googleapis.com/auth/compute",
  29562. // "https://www.googleapis.com/auth/compute.readonly"
  29563. // ]
  29564. // }
  29565. }
  29566. // method id "compute.acceleratorTypes.list":
  29567. type AcceleratorTypesListCall struct {
  29568. s *Service
  29569. project string
  29570. zone string
  29571. urlParams_ gensupport.URLParams
  29572. ifNoneMatch_ string
  29573. ctx_ context.Context
  29574. header_ http.Header
  29575. }
  29576. // List: Retrieves a list of accelerator types available to the
  29577. // specified project.
  29578. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  29579. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29580. c.project = project
  29581. c.zone = zone
  29582. return c
  29583. }
  29584. // Filter sets the optional parameter "filter": A filter expression that
  29585. // filters resources listed in the response. The expression must specify
  29586. // the field name, a comparison operator, and the value that you want to
  29587. // use for filtering. The value must be a string, a number, or a
  29588. // boolean. The comparison operator must be either =, !=, >, or <.
  29589. //
  29590. // For example, if you are filtering Compute Engine instances, you can
  29591. // exclude instances named example-instance by specifying name !=
  29592. // example-instance.
  29593. //
  29594. // You can also filter nested fields. For example, you could specify
  29595. // scheduling.automaticRestart = false to include instances only if they
  29596. // are not scheduled for automatic restarts. You can use filtering on
  29597. // nested fields to filter based on resource labels.
  29598. //
  29599. // To filter on multiple expressions, provide each separate expression
  29600. // within parentheses. For example, (scheduling.automaticRestart = true)
  29601. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29602. // AND expression. However, you can include AND and OR expressions
  29603. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29604. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29605. // true).
  29606. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  29607. c.urlParams_.Set("filter", filter)
  29608. return c
  29609. }
  29610. // MaxResults sets the optional parameter "maxResults": The maximum
  29611. // number of results per page that should be returned. If the number of
  29612. // available results is larger than maxResults, Compute Engine returns a
  29613. // nextPageToken that can be used to get the next page of results in
  29614. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29615. // (Default: 500)
  29616. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  29617. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29618. return c
  29619. }
  29620. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29621. // a certain order. By default, results are returned in alphanumerical
  29622. // order based on the resource name.
  29623. //
  29624. // You can also sort results in descending order based on the creation
  29625. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29626. // based on the creationTimestamp field in reverse chronological order
  29627. // (newest result first). Use this to sort resources like operations so
  29628. // that the newest operation is returned first.
  29629. //
  29630. // Currently, only sorting by name or creationTimestamp desc is
  29631. // supported.
  29632. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  29633. c.urlParams_.Set("orderBy", orderBy)
  29634. return c
  29635. }
  29636. // PageToken sets the optional parameter "pageToken": Specifies a page
  29637. // token to use. Set pageToken to the nextPageToken returned by a
  29638. // previous list request to get the next page of results.
  29639. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  29640. c.urlParams_.Set("pageToken", pageToken)
  29641. return c
  29642. }
  29643. // Fields allows partial responses to be retrieved. See
  29644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29645. // for more information.
  29646. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  29647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29648. return c
  29649. }
  29650. // IfNoneMatch sets the optional parameter which makes the operation
  29651. // fail if the object's ETag matches the given value. This is useful for
  29652. // getting updates only after the object has changed since the last
  29653. // request. Use googleapi.IsNotModified to check whether the response
  29654. // error from Do is the result of In-None-Match.
  29655. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  29656. c.ifNoneMatch_ = entityTag
  29657. return c
  29658. }
  29659. // Context sets the context to be used in this call's Do method. Any
  29660. // pending HTTP request will be aborted if the provided context is
  29661. // canceled.
  29662. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  29663. c.ctx_ = ctx
  29664. return c
  29665. }
  29666. // Header returns an http.Header that can be modified by the caller to
  29667. // add HTTP headers to the request.
  29668. func (c *AcceleratorTypesListCall) Header() http.Header {
  29669. if c.header_ == nil {
  29670. c.header_ = make(http.Header)
  29671. }
  29672. return c.header_
  29673. }
  29674. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  29675. reqHeaders := make(http.Header)
  29676. for k, v := range c.header_ {
  29677. reqHeaders[k] = v
  29678. }
  29679. reqHeaders.Set("User-Agent", c.s.userAgent())
  29680. if c.ifNoneMatch_ != "" {
  29681. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29682. }
  29683. var body io.Reader = nil
  29684. c.urlParams_.Set("alt", alt)
  29685. c.urlParams_.Set("prettyPrint", "false")
  29686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  29687. urls += "?" + c.urlParams_.Encode()
  29688. req, err := http.NewRequest("GET", urls, body)
  29689. if err != nil {
  29690. return nil, err
  29691. }
  29692. req.Header = reqHeaders
  29693. googleapi.Expand(req.URL, map[string]string{
  29694. "project": c.project,
  29695. "zone": c.zone,
  29696. })
  29697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29698. }
  29699. // Do executes the "compute.acceleratorTypes.list" call.
  29700. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  29701. // non-2xx status code is an error. Response headers are in either
  29702. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  29703. // returned at all) in error.(*googleapi.Error).Header. Use
  29704. // googleapi.IsNotModified to check whether the returned error was
  29705. // because http.StatusNotModified was returned.
  29706. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  29707. gensupport.SetOptions(c.urlParams_, opts...)
  29708. res, err := c.doRequest("json")
  29709. if res != nil && res.StatusCode == http.StatusNotModified {
  29710. if res.Body != nil {
  29711. res.Body.Close()
  29712. }
  29713. return nil, &googleapi.Error{
  29714. Code: res.StatusCode,
  29715. Header: res.Header,
  29716. }
  29717. }
  29718. if err != nil {
  29719. return nil, err
  29720. }
  29721. defer googleapi.CloseBody(res)
  29722. if err := googleapi.CheckResponse(res); err != nil {
  29723. return nil, err
  29724. }
  29725. ret := &AcceleratorTypeList{
  29726. ServerResponse: googleapi.ServerResponse{
  29727. Header: res.Header,
  29728. HTTPStatusCode: res.StatusCode,
  29729. },
  29730. }
  29731. target := &ret
  29732. if err := gensupport.DecodeResponse(target, res); err != nil {
  29733. return nil, err
  29734. }
  29735. return ret, nil
  29736. // {
  29737. // "description": "Retrieves a list of accelerator types available to the specified project.",
  29738. // "httpMethod": "GET",
  29739. // "id": "compute.acceleratorTypes.list",
  29740. // "parameterOrder": [
  29741. // "project",
  29742. // "zone"
  29743. // ],
  29744. // "parameters": {
  29745. // "filter": {
  29746. // "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).",
  29747. // "location": "query",
  29748. // "type": "string"
  29749. // },
  29750. // "maxResults": {
  29751. // "default": "500",
  29752. // "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)",
  29753. // "format": "uint32",
  29754. // "location": "query",
  29755. // "minimum": "0",
  29756. // "type": "integer"
  29757. // },
  29758. // "orderBy": {
  29759. // "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.",
  29760. // "location": "query",
  29761. // "type": "string"
  29762. // },
  29763. // "pageToken": {
  29764. // "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.",
  29765. // "location": "query",
  29766. // "type": "string"
  29767. // },
  29768. // "project": {
  29769. // "description": "Project ID for this request.",
  29770. // "location": "path",
  29771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29772. // "required": true,
  29773. // "type": "string"
  29774. // },
  29775. // "zone": {
  29776. // "description": "The name of the zone for this request.",
  29777. // "location": "path",
  29778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29779. // "required": true,
  29780. // "type": "string"
  29781. // }
  29782. // },
  29783. // "path": "{project}/zones/{zone}/acceleratorTypes",
  29784. // "response": {
  29785. // "$ref": "AcceleratorTypeList"
  29786. // },
  29787. // "scopes": [
  29788. // "https://www.googleapis.com/auth/cloud-platform",
  29789. // "https://www.googleapis.com/auth/compute",
  29790. // "https://www.googleapis.com/auth/compute.readonly"
  29791. // ]
  29792. // }
  29793. }
  29794. // Pages invokes f for each page of results.
  29795. // A non-nil error returned from f will halt the iteration.
  29796. // The provided context supersedes any context provided to the Context method.
  29797. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  29798. c.ctx_ = ctx
  29799. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29800. for {
  29801. x, err := c.Do()
  29802. if err != nil {
  29803. return err
  29804. }
  29805. if err := f(x); err != nil {
  29806. return err
  29807. }
  29808. if x.NextPageToken == "" {
  29809. return nil
  29810. }
  29811. c.PageToken(x.NextPageToken)
  29812. }
  29813. }
  29814. // method id "compute.addresses.aggregatedList":
  29815. type AddressesAggregatedListCall struct {
  29816. s *Service
  29817. project string
  29818. urlParams_ gensupport.URLParams
  29819. ifNoneMatch_ string
  29820. ctx_ context.Context
  29821. header_ http.Header
  29822. }
  29823. // AggregatedList: Retrieves an aggregated list of addresses.
  29824. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  29825. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  29826. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29827. c.project = project
  29828. return c
  29829. }
  29830. // Filter sets the optional parameter "filter": A filter expression that
  29831. // filters resources listed in the response. The expression must specify
  29832. // the field name, a comparison operator, and the value that you want to
  29833. // use for filtering. The value must be a string, a number, or a
  29834. // boolean. The comparison operator must be either =, !=, >, or <.
  29835. //
  29836. // For example, if you are filtering Compute Engine instances, you can
  29837. // exclude instances named example-instance by specifying name !=
  29838. // example-instance.
  29839. //
  29840. // You can also filter nested fields. For example, you could specify
  29841. // scheduling.automaticRestart = false to include instances only if they
  29842. // are not scheduled for automatic restarts. You can use filtering on
  29843. // nested fields to filter based on resource labels.
  29844. //
  29845. // To filter on multiple expressions, provide each separate expression
  29846. // within parentheses. For example, (scheduling.automaticRestart = true)
  29847. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29848. // AND expression. However, you can include AND and OR expressions
  29849. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29850. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29851. // true).
  29852. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  29853. c.urlParams_.Set("filter", filter)
  29854. return c
  29855. }
  29856. // MaxResults sets the optional parameter "maxResults": The maximum
  29857. // number of results per page that should be returned. If the number of
  29858. // available results is larger than maxResults, Compute Engine returns a
  29859. // nextPageToken that can be used to get the next page of results in
  29860. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29861. // (Default: 500)
  29862. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  29863. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29864. return c
  29865. }
  29866. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29867. // a certain order. By default, results are returned in alphanumerical
  29868. // order based on the resource name.
  29869. //
  29870. // You can also sort results in descending order based on the creation
  29871. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29872. // based on the creationTimestamp field in reverse chronological order
  29873. // (newest result first). Use this to sort resources like operations so
  29874. // that the newest operation is returned first.
  29875. //
  29876. // Currently, only sorting by name or creationTimestamp desc is
  29877. // supported.
  29878. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  29879. c.urlParams_.Set("orderBy", orderBy)
  29880. return c
  29881. }
  29882. // PageToken sets the optional parameter "pageToken": Specifies a page
  29883. // token to use. Set pageToken to the nextPageToken returned by a
  29884. // previous list request to get the next page of results.
  29885. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  29886. c.urlParams_.Set("pageToken", pageToken)
  29887. return c
  29888. }
  29889. // Fields allows partial responses to be retrieved. See
  29890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29891. // for more information.
  29892. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  29893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29894. return c
  29895. }
  29896. // IfNoneMatch sets the optional parameter which makes the operation
  29897. // fail if the object's ETag matches the given value. This is useful for
  29898. // getting updates only after the object has changed since the last
  29899. // request. Use googleapi.IsNotModified to check whether the response
  29900. // error from Do is the result of In-None-Match.
  29901. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  29902. c.ifNoneMatch_ = entityTag
  29903. return c
  29904. }
  29905. // Context sets the context to be used in this call's Do method. Any
  29906. // pending HTTP request will be aborted if the provided context is
  29907. // canceled.
  29908. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  29909. c.ctx_ = ctx
  29910. return c
  29911. }
  29912. // Header returns an http.Header that can be modified by the caller to
  29913. // add HTTP headers to the request.
  29914. func (c *AddressesAggregatedListCall) Header() http.Header {
  29915. if c.header_ == nil {
  29916. c.header_ = make(http.Header)
  29917. }
  29918. return c.header_
  29919. }
  29920. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  29921. reqHeaders := make(http.Header)
  29922. for k, v := range c.header_ {
  29923. reqHeaders[k] = v
  29924. }
  29925. reqHeaders.Set("User-Agent", c.s.userAgent())
  29926. if c.ifNoneMatch_ != "" {
  29927. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29928. }
  29929. var body io.Reader = nil
  29930. c.urlParams_.Set("alt", alt)
  29931. c.urlParams_.Set("prettyPrint", "false")
  29932. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  29933. urls += "?" + c.urlParams_.Encode()
  29934. req, err := http.NewRequest("GET", urls, body)
  29935. if err != nil {
  29936. return nil, err
  29937. }
  29938. req.Header = reqHeaders
  29939. googleapi.Expand(req.URL, map[string]string{
  29940. "project": c.project,
  29941. })
  29942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29943. }
  29944. // Do executes the "compute.addresses.aggregatedList" call.
  29945. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  29946. // non-2xx status code is an error. Response headers are in either
  29947. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  29948. // returned at all) in error.(*googleapi.Error).Header. Use
  29949. // googleapi.IsNotModified to check whether the returned error was
  29950. // because http.StatusNotModified was returned.
  29951. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  29952. gensupport.SetOptions(c.urlParams_, opts...)
  29953. res, err := c.doRequest("json")
  29954. if res != nil && res.StatusCode == http.StatusNotModified {
  29955. if res.Body != nil {
  29956. res.Body.Close()
  29957. }
  29958. return nil, &googleapi.Error{
  29959. Code: res.StatusCode,
  29960. Header: res.Header,
  29961. }
  29962. }
  29963. if err != nil {
  29964. return nil, err
  29965. }
  29966. defer googleapi.CloseBody(res)
  29967. if err := googleapi.CheckResponse(res); err != nil {
  29968. return nil, err
  29969. }
  29970. ret := &AddressAggregatedList{
  29971. ServerResponse: googleapi.ServerResponse{
  29972. Header: res.Header,
  29973. HTTPStatusCode: res.StatusCode,
  29974. },
  29975. }
  29976. target := &ret
  29977. if err := gensupport.DecodeResponse(target, res); err != nil {
  29978. return nil, err
  29979. }
  29980. return ret, nil
  29981. // {
  29982. // "description": "Retrieves an aggregated list of addresses.",
  29983. // "httpMethod": "GET",
  29984. // "id": "compute.addresses.aggregatedList",
  29985. // "parameterOrder": [
  29986. // "project"
  29987. // ],
  29988. // "parameters": {
  29989. // "filter": {
  29990. // "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).",
  29991. // "location": "query",
  29992. // "type": "string"
  29993. // },
  29994. // "maxResults": {
  29995. // "default": "500",
  29996. // "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)",
  29997. // "format": "uint32",
  29998. // "location": "query",
  29999. // "minimum": "0",
  30000. // "type": "integer"
  30001. // },
  30002. // "orderBy": {
  30003. // "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.",
  30004. // "location": "query",
  30005. // "type": "string"
  30006. // },
  30007. // "pageToken": {
  30008. // "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.",
  30009. // "location": "query",
  30010. // "type": "string"
  30011. // },
  30012. // "project": {
  30013. // "description": "Project ID for this request.",
  30014. // "location": "path",
  30015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30016. // "required": true,
  30017. // "type": "string"
  30018. // }
  30019. // },
  30020. // "path": "{project}/aggregated/addresses",
  30021. // "response": {
  30022. // "$ref": "AddressAggregatedList"
  30023. // },
  30024. // "scopes": [
  30025. // "https://www.googleapis.com/auth/cloud-platform",
  30026. // "https://www.googleapis.com/auth/compute",
  30027. // "https://www.googleapis.com/auth/compute.readonly"
  30028. // ]
  30029. // }
  30030. }
  30031. // Pages invokes f for each page of results.
  30032. // A non-nil error returned from f will halt the iteration.
  30033. // The provided context supersedes any context provided to the Context method.
  30034. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  30035. c.ctx_ = ctx
  30036. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30037. for {
  30038. x, err := c.Do()
  30039. if err != nil {
  30040. return err
  30041. }
  30042. if err := f(x); err != nil {
  30043. return err
  30044. }
  30045. if x.NextPageToken == "" {
  30046. return nil
  30047. }
  30048. c.PageToken(x.NextPageToken)
  30049. }
  30050. }
  30051. // method id "compute.addresses.delete":
  30052. type AddressesDeleteCall struct {
  30053. s *Service
  30054. project string
  30055. region string
  30056. address string
  30057. urlParams_ gensupport.URLParams
  30058. ctx_ context.Context
  30059. header_ http.Header
  30060. }
  30061. // Delete: Deletes the specified address resource.
  30062. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  30063. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  30064. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30065. c.project = project
  30066. c.region = region
  30067. c.address = address
  30068. return c
  30069. }
  30070. // RequestId sets the optional parameter "requestId": An optional
  30071. // request ID to identify requests. Specify a unique request ID so that
  30072. // if you must retry your request, the server will know to ignore the
  30073. // request if it has already been completed.
  30074. //
  30075. // For example, consider a situation where you make an initial request
  30076. // and the request times out. If you make the request again with the
  30077. // same request ID, the server can check if original operation with the
  30078. // same request ID was received, and if so, will ignore the second
  30079. // request. This prevents clients from accidentally creating duplicate
  30080. // commitments.
  30081. //
  30082. // The request ID must be a valid UUID with the exception that zero UUID
  30083. // is not supported (00000000-0000-0000-0000-000000000000).
  30084. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  30085. c.urlParams_.Set("requestId", requestId)
  30086. return c
  30087. }
  30088. // Fields allows partial responses to be retrieved. See
  30089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30090. // for more information.
  30091. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  30092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30093. return c
  30094. }
  30095. // Context sets the context to be used in this call's Do method. Any
  30096. // pending HTTP request will be aborted if the provided context is
  30097. // canceled.
  30098. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  30099. c.ctx_ = ctx
  30100. return c
  30101. }
  30102. // Header returns an http.Header that can be modified by the caller to
  30103. // add HTTP headers to the request.
  30104. func (c *AddressesDeleteCall) Header() http.Header {
  30105. if c.header_ == nil {
  30106. c.header_ = make(http.Header)
  30107. }
  30108. return c.header_
  30109. }
  30110. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30111. reqHeaders := make(http.Header)
  30112. for k, v := range c.header_ {
  30113. reqHeaders[k] = v
  30114. }
  30115. reqHeaders.Set("User-Agent", c.s.userAgent())
  30116. var body io.Reader = nil
  30117. c.urlParams_.Set("alt", alt)
  30118. c.urlParams_.Set("prettyPrint", "false")
  30119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  30120. urls += "?" + c.urlParams_.Encode()
  30121. req, err := http.NewRequest("DELETE", urls, body)
  30122. if err != nil {
  30123. return nil, err
  30124. }
  30125. req.Header = reqHeaders
  30126. googleapi.Expand(req.URL, map[string]string{
  30127. "project": c.project,
  30128. "region": c.region,
  30129. "address": c.address,
  30130. })
  30131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30132. }
  30133. // Do executes the "compute.addresses.delete" call.
  30134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30135. // status code is an error. Response headers are in either
  30136. // *Operation.ServerResponse.Header or (if a response was returned at
  30137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30138. // to check whether the returned error was because
  30139. // http.StatusNotModified was returned.
  30140. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30141. gensupport.SetOptions(c.urlParams_, opts...)
  30142. res, err := c.doRequest("json")
  30143. if res != nil && res.StatusCode == http.StatusNotModified {
  30144. if res.Body != nil {
  30145. res.Body.Close()
  30146. }
  30147. return nil, &googleapi.Error{
  30148. Code: res.StatusCode,
  30149. Header: res.Header,
  30150. }
  30151. }
  30152. if err != nil {
  30153. return nil, err
  30154. }
  30155. defer googleapi.CloseBody(res)
  30156. if err := googleapi.CheckResponse(res); err != nil {
  30157. return nil, err
  30158. }
  30159. ret := &Operation{
  30160. ServerResponse: googleapi.ServerResponse{
  30161. Header: res.Header,
  30162. HTTPStatusCode: res.StatusCode,
  30163. },
  30164. }
  30165. target := &ret
  30166. if err := gensupport.DecodeResponse(target, res); err != nil {
  30167. return nil, err
  30168. }
  30169. return ret, nil
  30170. // {
  30171. // "description": "Deletes the specified address resource.",
  30172. // "httpMethod": "DELETE",
  30173. // "id": "compute.addresses.delete",
  30174. // "parameterOrder": [
  30175. // "project",
  30176. // "region",
  30177. // "address"
  30178. // ],
  30179. // "parameters": {
  30180. // "address": {
  30181. // "description": "Name of the address resource to delete.",
  30182. // "location": "path",
  30183. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30184. // "required": true,
  30185. // "type": "string"
  30186. // },
  30187. // "project": {
  30188. // "description": "Project ID for this request.",
  30189. // "location": "path",
  30190. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30191. // "required": true,
  30192. // "type": "string"
  30193. // },
  30194. // "region": {
  30195. // "description": "Name of the region for this request.",
  30196. // "location": "path",
  30197. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30198. // "required": true,
  30199. // "type": "string"
  30200. // },
  30201. // "requestId": {
  30202. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30203. // "location": "query",
  30204. // "type": "string"
  30205. // }
  30206. // },
  30207. // "path": "{project}/regions/{region}/addresses/{address}",
  30208. // "response": {
  30209. // "$ref": "Operation"
  30210. // },
  30211. // "scopes": [
  30212. // "https://www.googleapis.com/auth/cloud-platform",
  30213. // "https://www.googleapis.com/auth/compute"
  30214. // ]
  30215. // }
  30216. }
  30217. // method id "compute.addresses.get":
  30218. type AddressesGetCall struct {
  30219. s *Service
  30220. project string
  30221. region string
  30222. address string
  30223. urlParams_ gensupport.URLParams
  30224. ifNoneMatch_ string
  30225. ctx_ context.Context
  30226. header_ http.Header
  30227. }
  30228. // Get: Returns the specified address resource.
  30229. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  30230. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  30231. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30232. c.project = project
  30233. c.region = region
  30234. c.address = address
  30235. return c
  30236. }
  30237. // Fields allows partial responses to be retrieved. See
  30238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30239. // for more information.
  30240. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  30241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30242. return c
  30243. }
  30244. // IfNoneMatch sets the optional parameter which makes the operation
  30245. // fail if the object's ETag matches the given value. This is useful for
  30246. // getting updates only after the object has changed since the last
  30247. // request. Use googleapi.IsNotModified to check whether the response
  30248. // error from Do is the result of In-None-Match.
  30249. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  30250. c.ifNoneMatch_ = entityTag
  30251. return c
  30252. }
  30253. // Context sets the context to be used in this call's Do method. Any
  30254. // pending HTTP request will be aborted if the provided context is
  30255. // canceled.
  30256. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  30257. c.ctx_ = ctx
  30258. return c
  30259. }
  30260. // Header returns an http.Header that can be modified by the caller to
  30261. // add HTTP headers to the request.
  30262. func (c *AddressesGetCall) Header() http.Header {
  30263. if c.header_ == nil {
  30264. c.header_ = make(http.Header)
  30265. }
  30266. return c.header_
  30267. }
  30268. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  30269. reqHeaders := make(http.Header)
  30270. for k, v := range c.header_ {
  30271. reqHeaders[k] = v
  30272. }
  30273. reqHeaders.Set("User-Agent", c.s.userAgent())
  30274. if c.ifNoneMatch_ != "" {
  30275. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30276. }
  30277. var body io.Reader = nil
  30278. c.urlParams_.Set("alt", alt)
  30279. c.urlParams_.Set("prettyPrint", "false")
  30280. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  30281. urls += "?" + c.urlParams_.Encode()
  30282. req, err := http.NewRequest("GET", urls, body)
  30283. if err != nil {
  30284. return nil, err
  30285. }
  30286. req.Header = reqHeaders
  30287. googleapi.Expand(req.URL, map[string]string{
  30288. "project": c.project,
  30289. "region": c.region,
  30290. "address": c.address,
  30291. })
  30292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30293. }
  30294. // Do executes the "compute.addresses.get" call.
  30295. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  30296. // code is an error. Response headers are in either
  30297. // *Address.ServerResponse.Header or (if a response was returned at all)
  30298. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  30299. // check whether the returned error was because http.StatusNotModified
  30300. // was returned.
  30301. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  30302. gensupport.SetOptions(c.urlParams_, opts...)
  30303. res, err := c.doRequest("json")
  30304. if res != nil && res.StatusCode == http.StatusNotModified {
  30305. if res.Body != nil {
  30306. res.Body.Close()
  30307. }
  30308. return nil, &googleapi.Error{
  30309. Code: res.StatusCode,
  30310. Header: res.Header,
  30311. }
  30312. }
  30313. if err != nil {
  30314. return nil, err
  30315. }
  30316. defer googleapi.CloseBody(res)
  30317. if err := googleapi.CheckResponse(res); err != nil {
  30318. return nil, err
  30319. }
  30320. ret := &Address{
  30321. ServerResponse: googleapi.ServerResponse{
  30322. Header: res.Header,
  30323. HTTPStatusCode: res.StatusCode,
  30324. },
  30325. }
  30326. target := &ret
  30327. if err := gensupport.DecodeResponse(target, res); err != nil {
  30328. return nil, err
  30329. }
  30330. return ret, nil
  30331. // {
  30332. // "description": "Returns the specified address resource.",
  30333. // "httpMethod": "GET",
  30334. // "id": "compute.addresses.get",
  30335. // "parameterOrder": [
  30336. // "project",
  30337. // "region",
  30338. // "address"
  30339. // ],
  30340. // "parameters": {
  30341. // "address": {
  30342. // "description": "Name of the address resource to return.",
  30343. // "location": "path",
  30344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30345. // "required": true,
  30346. // "type": "string"
  30347. // },
  30348. // "project": {
  30349. // "description": "Project ID for this request.",
  30350. // "location": "path",
  30351. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30352. // "required": true,
  30353. // "type": "string"
  30354. // },
  30355. // "region": {
  30356. // "description": "Name of the region for this request.",
  30357. // "location": "path",
  30358. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30359. // "required": true,
  30360. // "type": "string"
  30361. // }
  30362. // },
  30363. // "path": "{project}/regions/{region}/addresses/{address}",
  30364. // "response": {
  30365. // "$ref": "Address"
  30366. // },
  30367. // "scopes": [
  30368. // "https://www.googleapis.com/auth/cloud-platform",
  30369. // "https://www.googleapis.com/auth/compute",
  30370. // "https://www.googleapis.com/auth/compute.readonly"
  30371. // ]
  30372. // }
  30373. }
  30374. // method id "compute.addresses.insert":
  30375. type AddressesInsertCall struct {
  30376. s *Service
  30377. project string
  30378. region string
  30379. address *Address
  30380. urlParams_ gensupport.URLParams
  30381. ctx_ context.Context
  30382. header_ http.Header
  30383. }
  30384. // Insert: Creates an address resource in the specified project using
  30385. // the data included in the request.
  30386. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  30387. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  30388. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30389. c.project = project
  30390. c.region = region
  30391. c.address = address
  30392. return c
  30393. }
  30394. // RequestId sets the optional parameter "requestId": An optional
  30395. // request ID to identify requests. Specify a unique request ID so that
  30396. // if you must retry your request, the server will know to ignore the
  30397. // request if it has already been completed.
  30398. //
  30399. // For example, consider a situation where you make an initial request
  30400. // and the request times out. If you make the request again with the
  30401. // same request ID, the server can check if original operation with the
  30402. // same request ID was received, and if so, will ignore the second
  30403. // request. This prevents clients from accidentally creating duplicate
  30404. // commitments.
  30405. //
  30406. // The request ID must be a valid UUID with the exception that zero UUID
  30407. // is not supported (00000000-0000-0000-0000-000000000000).
  30408. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  30409. c.urlParams_.Set("requestId", requestId)
  30410. return c
  30411. }
  30412. // Fields allows partial responses to be retrieved. See
  30413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30414. // for more information.
  30415. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  30416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30417. return c
  30418. }
  30419. // Context sets the context to be used in this call's Do method. Any
  30420. // pending HTTP request will be aborted if the provided context is
  30421. // canceled.
  30422. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  30423. c.ctx_ = ctx
  30424. return c
  30425. }
  30426. // Header returns an http.Header that can be modified by the caller to
  30427. // add HTTP headers to the request.
  30428. func (c *AddressesInsertCall) Header() http.Header {
  30429. if c.header_ == nil {
  30430. c.header_ = make(http.Header)
  30431. }
  30432. return c.header_
  30433. }
  30434. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  30435. reqHeaders := make(http.Header)
  30436. for k, v := range c.header_ {
  30437. reqHeaders[k] = v
  30438. }
  30439. reqHeaders.Set("User-Agent", c.s.userAgent())
  30440. var body io.Reader = nil
  30441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  30442. if err != nil {
  30443. return nil, err
  30444. }
  30445. reqHeaders.Set("Content-Type", "application/json")
  30446. c.urlParams_.Set("alt", alt)
  30447. c.urlParams_.Set("prettyPrint", "false")
  30448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  30449. urls += "?" + c.urlParams_.Encode()
  30450. req, err := http.NewRequest("POST", urls, body)
  30451. if err != nil {
  30452. return nil, err
  30453. }
  30454. req.Header = reqHeaders
  30455. googleapi.Expand(req.URL, map[string]string{
  30456. "project": c.project,
  30457. "region": c.region,
  30458. })
  30459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30460. }
  30461. // Do executes the "compute.addresses.insert" call.
  30462. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30463. // status code is an error. Response headers are in either
  30464. // *Operation.ServerResponse.Header or (if a response was returned at
  30465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30466. // to check whether the returned error was because
  30467. // http.StatusNotModified was returned.
  30468. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30469. gensupport.SetOptions(c.urlParams_, opts...)
  30470. res, err := c.doRequest("json")
  30471. if res != nil && res.StatusCode == http.StatusNotModified {
  30472. if res.Body != nil {
  30473. res.Body.Close()
  30474. }
  30475. return nil, &googleapi.Error{
  30476. Code: res.StatusCode,
  30477. Header: res.Header,
  30478. }
  30479. }
  30480. if err != nil {
  30481. return nil, err
  30482. }
  30483. defer googleapi.CloseBody(res)
  30484. if err := googleapi.CheckResponse(res); err != nil {
  30485. return nil, err
  30486. }
  30487. ret := &Operation{
  30488. ServerResponse: googleapi.ServerResponse{
  30489. Header: res.Header,
  30490. HTTPStatusCode: res.StatusCode,
  30491. },
  30492. }
  30493. target := &ret
  30494. if err := gensupport.DecodeResponse(target, res); err != nil {
  30495. return nil, err
  30496. }
  30497. return ret, nil
  30498. // {
  30499. // "description": "Creates an address resource in the specified project using the data included in the request.",
  30500. // "httpMethod": "POST",
  30501. // "id": "compute.addresses.insert",
  30502. // "parameterOrder": [
  30503. // "project",
  30504. // "region"
  30505. // ],
  30506. // "parameters": {
  30507. // "project": {
  30508. // "description": "Project ID for this request.",
  30509. // "location": "path",
  30510. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30511. // "required": true,
  30512. // "type": "string"
  30513. // },
  30514. // "region": {
  30515. // "description": "Name of the region for this request.",
  30516. // "location": "path",
  30517. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30518. // "required": true,
  30519. // "type": "string"
  30520. // },
  30521. // "requestId": {
  30522. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30523. // "location": "query",
  30524. // "type": "string"
  30525. // }
  30526. // },
  30527. // "path": "{project}/regions/{region}/addresses",
  30528. // "request": {
  30529. // "$ref": "Address"
  30530. // },
  30531. // "response": {
  30532. // "$ref": "Operation"
  30533. // },
  30534. // "scopes": [
  30535. // "https://www.googleapis.com/auth/cloud-platform",
  30536. // "https://www.googleapis.com/auth/compute"
  30537. // ]
  30538. // }
  30539. }
  30540. // method id "compute.addresses.list":
  30541. type AddressesListCall struct {
  30542. s *Service
  30543. project string
  30544. region string
  30545. urlParams_ gensupport.URLParams
  30546. ifNoneMatch_ string
  30547. ctx_ context.Context
  30548. header_ http.Header
  30549. }
  30550. // List: Retrieves a list of addresses contained within the specified
  30551. // region.
  30552. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  30553. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  30554. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30555. c.project = project
  30556. c.region = region
  30557. return c
  30558. }
  30559. // Filter sets the optional parameter "filter": A filter expression that
  30560. // filters resources listed in the response. The expression must specify
  30561. // the field name, a comparison operator, and the value that you want to
  30562. // use for filtering. The value must be a string, a number, or a
  30563. // boolean. The comparison operator must be either =, !=, >, or <.
  30564. //
  30565. // For example, if you are filtering Compute Engine instances, you can
  30566. // exclude instances named example-instance by specifying name !=
  30567. // example-instance.
  30568. //
  30569. // You can also filter nested fields. For example, you could specify
  30570. // scheduling.automaticRestart = false to include instances only if they
  30571. // are not scheduled for automatic restarts. You can use filtering on
  30572. // nested fields to filter based on resource labels.
  30573. //
  30574. // To filter on multiple expressions, provide each separate expression
  30575. // within parentheses. For example, (scheduling.automaticRestart = true)
  30576. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30577. // AND expression. However, you can include AND and OR expressions
  30578. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30579. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30580. // true).
  30581. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  30582. c.urlParams_.Set("filter", filter)
  30583. return c
  30584. }
  30585. // MaxResults sets the optional parameter "maxResults": The maximum
  30586. // number of results per page that should be returned. If the number of
  30587. // available results is larger than maxResults, Compute Engine returns a
  30588. // nextPageToken that can be used to get the next page of results in
  30589. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30590. // (Default: 500)
  30591. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  30592. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30593. return c
  30594. }
  30595. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30596. // a certain order. By default, results are returned in alphanumerical
  30597. // order based on the resource name.
  30598. //
  30599. // You can also sort results in descending order based on the creation
  30600. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30601. // based on the creationTimestamp field in reverse chronological order
  30602. // (newest result first). Use this to sort resources like operations so
  30603. // that the newest operation is returned first.
  30604. //
  30605. // Currently, only sorting by name or creationTimestamp desc is
  30606. // supported.
  30607. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  30608. c.urlParams_.Set("orderBy", orderBy)
  30609. return c
  30610. }
  30611. // PageToken sets the optional parameter "pageToken": Specifies a page
  30612. // token to use. Set pageToken to the nextPageToken returned by a
  30613. // previous list request to get the next page of results.
  30614. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  30615. c.urlParams_.Set("pageToken", pageToken)
  30616. return c
  30617. }
  30618. // Fields allows partial responses to be retrieved. See
  30619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30620. // for more information.
  30621. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  30622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30623. return c
  30624. }
  30625. // IfNoneMatch sets the optional parameter which makes the operation
  30626. // fail if the object's ETag matches the given value. This is useful for
  30627. // getting updates only after the object has changed since the last
  30628. // request. Use googleapi.IsNotModified to check whether the response
  30629. // error from Do is the result of In-None-Match.
  30630. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  30631. c.ifNoneMatch_ = entityTag
  30632. return c
  30633. }
  30634. // Context sets the context to be used in this call's Do method. Any
  30635. // pending HTTP request will be aborted if the provided context is
  30636. // canceled.
  30637. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  30638. c.ctx_ = ctx
  30639. return c
  30640. }
  30641. // Header returns an http.Header that can be modified by the caller to
  30642. // add HTTP headers to the request.
  30643. func (c *AddressesListCall) Header() http.Header {
  30644. if c.header_ == nil {
  30645. c.header_ = make(http.Header)
  30646. }
  30647. return c.header_
  30648. }
  30649. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  30650. reqHeaders := make(http.Header)
  30651. for k, v := range c.header_ {
  30652. reqHeaders[k] = v
  30653. }
  30654. reqHeaders.Set("User-Agent", c.s.userAgent())
  30655. if c.ifNoneMatch_ != "" {
  30656. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30657. }
  30658. var body io.Reader = nil
  30659. c.urlParams_.Set("alt", alt)
  30660. c.urlParams_.Set("prettyPrint", "false")
  30661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  30662. urls += "?" + c.urlParams_.Encode()
  30663. req, err := http.NewRequest("GET", urls, body)
  30664. if err != nil {
  30665. return nil, err
  30666. }
  30667. req.Header = reqHeaders
  30668. googleapi.Expand(req.URL, map[string]string{
  30669. "project": c.project,
  30670. "region": c.region,
  30671. })
  30672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30673. }
  30674. // Do executes the "compute.addresses.list" call.
  30675. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  30676. // status code is an error. Response headers are in either
  30677. // *AddressList.ServerResponse.Header or (if a response was returned at
  30678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30679. // to check whether the returned error was because
  30680. // http.StatusNotModified was returned.
  30681. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  30682. gensupport.SetOptions(c.urlParams_, opts...)
  30683. res, err := c.doRequest("json")
  30684. if res != nil && res.StatusCode == http.StatusNotModified {
  30685. if res.Body != nil {
  30686. res.Body.Close()
  30687. }
  30688. return nil, &googleapi.Error{
  30689. Code: res.StatusCode,
  30690. Header: res.Header,
  30691. }
  30692. }
  30693. if err != nil {
  30694. return nil, err
  30695. }
  30696. defer googleapi.CloseBody(res)
  30697. if err := googleapi.CheckResponse(res); err != nil {
  30698. return nil, err
  30699. }
  30700. ret := &AddressList{
  30701. ServerResponse: googleapi.ServerResponse{
  30702. Header: res.Header,
  30703. HTTPStatusCode: res.StatusCode,
  30704. },
  30705. }
  30706. target := &ret
  30707. if err := gensupport.DecodeResponse(target, res); err != nil {
  30708. return nil, err
  30709. }
  30710. return ret, nil
  30711. // {
  30712. // "description": "Retrieves a list of addresses contained within the specified region.",
  30713. // "httpMethod": "GET",
  30714. // "id": "compute.addresses.list",
  30715. // "parameterOrder": [
  30716. // "project",
  30717. // "region"
  30718. // ],
  30719. // "parameters": {
  30720. // "filter": {
  30721. // "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).",
  30722. // "location": "query",
  30723. // "type": "string"
  30724. // },
  30725. // "maxResults": {
  30726. // "default": "500",
  30727. // "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)",
  30728. // "format": "uint32",
  30729. // "location": "query",
  30730. // "minimum": "0",
  30731. // "type": "integer"
  30732. // },
  30733. // "orderBy": {
  30734. // "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.",
  30735. // "location": "query",
  30736. // "type": "string"
  30737. // },
  30738. // "pageToken": {
  30739. // "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.",
  30740. // "location": "query",
  30741. // "type": "string"
  30742. // },
  30743. // "project": {
  30744. // "description": "Project ID for this request.",
  30745. // "location": "path",
  30746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30747. // "required": true,
  30748. // "type": "string"
  30749. // },
  30750. // "region": {
  30751. // "description": "Name of the region for this request.",
  30752. // "location": "path",
  30753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30754. // "required": true,
  30755. // "type": "string"
  30756. // }
  30757. // },
  30758. // "path": "{project}/regions/{region}/addresses",
  30759. // "response": {
  30760. // "$ref": "AddressList"
  30761. // },
  30762. // "scopes": [
  30763. // "https://www.googleapis.com/auth/cloud-platform",
  30764. // "https://www.googleapis.com/auth/compute",
  30765. // "https://www.googleapis.com/auth/compute.readonly"
  30766. // ]
  30767. // }
  30768. }
  30769. // Pages invokes f for each page of results.
  30770. // A non-nil error returned from f will halt the iteration.
  30771. // The provided context supersedes any context provided to the Context method.
  30772. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  30773. c.ctx_ = ctx
  30774. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30775. for {
  30776. x, err := c.Do()
  30777. if err != nil {
  30778. return err
  30779. }
  30780. if err := f(x); err != nil {
  30781. return err
  30782. }
  30783. if x.NextPageToken == "" {
  30784. return nil
  30785. }
  30786. c.PageToken(x.NextPageToken)
  30787. }
  30788. }
  30789. // method id "compute.addresses.setLabels":
  30790. type AddressesSetLabelsCall struct {
  30791. s *Service
  30792. project string
  30793. region string
  30794. resource string
  30795. regionsetlabelsrequest *RegionSetLabelsRequest
  30796. urlParams_ gensupport.URLParams
  30797. ctx_ context.Context
  30798. header_ http.Header
  30799. }
  30800. // SetLabels: Sets the labels on an Address. To learn more about labels,
  30801. // read the Labeling Resources documentation.
  30802. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  30803. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30804. c.project = project
  30805. c.region = region
  30806. c.resource = resource
  30807. c.regionsetlabelsrequest = regionsetlabelsrequest
  30808. return c
  30809. }
  30810. // RequestId sets the optional parameter "requestId": An optional
  30811. // request ID to identify requests. Specify a unique request ID so that
  30812. // if you must retry your request, the server will know to ignore the
  30813. // request if it has already been completed.
  30814. //
  30815. // For example, consider a situation where you make an initial request
  30816. // and the request times out. If you make the request again with the
  30817. // same request ID, the server can check if original operation with the
  30818. // same request ID was received, and if so, will ignore the second
  30819. // request. This prevents clients from accidentally creating duplicate
  30820. // commitments.
  30821. //
  30822. // The request ID must be a valid UUID with the exception that zero UUID
  30823. // is not supported (00000000-0000-0000-0000-000000000000).
  30824. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  30825. c.urlParams_.Set("requestId", requestId)
  30826. return c
  30827. }
  30828. // Fields allows partial responses to be retrieved. See
  30829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30830. // for more information.
  30831. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  30832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30833. return c
  30834. }
  30835. // Context sets the context to be used in this call's Do method. Any
  30836. // pending HTTP request will be aborted if the provided context is
  30837. // canceled.
  30838. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  30839. c.ctx_ = ctx
  30840. return c
  30841. }
  30842. // Header returns an http.Header that can be modified by the caller to
  30843. // add HTTP headers to the request.
  30844. func (c *AddressesSetLabelsCall) Header() http.Header {
  30845. if c.header_ == nil {
  30846. c.header_ = make(http.Header)
  30847. }
  30848. return c.header_
  30849. }
  30850. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  30851. reqHeaders := make(http.Header)
  30852. for k, v := range c.header_ {
  30853. reqHeaders[k] = v
  30854. }
  30855. reqHeaders.Set("User-Agent", c.s.userAgent())
  30856. var body io.Reader = nil
  30857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  30858. if err != nil {
  30859. return nil, err
  30860. }
  30861. reqHeaders.Set("Content-Type", "application/json")
  30862. c.urlParams_.Set("alt", alt)
  30863. c.urlParams_.Set("prettyPrint", "false")
  30864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  30865. urls += "?" + c.urlParams_.Encode()
  30866. req, err := http.NewRequest("POST", urls, body)
  30867. if err != nil {
  30868. return nil, err
  30869. }
  30870. req.Header = reqHeaders
  30871. googleapi.Expand(req.URL, map[string]string{
  30872. "project": c.project,
  30873. "region": c.region,
  30874. "resource": c.resource,
  30875. })
  30876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30877. }
  30878. // Do executes the "compute.addresses.setLabels" call.
  30879. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30880. // status code is an error. Response headers are in either
  30881. // *Operation.ServerResponse.Header or (if a response was returned at
  30882. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30883. // to check whether the returned error was because
  30884. // http.StatusNotModified was returned.
  30885. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30886. gensupport.SetOptions(c.urlParams_, opts...)
  30887. res, err := c.doRequest("json")
  30888. if res != nil && res.StatusCode == http.StatusNotModified {
  30889. if res.Body != nil {
  30890. res.Body.Close()
  30891. }
  30892. return nil, &googleapi.Error{
  30893. Code: res.StatusCode,
  30894. Header: res.Header,
  30895. }
  30896. }
  30897. if err != nil {
  30898. return nil, err
  30899. }
  30900. defer googleapi.CloseBody(res)
  30901. if err := googleapi.CheckResponse(res); err != nil {
  30902. return nil, err
  30903. }
  30904. ret := &Operation{
  30905. ServerResponse: googleapi.ServerResponse{
  30906. Header: res.Header,
  30907. HTTPStatusCode: res.StatusCode,
  30908. },
  30909. }
  30910. target := &ret
  30911. if err := gensupport.DecodeResponse(target, res); err != nil {
  30912. return nil, err
  30913. }
  30914. return ret, nil
  30915. // {
  30916. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  30917. // "httpMethod": "POST",
  30918. // "id": "compute.addresses.setLabels",
  30919. // "parameterOrder": [
  30920. // "project",
  30921. // "region",
  30922. // "resource"
  30923. // ],
  30924. // "parameters": {
  30925. // "project": {
  30926. // "description": "Project ID for this request.",
  30927. // "location": "path",
  30928. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30929. // "required": true,
  30930. // "type": "string"
  30931. // },
  30932. // "region": {
  30933. // "description": "The region for this request.",
  30934. // "location": "path",
  30935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30936. // "required": true,
  30937. // "type": "string"
  30938. // },
  30939. // "requestId": {
  30940. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30941. // "location": "query",
  30942. // "type": "string"
  30943. // },
  30944. // "resource": {
  30945. // "description": "Name or id of the resource for this request.",
  30946. // "location": "path",
  30947. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30948. // "required": true,
  30949. // "type": "string"
  30950. // }
  30951. // },
  30952. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  30953. // "request": {
  30954. // "$ref": "RegionSetLabelsRequest"
  30955. // },
  30956. // "response": {
  30957. // "$ref": "Operation"
  30958. // },
  30959. // "scopes": [
  30960. // "https://www.googleapis.com/auth/cloud-platform",
  30961. // "https://www.googleapis.com/auth/compute"
  30962. // ]
  30963. // }
  30964. }
  30965. // method id "compute.addresses.testIamPermissions":
  30966. type AddressesTestIamPermissionsCall struct {
  30967. s *Service
  30968. project string
  30969. region string
  30970. resource string
  30971. testpermissionsrequest *TestPermissionsRequest
  30972. urlParams_ gensupport.URLParams
  30973. ctx_ context.Context
  30974. header_ http.Header
  30975. }
  30976. // TestIamPermissions: Returns permissions that a caller has on the
  30977. // specified resource.
  30978. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  30979. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30980. c.project = project
  30981. c.region = region
  30982. c.resource = resource
  30983. c.testpermissionsrequest = testpermissionsrequest
  30984. return c
  30985. }
  30986. // Fields allows partial responses to be retrieved. See
  30987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30988. // for more information.
  30989. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  30990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30991. return c
  30992. }
  30993. // Context sets the context to be used in this call's Do method. Any
  30994. // pending HTTP request will be aborted if the provided context is
  30995. // canceled.
  30996. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  30997. c.ctx_ = ctx
  30998. return c
  30999. }
  31000. // Header returns an http.Header that can be modified by the caller to
  31001. // add HTTP headers to the request.
  31002. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  31003. if c.header_ == nil {
  31004. c.header_ = make(http.Header)
  31005. }
  31006. return c.header_
  31007. }
  31008. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  31009. reqHeaders := make(http.Header)
  31010. for k, v := range c.header_ {
  31011. reqHeaders[k] = v
  31012. }
  31013. reqHeaders.Set("User-Agent", c.s.userAgent())
  31014. var body io.Reader = nil
  31015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  31016. if err != nil {
  31017. return nil, err
  31018. }
  31019. reqHeaders.Set("Content-Type", "application/json")
  31020. c.urlParams_.Set("alt", alt)
  31021. c.urlParams_.Set("prettyPrint", "false")
  31022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  31023. urls += "?" + c.urlParams_.Encode()
  31024. req, err := http.NewRequest("POST", urls, body)
  31025. if err != nil {
  31026. return nil, err
  31027. }
  31028. req.Header = reqHeaders
  31029. googleapi.Expand(req.URL, map[string]string{
  31030. "project": c.project,
  31031. "region": c.region,
  31032. "resource": c.resource,
  31033. })
  31034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31035. }
  31036. // Do executes the "compute.addresses.testIamPermissions" call.
  31037. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  31038. // non-2xx status code is an error. Response headers are in either
  31039. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  31040. // returned at all) in error.(*googleapi.Error).Header. Use
  31041. // googleapi.IsNotModified to check whether the returned error was
  31042. // because http.StatusNotModified was returned.
  31043. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  31044. gensupport.SetOptions(c.urlParams_, opts...)
  31045. res, err := c.doRequest("json")
  31046. if res != nil && res.StatusCode == http.StatusNotModified {
  31047. if res.Body != nil {
  31048. res.Body.Close()
  31049. }
  31050. return nil, &googleapi.Error{
  31051. Code: res.StatusCode,
  31052. Header: res.Header,
  31053. }
  31054. }
  31055. if err != nil {
  31056. return nil, err
  31057. }
  31058. defer googleapi.CloseBody(res)
  31059. if err := googleapi.CheckResponse(res); err != nil {
  31060. return nil, err
  31061. }
  31062. ret := &TestPermissionsResponse{
  31063. ServerResponse: googleapi.ServerResponse{
  31064. Header: res.Header,
  31065. HTTPStatusCode: res.StatusCode,
  31066. },
  31067. }
  31068. target := &ret
  31069. if err := gensupport.DecodeResponse(target, res); err != nil {
  31070. return nil, err
  31071. }
  31072. return ret, nil
  31073. // {
  31074. // "description": "Returns permissions that a caller has on the specified resource.",
  31075. // "httpMethod": "POST",
  31076. // "id": "compute.addresses.testIamPermissions",
  31077. // "parameterOrder": [
  31078. // "project",
  31079. // "region",
  31080. // "resource"
  31081. // ],
  31082. // "parameters": {
  31083. // "project": {
  31084. // "description": "Project ID for this request.",
  31085. // "location": "path",
  31086. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31087. // "required": true,
  31088. // "type": "string"
  31089. // },
  31090. // "region": {
  31091. // "description": "The name of the region for this request.",
  31092. // "location": "path",
  31093. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31094. // "required": true,
  31095. // "type": "string"
  31096. // },
  31097. // "resource": {
  31098. // "description": "Name or id of the resource for this request.",
  31099. // "location": "path",
  31100. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31101. // "required": true,
  31102. // "type": "string"
  31103. // }
  31104. // },
  31105. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  31106. // "request": {
  31107. // "$ref": "TestPermissionsRequest"
  31108. // },
  31109. // "response": {
  31110. // "$ref": "TestPermissionsResponse"
  31111. // },
  31112. // "scopes": [
  31113. // "https://www.googleapis.com/auth/cloud-platform",
  31114. // "https://www.googleapis.com/auth/compute",
  31115. // "https://www.googleapis.com/auth/compute.readonly"
  31116. // ]
  31117. // }
  31118. }
  31119. // method id "compute.allocations.aggregatedList":
  31120. type AllocationsAggregatedListCall struct {
  31121. s *Service
  31122. project string
  31123. urlParams_ gensupport.URLParams
  31124. ifNoneMatch_ string
  31125. ctx_ context.Context
  31126. header_ http.Header
  31127. }
  31128. // AggregatedList: Retrieves an aggregated list of allocations.
  31129. func (r *AllocationsService) AggregatedList(project string) *AllocationsAggregatedListCall {
  31130. c := &AllocationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31131. c.project = project
  31132. return c
  31133. }
  31134. // Filter sets the optional parameter "filter": A filter expression that
  31135. // filters resources listed in the response. The expression must specify
  31136. // the field name, a comparison operator, and the value that you want to
  31137. // use for filtering. The value must be a string, a number, or a
  31138. // boolean. The comparison operator must be either =, !=, >, or <.
  31139. //
  31140. // For example, if you are filtering Compute Engine instances, you can
  31141. // exclude instances named example-instance by specifying name !=
  31142. // example-instance.
  31143. //
  31144. // You can also filter nested fields. For example, you could specify
  31145. // scheduling.automaticRestart = false to include instances only if they
  31146. // are not scheduled for automatic restarts. You can use filtering on
  31147. // nested fields to filter based on resource labels.
  31148. //
  31149. // To filter on multiple expressions, provide each separate expression
  31150. // within parentheses. For example, (scheduling.automaticRestart = true)
  31151. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31152. // AND expression. However, you can include AND and OR expressions
  31153. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31154. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31155. // true).
  31156. func (c *AllocationsAggregatedListCall) Filter(filter string) *AllocationsAggregatedListCall {
  31157. c.urlParams_.Set("filter", filter)
  31158. return c
  31159. }
  31160. // MaxResults sets the optional parameter "maxResults": The maximum
  31161. // number of results per page that should be returned. If the number of
  31162. // available results is larger than maxResults, Compute Engine returns a
  31163. // nextPageToken that can be used to get the next page of results in
  31164. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31165. // (Default: 500)
  31166. func (c *AllocationsAggregatedListCall) MaxResults(maxResults int64) *AllocationsAggregatedListCall {
  31167. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31168. return c
  31169. }
  31170. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31171. // a certain order. By default, results are returned in alphanumerical
  31172. // order based on the resource name.
  31173. //
  31174. // You can also sort results in descending order based on the creation
  31175. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31176. // based on the creationTimestamp field in reverse chronological order
  31177. // (newest result first). Use this to sort resources like operations so
  31178. // that the newest operation is returned first.
  31179. //
  31180. // Currently, only sorting by name or creationTimestamp desc is
  31181. // supported.
  31182. func (c *AllocationsAggregatedListCall) OrderBy(orderBy string) *AllocationsAggregatedListCall {
  31183. c.urlParams_.Set("orderBy", orderBy)
  31184. return c
  31185. }
  31186. // PageToken sets the optional parameter "pageToken": Specifies a page
  31187. // token to use. Set pageToken to the nextPageToken returned by a
  31188. // previous list request to get the next page of results.
  31189. func (c *AllocationsAggregatedListCall) PageToken(pageToken string) *AllocationsAggregatedListCall {
  31190. c.urlParams_.Set("pageToken", pageToken)
  31191. return c
  31192. }
  31193. // Fields allows partial responses to be retrieved. See
  31194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31195. // for more information.
  31196. func (c *AllocationsAggregatedListCall) Fields(s ...googleapi.Field) *AllocationsAggregatedListCall {
  31197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31198. return c
  31199. }
  31200. // IfNoneMatch sets the optional parameter which makes the operation
  31201. // fail if the object's ETag matches the given value. This is useful for
  31202. // getting updates only after the object has changed since the last
  31203. // request. Use googleapi.IsNotModified to check whether the response
  31204. // error from Do is the result of In-None-Match.
  31205. func (c *AllocationsAggregatedListCall) IfNoneMatch(entityTag string) *AllocationsAggregatedListCall {
  31206. c.ifNoneMatch_ = entityTag
  31207. return c
  31208. }
  31209. // Context sets the context to be used in this call's Do method. Any
  31210. // pending HTTP request will be aborted if the provided context is
  31211. // canceled.
  31212. func (c *AllocationsAggregatedListCall) Context(ctx context.Context) *AllocationsAggregatedListCall {
  31213. c.ctx_ = ctx
  31214. return c
  31215. }
  31216. // Header returns an http.Header that can be modified by the caller to
  31217. // add HTTP headers to the request.
  31218. func (c *AllocationsAggregatedListCall) Header() http.Header {
  31219. if c.header_ == nil {
  31220. c.header_ = make(http.Header)
  31221. }
  31222. return c.header_
  31223. }
  31224. func (c *AllocationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31225. reqHeaders := make(http.Header)
  31226. for k, v := range c.header_ {
  31227. reqHeaders[k] = v
  31228. }
  31229. reqHeaders.Set("User-Agent", c.s.userAgent())
  31230. if c.ifNoneMatch_ != "" {
  31231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31232. }
  31233. var body io.Reader = nil
  31234. c.urlParams_.Set("alt", alt)
  31235. c.urlParams_.Set("prettyPrint", "false")
  31236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/allocations")
  31237. urls += "?" + c.urlParams_.Encode()
  31238. req, err := http.NewRequest("GET", urls, body)
  31239. if err != nil {
  31240. return nil, err
  31241. }
  31242. req.Header = reqHeaders
  31243. googleapi.Expand(req.URL, map[string]string{
  31244. "project": c.project,
  31245. })
  31246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31247. }
  31248. // Do executes the "compute.allocations.aggregatedList" call.
  31249. // Exactly one of *AllocationAggregatedList or error will be non-nil.
  31250. // Any non-2xx status code is an error. Response headers are in either
  31251. // *AllocationAggregatedList.ServerResponse.Header or (if a response was
  31252. // returned at all) in error.(*googleapi.Error).Header. Use
  31253. // googleapi.IsNotModified to check whether the returned error was
  31254. // because http.StatusNotModified was returned.
  31255. func (c *AllocationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*AllocationAggregatedList, error) {
  31256. gensupport.SetOptions(c.urlParams_, opts...)
  31257. res, err := c.doRequest("json")
  31258. if res != nil && res.StatusCode == http.StatusNotModified {
  31259. if res.Body != nil {
  31260. res.Body.Close()
  31261. }
  31262. return nil, &googleapi.Error{
  31263. Code: res.StatusCode,
  31264. Header: res.Header,
  31265. }
  31266. }
  31267. if err != nil {
  31268. return nil, err
  31269. }
  31270. defer googleapi.CloseBody(res)
  31271. if err := googleapi.CheckResponse(res); err != nil {
  31272. return nil, err
  31273. }
  31274. ret := &AllocationAggregatedList{
  31275. ServerResponse: googleapi.ServerResponse{
  31276. Header: res.Header,
  31277. HTTPStatusCode: res.StatusCode,
  31278. },
  31279. }
  31280. target := &ret
  31281. if err := gensupport.DecodeResponse(target, res); err != nil {
  31282. return nil, err
  31283. }
  31284. return ret, nil
  31285. // {
  31286. // "description": "Retrieves an aggregated list of allocations.",
  31287. // "httpMethod": "GET",
  31288. // "id": "compute.allocations.aggregatedList",
  31289. // "parameterOrder": [
  31290. // "project"
  31291. // ],
  31292. // "parameters": {
  31293. // "filter": {
  31294. // "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).",
  31295. // "location": "query",
  31296. // "type": "string"
  31297. // },
  31298. // "maxResults": {
  31299. // "default": "500",
  31300. // "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)",
  31301. // "format": "uint32",
  31302. // "location": "query",
  31303. // "minimum": "0",
  31304. // "type": "integer"
  31305. // },
  31306. // "orderBy": {
  31307. // "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.",
  31308. // "location": "query",
  31309. // "type": "string"
  31310. // },
  31311. // "pageToken": {
  31312. // "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.",
  31313. // "location": "query",
  31314. // "type": "string"
  31315. // },
  31316. // "project": {
  31317. // "description": "Project ID for this request.",
  31318. // "location": "path",
  31319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31320. // "required": true,
  31321. // "type": "string"
  31322. // }
  31323. // },
  31324. // "path": "{project}/aggregated/allocations",
  31325. // "response": {
  31326. // "$ref": "AllocationAggregatedList"
  31327. // },
  31328. // "scopes": [
  31329. // "https://www.googleapis.com/auth/cloud-platform",
  31330. // "https://www.googleapis.com/auth/compute",
  31331. // "https://www.googleapis.com/auth/compute.readonly"
  31332. // ]
  31333. // }
  31334. }
  31335. // Pages invokes f for each page of results.
  31336. // A non-nil error returned from f will halt the iteration.
  31337. // The provided context supersedes any context provided to the Context method.
  31338. func (c *AllocationsAggregatedListCall) Pages(ctx context.Context, f func(*AllocationAggregatedList) error) error {
  31339. c.ctx_ = ctx
  31340. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31341. for {
  31342. x, err := c.Do()
  31343. if err != nil {
  31344. return err
  31345. }
  31346. if err := f(x); err != nil {
  31347. return err
  31348. }
  31349. if x.NextPageToken == "" {
  31350. return nil
  31351. }
  31352. c.PageToken(x.NextPageToken)
  31353. }
  31354. }
  31355. // method id "compute.allocations.delete":
  31356. type AllocationsDeleteCall struct {
  31357. s *Service
  31358. project string
  31359. zone string
  31360. allocation string
  31361. urlParams_ gensupport.URLParams
  31362. ctx_ context.Context
  31363. header_ http.Header
  31364. }
  31365. // Delete: Deletes the specified allocation.
  31366. func (r *AllocationsService) Delete(project string, zone string, allocation string) *AllocationsDeleteCall {
  31367. c := &AllocationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31368. c.project = project
  31369. c.zone = zone
  31370. c.allocation = allocation
  31371. return c
  31372. }
  31373. // RequestId sets the optional parameter "requestId": An optional
  31374. // request ID to identify requests. Specify a unique request ID so that
  31375. // if you must retry your request, the server will know to ignore the
  31376. // request if it has already been completed.
  31377. //
  31378. // For example, consider a situation where you make an initial request
  31379. // and the request times out. If you make the request again with the
  31380. // same request ID, the server can check if original operation with the
  31381. // same request ID was received, and if so, will ignore the second
  31382. // request. This prevents clients from accidentally creating duplicate
  31383. // commitments.
  31384. //
  31385. // The request ID must be a valid UUID with the exception that zero UUID
  31386. // is not supported (00000000-0000-0000-0000-000000000000).
  31387. func (c *AllocationsDeleteCall) RequestId(requestId string) *AllocationsDeleteCall {
  31388. c.urlParams_.Set("requestId", requestId)
  31389. return c
  31390. }
  31391. // Fields allows partial responses to be retrieved. See
  31392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31393. // for more information.
  31394. func (c *AllocationsDeleteCall) Fields(s ...googleapi.Field) *AllocationsDeleteCall {
  31395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31396. return c
  31397. }
  31398. // Context sets the context to be used in this call's Do method. Any
  31399. // pending HTTP request will be aborted if the provided context is
  31400. // canceled.
  31401. func (c *AllocationsDeleteCall) Context(ctx context.Context) *AllocationsDeleteCall {
  31402. c.ctx_ = ctx
  31403. return c
  31404. }
  31405. // Header returns an http.Header that can be modified by the caller to
  31406. // add HTTP headers to the request.
  31407. func (c *AllocationsDeleteCall) Header() http.Header {
  31408. if c.header_ == nil {
  31409. c.header_ = make(http.Header)
  31410. }
  31411. return c.header_
  31412. }
  31413. func (c *AllocationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  31414. reqHeaders := make(http.Header)
  31415. for k, v := range c.header_ {
  31416. reqHeaders[k] = v
  31417. }
  31418. reqHeaders.Set("User-Agent", c.s.userAgent())
  31419. var body io.Reader = nil
  31420. c.urlParams_.Set("alt", alt)
  31421. c.urlParams_.Set("prettyPrint", "false")
  31422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  31423. urls += "?" + c.urlParams_.Encode()
  31424. req, err := http.NewRequest("DELETE", urls, body)
  31425. if err != nil {
  31426. return nil, err
  31427. }
  31428. req.Header = reqHeaders
  31429. googleapi.Expand(req.URL, map[string]string{
  31430. "project": c.project,
  31431. "zone": c.zone,
  31432. "allocation": c.allocation,
  31433. })
  31434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31435. }
  31436. // Do executes the "compute.allocations.delete" call.
  31437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31438. // status code is an error. Response headers are in either
  31439. // *Operation.ServerResponse.Header or (if a response was returned at
  31440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31441. // to check whether the returned error was because
  31442. // http.StatusNotModified was returned.
  31443. func (c *AllocationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31444. gensupport.SetOptions(c.urlParams_, opts...)
  31445. res, err := c.doRequest("json")
  31446. if res != nil && res.StatusCode == http.StatusNotModified {
  31447. if res.Body != nil {
  31448. res.Body.Close()
  31449. }
  31450. return nil, &googleapi.Error{
  31451. Code: res.StatusCode,
  31452. Header: res.Header,
  31453. }
  31454. }
  31455. if err != nil {
  31456. return nil, err
  31457. }
  31458. defer googleapi.CloseBody(res)
  31459. if err := googleapi.CheckResponse(res); err != nil {
  31460. return nil, err
  31461. }
  31462. ret := &Operation{
  31463. ServerResponse: googleapi.ServerResponse{
  31464. Header: res.Header,
  31465. HTTPStatusCode: res.StatusCode,
  31466. },
  31467. }
  31468. target := &ret
  31469. if err := gensupport.DecodeResponse(target, res); err != nil {
  31470. return nil, err
  31471. }
  31472. return ret, nil
  31473. // {
  31474. // "description": "Deletes the specified allocation.",
  31475. // "httpMethod": "DELETE",
  31476. // "id": "compute.allocations.delete",
  31477. // "parameterOrder": [
  31478. // "project",
  31479. // "zone",
  31480. // "allocation"
  31481. // ],
  31482. // "parameters": {
  31483. // "allocation": {
  31484. // "description": "Name of the allocation to delete.",
  31485. // "location": "path",
  31486. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31487. // "required": true,
  31488. // "type": "string"
  31489. // },
  31490. // "project": {
  31491. // "description": "Project ID for this request.",
  31492. // "location": "path",
  31493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31494. // "required": true,
  31495. // "type": "string"
  31496. // },
  31497. // "requestId": {
  31498. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31499. // "location": "query",
  31500. // "type": "string"
  31501. // },
  31502. // "zone": {
  31503. // "description": "Name of the zone for this request.",
  31504. // "location": "path",
  31505. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31506. // "required": true,
  31507. // "type": "string"
  31508. // }
  31509. // },
  31510. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  31511. // "response": {
  31512. // "$ref": "Operation"
  31513. // },
  31514. // "scopes": [
  31515. // "https://www.googleapis.com/auth/cloud-platform",
  31516. // "https://www.googleapis.com/auth/compute"
  31517. // ]
  31518. // }
  31519. }
  31520. // method id "compute.allocations.get":
  31521. type AllocationsGetCall struct {
  31522. s *Service
  31523. project string
  31524. zone string
  31525. allocation string
  31526. urlParams_ gensupport.URLParams
  31527. ifNoneMatch_ string
  31528. ctx_ context.Context
  31529. header_ http.Header
  31530. }
  31531. // Get: Retrieves all information of the specified allocation.
  31532. func (r *AllocationsService) Get(project string, zone string, allocation string) *AllocationsGetCall {
  31533. c := &AllocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31534. c.project = project
  31535. c.zone = zone
  31536. c.allocation = allocation
  31537. return c
  31538. }
  31539. // Fields allows partial responses to be retrieved. See
  31540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31541. // for more information.
  31542. func (c *AllocationsGetCall) Fields(s ...googleapi.Field) *AllocationsGetCall {
  31543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31544. return c
  31545. }
  31546. // IfNoneMatch sets the optional parameter which makes the operation
  31547. // fail if the object's ETag matches the given value. This is useful for
  31548. // getting updates only after the object has changed since the last
  31549. // request. Use googleapi.IsNotModified to check whether the response
  31550. // error from Do is the result of In-None-Match.
  31551. func (c *AllocationsGetCall) IfNoneMatch(entityTag string) *AllocationsGetCall {
  31552. c.ifNoneMatch_ = entityTag
  31553. return c
  31554. }
  31555. // Context sets the context to be used in this call's Do method. Any
  31556. // pending HTTP request will be aborted if the provided context is
  31557. // canceled.
  31558. func (c *AllocationsGetCall) Context(ctx context.Context) *AllocationsGetCall {
  31559. c.ctx_ = ctx
  31560. return c
  31561. }
  31562. // Header returns an http.Header that can be modified by the caller to
  31563. // add HTTP headers to the request.
  31564. func (c *AllocationsGetCall) Header() http.Header {
  31565. if c.header_ == nil {
  31566. c.header_ = make(http.Header)
  31567. }
  31568. return c.header_
  31569. }
  31570. func (c *AllocationsGetCall) doRequest(alt string) (*http.Response, error) {
  31571. reqHeaders := make(http.Header)
  31572. for k, v := range c.header_ {
  31573. reqHeaders[k] = v
  31574. }
  31575. reqHeaders.Set("User-Agent", c.s.userAgent())
  31576. if c.ifNoneMatch_ != "" {
  31577. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31578. }
  31579. var body io.Reader = nil
  31580. c.urlParams_.Set("alt", alt)
  31581. c.urlParams_.Set("prettyPrint", "false")
  31582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  31583. urls += "?" + c.urlParams_.Encode()
  31584. req, err := http.NewRequest("GET", urls, body)
  31585. if err != nil {
  31586. return nil, err
  31587. }
  31588. req.Header = reqHeaders
  31589. googleapi.Expand(req.URL, map[string]string{
  31590. "project": c.project,
  31591. "zone": c.zone,
  31592. "allocation": c.allocation,
  31593. })
  31594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31595. }
  31596. // Do executes the "compute.allocations.get" call.
  31597. // Exactly one of *Allocation or error will be non-nil. Any non-2xx
  31598. // status code is an error. Response headers are in either
  31599. // *Allocation.ServerResponse.Header or (if a response was returned at
  31600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31601. // to check whether the returned error was because
  31602. // http.StatusNotModified was returned.
  31603. func (c *AllocationsGetCall) Do(opts ...googleapi.CallOption) (*Allocation, error) {
  31604. gensupport.SetOptions(c.urlParams_, opts...)
  31605. res, err := c.doRequest("json")
  31606. if res != nil && res.StatusCode == http.StatusNotModified {
  31607. if res.Body != nil {
  31608. res.Body.Close()
  31609. }
  31610. return nil, &googleapi.Error{
  31611. Code: res.StatusCode,
  31612. Header: res.Header,
  31613. }
  31614. }
  31615. if err != nil {
  31616. return nil, err
  31617. }
  31618. defer googleapi.CloseBody(res)
  31619. if err := googleapi.CheckResponse(res); err != nil {
  31620. return nil, err
  31621. }
  31622. ret := &Allocation{
  31623. ServerResponse: googleapi.ServerResponse{
  31624. Header: res.Header,
  31625. HTTPStatusCode: res.StatusCode,
  31626. },
  31627. }
  31628. target := &ret
  31629. if err := gensupport.DecodeResponse(target, res); err != nil {
  31630. return nil, err
  31631. }
  31632. return ret, nil
  31633. // {
  31634. // "description": "Retrieves all information of the specified allocation.",
  31635. // "httpMethod": "GET",
  31636. // "id": "compute.allocations.get",
  31637. // "parameterOrder": [
  31638. // "project",
  31639. // "zone",
  31640. // "allocation"
  31641. // ],
  31642. // "parameters": {
  31643. // "allocation": {
  31644. // "description": "Name of the allocation to retrieve.",
  31645. // "location": "path",
  31646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31647. // "required": true,
  31648. // "type": "string"
  31649. // },
  31650. // "project": {
  31651. // "description": "Project ID for this request.",
  31652. // "location": "path",
  31653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31654. // "required": true,
  31655. // "type": "string"
  31656. // },
  31657. // "zone": {
  31658. // "description": "Name of the zone for this request.",
  31659. // "location": "path",
  31660. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31661. // "required": true,
  31662. // "type": "string"
  31663. // }
  31664. // },
  31665. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  31666. // "response": {
  31667. // "$ref": "Allocation"
  31668. // },
  31669. // "scopes": [
  31670. // "https://www.googleapis.com/auth/cloud-platform",
  31671. // "https://www.googleapis.com/auth/compute",
  31672. // "https://www.googleapis.com/auth/compute.readonly"
  31673. // ]
  31674. // }
  31675. }
  31676. // method id "compute.allocations.getIamPolicy":
  31677. type AllocationsGetIamPolicyCall struct {
  31678. s *Service
  31679. project string
  31680. zone string
  31681. resource string
  31682. urlParams_ gensupport.URLParams
  31683. ifNoneMatch_ string
  31684. ctx_ context.Context
  31685. header_ http.Header
  31686. }
  31687. // GetIamPolicy: Gets the access control policy for a resource. May be
  31688. // empty if no such policy or resource exists.
  31689. func (r *AllocationsService) GetIamPolicy(project string, zone string, resource string) *AllocationsGetIamPolicyCall {
  31690. c := &AllocationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31691. c.project = project
  31692. c.zone = zone
  31693. c.resource = resource
  31694. return c
  31695. }
  31696. // Fields allows partial responses to be retrieved. See
  31697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31698. // for more information.
  31699. func (c *AllocationsGetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsGetIamPolicyCall {
  31700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31701. return c
  31702. }
  31703. // IfNoneMatch sets the optional parameter which makes the operation
  31704. // fail if the object's ETag matches the given value. This is useful for
  31705. // getting updates only after the object has changed since the last
  31706. // request. Use googleapi.IsNotModified to check whether the response
  31707. // error from Do is the result of In-None-Match.
  31708. func (c *AllocationsGetIamPolicyCall) IfNoneMatch(entityTag string) *AllocationsGetIamPolicyCall {
  31709. c.ifNoneMatch_ = entityTag
  31710. return c
  31711. }
  31712. // Context sets the context to be used in this call's Do method. Any
  31713. // pending HTTP request will be aborted if the provided context is
  31714. // canceled.
  31715. func (c *AllocationsGetIamPolicyCall) Context(ctx context.Context) *AllocationsGetIamPolicyCall {
  31716. c.ctx_ = ctx
  31717. return c
  31718. }
  31719. // Header returns an http.Header that can be modified by the caller to
  31720. // add HTTP headers to the request.
  31721. func (c *AllocationsGetIamPolicyCall) Header() http.Header {
  31722. if c.header_ == nil {
  31723. c.header_ = make(http.Header)
  31724. }
  31725. return c.header_
  31726. }
  31727. func (c *AllocationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  31728. reqHeaders := make(http.Header)
  31729. for k, v := range c.header_ {
  31730. reqHeaders[k] = v
  31731. }
  31732. reqHeaders.Set("User-Agent", c.s.userAgent())
  31733. if c.ifNoneMatch_ != "" {
  31734. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31735. }
  31736. var body io.Reader = nil
  31737. c.urlParams_.Set("alt", alt)
  31738. c.urlParams_.Set("prettyPrint", "false")
  31739. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/getIamPolicy")
  31740. urls += "?" + c.urlParams_.Encode()
  31741. req, err := http.NewRequest("GET", urls, body)
  31742. if err != nil {
  31743. return nil, err
  31744. }
  31745. req.Header = reqHeaders
  31746. googleapi.Expand(req.URL, map[string]string{
  31747. "project": c.project,
  31748. "zone": c.zone,
  31749. "resource": c.resource,
  31750. })
  31751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31752. }
  31753. // Do executes the "compute.allocations.getIamPolicy" call.
  31754. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  31755. // code is an error. Response headers are in either
  31756. // *Policy.ServerResponse.Header or (if a response was returned at all)
  31757. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  31758. // check whether the returned error was because http.StatusNotModified
  31759. // was returned.
  31760. func (c *AllocationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  31761. gensupport.SetOptions(c.urlParams_, opts...)
  31762. res, err := c.doRequest("json")
  31763. if res != nil && res.StatusCode == http.StatusNotModified {
  31764. if res.Body != nil {
  31765. res.Body.Close()
  31766. }
  31767. return nil, &googleapi.Error{
  31768. Code: res.StatusCode,
  31769. Header: res.Header,
  31770. }
  31771. }
  31772. if err != nil {
  31773. return nil, err
  31774. }
  31775. defer googleapi.CloseBody(res)
  31776. if err := googleapi.CheckResponse(res); err != nil {
  31777. return nil, err
  31778. }
  31779. ret := &Policy{
  31780. ServerResponse: googleapi.ServerResponse{
  31781. Header: res.Header,
  31782. HTTPStatusCode: res.StatusCode,
  31783. },
  31784. }
  31785. target := &ret
  31786. if err := gensupport.DecodeResponse(target, res); err != nil {
  31787. return nil, err
  31788. }
  31789. return ret, nil
  31790. // {
  31791. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  31792. // "httpMethod": "GET",
  31793. // "id": "compute.allocations.getIamPolicy",
  31794. // "parameterOrder": [
  31795. // "project",
  31796. // "zone",
  31797. // "resource"
  31798. // ],
  31799. // "parameters": {
  31800. // "project": {
  31801. // "description": "Project ID for this request.",
  31802. // "location": "path",
  31803. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31804. // "required": true,
  31805. // "type": "string"
  31806. // },
  31807. // "resource": {
  31808. // "description": "Name or id of the resource for this request.",
  31809. // "location": "path",
  31810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31811. // "required": true,
  31812. // "type": "string"
  31813. // },
  31814. // "zone": {
  31815. // "description": "The name of the zone for this request.",
  31816. // "location": "path",
  31817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31818. // "required": true,
  31819. // "type": "string"
  31820. // }
  31821. // },
  31822. // "path": "{project}/zones/{zone}/allocations/{resource}/getIamPolicy",
  31823. // "response": {
  31824. // "$ref": "Policy"
  31825. // },
  31826. // "scopes": [
  31827. // "https://www.googleapis.com/auth/cloud-platform",
  31828. // "https://www.googleapis.com/auth/compute",
  31829. // "https://www.googleapis.com/auth/compute.readonly"
  31830. // ]
  31831. // }
  31832. }
  31833. // method id "compute.allocations.insert":
  31834. type AllocationsInsertCall struct {
  31835. s *Service
  31836. project string
  31837. zone string
  31838. allocation *Allocation
  31839. urlParams_ gensupport.URLParams
  31840. ctx_ context.Context
  31841. header_ http.Header
  31842. }
  31843. // Insert: Creates a new allocation.
  31844. func (r *AllocationsService) Insert(project string, zone string, allocation *Allocation) *AllocationsInsertCall {
  31845. c := &AllocationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31846. c.project = project
  31847. c.zone = zone
  31848. c.allocation = allocation
  31849. return c
  31850. }
  31851. // RequestId sets the optional parameter "requestId": An optional
  31852. // request ID to identify requests. Specify a unique request ID so that
  31853. // if you must retry your request, the server will know to ignore the
  31854. // request if it has already been completed.
  31855. //
  31856. // For example, consider a situation where you make an initial request
  31857. // and the request times out. If you make the request again with the
  31858. // same request ID, the server can check if original operation with the
  31859. // same request ID was received, and if so, will ignore the second
  31860. // request. This prevents clients from accidentally creating duplicate
  31861. // commitments.
  31862. //
  31863. // The request ID must be a valid UUID with the exception that zero UUID
  31864. // is not supported (00000000-0000-0000-0000-000000000000).
  31865. func (c *AllocationsInsertCall) RequestId(requestId string) *AllocationsInsertCall {
  31866. c.urlParams_.Set("requestId", requestId)
  31867. return c
  31868. }
  31869. // Fields allows partial responses to be retrieved. See
  31870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31871. // for more information.
  31872. func (c *AllocationsInsertCall) Fields(s ...googleapi.Field) *AllocationsInsertCall {
  31873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31874. return c
  31875. }
  31876. // Context sets the context to be used in this call's Do method. Any
  31877. // pending HTTP request will be aborted if the provided context is
  31878. // canceled.
  31879. func (c *AllocationsInsertCall) Context(ctx context.Context) *AllocationsInsertCall {
  31880. c.ctx_ = ctx
  31881. return c
  31882. }
  31883. // Header returns an http.Header that can be modified by the caller to
  31884. // add HTTP headers to the request.
  31885. func (c *AllocationsInsertCall) Header() http.Header {
  31886. if c.header_ == nil {
  31887. c.header_ = make(http.Header)
  31888. }
  31889. return c.header_
  31890. }
  31891. func (c *AllocationsInsertCall) doRequest(alt string) (*http.Response, error) {
  31892. reqHeaders := make(http.Header)
  31893. for k, v := range c.header_ {
  31894. reqHeaders[k] = v
  31895. }
  31896. reqHeaders.Set("User-Agent", c.s.userAgent())
  31897. var body io.Reader = nil
  31898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocation)
  31899. if err != nil {
  31900. return nil, err
  31901. }
  31902. reqHeaders.Set("Content-Type", "application/json")
  31903. c.urlParams_.Set("alt", alt)
  31904. c.urlParams_.Set("prettyPrint", "false")
  31905. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  31906. urls += "?" + c.urlParams_.Encode()
  31907. req, err := http.NewRequest("POST", urls, body)
  31908. if err != nil {
  31909. return nil, err
  31910. }
  31911. req.Header = reqHeaders
  31912. googleapi.Expand(req.URL, map[string]string{
  31913. "project": c.project,
  31914. "zone": c.zone,
  31915. })
  31916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31917. }
  31918. // Do executes the "compute.allocations.insert" call.
  31919. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31920. // status code is an error. Response headers are in either
  31921. // *Operation.ServerResponse.Header or (if a response was returned at
  31922. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31923. // to check whether the returned error was because
  31924. // http.StatusNotModified was returned.
  31925. func (c *AllocationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31926. gensupport.SetOptions(c.urlParams_, opts...)
  31927. res, err := c.doRequest("json")
  31928. if res != nil && res.StatusCode == http.StatusNotModified {
  31929. if res.Body != nil {
  31930. res.Body.Close()
  31931. }
  31932. return nil, &googleapi.Error{
  31933. Code: res.StatusCode,
  31934. Header: res.Header,
  31935. }
  31936. }
  31937. if err != nil {
  31938. return nil, err
  31939. }
  31940. defer googleapi.CloseBody(res)
  31941. if err := googleapi.CheckResponse(res); err != nil {
  31942. return nil, err
  31943. }
  31944. ret := &Operation{
  31945. ServerResponse: googleapi.ServerResponse{
  31946. Header: res.Header,
  31947. HTTPStatusCode: res.StatusCode,
  31948. },
  31949. }
  31950. target := &ret
  31951. if err := gensupport.DecodeResponse(target, res); err != nil {
  31952. return nil, err
  31953. }
  31954. return ret, nil
  31955. // {
  31956. // "description": "Creates a new allocation.",
  31957. // "httpMethod": "POST",
  31958. // "id": "compute.allocations.insert",
  31959. // "parameterOrder": [
  31960. // "project",
  31961. // "zone"
  31962. // ],
  31963. // "parameters": {
  31964. // "project": {
  31965. // "description": "Project ID for this request.",
  31966. // "location": "path",
  31967. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31968. // "required": true,
  31969. // "type": "string"
  31970. // },
  31971. // "requestId": {
  31972. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31973. // "location": "query",
  31974. // "type": "string"
  31975. // },
  31976. // "zone": {
  31977. // "description": "Name of the zone for this request.",
  31978. // "location": "path",
  31979. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31980. // "required": true,
  31981. // "type": "string"
  31982. // }
  31983. // },
  31984. // "path": "{project}/zones/{zone}/allocations",
  31985. // "request": {
  31986. // "$ref": "Allocation"
  31987. // },
  31988. // "response": {
  31989. // "$ref": "Operation"
  31990. // },
  31991. // "scopes": [
  31992. // "https://www.googleapis.com/auth/cloud-platform",
  31993. // "https://www.googleapis.com/auth/compute"
  31994. // ]
  31995. // }
  31996. }
  31997. // method id "compute.allocations.list":
  31998. type AllocationsListCall struct {
  31999. s *Service
  32000. project string
  32001. zone string
  32002. urlParams_ gensupport.URLParams
  32003. ifNoneMatch_ string
  32004. ctx_ context.Context
  32005. header_ http.Header
  32006. }
  32007. // List: A list all the allocations that have been configured for the
  32008. // specified project in specified zone.
  32009. func (r *AllocationsService) List(project string, zone string) *AllocationsListCall {
  32010. c := &AllocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32011. c.project = project
  32012. c.zone = zone
  32013. return c
  32014. }
  32015. // Filter sets the optional parameter "filter": A filter expression that
  32016. // filters resources listed in the response. The expression must specify
  32017. // the field name, a comparison operator, and the value that you want to
  32018. // use for filtering. The value must be a string, a number, or a
  32019. // boolean. The comparison operator must be either =, !=, >, or <.
  32020. //
  32021. // For example, if you are filtering Compute Engine instances, you can
  32022. // exclude instances named example-instance by specifying name !=
  32023. // example-instance.
  32024. //
  32025. // You can also filter nested fields. For example, you could specify
  32026. // scheduling.automaticRestart = false to include instances only if they
  32027. // are not scheduled for automatic restarts. You can use filtering on
  32028. // nested fields to filter based on resource labels.
  32029. //
  32030. // To filter on multiple expressions, provide each separate expression
  32031. // within parentheses. For example, (scheduling.automaticRestart = true)
  32032. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32033. // AND expression. However, you can include AND and OR expressions
  32034. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32035. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32036. // true).
  32037. func (c *AllocationsListCall) Filter(filter string) *AllocationsListCall {
  32038. c.urlParams_.Set("filter", filter)
  32039. return c
  32040. }
  32041. // MaxResults sets the optional parameter "maxResults": The maximum
  32042. // number of results per page that should be returned. If the number of
  32043. // available results is larger than maxResults, Compute Engine returns a
  32044. // nextPageToken that can be used to get the next page of results in
  32045. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32046. // (Default: 500)
  32047. func (c *AllocationsListCall) MaxResults(maxResults int64) *AllocationsListCall {
  32048. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32049. return c
  32050. }
  32051. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32052. // a certain order. By default, results are returned in alphanumerical
  32053. // order based on the resource name.
  32054. //
  32055. // You can also sort results in descending order based on the creation
  32056. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32057. // based on the creationTimestamp field in reverse chronological order
  32058. // (newest result first). Use this to sort resources like operations so
  32059. // that the newest operation is returned first.
  32060. //
  32061. // Currently, only sorting by name or creationTimestamp desc is
  32062. // supported.
  32063. func (c *AllocationsListCall) OrderBy(orderBy string) *AllocationsListCall {
  32064. c.urlParams_.Set("orderBy", orderBy)
  32065. return c
  32066. }
  32067. // PageToken sets the optional parameter "pageToken": Specifies a page
  32068. // token to use. Set pageToken to the nextPageToken returned by a
  32069. // previous list request to get the next page of results.
  32070. func (c *AllocationsListCall) PageToken(pageToken string) *AllocationsListCall {
  32071. c.urlParams_.Set("pageToken", pageToken)
  32072. return c
  32073. }
  32074. // Fields allows partial responses to be retrieved. See
  32075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32076. // for more information.
  32077. func (c *AllocationsListCall) Fields(s ...googleapi.Field) *AllocationsListCall {
  32078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32079. return c
  32080. }
  32081. // IfNoneMatch sets the optional parameter which makes the operation
  32082. // fail if the object's ETag matches the given value. This is useful for
  32083. // getting updates only after the object has changed since the last
  32084. // request. Use googleapi.IsNotModified to check whether the response
  32085. // error from Do is the result of In-None-Match.
  32086. func (c *AllocationsListCall) IfNoneMatch(entityTag string) *AllocationsListCall {
  32087. c.ifNoneMatch_ = entityTag
  32088. return c
  32089. }
  32090. // Context sets the context to be used in this call's Do method. Any
  32091. // pending HTTP request will be aborted if the provided context is
  32092. // canceled.
  32093. func (c *AllocationsListCall) Context(ctx context.Context) *AllocationsListCall {
  32094. c.ctx_ = ctx
  32095. return c
  32096. }
  32097. // Header returns an http.Header that can be modified by the caller to
  32098. // add HTTP headers to the request.
  32099. func (c *AllocationsListCall) Header() http.Header {
  32100. if c.header_ == nil {
  32101. c.header_ = make(http.Header)
  32102. }
  32103. return c.header_
  32104. }
  32105. func (c *AllocationsListCall) doRequest(alt string) (*http.Response, error) {
  32106. reqHeaders := make(http.Header)
  32107. for k, v := range c.header_ {
  32108. reqHeaders[k] = v
  32109. }
  32110. reqHeaders.Set("User-Agent", c.s.userAgent())
  32111. if c.ifNoneMatch_ != "" {
  32112. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32113. }
  32114. var body io.Reader = nil
  32115. c.urlParams_.Set("alt", alt)
  32116. c.urlParams_.Set("prettyPrint", "false")
  32117. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  32118. urls += "?" + c.urlParams_.Encode()
  32119. req, err := http.NewRequest("GET", urls, body)
  32120. if err != nil {
  32121. return nil, err
  32122. }
  32123. req.Header = reqHeaders
  32124. googleapi.Expand(req.URL, map[string]string{
  32125. "project": c.project,
  32126. "zone": c.zone,
  32127. })
  32128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32129. }
  32130. // Do executes the "compute.allocations.list" call.
  32131. // Exactly one of *AllocationList or error will be non-nil. Any non-2xx
  32132. // status code is an error. Response headers are in either
  32133. // *AllocationList.ServerResponse.Header or (if a response was returned
  32134. // at all) in error.(*googleapi.Error).Header. Use
  32135. // googleapi.IsNotModified to check whether the returned error was
  32136. // because http.StatusNotModified was returned.
  32137. func (c *AllocationsListCall) Do(opts ...googleapi.CallOption) (*AllocationList, error) {
  32138. gensupport.SetOptions(c.urlParams_, opts...)
  32139. res, err := c.doRequest("json")
  32140. if res != nil && res.StatusCode == http.StatusNotModified {
  32141. if res.Body != nil {
  32142. res.Body.Close()
  32143. }
  32144. return nil, &googleapi.Error{
  32145. Code: res.StatusCode,
  32146. Header: res.Header,
  32147. }
  32148. }
  32149. if err != nil {
  32150. return nil, err
  32151. }
  32152. defer googleapi.CloseBody(res)
  32153. if err := googleapi.CheckResponse(res); err != nil {
  32154. return nil, err
  32155. }
  32156. ret := &AllocationList{
  32157. ServerResponse: googleapi.ServerResponse{
  32158. Header: res.Header,
  32159. HTTPStatusCode: res.StatusCode,
  32160. },
  32161. }
  32162. target := &ret
  32163. if err := gensupport.DecodeResponse(target, res); err != nil {
  32164. return nil, err
  32165. }
  32166. return ret, nil
  32167. // {
  32168. // "description": "A list all the allocations that have been configured for the specified project in specified zone.",
  32169. // "httpMethod": "GET",
  32170. // "id": "compute.allocations.list",
  32171. // "parameterOrder": [
  32172. // "project",
  32173. // "zone"
  32174. // ],
  32175. // "parameters": {
  32176. // "filter": {
  32177. // "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).",
  32178. // "location": "query",
  32179. // "type": "string"
  32180. // },
  32181. // "maxResults": {
  32182. // "default": "500",
  32183. // "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)",
  32184. // "format": "uint32",
  32185. // "location": "query",
  32186. // "minimum": "0",
  32187. // "type": "integer"
  32188. // },
  32189. // "orderBy": {
  32190. // "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.",
  32191. // "location": "query",
  32192. // "type": "string"
  32193. // },
  32194. // "pageToken": {
  32195. // "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.",
  32196. // "location": "query",
  32197. // "type": "string"
  32198. // },
  32199. // "project": {
  32200. // "description": "Project ID for this request.",
  32201. // "location": "path",
  32202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32203. // "required": true,
  32204. // "type": "string"
  32205. // },
  32206. // "zone": {
  32207. // "description": "Name of the zone for this request.",
  32208. // "location": "path",
  32209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32210. // "required": true,
  32211. // "type": "string"
  32212. // }
  32213. // },
  32214. // "path": "{project}/zones/{zone}/allocations",
  32215. // "response": {
  32216. // "$ref": "AllocationList"
  32217. // },
  32218. // "scopes": [
  32219. // "https://www.googleapis.com/auth/cloud-platform",
  32220. // "https://www.googleapis.com/auth/compute",
  32221. // "https://www.googleapis.com/auth/compute.readonly"
  32222. // ]
  32223. // }
  32224. }
  32225. // Pages invokes f for each page of results.
  32226. // A non-nil error returned from f will halt the iteration.
  32227. // The provided context supersedes any context provided to the Context method.
  32228. func (c *AllocationsListCall) Pages(ctx context.Context, f func(*AllocationList) error) error {
  32229. c.ctx_ = ctx
  32230. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32231. for {
  32232. x, err := c.Do()
  32233. if err != nil {
  32234. return err
  32235. }
  32236. if err := f(x); err != nil {
  32237. return err
  32238. }
  32239. if x.NextPageToken == "" {
  32240. return nil
  32241. }
  32242. c.PageToken(x.NextPageToken)
  32243. }
  32244. }
  32245. // method id "compute.allocations.setIamPolicy":
  32246. type AllocationsSetIamPolicyCall struct {
  32247. s *Service
  32248. project string
  32249. zone string
  32250. resource string
  32251. zonesetpolicyrequest *ZoneSetPolicyRequest
  32252. urlParams_ gensupport.URLParams
  32253. ctx_ context.Context
  32254. header_ http.Header
  32255. }
  32256. // SetIamPolicy: Sets the access control policy on the specified
  32257. // resource. Replaces any existing policy.
  32258. func (r *AllocationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *AllocationsSetIamPolicyCall {
  32259. c := &AllocationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32260. c.project = project
  32261. c.zone = zone
  32262. c.resource = resource
  32263. c.zonesetpolicyrequest = zonesetpolicyrequest
  32264. return c
  32265. }
  32266. // Fields allows partial responses to be retrieved. See
  32267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32268. // for more information.
  32269. func (c *AllocationsSetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsSetIamPolicyCall {
  32270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32271. return c
  32272. }
  32273. // Context sets the context to be used in this call's Do method. Any
  32274. // pending HTTP request will be aborted if the provided context is
  32275. // canceled.
  32276. func (c *AllocationsSetIamPolicyCall) Context(ctx context.Context) *AllocationsSetIamPolicyCall {
  32277. c.ctx_ = ctx
  32278. return c
  32279. }
  32280. // Header returns an http.Header that can be modified by the caller to
  32281. // add HTTP headers to the request.
  32282. func (c *AllocationsSetIamPolicyCall) Header() http.Header {
  32283. if c.header_ == nil {
  32284. c.header_ = make(http.Header)
  32285. }
  32286. return c.header_
  32287. }
  32288. func (c *AllocationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  32289. reqHeaders := make(http.Header)
  32290. for k, v := range c.header_ {
  32291. reqHeaders[k] = v
  32292. }
  32293. reqHeaders.Set("User-Agent", c.s.userAgent())
  32294. var body io.Reader = nil
  32295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  32296. if err != nil {
  32297. return nil, err
  32298. }
  32299. reqHeaders.Set("Content-Type", "application/json")
  32300. c.urlParams_.Set("alt", alt)
  32301. c.urlParams_.Set("prettyPrint", "false")
  32302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/setIamPolicy")
  32303. urls += "?" + c.urlParams_.Encode()
  32304. req, err := http.NewRequest("POST", urls, body)
  32305. if err != nil {
  32306. return nil, err
  32307. }
  32308. req.Header = reqHeaders
  32309. googleapi.Expand(req.URL, map[string]string{
  32310. "project": c.project,
  32311. "zone": c.zone,
  32312. "resource": c.resource,
  32313. })
  32314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32315. }
  32316. // Do executes the "compute.allocations.setIamPolicy" call.
  32317. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  32318. // code is an error. Response headers are in either
  32319. // *Policy.ServerResponse.Header or (if a response was returned at all)
  32320. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  32321. // check whether the returned error was because http.StatusNotModified
  32322. // was returned.
  32323. func (c *AllocationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  32324. gensupport.SetOptions(c.urlParams_, opts...)
  32325. res, err := c.doRequest("json")
  32326. if res != nil && res.StatusCode == http.StatusNotModified {
  32327. if res.Body != nil {
  32328. res.Body.Close()
  32329. }
  32330. return nil, &googleapi.Error{
  32331. Code: res.StatusCode,
  32332. Header: res.Header,
  32333. }
  32334. }
  32335. if err != nil {
  32336. return nil, err
  32337. }
  32338. defer googleapi.CloseBody(res)
  32339. if err := googleapi.CheckResponse(res); err != nil {
  32340. return nil, err
  32341. }
  32342. ret := &Policy{
  32343. ServerResponse: googleapi.ServerResponse{
  32344. Header: res.Header,
  32345. HTTPStatusCode: res.StatusCode,
  32346. },
  32347. }
  32348. target := &ret
  32349. if err := gensupport.DecodeResponse(target, res); err != nil {
  32350. return nil, err
  32351. }
  32352. return ret, nil
  32353. // {
  32354. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  32355. // "httpMethod": "POST",
  32356. // "id": "compute.allocations.setIamPolicy",
  32357. // "parameterOrder": [
  32358. // "project",
  32359. // "zone",
  32360. // "resource"
  32361. // ],
  32362. // "parameters": {
  32363. // "project": {
  32364. // "description": "Project ID for this request.",
  32365. // "location": "path",
  32366. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32367. // "required": true,
  32368. // "type": "string"
  32369. // },
  32370. // "resource": {
  32371. // "description": "Name or id of the resource for this request.",
  32372. // "location": "path",
  32373. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32374. // "required": true,
  32375. // "type": "string"
  32376. // },
  32377. // "zone": {
  32378. // "description": "The name of the zone for this request.",
  32379. // "location": "path",
  32380. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32381. // "required": true,
  32382. // "type": "string"
  32383. // }
  32384. // },
  32385. // "path": "{project}/zones/{zone}/allocations/{resource}/setIamPolicy",
  32386. // "request": {
  32387. // "$ref": "ZoneSetPolicyRequest"
  32388. // },
  32389. // "response": {
  32390. // "$ref": "Policy"
  32391. // },
  32392. // "scopes": [
  32393. // "https://www.googleapis.com/auth/cloud-platform",
  32394. // "https://www.googleapis.com/auth/compute"
  32395. // ]
  32396. // }
  32397. }
  32398. // method id "compute.allocations.testIamPermissions":
  32399. type AllocationsTestIamPermissionsCall struct {
  32400. s *Service
  32401. project string
  32402. zone string
  32403. resource string
  32404. testpermissionsrequest *TestPermissionsRequest
  32405. urlParams_ gensupport.URLParams
  32406. ctx_ context.Context
  32407. header_ http.Header
  32408. }
  32409. // TestIamPermissions: Returns permissions that a caller has on the
  32410. // specified resource.
  32411. func (r *AllocationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AllocationsTestIamPermissionsCall {
  32412. c := &AllocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32413. c.project = project
  32414. c.zone = zone
  32415. c.resource = resource
  32416. c.testpermissionsrequest = testpermissionsrequest
  32417. return c
  32418. }
  32419. // Fields allows partial responses to be retrieved. See
  32420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32421. // for more information.
  32422. func (c *AllocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *AllocationsTestIamPermissionsCall {
  32423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32424. return c
  32425. }
  32426. // Context sets the context to be used in this call's Do method. Any
  32427. // pending HTTP request will be aborted if the provided context is
  32428. // canceled.
  32429. func (c *AllocationsTestIamPermissionsCall) Context(ctx context.Context) *AllocationsTestIamPermissionsCall {
  32430. c.ctx_ = ctx
  32431. return c
  32432. }
  32433. // Header returns an http.Header that can be modified by the caller to
  32434. // add HTTP headers to the request.
  32435. func (c *AllocationsTestIamPermissionsCall) Header() http.Header {
  32436. if c.header_ == nil {
  32437. c.header_ = make(http.Header)
  32438. }
  32439. return c.header_
  32440. }
  32441. func (c *AllocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  32442. reqHeaders := make(http.Header)
  32443. for k, v := range c.header_ {
  32444. reqHeaders[k] = v
  32445. }
  32446. reqHeaders.Set("User-Agent", c.s.userAgent())
  32447. var body io.Reader = nil
  32448. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  32449. if err != nil {
  32450. return nil, err
  32451. }
  32452. reqHeaders.Set("Content-Type", "application/json")
  32453. c.urlParams_.Set("alt", alt)
  32454. c.urlParams_.Set("prettyPrint", "false")
  32455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/testIamPermissions")
  32456. urls += "?" + c.urlParams_.Encode()
  32457. req, err := http.NewRequest("POST", urls, body)
  32458. if err != nil {
  32459. return nil, err
  32460. }
  32461. req.Header = reqHeaders
  32462. googleapi.Expand(req.URL, map[string]string{
  32463. "project": c.project,
  32464. "zone": c.zone,
  32465. "resource": c.resource,
  32466. })
  32467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32468. }
  32469. // Do executes the "compute.allocations.testIamPermissions" call.
  32470. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  32471. // non-2xx status code is an error. Response headers are in either
  32472. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  32473. // returned at all) in error.(*googleapi.Error).Header. Use
  32474. // googleapi.IsNotModified to check whether the returned error was
  32475. // because http.StatusNotModified was returned.
  32476. func (c *AllocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  32477. gensupport.SetOptions(c.urlParams_, opts...)
  32478. res, err := c.doRequest("json")
  32479. if res != nil && res.StatusCode == http.StatusNotModified {
  32480. if res.Body != nil {
  32481. res.Body.Close()
  32482. }
  32483. return nil, &googleapi.Error{
  32484. Code: res.StatusCode,
  32485. Header: res.Header,
  32486. }
  32487. }
  32488. if err != nil {
  32489. return nil, err
  32490. }
  32491. defer googleapi.CloseBody(res)
  32492. if err := googleapi.CheckResponse(res); err != nil {
  32493. return nil, err
  32494. }
  32495. ret := &TestPermissionsResponse{
  32496. ServerResponse: googleapi.ServerResponse{
  32497. Header: res.Header,
  32498. HTTPStatusCode: res.StatusCode,
  32499. },
  32500. }
  32501. target := &ret
  32502. if err := gensupport.DecodeResponse(target, res); err != nil {
  32503. return nil, err
  32504. }
  32505. return ret, nil
  32506. // {
  32507. // "description": "Returns permissions that a caller has on the specified resource.",
  32508. // "httpMethod": "POST",
  32509. // "id": "compute.allocations.testIamPermissions",
  32510. // "parameterOrder": [
  32511. // "project",
  32512. // "zone",
  32513. // "resource"
  32514. // ],
  32515. // "parameters": {
  32516. // "project": {
  32517. // "description": "Project ID for this request.",
  32518. // "location": "path",
  32519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32520. // "required": true,
  32521. // "type": "string"
  32522. // },
  32523. // "resource": {
  32524. // "description": "Name or id of the resource for this request.",
  32525. // "location": "path",
  32526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32527. // "required": true,
  32528. // "type": "string"
  32529. // },
  32530. // "zone": {
  32531. // "description": "The name of the zone for this request.",
  32532. // "location": "path",
  32533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32534. // "required": true,
  32535. // "type": "string"
  32536. // }
  32537. // },
  32538. // "path": "{project}/zones/{zone}/allocations/{resource}/testIamPermissions",
  32539. // "request": {
  32540. // "$ref": "TestPermissionsRequest"
  32541. // },
  32542. // "response": {
  32543. // "$ref": "TestPermissionsResponse"
  32544. // },
  32545. // "scopes": [
  32546. // "https://www.googleapis.com/auth/cloud-platform",
  32547. // "https://www.googleapis.com/auth/compute",
  32548. // "https://www.googleapis.com/auth/compute.readonly"
  32549. // ]
  32550. // }
  32551. }
  32552. // method id "compute.autoscalers.aggregatedList":
  32553. type AutoscalersAggregatedListCall struct {
  32554. s *Service
  32555. project string
  32556. urlParams_ gensupport.URLParams
  32557. ifNoneMatch_ string
  32558. ctx_ context.Context
  32559. header_ http.Header
  32560. }
  32561. // AggregatedList: Retrieves an aggregated list of autoscalers.
  32562. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  32563. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32564. c.project = project
  32565. return c
  32566. }
  32567. // Filter sets the optional parameter "filter": A filter expression that
  32568. // filters resources listed in the response. The expression must specify
  32569. // the field name, a comparison operator, and the value that you want to
  32570. // use for filtering. The value must be a string, a number, or a
  32571. // boolean. The comparison operator must be either =, !=, >, or <.
  32572. //
  32573. // For example, if you are filtering Compute Engine instances, you can
  32574. // exclude instances named example-instance by specifying name !=
  32575. // example-instance.
  32576. //
  32577. // You can also filter nested fields. For example, you could specify
  32578. // scheduling.automaticRestart = false to include instances only if they
  32579. // are not scheduled for automatic restarts. You can use filtering on
  32580. // nested fields to filter based on resource labels.
  32581. //
  32582. // To filter on multiple expressions, provide each separate expression
  32583. // within parentheses. For example, (scheduling.automaticRestart = true)
  32584. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32585. // AND expression. However, you can include AND and OR expressions
  32586. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32587. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32588. // true).
  32589. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  32590. c.urlParams_.Set("filter", filter)
  32591. return c
  32592. }
  32593. // MaxResults sets the optional parameter "maxResults": The maximum
  32594. // number of results per page that should be returned. If the number of
  32595. // available results is larger than maxResults, Compute Engine returns a
  32596. // nextPageToken that can be used to get the next page of results in
  32597. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32598. // (Default: 500)
  32599. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  32600. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32601. return c
  32602. }
  32603. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32604. // a certain order. By default, results are returned in alphanumerical
  32605. // order based on the resource name.
  32606. //
  32607. // You can also sort results in descending order based on the creation
  32608. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32609. // based on the creationTimestamp field in reverse chronological order
  32610. // (newest result first). Use this to sort resources like operations so
  32611. // that the newest operation is returned first.
  32612. //
  32613. // Currently, only sorting by name or creationTimestamp desc is
  32614. // supported.
  32615. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  32616. c.urlParams_.Set("orderBy", orderBy)
  32617. return c
  32618. }
  32619. // PageToken sets the optional parameter "pageToken": Specifies a page
  32620. // token to use. Set pageToken to the nextPageToken returned by a
  32621. // previous list request to get the next page of results.
  32622. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  32623. c.urlParams_.Set("pageToken", pageToken)
  32624. return c
  32625. }
  32626. // Fields allows partial responses to be retrieved. See
  32627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32628. // for more information.
  32629. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  32630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32631. return c
  32632. }
  32633. // IfNoneMatch sets the optional parameter which makes the operation
  32634. // fail if the object's ETag matches the given value. This is useful for
  32635. // getting updates only after the object has changed since the last
  32636. // request. Use googleapi.IsNotModified to check whether the response
  32637. // error from Do is the result of In-None-Match.
  32638. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  32639. c.ifNoneMatch_ = entityTag
  32640. return c
  32641. }
  32642. // Context sets the context to be used in this call's Do method. Any
  32643. // pending HTTP request will be aborted if the provided context is
  32644. // canceled.
  32645. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  32646. c.ctx_ = ctx
  32647. return c
  32648. }
  32649. // Header returns an http.Header that can be modified by the caller to
  32650. // add HTTP headers to the request.
  32651. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  32652. if c.header_ == nil {
  32653. c.header_ = make(http.Header)
  32654. }
  32655. return c.header_
  32656. }
  32657. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32658. reqHeaders := make(http.Header)
  32659. for k, v := range c.header_ {
  32660. reqHeaders[k] = v
  32661. }
  32662. reqHeaders.Set("User-Agent", c.s.userAgent())
  32663. if c.ifNoneMatch_ != "" {
  32664. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32665. }
  32666. var body io.Reader = nil
  32667. c.urlParams_.Set("alt", alt)
  32668. c.urlParams_.Set("prettyPrint", "false")
  32669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  32670. urls += "?" + c.urlParams_.Encode()
  32671. req, err := http.NewRequest("GET", urls, body)
  32672. if err != nil {
  32673. return nil, err
  32674. }
  32675. req.Header = reqHeaders
  32676. googleapi.Expand(req.URL, map[string]string{
  32677. "project": c.project,
  32678. })
  32679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32680. }
  32681. // Do executes the "compute.autoscalers.aggregatedList" call.
  32682. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  32683. // Any non-2xx status code is an error. Response headers are in either
  32684. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  32685. // returned at all) in error.(*googleapi.Error).Header. Use
  32686. // googleapi.IsNotModified to check whether the returned error was
  32687. // because http.StatusNotModified was returned.
  32688. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  32689. gensupport.SetOptions(c.urlParams_, opts...)
  32690. res, err := c.doRequest("json")
  32691. if res != nil && res.StatusCode == http.StatusNotModified {
  32692. if res.Body != nil {
  32693. res.Body.Close()
  32694. }
  32695. return nil, &googleapi.Error{
  32696. Code: res.StatusCode,
  32697. Header: res.Header,
  32698. }
  32699. }
  32700. if err != nil {
  32701. return nil, err
  32702. }
  32703. defer googleapi.CloseBody(res)
  32704. if err := googleapi.CheckResponse(res); err != nil {
  32705. return nil, err
  32706. }
  32707. ret := &AutoscalerAggregatedList{
  32708. ServerResponse: googleapi.ServerResponse{
  32709. Header: res.Header,
  32710. HTTPStatusCode: res.StatusCode,
  32711. },
  32712. }
  32713. target := &ret
  32714. if err := gensupport.DecodeResponse(target, res); err != nil {
  32715. return nil, err
  32716. }
  32717. return ret, nil
  32718. // {
  32719. // "description": "Retrieves an aggregated list of autoscalers.",
  32720. // "httpMethod": "GET",
  32721. // "id": "compute.autoscalers.aggregatedList",
  32722. // "parameterOrder": [
  32723. // "project"
  32724. // ],
  32725. // "parameters": {
  32726. // "filter": {
  32727. // "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).",
  32728. // "location": "query",
  32729. // "type": "string"
  32730. // },
  32731. // "maxResults": {
  32732. // "default": "500",
  32733. // "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)",
  32734. // "format": "uint32",
  32735. // "location": "query",
  32736. // "minimum": "0",
  32737. // "type": "integer"
  32738. // },
  32739. // "orderBy": {
  32740. // "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.",
  32741. // "location": "query",
  32742. // "type": "string"
  32743. // },
  32744. // "pageToken": {
  32745. // "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.",
  32746. // "location": "query",
  32747. // "type": "string"
  32748. // },
  32749. // "project": {
  32750. // "description": "Project ID for this request.",
  32751. // "location": "path",
  32752. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32753. // "required": true,
  32754. // "type": "string"
  32755. // }
  32756. // },
  32757. // "path": "{project}/aggregated/autoscalers",
  32758. // "response": {
  32759. // "$ref": "AutoscalerAggregatedList"
  32760. // },
  32761. // "scopes": [
  32762. // "https://www.googleapis.com/auth/cloud-platform",
  32763. // "https://www.googleapis.com/auth/compute",
  32764. // "https://www.googleapis.com/auth/compute.readonly"
  32765. // ]
  32766. // }
  32767. }
  32768. // Pages invokes f for each page of results.
  32769. // A non-nil error returned from f will halt the iteration.
  32770. // The provided context supersedes any context provided to the Context method.
  32771. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  32772. c.ctx_ = ctx
  32773. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32774. for {
  32775. x, err := c.Do()
  32776. if err != nil {
  32777. return err
  32778. }
  32779. if err := f(x); err != nil {
  32780. return err
  32781. }
  32782. if x.NextPageToken == "" {
  32783. return nil
  32784. }
  32785. c.PageToken(x.NextPageToken)
  32786. }
  32787. }
  32788. // method id "compute.autoscalers.delete":
  32789. type AutoscalersDeleteCall struct {
  32790. s *Service
  32791. project string
  32792. zone string
  32793. autoscaler string
  32794. urlParams_ gensupport.URLParams
  32795. ctx_ context.Context
  32796. header_ http.Header
  32797. }
  32798. // Delete: Deletes the specified autoscaler.
  32799. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  32800. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32801. c.project = project
  32802. c.zone = zone
  32803. c.autoscaler = autoscaler
  32804. return c
  32805. }
  32806. // RequestId sets the optional parameter "requestId": An optional
  32807. // request ID to identify requests. Specify a unique request ID so that
  32808. // if you must retry your request, the server will know to ignore the
  32809. // request if it has already been completed.
  32810. //
  32811. // For example, consider a situation where you make an initial request
  32812. // and the request times out. If you make the request again with the
  32813. // same request ID, the server can check if original operation with the
  32814. // same request ID was received, and if so, will ignore the second
  32815. // request. This prevents clients from accidentally creating duplicate
  32816. // commitments.
  32817. //
  32818. // The request ID must be a valid UUID with the exception that zero UUID
  32819. // is not supported (00000000-0000-0000-0000-000000000000).
  32820. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  32821. c.urlParams_.Set("requestId", requestId)
  32822. return c
  32823. }
  32824. // Fields allows partial responses to be retrieved. See
  32825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32826. // for more information.
  32827. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  32828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32829. return c
  32830. }
  32831. // Context sets the context to be used in this call's Do method. Any
  32832. // pending HTTP request will be aborted if the provided context is
  32833. // canceled.
  32834. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  32835. c.ctx_ = ctx
  32836. return c
  32837. }
  32838. // Header returns an http.Header that can be modified by the caller to
  32839. // add HTTP headers to the request.
  32840. func (c *AutoscalersDeleteCall) Header() http.Header {
  32841. if c.header_ == nil {
  32842. c.header_ = make(http.Header)
  32843. }
  32844. return c.header_
  32845. }
  32846. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  32847. reqHeaders := make(http.Header)
  32848. for k, v := range c.header_ {
  32849. reqHeaders[k] = v
  32850. }
  32851. reqHeaders.Set("User-Agent", c.s.userAgent())
  32852. var body io.Reader = nil
  32853. c.urlParams_.Set("alt", alt)
  32854. c.urlParams_.Set("prettyPrint", "false")
  32855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  32856. urls += "?" + c.urlParams_.Encode()
  32857. req, err := http.NewRequest("DELETE", urls, body)
  32858. if err != nil {
  32859. return nil, err
  32860. }
  32861. req.Header = reqHeaders
  32862. googleapi.Expand(req.URL, map[string]string{
  32863. "project": c.project,
  32864. "zone": c.zone,
  32865. "autoscaler": c.autoscaler,
  32866. })
  32867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32868. }
  32869. // Do executes the "compute.autoscalers.delete" call.
  32870. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32871. // status code is an error. Response headers are in either
  32872. // *Operation.ServerResponse.Header or (if a response was returned at
  32873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32874. // to check whether the returned error was because
  32875. // http.StatusNotModified was returned.
  32876. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32877. gensupport.SetOptions(c.urlParams_, opts...)
  32878. res, err := c.doRequest("json")
  32879. if res != nil && res.StatusCode == http.StatusNotModified {
  32880. if res.Body != nil {
  32881. res.Body.Close()
  32882. }
  32883. return nil, &googleapi.Error{
  32884. Code: res.StatusCode,
  32885. Header: res.Header,
  32886. }
  32887. }
  32888. if err != nil {
  32889. return nil, err
  32890. }
  32891. defer googleapi.CloseBody(res)
  32892. if err := googleapi.CheckResponse(res); err != nil {
  32893. return nil, err
  32894. }
  32895. ret := &Operation{
  32896. ServerResponse: googleapi.ServerResponse{
  32897. Header: res.Header,
  32898. HTTPStatusCode: res.StatusCode,
  32899. },
  32900. }
  32901. target := &ret
  32902. if err := gensupport.DecodeResponse(target, res); err != nil {
  32903. return nil, err
  32904. }
  32905. return ret, nil
  32906. // {
  32907. // "description": "Deletes the specified autoscaler.",
  32908. // "httpMethod": "DELETE",
  32909. // "id": "compute.autoscalers.delete",
  32910. // "parameterOrder": [
  32911. // "project",
  32912. // "zone",
  32913. // "autoscaler"
  32914. // ],
  32915. // "parameters": {
  32916. // "autoscaler": {
  32917. // "description": "Name of the autoscaler to delete.",
  32918. // "location": "path",
  32919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32920. // "required": true,
  32921. // "type": "string"
  32922. // },
  32923. // "project": {
  32924. // "description": "Project ID for this request.",
  32925. // "location": "path",
  32926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32927. // "required": true,
  32928. // "type": "string"
  32929. // },
  32930. // "requestId": {
  32931. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32932. // "location": "query",
  32933. // "type": "string"
  32934. // },
  32935. // "zone": {
  32936. // "description": "Name of the zone for this request.",
  32937. // "location": "path",
  32938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32939. // "required": true,
  32940. // "type": "string"
  32941. // }
  32942. // },
  32943. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  32944. // "response": {
  32945. // "$ref": "Operation"
  32946. // },
  32947. // "scopes": [
  32948. // "https://www.googleapis.com/auth/cloud-platform",
  32949. // "https://www.googleapis.com/auth/compute"
  32950. // ]
  32951. // }
  32952. }
  32953. // method id "compute.autoscalers.get":
  32954. type AutoscalersGetCall struct {
  32955. s *Service
  32956. project string
  32957. zone string
  32958. autoscaler string
  32959. urlParams_ gensupport.URLParams
  32960. ifNoneMatch_ string
  32961. ctx_ context.Context
  32962. header_ http.Header
  32963. }
  32964. // Get: Returns the specified autoscaler resource. Gets a list of
  32965. // available autoscalers by making a list() request.
  32966. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  32967. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32968. c.project = project
  32969. c.zone = zone
  32970. c.autoscaler = autoscaler
  32971. return c
  32972. }
  32973. // Fields allows partial responses to be retrieved. See
  32974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32975. // for more information.
  32976. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  32977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32978. return c
  32979. }
  32980. // IfNoneMatch sets the optional parameter which makes the operation
  32981. // fail if the object's ETag matches the given value. This is useful for
  32982. // getting updates only after the object has changed since the last
  32983. // request. Use googleapi.IsNotModified to check whether the response
  32984. // error from Do is the result of In-None-Match.
  32985. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  32986. c.ifNoneMatch_ = entityTag
  32987. return c
  32988. }
  32989. // Context sets the context to be used in this call's Do method. Any
  32990. // pending HTTP request will be aborted if the provided context is
  32991. // canceled.
  32992. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  32993. c.ctx_ = ctx
  32994. return c
  32995. }
  32996. // Header returns an http.Header that can be modified by the caller to
  32997. // add HTTP headers to the request.
  32998. func (c *AutoscalersGetCall) Header() http.Header {
  32999. if c.header_ == nil {
  33000. c.header_ = make(http.Header)
  33001. }
  33002. return c.header_
  33003. }
  33004. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  33005. reqHeaders := make(http.Header)
  33006. for k, v := range c.header_ {
  33007. reqHeaders[k] = v
  33008. }
  33009. reqHeaders.Set("User-Agent", c.s.userAgent())
  33010. if c.ifNoneMatch_ != "" {
  33011. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33012. }
  33013. var body io.Reader = nil
  33014. c.urlParams_.Set("alt", alt)
  33015. c.urlParams_.Set("prettyPrint", "false")
  33016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  33017. urls += "?" + c.urlParams_.Encode()
  33018. req, err := http.NewRequest("GET", urls, body)
  33019. if err != nil {
  33020. return nil, err
  33021. }
  33022. req.Header = reqHeaders
  33023. googleapi.Expand(req.URL, map[string]string{
  33024. "project": c.project,
  33025. "zone": c.zone,
  33026. "autoscaler": c.autoscaler,
  33027. })
  33028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33029. }
  33030. // Do executes the "compute.autoscalers.get" call.
  33031. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  33032. // status code is an error. Response headers are in either
  33033. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  33034. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33035. // to check whether the returned error was because
  33036. // http.StatusNotModified was returned.
  33037. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  33038. gensupport.SetOptions(c.urlParams_, opts...)
  33039. res, err := c.doRequest("json")
  33040. if res != nil && res.StatusCode == http.StatusNotModified {
  33041. if res.Body != nil {
  33042. res.Body.Close()
  33043. }
  33044. return nil, &googleapi.Error{
  33045. Code: res.StatusCode,
  33046. Header: res.Header,
  33047. }
  33048. }
  33049. if err != nil {
  33050. return nil, err
  33051. }
  33052. defer googleapi.CloseBody(res)
  33053. if err := googleapi.CheckResponse(res); err != nil {
  33054. return nil, err
  33055. }
  33056. ret := &Autoscaler{
  33057. ServerResponse: googleapi.ServerResponse{
  33058. Header: res.Header,
  33059. HTTPStatusCode: res.StatusCode,
  33060. },
  33061. }
  33062. target := &ret
  33063. if err := gensupport.DecodeResponse(target, res); err != nil {
  33064. return nil, err
  33065. }
  33066. return ret, nil
  33067. // {
  33068. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  33069. // "httpMethod": "GET",
  33070. // "id": "compute.autoscalers.get",
  33071. // "parameterOrder": [
  33072. // "project",
  33073. // "zone",
  33074. // "autoscaler"
  33075. // ],
  33076. // "parameters": {
  33077. // "autoscaler": {
  33078. // "description": "Name of the autoscaler to return.",
  33079. // "location": "path",
  33080. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33081. // "required": true,
  33082. // "type": "string"
  33083. // },
  33084. // "project": {
  33085. // "description": "Project ID for this request.",
  33086. // "location": "path",
  33087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33088. // "required": true,
  33089. // "type": "string"
  33090. // },
  33091. // "zone": {
  33092. // "description": "Name of the zone for this request.",
  33093. // "location": "path",
  33094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33095. // "required": true,
  33096. // "type": "string"
  33097. // }
  33098. // },
  33099. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  33100. // "response": {
  33101. // "$ref": "Autoscaler"
  33102. // },
  33103. // "scopes": [
  33104. // "https://www.googleapis.com/auth/cloud-platform",
  33105. // "https://www.googleapis.com/auth/compute",
  33106. // "https://www.googleapis.com/auth/compute.readonly"
  33107. // ]
  33108. // }
  33109. }
  33110. // method id "compute.autoscalers.insert":
  33111. type AutoscalersInsertCall struct {
  33112. s *Service
  33113. project string
  33114. zone string
  33115. autoscaler *Autoscaler
  33116. urlParams_ gensupport.URLParams
  33117. ctx_ context.Context
  33118. header_ http.Header
  33119. }
  33120. // Insert: Creates an autoscaler in the specified project using the data
  33121. // included in the request.
  33122. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  33123. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33124. c.project = project
  33125. c.zone = zone
  33126. c.autoscaler = autoscaler
  33127. return c
  33128. }
  33129. // RequestId sets the optional parameter "requestId": An optional
  33130. // request ID to identify requests. Specify a unique request ID so that
  33131. // if you must retry your request, the server will know to ignore the
  33132. // request if it has already been completed.
  33133. //
  33134. // For example, consider a situation where you make an initial request
  33135. // and the request times out. If you make the request again with the
  33136. // same request ID, the server can check if original operation with the
  33137. // same request ID was received, and if so, will ignore the second
  33138. // request. This prevents clients from accidentally creating duplicate
  33139. // commitments.
  33140. //
  33141. // The request ID must be a valid UUID with the exception that zero UUID
  33142. // is not supported (00000000-0000-0000-0000-000000000000).
  33143. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  33144. c.urlParams_.Set("requestId", requestId)
  33145. return c
  33146. }
  33147. // Fields allows partial responses to be retrieved. See
  33148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33149. // for more information.
  33150. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  33151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33152. return c
  33153. }
  33154. // Context sets the context to be used in this call's Do method. Any
  33155. // pending HTTP request will be aborted if the provided context is
  33156. // canceled.
  33157. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  33158. c.ctx_ = ctx
  33159. return c
  33160. }
  33161. // Header returns an http.Header that can be modified by the caller to
  33162. // add HTTP headers to the request.
  33163. func (c *AutoscalersInsertCall) Header() http.Header {
  33164. if c.header_ == nil {
  33165. c.header_ = make(http.Header)
  33166. }
  33167. return c.header_
  33168. }
  33169. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  33170. reqHeaders := make(http.Header)
  33171. for k, v := range c.header_ {
  33172. reqHeaders[k] = v
  33173. }
  33174. reqHeaders.Set("User-Agent", c.s.userAgent())
  33175. var body io.Reader = nil
  33176. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  33177. if err != nil {
  33178. return nil, err
  33179. }
  33180. reqHeaders.Set("Content-Type", "application/json")
  33181. c.urlParams_.Set("alt", alt)
  33182. c.urlParams_.Set("prettyPrint", "false")
  33183. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33184. urls += "?" + c.urlParams_.Encode()
  33185. req, err := http.NewRequest("POST", urls, body)
  33186. if err != nil {
  33187. return nil, err
  33188. }
  33189. req.Header = reqHeaders
  33190. googleapi.Expand(req.URL, map[string]string{
  33191. "project": c.project,
  33192. "zone": c.zone,
  33193. })
  33194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33195. }
  33196. // Do executes the "compute.autoscalers.insert" call.
  33197. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33198. // status code is an error. Response headers are in either
  33199. // *Operation.ServerResponse.Header or (if a response was returned at
  33200. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33201. // to check whether the returned error was because
  33202. // http.StatusNotModified was returned.
  33203. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33204. gensupport.SetOptions(c.urlParams_, opts...)
  33205. res, err := c.doRequest("json")
  33206. if res != nil && res.StatusCode == http.StatusNotModified {
  33207. if res.Body != nil {
  33208. res.Body.Close()
  33209. }
  33210. return nil, &googleapi.Error{
  33211. Code: res.StatusCode,
  33212. Header: res.Header,
  33213. }
  33214. }
  33215. if err != nil {
  33216. return nil, err
  33217. }
  33218. defer googleapi.CloseBody(res)
  33219. if err := googleapi.CheckResponse(res); err != nil {
  33220. return nil, err
  33221. }
  33222. ret := &Operation{
  33223. ServerResponse: googleapi.ServerResponse{
  33224. Header: res.Header,
  33225. HTTPStatusCode: res.StatusCode,
  33226. },
  33227. }
  33228. target := &ret
  33229. if err := gensupport.DecodeResponse(target, res); err != nil {
  33230. return nil, err
  33231. }
  33232. return ret, nil
  33233. // {
  33234. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  33235. // "httpMethod": "POST",
  33236. // "id": "compute.autoscalers.insert",
  33237. // "parameterOrder": [
  33238. // "project",
  33239. // "zone"
  33240. // ],
  33241. // "parameters": {
  33242. // "project": {
  33243. // "description": "Project ID for this request.",
  33244. // "location": "path",
  33245. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33246. // "required": true,
  33247. // "type": "string"
  33248. // },
  33249. // "requestId": {
  33250. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33251. // "location": "query",
  33252. // "type": "string"
  33253. // },
  33254. // "zone": {
  33255. // "description": "Name of the zone for this request.",
  33256. // "location": "path",
  33257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33258. // "required": true,
  33259. // "type": "string"
  33260. // }
  33261. // },
  33262. // "path": "{project}/zones/{zone}/autoscalers",
  33263. // "request": {
  33264. // "$ref": "Autoscaler"
  33265. // },
  33266. // "response": {
  33267. // "$ref": "Operation"
  33268. // },
  33269. // "scopes": [
  33270. // "https://www.googleapis.com/auth/cloud-platform",
  33271. // "https://www.googleapis.com/auth/compute"
  33272. // ]
  33273. // }
  33274. }
  33275. // method id "compute.autoscalers.list":
  33276. type AutoscalersListCall struct {
  33277. s *Service
  33278. project string
  33279. zone string
  33280. urlParams_ gensupport.URLParams
  33281. ifNoneMatch_ string
  33282. ctx_ context.Context
  33283. header_ http.Header
  33284. }
  33285. // List: Retrieves a list of autoscalers contained within the specified
  33286. // zone.
  33287. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  33288. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33289. c.project = project
  33290. c.zone = zone
  33291. return c
  33292. }
  33293. // Filter sets the optional parameter "filter": A filter expression that
  33294. // filters resources listed in the response. The expression must specify
  33295. // the field name, a comparison operator, and the value that you want to
  33296. // use for filtering. The value must be a string, a number, or a
  33297. // boolean. The comparison operator must be either =, !=, >, or <.
  33298. //
  33299. // For example, if you are filtering Compute Engine instances, you can
  33300. // exclude instances named example-instance by specifying name !=
  33301. // example-instance.
  33302. //
  33303. // You can also filter nested fields. For example, you could specify
  33304. // scheduling.automaticRestart = false to include instances only if they
  33305. // are not scheduled for automatic restarts. You can use filtering on
  33306. // nested fields to filter based on resource labels.
  33307. //
  33308. // To filter on multiple expressions, provide each separate expression
  33309. // within parentheses. For example, (scheduling.automaticRestart = true)
  33310. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33311. // AND expression. However, you can include AND and OR expressions
  33312. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33313. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33314. // true).
  33315. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  33316. c.urlParams_.Set("filter", filter)
  33317. return c
  33318. }
  33319. // MaxResults sets the optional parameter "maxResults": The maximum
  33320. // number of results per page that should be returned. If the number of
  33321. // available results is larger than maxResults, Compute Engine returns a
  33322. // nextPageToken that can be used to get the next page of results in
  33323. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33324. // (Default: 500)
  33325. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  33326. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33327. return c
  33328. }
  33329. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33330. // a certain order. By default, results are returned in alphanumerical
  33331. // order based on the resource name.
  33332. //
  33333. // You can also sort results in descending order based on the creation
  33334. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33335. // based on the creationTimestamp field in reverse chronological order
  33336. // (newest result first). Use this to sort resources like operations so
  33337. // that the newest operation is returned first.
  33338. //
  33339. // Currently, only sorting by name or creationTimestamp desc is
  33340. // supported.
  33341. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  33342. c.urlParams_.Set("orderBy", orderBy)
  33343. return c
  33344. }
  33345. // PageToken sets the optional parameter "pageToken": Specifies a page
  33346. // token to use. Set pageToken to the nextPageToken returned by a
  33347. // previous list request to get the next page of results.
  33348. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  33349. c.urlParams_.Set("pageToken", pageToken)
  33350. return c
  33351. }
  33352. // Fields allows partial responses to be retrieved. See
  33353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33354. // for more information.
  33355. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  33356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33357. return c
  33358. }
  33359. // IfNoneMatch sets the optional parameter which makes the operation
  33360. // fail if the object's ETag matches the given value. This is useful for
  33361. // getting updates only after the object has changed since the last
  33362. // request. Use googleapi.IsNotModified to check whether the response
  33363. // error from Do is the result of In-None-Match.
  33364. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  33365. c.ifNoneMatch_ = entityTag
  33366. return c
  33367. }
  33368. // Context sets the context to be used in this call's Do method. Any
  33369. // pending HTTP request will be aborted if the provided context is
  33370. // canceled.
  33371. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  33372. c.ctx_ = ctx
  33373. return c
  33374. }
  33375. // Header returns an http.Header that can be modified by the caller to
  33376. // add HTTP headers to the request.
  33377. func (c *AutoscalersListCall) Header() http.Header {
  33378. if c.header_ == nil {
  33379. c.header_ = make(http.Header)
  33380. }
  33381. return c.header_
  33382. }
  33383. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  33384. reqHeaders := make(http.Header)
  33385. for k, v := range c.header_ {
  33386. reqHeaders[k] = v
  33387. }
  33388. reqHeaders.Set("User-Agent", c.s.userAgent())
  33389. if c.ifNoneMatch_ != "" {
  33390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33391. }
  33392. var body io.Reader = nil
  33393. c.urlParams_.Set("alt", alt)
  33394. c.urlParams_.Set("prettyPrint", "false")
  33395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33396. urls += "?" + c.urlParams_.Encode()
  33397. req, err := http.NewRequest("GET", urls, body)
  33398. if err != nil {
  33399. return nil, err
  33400. }
  33401. req.Header = reqHeaders
  33402. googleapi.Expand(req.URL, map[string]string{
  33403. "project": c.project,
  33404. "zone": c.zone,
  33405. })
  33406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33407. }
  33408. // Do executes the "compute.autoscalers.list" call.
  33409. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  33410. // status code is an error. Response headers are in either
  33411. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  33412. // at all) in error.(*googleapi.Error).Header. Use
  33413. // googleapi.IsNotModified to check whether the returned error was
  33414. // because http.StatusNotModified was returned.
  33415. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  33416. gensupport.SetOptions(c.urlParams_, opts...)
  33417. res, err := c.doRequest("json")
  33418. if res != nil && res.StatusCode == http.StatusNotModified {
  33419. if res.Body != nil {
  33420. res.Body.Close()
  33421. }
  33422. return nil, &googleapi.Error{
  33423. Code: res.StatusCode,
  33424. Header: res.Header,
  33425. }
  33426. }
  33427. if err != nil {
  33428. return nil, err
  33429. }
  33430. defer googleapi.CloseBody(res)
  33431. if err := googleapi.CheckResponse(res); err != nil {
  33432. return nil, err
  33433. }
  33434. ret := &AutoscalerList{
  33435. ServerResponse: googleapi.ServerResponse{
  33436. Header: res.Header,
  33437. HTTPStatusCode: res.StatusCode,
  33438. },
  33439. }
  33440. target := &ret
  33441. if err := gensupport.DecodeResponse(target, res); err != nil {
  33442. return nil, err
  33443. }
  33444. return ret, nil
  33445. // {
  33446. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  33447. // "httpMethod": "GET",
  33448. // "id": "compute.autoscalers.list",
  33449. // "parameterOrder": [
  33450. // "project",
  33451. // "zone"
  33452. // ],
  33453. // "parameters": {
  33454. // "filter": {
  33455. // "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).",
  33456. // "location": "query",
  33457. // "type": "string"
  33458. // },
  33459. // "maxResults": {
  33460. // "default": "500",
  33461. // "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)",
  33462. // "format": "uint32",
  33463. // "location": "query",
  33464. // "minimum": "0",
  33465. // "type": "integer"
  33466. // },
  33467. // "orderBy": {
  33468. // "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.",
  33469. // "location": "query",
  33470. // "type": "string"
  33471. // },
  33472. // "pageToken": {
  33473. // "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.",
  33474. // "location": "query",
  33475. // "type": "string"
  33476. // },
  33477. // "project": {
  33478. // "description": "Project ID for this request.",
  33479. // "location": "path",
  33480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33481. // "required": true,
  33482. // "type": "string"
  33483. // },
  33484. // "zone": {
  33485. // "description": "Name of the zone for this request.",
  33486. // "location": "path",
  33487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33488. // "required": true,
  33489. // "type": "string"
  33490. // }
  33491. // },
  33492. // "path": "{project}/zones/{zone}/autoscalers",
  33493. // "response": {
  33494. // "$ref": "AutoscalerList"
  33495. // },
  33496. // "scopes": [
  33497. // "https://www.googleapis.com/auth/cloud-platform",
  33498. // "https://www.googleapis.com/auth/compute",
  33499. // "https://www.googleapis.com/auth/compute.readonly"
  33500. // ]
  33501. // }
  33502. }
  33503. // Pages invokes f for each page of results.
  33504. // A non-nil error returned from f will halt the iteration.
  33505. // The provided context supersedes any context provided to the Context method.
  33506. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  33507. c.ctx_ = ctx
  33508. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33509. for {
  33510. x, err := c.Do()
  33511. if err != nil {
  33512. return err
  33513. }
  33514. if err := f(x); err != nil {
  33515. return err
  33516. }
  33517. if x.NextPageToken == "" {
  33518. return nil
  33519. }
  33520. c.PageToken(x.NextPageToken)
  33521. }
  33522. }
  33523. // method id "compute.autoscalers.patch":
  33524. type AutoscalersPatchCall struct {
  33525. s *Service
  33526. project string
  33527. zone string
  33528. autoscaler *Autoscaler
  33529. urlParams_ gensupport.URLParams
  33530. ctx_ context.Context
  33531. header_ http.Header
  33532. }
  33533. // Patch: Updates an autoscaler in the specified project using the data
  33534. // included in the request. This method supports PATCH semantics and
  33535. // uses the JSON merge patch format and processing rules.
  33536. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  33537. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33538. c.project = project
  33539. c.zone = zone
  33540. c.autoscaler = autoscaler
  33541. return c
  33542. }
  33543. // Autoscaler sets the optional parameter "autoscaler": Name of the
  33544. // autoscaler to patch.
  33545. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  33546. c.urlParams_.Set("autoscaler", autoscaler)
  33547. return c
  33548. }
  33549. // RequestId sets the optional parameter "requestId": An optional
  33550. // request ID to identify requests. Specify a unique request ID so that
  33551. // if you must retry your request, the server will know to ignore the
  33552. // request if it has already been completed.
  33553. //
  33554. // For example, consider a situation where you make an initial request
  33555. // and the request times out. If you make the request again with the
  33556. // same request ID, the server can check if original operation with the
  33557. // same request ID was received, and if so, will ignore the second
  33558. // request. This prevents clients from accidentally creating duplicate
  33559. // commitments.
  33560. //
  33561. // The request ID must be a valid UUID with the exception that zero UUID
  33562. // is not supported (00000000-0000-0000-0000-000000000000).
  33563. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  33564. c.urlParams_.Set("requestId", requestId)
  33565. return c
  33566. }
  33567. // Fields allows partial responses to be retrieved. See
  33568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33569. // for more information.
  33570. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  33571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33572. return c
  33573. }
  33574. // Context sets the context to be used in this call's Do method. Any
  33575. // pending HTTP request will be aborted if the provided context is
  33576. // canceled.
  33577. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  33578. c.ctx_ = ctx
  33579. return c
  33580. }
  33581. // Header returns an http.Header that can be modified by the caller to
  33582. // add HTTP headers to the request.
  33583. func (c *AutoscalersPatchCall) Header() http.Header {
  33584. if c.header_ == nil {
  33585. c.header_ = make(http.Header)
  33586. }
  33587. return c.header_
  33588. }
  33589. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  33590. reqHeaders := make(http.Header)
  33591. for k, v := range c.header_ {
  33592. reqHeaders[k] = v
  33593. }
  33594. reqHeaders.Set("User-Agent", c.s.userAgent())
  33595. var body io.Reader = nil
  33596. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  33597. if err != nil {
  33598. return nil, err
  33599. }
  33600. reqHeaders.Set("Content-Type", "application/json")
  33601. c.urlParams_.Set("alt", alt)
  33602. c.urlParams_.Set("prettyPrint", "false")
  33603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33604. urls += "?" + c.urlParams_.Encode()
  33605. req, err := http.NewRequest("PATCH", urls, body)
  33606. if err != nil {
  33607. return nil, err
  33608. }
  33609. req.Header = reqHeaders
  33610. googleapi.Expand(req.URL, map[string]string{
  33611. "project": c.project,
  33612. "zone": c.zone,
  33613. })
  33614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33615. }
  33616. // Do executes the "compute.autoscalers.patch" call.
  33617. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33618. // status code is an error. Response headers are in either
  33619. // *Operation.ServerResponse.Header or (if a response was returned at
  33620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33621. // to check whether the returned error was because
  33622. // http.StatusNotModified was returned.
  33623. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33624. gensupport.SetOptions(c.urlParams_, opts...)
  33625. res, err := c.doRequest("json")
  33626. if res != nil && res.StatusCode == http.StatusNotModified {
  33627. if res.Body != nil {
  33628. res.Body.Close()
  33629. }
  33630. return nil, &googleapi.Error{
  33631. Code: res.StatusCode,
  33632. Header: res.Header,
  33633. }
  33634. }
  33635. if err != nil {
  33636. return nil, err
  33637. }
  33638. defer googleapi.CloseBody(res)
  33639. if err := googleapi.CheckResponse(res); err != nil {
  33640. return nil, err
  33641. }
  33642. ret := &Operation{
  33643. ServerResponse: googleapi.ServerResponse{
  33644. Header: res.Header,
  33645. HTTPStatusCode: res.StatusCode,
  33646. },
  33647. }
  33648. target := &ret
  33649. if err := gensupport.DecodeResponse(target, res); err != nil {
  33650. return nil, err
  33651. }
  33652. return ret, nil
  33653. // {
  33654. // "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.",
  33655. // "httpMethod": "PATCH",
  33656. // "id": "compute.autoscalers.patch",
  33657. // "parameterOrder": [
  33658. // "project",
  33659. // "zone"
  33660. // ],
  33661. // "parameters": {
  33662. // "autoscaler": {
  33663. // "description": "Name of the autoscaler to patch.",
  33664. // "location": "query",
  33665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33666. // "type": "string"
  33667. // },
  33668. // "project": {
  33669. // "description": "Project ID for this request.",
  33670. // "location": "path",
  33671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33672. // "required": true,
  33673. // "type": "string"
  33674. // },
  33675. // "requestId": {
  33676. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33677. // "location": "query",
  33678. // "type": "string"
  33679. // },
  33680. // "zone": {
  33681. // "description": "Name of the zone for this request.",
  33682. // "location": "path",
  33683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33684. // "required": true,
  33685. // "type": "string"
  33686. // }
  33687. // },
  33688. // "path": "{project}/zones/{zone}/autoscalers",
  33689. // "request": {
  33690. // "$ref": "Autoscaler"
  33691. // },
  33692. // "response": {
  33693. // "$ref": "Operation"
  33694. // },
  33695. // "scopes": [
  33696. // "https://www.googleapis.com/auth/cloud-platform",
  33697. // "https://www.googleapis.com/auth/compute"
  33698. // ]
  33699. // }
  33700. }
  33701. // method id "compute.autoscalers.testIamPermissions":
  33702. type AutoscalersTestIamPermissionsCall struct {
  33703. s *Service
  33704. project string
  33705. zone string
  33706. resource string
  33707. testpermissionsrequest *TestPermissionsRequest
  33708. urlParams_ gensupport.URLParams
  33709. ctx_ context.Context
  33710. header_ http.Header
  33711. }
  33712. // TestIamPermissions: Returns permissions that a caller has on the
  33713. // specified resource.
  33714. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  33715. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33716. c.project = project
  33717. c.zone = zone
  33718. c.resource = resource
  33719. c.testpermissionsrequest = testpermissionsrequest
  33720. return c
  33721. }
  33722. // Fields allows partial responses to be retrieved. See
  33723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33724. // for more information.
  33725. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  33726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33727. return c
  33728. }
  33729. // Context sets the context to be used in this call's Do method. Any
  33730. // pending HTTP request will be aborted if the provided context is
  33731. // canceled.
  33732. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  33733. c.ctx_ = ctx
  33734. return c
  33735. }
  33736. // Header returns an http.Header that can be modified by the caller to
  33737. // add HTTP headers to the request.
  33738. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  33739. if c.header_ == nil {
  33740. c.header_ = make(http.Header)
  33741. }
  33742. return c.header_
  33743. }
  33744. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  33745. reqHeaders := make(http.Header)
  33746. for k, v := range c.header_ {
  33747. reqHeaders[k] = v
  33748. }
  33749. reqHeaders.Set("User-Agent", c.s.userAgent())
  33750. var body io.Reader = nil
  33751. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  33752. if err != nil {
  33753. return nil, err
  33754. }
  33755. reqHeaders.Set("Content-Type", "application/json")
  33756. c.urlParams_.Set("alt", alt)
  33757. c.urlParams_.Set("prettyPrint", "false")
  33758. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  33759. urls += "?" + c.urlParams_.Encode()
  33760. req, err := http.NewRequest("POST", urls, body)
  33761. if err != nil {
  33762. return nil, err
  33763. }
  33764. req.Header = reqHeaders
  33765. googleapi.Expand(req.URL, map[string]string{
  33766. "project": c.project,
  33767. "zone": c.zone,
  33768. "resource": c.resource,
  33769. })
  33770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33771. }
  33772. // Do executes the "compute.autoscalers.testIamPermissions" call.
  33773. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  33774. // non-2xx status code is an error. Response headers are in either
  33775. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  33776. // returned at all) in error.(*googleapi.Error).Header. Use
  33777. // googleapi.IsNotModified to check whether the returned error was
  33778. // because http.StatusNotModified was returned.
  33779. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  33780. gensupport.SetOptions(c.urlParams_, opts...)
  33781. res, err := c.doRequest("json")
  33782. if res != nil && res.StatusCode == http.StatusNotModified {
  33783. if res.Body != nil {
  33784. res.Body.Close()
  33785. }
  33786. return nil, &googleapi.Error{
  33787. Code: res.StatusCode,
  33788. Header: res.Header,
  33789. }
  33790. }
  33791. if err != nil {
  33792. return nil, err
  33793. }
  33794. defer googleapi.CloseBody(res)
  33795. if err := googleapi.CheckResponse(res); err != nil {
  33796. return nil, err
  33797. }
  33798. ret := &TestPermissionsResponse{
  33799. ServerResponse: googleapi.ServerResponse{
  33800. Header: res.Header,
  33801. HTTPStatusCode: res.StatusCode,
  33802. },
  33803. }
  33804. target := &ret
  33805. if err := gensupport.DecodeResponse(target, res); err != nil {
  33806. return nil, err
  33807. }
  33808. return ret, nil
  33809. // {
  33810. // "description": "Returns permissions that a caller has on the specified resource.",
  33811. // "httpMethod": "POST",
  33812. // "id": "compute.autoscalers.testIamPermissions",
  33813. // "parameterOrder": [
  33814. // "project",
  33815. // "zone",
  33816. // "resource"
  33817. // ],
  33818. // "parameters": {
  33819. // "project": {
  33820. // "description": "Project ID for this request.",
  33821. // "location": "path",
  33822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33823. // "required": true,
  33824. // "type": "string"
  33825. // },
  33826. // "resource": {
  33827. // "description": "Name or id of the resource for this request.",
  33828. // "location": "path",
  33829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33830. // "required": true,
  33831. // "type": "string"
  33832. // },
  33833. // "zone": {
  33834. // "description": "The name of the zone for this request.",
  33835. // "location": "path",
  33836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33837. // "required": true,
  33838. // "type": "string"
  33839. // }
  33840. // },
  33841. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  33842. // "request": {
  33843. // "$ref": "TestPermissionsRequest"
  33844. // },
  33845. // "response": {
  33846. // "$ref": "TestPermissionsResponse"
  33847. // },
  33848. // "scopes": [
  33849. // "https://www.googleapis.com/auth/cloud-platform",
  33850. // "https://www.googleapis.com/auth/compute",
  33851. // "https://www.googleapis.com/auth/compute.readonly"
  33852. // ]
  33853. // }
  33854. }
  33855. // method id "compute.autoscalers.update":
  33856. type AutoscalersUpdateCall struct {
  33857. s *Service
  33858. project string
  33859. zone string
  33860. autoscaler *Autoscaler
  33861. urlParams_ gensupport.URLParams
  33862. ctx_ context.Context
  33863. header_ http.Header
  33864. }
  33865. // Update: Updates an autoscaler in the specified project using the data
  33866. // included in the request.
  33867. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  33868. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33869. c.project = project
  33870. c.zone = zone
  33871. c.autoscaler = autoscaler
  33872. return c
  33873. }
  33874. // Autoscaler sets the optional parameter "autoscaler": Name of the
  33875. // autoscaler to update.
  33876. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  33877. c.urlParams_.Set("autoscaler", autoscaler)
  33878. return c
  33879. }
  33880. // RequestId sets the optional parameter "requestId": An optional
  33881. // request ID to identify requests. Specify a unique request ID so that
  33882. // if you must retry your request, the server will know to ignore the
  33883. // request if it has already been completed.
  33884. //
  33885. // For example, consider a situation where you make an initial request
  33886. // and the request times out. If you make the request again with the
  33887. // same request ID, the server can check if original operation with the
  33888. // same request ID was received, and if so, will ignore the second
  33889. // request. This prevents clients from accidentally creating duplicate
  33890. // commitments.
  33891. //
  33892. // The request ID must be a valid UUID with the exception that zero UUID
  33893. // is not supported (00000000-0000-0000-0000-000000000000).
  33894. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  33895. c.urlParams_.Set("requestId", requestId)
  33896. return c
  33897. }
  33898. // Fields allows partial responses to be retrieved. See
  33899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33900. // for more information.
  33901. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  33902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33903. return c
  33904. }
  33905. // Context sets the context to be used in this call's Do method. Any
  33906. // pending HTTP request will be aborted if the provided context is
  33907. // canceled.
  33908. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  33909. c.ctx_ = ctx
  33910. return c
  33911. }
  33912. // Header returns an http.Header that can be modified by the caller to
  33913. // add HTTP headers to the request.
  33914. func (c *AutoscalersUpdateCall) Header() http.Header {
  33915. if c.header_ == nil {
  33916. c.header_ = make(http.Header)
  33917. }
  33918. return c.header_
  33919. }
  33920. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  33921. reqHeaders := make(http.Header)
  33922. for k, v := range c.header_ {
  33923. reqHeaders[k] = v
  33924. }
  33925. reqHeaders.Set("User-Agent", c.s.userAgent())
  33926. var body io.Reader = nil
  33927. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  33928. if err != nil {
  33929. return nil, err
  33930. }
  33931. reqHeaders.Set("Content-Type", "application/json")
  33932. c.urlParams_.Set("alt", alt)
  33933. c.urlParams_.Set("prettyPrint", "false")
  33934. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33935. urls += "?" + c.urlParams_.Encode()
  33936. req, err := http.NewRequest("PUT", urls, body)
  33937. if err != nil {
  33938. return nil, err
  33939. }
  33940. req.Header = reqHeaders
  33941. googleapi.Expand(req.URL, map[string]string{
  33942. "project": c.project,
  33943. "zone": c.zone,
  33944. })
  33945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33946. }
  33947. // Do executes the "compute.autoscalers.update" call.
  33948. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33949. // status code is an error. Response headers are in either
  33950. // *Operation.ServerResponse.Header or (if a response was returned at
  33951. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33952. // to check whether the returned error was because
  33953. // http.StatusNotModified was returned.
  33954. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33955. gensupport.SetOptions(c.urlParams_, opts...)
  33956. res, err := c.doRequest("json")
  33957. if res != nil && res.StatusCode == http.StatusNotModified {
  33958. if res.Body != nil {
  33959. res.Body.Close()
  33960. }
  33961. return nil, &googleapi.Error{
  33962. Code: res.StatusCode,
  33963. Header: res.Header,
  33964. }
  33965. }
  33966. if err != nil {
  33967. return nil, err
  33968. }
  33969. defer googleapi.CloseBody(res)
  33970. if err := googleapi.CheckResponse(res); err != nil {
  33971. return nil, err
  33972. }
  33973. ret := &Operation{
  33974. ServerResponse: googleapi.ServerResponse{
  33975. Header: res.Header,
  33976. HTTPStatusCode: res.StatusCode,
  33977. },
  33978. }
  33979. target := &ret
  33980. if err := gensupport.DecodeResponse(target, res); err != nil {
  33981. return nil, err
  33982. }
  33983. return ret, nil
  33984. // {
  33985. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  33986. // "httpMethod": "PUT",
  33987. // "id": "compute.autoscalers.update",
  33988. // "parameterOrder": [
  33989. // "project",
  33990. // "zone"
  33991. // ],
  33992. // "parameters": {
  33993. // "autoscaler": {
  33994. // "description": "Name of the autoscaler to update.",
  33995. // "location": "query",
  33996. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33997. // "type": "string"
  33998. // },
  33999. // "project": {
  34000. // "description": "Project ID for this request.",
  34001. // "location": "path",
  34002. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34003. // "required": true,
  34004. // "type": "string"
  34005. // },
  34006. // "requestId": {
  34007. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34008. // "location": "query",
  34009. // "type": "string"
  34010. // },
  34011. // "zone": {
  34012. // "description": "Name of the zone for this request.",
  34013. // "location": "path",
  34014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34015. // "required": true,
  34016. // "type": "string"
  34017. // }
  34018. // },
  34019. // "path": "{project}/zones/{zone}/autoscalers",
  34020. // "request": {
  34021. // "$ref": "Autoscaler"
  34022. // },
  34023. // "response": {
  34024. // "$ref": "Operation"
  34025. // },
  34026. // "scopes": [
  34027. // "https://www.googleapis.com/auth/cloud-platform",
  34028. // "https://www.googleapis.com/auth/compute"
  34029. // ]
  34030. // }
  34031. }
  34032. // method id "compute.backendBuckets.addSignedUrlKey":
  34033. type BackendBucketsAddSignedUrlKeyCall struct {
  34034. s *Service
  34035. project string
  34036. backendBucket string
  34037. signedurlkey *SignedUrlKey
  34038. urlParams_ gensupport.URLParams
  34039. ctx_ context.Context
  34040. header_ http.Header
  34041. }
  34042. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  34043. // for this backend bucket.
  34044. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  34045. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34046. c.project = project
  34047. c.backendBucket = backendBucket
  34048. c.signedurlkey = signedurlkey
  34049. return c
  34050. }
  34051. // RequestId sets the optional parameter "requestId": An optional
  34052. // request ID to identify requests. Specify a unique request ID so that
  34053. // if you must retry your request, the server will know to ignore the
  34054. // request if it has already been completed.
  34055. //
  34056. // For example, consider a situation where you make an initial request
  34057. // and the request times out. If you make the request again with the
  34058. // same request ID, the server can check if original operation with the
  34059. // same request ID was received, and if so, will ignore the second
  34060. // request. This prevents clients from accidentally creating duplicate
  34061. // commitments.
  34062. //
  34063. // The request ID must be a valid UUID with the exception that zero UUID
  34064. // is not supported (00000000-0000-0000-0000-000000000000).
  34065. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  34066. c.urlParams_.Set("requestId", requestId)
  34067. return c
  34068. }
  34069. // Fields allows partial responses to be retrieved. See
  34070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34071. // for more information.
  34072. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  34073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34074. return c
  34075. }
  34076. // Context sets the context to be used in this call's Do method. Any
  34077. // pending HTTP request will be aborted if the provided context is
  34078. // canceled.
  34079. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  34080. c.ctx_ = ctx
  34081. return c
  34082. }
  34083. // Header returns an http.Header that can be modified by the caller to
  34084. // add HTTP headers to the request.
  34085. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  34086. if c.header_ == nil {
  34087. c.header_ = make(http.Header)
  34088. }
  34089. return c.header_
  34090. }
  34091. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  34092. reqHeaders := make(http.Header)
  34093. for k, v := range c.header_ {
  34094. reqHeaders[k] = v
  34095. }
  34096. reqHeaders.Set("User-Agent", c.s.userAgent())
  34097. var body io.Reader = nil
  34098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  34099. if err != nil {
  34100. return nil, err
  34101. }
  34102. reqHeaders.Set("Content-Type", "application/json")
  34103. c.urlParams_.Set("alt", alt)
  34104. c.urlParams_.Set("prettyPrint", "false")
  34105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  34106. urls += "?" + c.urlParams_.Encode()
  34107. req, err := http.NewRequest("POST", urls, body)
  34108. if err != nil {
  34109. return nil, err
  34110. }
  34111. req.Header = reqHeaders
  34112. googleapi.Expand(req.URL, map[string]string{
  34113. "project": c.project,
  34114. "backendBucket": c.backendBucket,
  34115. })
  34116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34117. }
  34118. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  34119. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34120. // status code is an error. Response headers are in either
  34121. // *Operation.ServerResponse.Header or (if a response was returned at
  34122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34123. // to check whether the returned error was because
  34124. // http.StatusNotModified was returned.
  34125. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34126. gensupport.SetOptions(c.urlParams_, opts...)
  34127. res, err := c.doRequest("json")
  34128. if res != nil && res.StatusCode == http.StatusNotModified {
  34129. if res.Body != nil {
  34130. res.Body.Close()
  34131. }
  34132. return nil, &googleapi.Error{
  34133. Code: res.StatusCode,
  34134. Header: res.Header,
  34135. }
  34136. }
  34137. if err != nil {
  34138. return nil, err
  34139. }
  34140. defer googleapi.CloseBody(res)
  34141. if err := googleapi.CheckResponse(res); err != nil {
  34142. return nil, err
  34143. }
  34144. ret := &Operation{
  34145. ServerResponse: googleapi.ServerResponse{
  34146. Header: res.Header,
  34147. HTTPStatusCode: res.StatusCode,
  34148. },
  34149. }
  34150. target := &ret
  34151. if err := gensupport.DecodeResponse(target, res); err != nil {
  34152. return nil, err
  34153. }
  34154. return ret, nil
  34155. // {
  34156. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  34157. // "httpMethod": "POST",
  34158. // "id": "compute.backendBuckets.addSignedUrlKey",
  34159. // "parameterOrder": [
  34160. // "project",
  34161. // "backendBucket"
  34162. // ],
  34163. // "parameters": {
  34164. // "backendBucket": {
  34165. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  34166. // "location": "path",
  34167. // "required": true,
  34168. // "type": "string"
  34169. // },
  34170. // "project": {
  34171. // "description": "Project ID for this request.",
  34172. // "location": "path",
  34173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34174. // "required": true,
  34175. // "type": "string"
  34176. // },
  34177. // "requestId": {
  34178. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34179. // "location": "query",
  34180. // "type": "string"
  34181. // }
  34182. // },
  34183. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  34184. // "request": {
  34185. // "$ref": "SignedUrlKey"
  34186. // },
  34187. // "response": {
  34188. // "$ref": "Operation"
  34189. // },
  34190. // "scopes": [
  34191. // "https://www.googleapis.com/auth/cloud-platform",
  34192. // "https://www.googleapis.com/auth/compute"
  34193. // ]
  34194. // }
  34195. }
  34196. // method id "compute.backendBuckets.delete":
  34197. type BackendBucketsDeleteCall struct {
  34198. s *Service
  34199. project string
  34200. backendBucket string
  34201. urlParams_ gensupport.URLParams
  34202. ctx_ context.Context
  34203. header_ http.Header
  34204. }
  34205. // Delete: Deletes the specified BackendBucket resource.
  34206. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  34207. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34208. c.project = project
  34209. c.backendBucket = backendBucket
  34210. return c
  34211. }
  34212. // RequestId sets the optional parameter "requestId": An optional
  34213. // request ID to identify requests. Specify a unique request ID so that
  34214. // if you must retry your request, the server will know to ignore the
  34215. // request if it has already been completed.
  34216. //
  34217. // For example, consider a situation where you make an initial request
  34218. // and the request times out. If you make the request again with the
  34219. // same request ID, the server can check if original operation with the
  34220. // same request ID was received, and if so, will ignore the second
  34221. // request. This prevents clients from accidentally creating duplicate
  34222. // commitments.
  34223. //
  34224. // The request ID must be a valid UUID with the exception that zero UUID
  34225. // is not supported (00000000-0000-0000-0000-000000000000).
  34226. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  34227. c.urlParams_.Set("requestId", requestId)
  34228. return c
  34229. }
  34230. // Fields allows partial responses to be retrieved. See
  34231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34232. // for more information.
  34233. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  34234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34235. return c
  34236. }
  34237. // Context sets the context to be used in this call's Do method. Any
  34238. // pending HTTP request will be aborted if the provided context is
  34239. // canceled.
  34240. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  34241. c.ctx_ = ctx
  34242. return c
  34243. }
  34244. // Header returns an http.Header that can be modified by the caller to
  34245. // add HTTP headers to the request.
  34246. func (c *BackendBucketsDeleteCall) Header() http.Header {
  34247. if c.header_ == nil {
  34248. c.header_ = make(http.Header)
  34249. }
  34250. return c.header_
  34251. }
  34252. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  34253. reqHeaders := make(http.Header)
  34254. for k, v := range c.header_ {
  34255. reqHeaders[k] = v
  34256. }
  34257. reqHeaders.Set("User-Agent", c.s.userAgent())
  34258. var body io.Reader = nil
  34259. c.urlParams_.Set("alt", alt)
  34260. c.urlParams_.Set("prettyPrint", "false")
  34261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  34262. urls += "?" + c.urlParams_.Encode()
  34263. req, err := http.NewRequest("DELETE", urls, body)
  34264. if err != nil {
  34265. return nil, err
  34266. }
  34267. req.Header = reqHeaders
  34268. googleapi.Expand(req.URL, map[string]string{
  34269. "project": c.project,
  34270. "backendBucket": c.backendBucket,
  34271. })
  34272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34273. }
  34274. // Do executes the "compute.backendBuckets.delete" call.
  34275. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34276. // status code is an error. Response headers are in either
  34277. // *Operation.ServerResponse.Header or (if a response was returned at
  34278. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34279. // to check whether the returned error was because
  34280. // http.StatusNotModified was returned.
  34281. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34282. gensupport.SetOptions(c.urlParams_, opts...)
  34283. res, err := c.doRequest("json")
  34284. if res != nil && res.StatusCode == http.StatusNotModified {
  34285. if res.Body != nil {
  34286. res.Body.Close()
  34287. }
  34288. return nil, &googleapi.Error{
  34289. Code: res.StatusCode,
  34290. Header: res.Header,
  34291. }
  34292. }
  34293. if err != nil {
  34294. return nil, err
  34295. }
  34296. defer googleapi.CloseBody(res)
  34297. if err := googleapi.CheckResponse(res); err != nil {
  34298. return nil, err
  34299. }
  34300. ret := &Operation{
  34301. ServerResponse: googleapi.ServerResponse{
  34302. Header: res.Header,
  34303. HTTPStatusCode: res.StatusCode,
  34304. },
  34305. }
  34306. target := &ret
  34307. if err := gensupport.DecodeResponse(target, res); err != nil {
  34308. return nil, err
  34309. }
  34310. return ret, nil
  34311. // {
  34312. // "description": "Deletes the specified BackendBucket resource.",
  34313. // "httpMethod": "DELETE",
  34314. // "id": "compute.backendBuckets.delete",
  34315. // "parameterOrder": [
  34316. // "project",
  34317. // "backendBucket"
  34318. // ],
  34319. // "parameters": {
  34320. // "backendBucket": {
  34321. // "description": "Name of the BackendBucket resource to delete.",
  34322. // "location": "path",
  34323. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34324. // "required": true,
  34325. // "type": "string"
  34326. // },
  34327. // "project": {
  34328. // "description": "Project ID for this request.",
  34329. // "location": "path",
  34330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34331. // "required": true,
  34332. // "type": "string"
  34333. // },
  34334. // "requestId": {
  34335. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34336. // "location": "query",
  34337. // "type": "string"
  34338. // }
  34339. // },
  34340. // "path": "{project}/global/backendBuckets/{backendBucket}",
  34341. // "response": {
  34342. // "$ref": "Operation"
  34343. // },
  34344. // "scopes": [
  34345. // "https://www.googleapis.com/auth/cloud-platform",
  34346. // "https://www.googleapis.com/auth/compute"
  34347. // ]
  34348. // }
  34349. }
  34350. // method id "compute.backendBuckets.deleteSignedUrlKey":
  34351. type BackendBucketsDeleteSignedUrlKeyCall struct {
  34352. s *Service
  34353. project string
  34354. backendBucket string
  34355. urlParams_ gensupport.URLParams
  34356. ctx_ context.Context
  34357. header_ http.Header
  34358. }
  34359. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  34360. // URLs for this backend bucket.
  34361. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  34362. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34363. c.project = project
  34364. c.backendBucket = backendBucket
  34365. c.urlParams_.Set("keyName", keyName)
  34366. return c
  34367. }
  34368. // RequestId sets the optional parameter "requestId": An optional
  34369. // request ID to identify requests. Specify a unique request ID so that
  34370. // if you must retry your request, the server will know to ignore the
  34371. // request if it has already been completed.
  34372. //
  34373. // For example, consider a situation where you make an initial request
  34374. // and the request times out. If you make the request again with the
  34375. // same request ID, the server can check if original operation with the
  34376. // same request ID was received, and if so, will ignore the second
  34377. // request. This prevents clients from accidentally creating duplicate
  34378. // commitments.
  34379. //
  34380. // The request ID must be a valid UUID with the exception that zero UUID
  34381. // is not supported (00000000-0000-0000-0000-000000000000).
  34382. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  34383. c.urlParams_.Set("requestId", requestId)
  34384. return c
  34385. }
  34386. // Fields allows partial responses to be retrieved. See
  34387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34388. // for more information.
  34389. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  34390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34391. return c
  34392. }
  34393. // Context sets the context to be used in this call's Do method. Any
  34394. // pending HTTP request will be aborted if the provided context is
  34395. // canceled.
  34396. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  34397. c.ctx_ = ctx
  34398. return c
  34399. }
  34400. // Header returns an http.Header that can be modified by the caller to
  34401. // add HTTP headers to the request.
  34402. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  34403. if c.header_ == nil {
  34404. c.header_ = make(http.Header)
  34405. }
  34406. return c.header_
  34407. }
  34408. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  34409. reqHeaders := make(http.Header)
  34410. for k, v := range c.header_ {
  34411. reqHeaders[k] = v
  34412. }
  34413. reqHeaders.Set("User-Agent", c.s.userAgent())
  34414. var body io.Reader = nil
  34415. c.urlParams_.Set("alt", alt)
  34416. c.urlParams_.Set("prettyPrint", "false")
  34417. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  34418. urls += "?" + c.urlParams_.Encode()
  34419. req, err := http.NewRequest("POST", urls, body)
  34420. if err != nil {
  34421. return nil, err
  34422. }
  34423. req.Header = reqHeaders
  34424. googleapi.Expand(req.URL, map[string]string{
  34425. "project": c.project,
  34426. "backendBucket": c.backendBucket,
  34427. })
  34428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34429. }
  34430. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  34431. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34432. // status code is an error. Response headers are in either
  34433. // *Operation.ServerResponse.Header or (if a response was returned at
  34434. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34435. // to check whether the returned error was because
  34436. // http.StatusNotModified was returned.
  34437. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34438. gensupport.SetOptions(c.urlParams_, opts...)
  34439. res, err := c.doRequest("json")
  34440. if res != nil && res.StatusCode == http.StatusNotModified {
  34441. if res.Body != nil {
  34442. res.Body.Close()
  34443. }
  34444. return nil, &googleapi.Error{
  34445. Code: res.StatusCode,
  34446. Header: res.Header,
  34447. }
  34448. }
  34449. if err != nil {
  34450. return nil, err
  34451. }
  34452. defer googleapi.CloseBody(res)
  34453. if err := googleapi.CheckResponse(res); err != nil {
  34454. return nil, err
  34455. }
  34456. ret := &Operation{
  34457. ServerResponse: googleapi.ServerResponse{
  34458. Header: res.Header,
  34459. HTTPStatusCode: res.StatusCode,
  34460. },
  34461. }
  34462. target := &ret
  34463. if err := gensupport.DecodeResponse(target, res); err != nil {
  34464. return nil, err
  34465. }
  34466. return ret, nil
  34467. // {
  34468. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  34469. // "httpMethod": "POST",
  34470. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  34471. // "parameterOrder": [
  34472. // "project",
  34473. // "backendBucket",
  34474. // "keyName"
  34475. // ],
  34476. // "parameters": {
  34477. // "backendBucket": {
  34478. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  34479. // "location": "path",
  34480. // "required": true,
  34481. // "type": "string"
  34482. // },
  34483. // "keyName": {
  34484. // "description": "The name of the Signed URL Key to delete.",
  34485. // "location": "query",
  34486. // "required": true,
  34487. // "type": "string"
  34488. // },
  34489. // "project": {
  34490. // "description": "Project ID for this request.",
  34491. // "location": "path",
  34492. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34493. // "required": true,
  34494. // "type": "string"
  34495. // },
  34496. // "requestId": {
  34497. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34498. // "location": "query",
  34499. // "type": "string"
  34500. // }
  34501. // },
  34502. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  34503. // "response": {
  34504. // "$ref": "Operation"
  34505. // },
  34506. // "scopes": [
  34507. // "https://www.googleapis.com/auth/cloud-platform",
  34508. // "https://www.googleapis.com/auth/compute"
  34509. // ]
  34510. // }
  34511. }
  34512. // method id "compute.backendBuckets.get":
  34513. type BackendBucketsGetCall struct {
  34514. s *Service
  34515. project string
  34516. backendBucket string
  34517. urlParams_ gensupport.URLParams
  34518. ifNoneMatch_ string
  34519. ctx_ context.Context
  34520. header_ http.Header
  34521. }
  34522. // Get: Returns the specified BackendBucket resource. Gets a list of
  34523. // available backend buckets by making a list() request.
  34524. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  34525. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34526. c.project = project
  34527. c.backendBucket = backendBucket
  34528. return c
  34529. }
  34530. // Fields allows partial responses to be retrieved. See
  34531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34532. // for more information.
  34533. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  34534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34535. return c
  34536. }
  34537. // IfNoneMatch sets the optional parameter which makes the operation
  34538. // fail if the object's ETag matches the given value. This is useful for
  34539. // getting updates only after the object has changed since the last
  34540. // request. Use googleapi.IsNotModified to check whether the response
  34541. // error from Do is the result of In-None-Match.
  34542. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  34543. c.ifNoneMatch_ = entityTag
  34544. return c
  34545. }
  34546. // Context sets the context to be used in this call's Do method. Any
  34547. // pending HTTP request will be aborted if the provided context is
  34548. // canceled.
  34549. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  34550. c.ctx_ = ctx
  34551. return c
  34552. }
  34553. // Header returns an http.Header that can be modified by the caller to
  34554. // add HTTP headers to the request.
  34555. func (c *BackendBucketsGetCall) Header() http.Header {
  34556. if c.header_ == nil {
  34557. c.header_ = make(http.Header)
  34558. }
  34559. return c.header_
  34560. }
  34561. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  34562. reqHeaders := make(http.Header)
  34563. for k, v := range c.header_ {
  34564. reqHeaders[k] = v
  34565. }
  34566. reqHeaders.Set("User-Agent", c.s.userAgent())
  34567. if c.ifNoneMatch_ != "" {
  34568. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34569. }
  34570. var body io.Reader = nil
  34571. c.urlParams_.Set("alt", alt)
  34572. c.urlParams_.Set("prettyPrint", "false")
  34573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  34574. urls += "?" + c.urlParams_.Encode()
  34575. req, err := http.NewRequest("GET", urls, body)
  34576. if err != nil {
  34577. return nil, err
  34578. }
  34579. req.Header = reqHeaders
  34580. googleapi.Expand(req.URL, map[string]string{
  34581. "project": c.project,
  34582. "backendBucket": c.backendBucket,
  34583. })
  34584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34585. }
  34586. // Do executes the "compute.backendBuckets.get" call.
  34587. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  34588. // status code is an error. Response headers are in either
  34589. // *BackendBucket.ServerResponse.Header or (if a response was returned
  34590. // at all) in error.(*googleapi.Error).Header. Use
  34591. // googleapi.IsNotModified to check whether the returned error was
  34592. // because http.StatusNotModified was returned.
  34593. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  34594. gensupport.SetOptions(c.urlParams_, opts...)
  34595. res, err := c.doRequest("json")
  34596. if res != nil && res.StatusCode == http.StatusNotModified {
  34597. if res.Body != nil {
  34598. res.Body.Close()
  34599. }
  34600. return nil, &googleapi.Error{
  34601. Code: res.StatusCode,
  34602. Header: res.Header,
  34603. }
  34604. }
  34605. if err != nil {
  34606. return nil, err
  34607. }
  34608. defer googleapi.CloseBody(res)
  34609. if err := googleapi.CheckResponse(res); err != nil {
  34610. return nil, err
  34611. }
  34612. ret := &BackendBucket{
  34613. ServerResponse: googleapi.ServerResponse{
  34614. Header: res.Header,
  34615. HTTPStatusCode: res.StatusCode,
  34616. },
  34617. }
  34618. target := &ret
  34619. if err := gensupport.DecodeResponse(target, res); err != nil {
  34620. return nil, err
  34621. }
  34622. return ret, nil
  34623. // {
  34624. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  34625. // "httpMethod": "GET",
  34626. // "id": "compute.backendBuckets.get",
  34627. // "parameterOrder": [
  34628. // "project",
  34629. // "backendBucket"
  34630. // ],
  34631. // "parameters": {
  34632. // "backendBucket": {
  34633. // "description": "Name of the BackendBucket resource to return.",
  34634. // "location": "path",
  34635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34636. // "required": true,
  34637. // "type": "string"
  34638. // },
  34639. // "project": {
  34640. // "description": "Project ID for this request.",
  34641. // "location": "path",
  34642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34643. // "required": true,
  34644. // "type": "string"
  34645. // }
  34646. // },
  34647. // "path": "{project}/global/backendBuckets/{backendBucket}",
  34648. // "response": {
  34649. // "$ref": "BackendBucket"
  34650. // },
  34651. // "scopes": [
  34652. // "https://www.googleapis.com/auth/cloud-platform",
  34653. // "https://www.googleapis.com/auth/compute",
  34654. // "https://www.googleapis.com/auth/compute.readonly"
  34655. // ]
  34656. // }
  34657. }
  34658. // method id "compute.backendBuckets.insert":
  34659. type BackendBucketsInsertCall struct {
  34660. s *Service
  34661. project string
  34662. backendbucket *BackendBucket
  34663. urlParams_ gensupport.URLParams
  34664. ctx_ context.Context
  34665. header_ http.Header
  34666. }
  34667. // Insert: Creates a BackendBucket resource in the specified project
  34668. // using the data included in the request.
  34669. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  34670. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34671. c.project = project
  34672. c.backendbucket = backendbucket
  34673. return c
  34674. }
  34675. // RequestId sets the optional parameter "requestId": An optional
  34676. // request ID to identify requests. Specify a unique request ID so that
  34677. // if you must retry your request, the server will know to ignore the
  34678. // request if it has already been completed.
  34679. //
  34680. // For example, consider a situation where you make an initial request
  34681. // and the request times out. If you make the request again with the
  34682. // same request ID, the server can check if original operation with the
  34683. // same request ID was received, and if so, will ignore the second
  34684. // request. This prevents clients from accidentally creating duplicate
  34685. // commitments.
  34686. //
  34687. // The request ID must be a valid UUID with the exception that zero UUID
  34688. // is not supported (00000000-0000-0000-0000-000000000000).
  34689. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  34690. c.urlParams_.Set("requestId", requestId)
  34691. return c
  34692. }
  34693. // Fields allows partial responses to be retrieved. See
  34694. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34695. // for more information.
  34696. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  34697. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34698. return c
  34699. }
  34700. // Context sets the context to be used in this call's Do method. Any
  34701. // pending HTTP request will be aborted if the provided context is
  34702. // canceled.
  34703. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  34704. c.ctx_ = ctx
  34705. return c
  34706. }
  34707. // Header returns an http.Header that can be modified by the caller to
  34708. // add HTTP headers to the request.
  34709. func (c *BackendBucketsInsertCall) Header() http.Header {
  34710. if c.header_ == nil {
  34711. c.header_ = make(http.Header)
  34712. }
  34713. return c.header_
  34714. }
  34715. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  34716. reqHeaders := make(http.Header)
  34717. for k, v := range c.header_ {
  34718. reqHeaders[k] = v
  34719. }
  34720. reqHeaders.Set("User-Agent", c.s.userAgent())
  34721. var body io.Reader = nil
  34722. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  34723. if err != nil {
  34724. return nil, err
  34725. }
  34726. reqHeaders.Set("Content-Type", "application/json")
  34727. c.urlParams_.Set("alt", alt)
  34728. c.urlParams_.Set("prettyPrint", "false")
  34729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  34730. urls += "?" + c.urlParams_.Encode()
  34731. req, err := http.NewRequest("POST", urls, body)
  34732. if err != nil {
  34733. return nil, err
  34734. }
  34735. req.Header = reqHeaders
  34736. googleapi.Expand(req.URL, map[string]string{
  34737. "project": c.project,
  34738. })
  34739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34740. }
  34741. // Do executes the "compute.backendBuckets.insert" call.
  34742. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34743. // status code is an error. Response headers are in either
  34744. // *Operation.ServerResponse.Header or (if a response was returned at
  34745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34746. // to check whether the returned error was because
  34747. // http.StatusNotModified was returned.
  34748. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34749. gensupport.SetOptions(c.urlParams_, opts...)
  34750. res, err := c.doRequest("json")
  34751. if res != nil && res.StatusCode == http.StatusNotModified {
  34752. if res.Body != nil {
  34753. res.Body.Close()
  34754. }
  34755. return nil, &googleapi.Error{
  34756. Code: res.StatusCode,
  34757. Header: res.Header,
  34758. }
  34759. }
  34760. if err != nil {
  34761. return nil, err
  34762. }
  34763. defer googleapi.CloseBody(res)
  34764. if err := googleapi.CheckResponse(res); err != nil {
  34765. return nil, err
  34766. }
  34767. ret := &Operation{
  34768. ServerResponse: googleapi.ServerResponse{
  34769. Header: res.Header,
  34770. HTTPStatusCode: res.StatusCode,
  34771. },
  34772. }
  34773. target := &ret
  34774. if err := gensupport.DecodeResponse(target, res); err != nil {
  34775. return nil, err
  34776. }
  34777. return ret, nil
  34778. // {
  34779. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  34780. // "httpMethod": "POST",
  34781. // "id": "compute.backendBuckets.insert",
  34782. // "parameterOrder": [
  34783. // "project"
  34784. // ],
  34785. // "parameters": {
  34786. // "project": {
  34787. // "description": "Project ID for this request.",
  34788. // "location": "path",
  34789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34790. // "required": true,
  34791. // "type": "string"
  34792. // },
  34793. // "requestId": {
  34794. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34795. // "location": "query",
  34796. // "type": "string"
  34797. // }
  34798. // },
  34799. // "path": "{project}/global/backendBuckets",
  34800. // "request": {
  34801. // "$ref": "BackendBucket"
  34802. // },
  34803. // "response": {
  34804. // "$ref": "Operation"
  34805. // },
  34806. // "scopes": [
  34807. // "https://www.googleapis.com/auth/cloud-platform",
  34808. // "https://www.googleapis.com/auth/compute"
  34809. // ]
  34810. // }
  34811. }
  34812. // method id "compute.backendBuckets.list":
  34813. type BackendBucketsListCall struct {
  34814. s *Service
  34815. project string
  34816. urlParams_ gensupport.URLParams
  34817. ifNoneMatch_ string
  34818. ctx_ context.Context
  34819. header_ http.Header
  34820. }
  34821. // List: Retrieves the list of BackendBucket resources available to the
  34822. // specified project.
  34823. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  34824. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34825. c.project = project
  34826. return c
  34827. }
  34828. // Filter sets the optional parameter "filter": A filter expression that
  34829. // filters resources listed in the response. The expression must specify
  34830. // the field name, a comparison operator, and the value that you want to
  34831. // use for filtering. The value must be a string, a number, or a
  34832. // boolean. The comparison operator must be either =, !=, >, or <.
  34833. //
  34834. // For example, if you are filtering Compute Engine instances, you can
  34835. // exclude instances named example-instance by specifying name !=
  34836. // example-instance.
  34837. //
  34838. // You can also filter nested fields. For example, you could specify
  34839. // scheduling.automaticRestart = false to include instances only if they
  34840. // are not scheduled for automatic restarts. You can use filtering on
  34841. // nested fields to filter based on resource labels.
  34842. //
  34843. // To filter on multiple expressions, provide each separate expression
  34844. // within parentheses. For example, (scheduling.automaticRestart = true)
  34845. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34846. // AND expression. However, you can include AND and OR expressions
  34847. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34848. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34849. // true).
  34850. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  34851. c.urlParams_.Set("filter", filter)
  34852. return c
  34853. }
  34854. // MaxResults sets the optional parameter "maxResults": The maximum
  34855. // number of results per page that should be returned. If the number of
  34856. // available results is larger than maxResults, Compute Engine returns a
  34857. // nextPageToken that can be used to get the next page of results in
  34858. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34859. // (Default: 500)
  34860. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  34861. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34862. return c
  34863. }
  34864. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34865. // a certain order. By default, results are returned in alphanumerical
  34866. // order based on the resource name.
  34867. //
  34868. // You can also sort results in descending order based on the creation
  34869. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34870. // based on the creationTimestamp field in reverse chronological order
  34871. // (newest result first). Use this to sort resources like operations so
  34872. // that the newest operation is returned first.
  34873. //
  34874. // Currently, only sorting by name or creationTimestamp desc is
  34875. // supported.
  34876. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  34877. c.urlParams_.Set("orderBy", orderBy)
  34878. return c
  34879. }
  34880. // PageToken sets the optional parameter "pageToken": Specifies a page
  34881. // token to use. Set pageToken to the nextPageToken returned by a
  34882. // previous list request to get the next page of results.
  34883. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  34884. c.urlParams_.Set("pageToken", pageToken)
  34885. return c
  34886. }
  34887. // Fields allows partial responses to be retrieved. See
  34888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34889. // for more information.
  34890. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  34891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34892. return c
  34893. }
  34894. // IfNoneMatch sets the optional parameter which makes the operation
  34895. // fail if the object's ETag matches the given value. This is useful for
  34896. // getting updates only after the object has changed since the last
  34897. // request. Use googleapi.IsNotModified to check whether the response
  34898. // error from Do is the result of In-None-Match.
  34899. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  34900. c.ifNoneMatch_ = entityTag
  34901. return c
  34902. }
  34903. // Context sets the context to be used in this call's Do method. Any
  34904. // pending HTTP request will be aborted if the provided context is
  34905. // canceled.
  34906. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  34907. c.ctx_ = ctx
  34908. return c
  34909. }
  34910. // Header returns an http.Header that can be modified by the caller to
  34911. // add HTTP headers to the request.
  34912. func (c *BackendBucketsListCall) Header() http.Header {
  34913. if c.header_ == nil {
  34914. c.header_ = make(http.Header)
  34915. }
  34916. return c.header_
  34917. }
  34918. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  34919. reqHeaders := make(http.Header)
  34920. for k, v := range c.header_ {
  34921. reqHeaders[k] = v
  34922. }
  34923. reqHeaders.Set("User-Agent", c.s.userAgent())
  34924. if c.ifNoneMatch_ != "" {
  34925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34926. }
  34927. var body io.Reader = nil
  34928. c.urlParams_.Set("alt", alt)
  34929. c.urlParams_.Set("prettyPrint", "false")
  34930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  34931. urls += "?" + c.urlParams_.Encode()
  34932. req, err := http.NewRequest("GET", urls, body)
  34933. if err != nil {
  34934. return nil, err
  34935. }
  34936. req.Header = reqHeaders
  34937. googleapi.Expand(req.URL, map[string]string{
  34938. "project": c.project,
  34939. })
  34940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34941. }
  34942. // Do executes the "compute.backendBuckets.list" call.
  34943. // Exactly one of *BackendBucketList or error will be non-nil. Any
  34944. // non-2xx status code is an error. Response headers are in either
  34945. // *BackendBucketList.ServerResponse.Header or (if a response was
  34946. // returned at all) in error.(*googleapi.Error).Header. Use
  34947. // googleapi.IsNotModified to check whether the returned error was
  34948. // because http.StatusNotModified was returned.
  34949. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  34950. gensupport.SetOptions(c.urlParams_, opts...)
  34951. res, err := c.doRequest("json")
  34952. if res != nil && res.StatusCode == http.StatusNotModified {
  34953. if res.Body != nil {
  34954. res.Body.Close()
  34955. }
  34956. return nil, &googleapi.Error{
  34957. Code: res.StatusCode,
  34958. Header: res.Header,
  34959. }
  34960. }
  34961. if err != nil {
  34962. return nil, err
  34963. }
  34964. defer googleapi.CloseBody(res)
  34965. if err := googleapi.CheckResponse(res); err != nil {
  34966. return nil, err
  34967. }
  34968. ret := &BackendBucketList{
  34969. ServerResponse: googleapi.ServerResponse{
  34970. Header: res.Header,
  34971. HTTPStatusCode: res.StatusCode,
  34972. },
  34973. }
  34974. target := &ret
  34975. if err := gensupport.DecodeResponse(target, res); err != nil {
  34976. return nil, err
  34977. }
  34978. return ret, nil
  34979. // {
  34980. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  34981. // "httpMethod": "GET",
  34982. // "id": "compute.backendBuckets.list",
  34983. // "parameterOrder": [
  34984. // "project"
  34985. // ],
  34986. // "parameters": {
  34987. // "filter": {
  34988. // "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).",
  34989. // "location": "query",
  34990. // "type": "string"
  34991. // },
  34992. // "maxResults": {
  34993. // "default": "500",
  34994. // "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)",
  34995. // "format": "uint32",
  34996. // "location": "query",
  34997. // "minimum": "0",
  34998. // "type": "integer"
  34999. // },
  35000. // "orderBy": {
  35001. // "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.",
  35002. // "location": "query",
  35003. // "type": "string"
  35004. // },
  35005. // "pageToken": {
  35006. // "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.",
  35007. // "location": "query",
  35008. // "type": "string"
  35009. // },
  35010. // "project": {
  35011. // "description": "Project ID for this request.",
  35012. // "location": "path",
  35013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35014. // "required": true,
  35015. // "type": "string"
  35016. // }
  35017. // },
  35018. // "path": "{project}/global/backendBuckets",
  35019. // "response": {
  35020. // "$ref": "BackendBucketList"
  35021. // },
  35022. // "scopes": [
  35023. // "https://www.googleapis.com/auth/cloud-platform",
  35024. // "https://www.googleapis.com/auth/compute",
  35025. // "https://www.googleapis.com/auth/compute.readonly"
  35026. // ]
  35027. // }
  35028. }
  35029. // Pages invokes f for each page of results.
  35030. // A non-nil error returned from f will halt the iteration.
  35031. // The provided context supersedes any context provided to the Context method.
  35032. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  35033. c.ctx_ = ctx
  35034. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35035. for {
  35036. x, err := c.Do()
  35037. if err != nil {
  35038. return err
  35039. }
  35040. if err := f(x); err != nil {
  35041. return err
  35042. }
  35043. if x.NextPageToken == "" {
  35044. return nil
  35045. }
  35046. c.PageToken(x.NextPageToken)
  35047. }
  35048. }
  35049. // method id "compute.backendBuckets.patch":
  35050. type BackendBucketsPatchCall struct {
  35051. s *Service
  35052. project string
  35053. backendBucket string
  35054. backendbucket *BackendBucket
  35055. urlParams_ gensupport.URLParams
  35056. ctx_ context.Context
  35057. header_ http.Header
  35058. }
  35059. // Patch: Updates the specified BackendBucket resource with the data
  35060. // included in the request. This method supports PATCH semantics and
  35061. // uses the JSON merge patch format and processing rules.
  35062. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  35063. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35064. c.project = project
  35065. c.backendBucket = backendBucket
  35066. c.backendbucket = backendbucket
  35067. return c
  35068. }
  35069. // RequestId sets the optional parameter "requestId": An optional
  35070. // request ID to identify requests. Specify a unique request ID so that
  35071. // if you must retry your request, the server will know to ignore the
  35072. // request if it has already been completed.
  35073. //
  35074. // For example, consider a situation where you make an initial request
  35075. // and the request times out. If you make the request again with the
  35076. // same request ID, the server can check if original operation with the
  35077. // same request ID was received, and if so, will ignore the second
  35078. // request. This prevents clients from accidentally creating duplicate
  35079. // commitments.
  35080. //
  35081. // The request ID must be a valid UUID with the exception that zero UUID
  35082. // is not supported (00000000-0000-0000-0000-000000000000).
  35083. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  35084. c.urlParams_.Set("requestId", requestId)
  35085. return c
  35086. }
  35087. // Fields allows partial responses to be retrieved. See
  35088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35089. // for more information.
  35090. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  35091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35092. return c
  35093. }
  35094. // Context sets the context to be used in this call's Do method. Any
  35095. // pending HTTP request will be aborted if the provided context is
  35096. // canceled.
  35097. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  35098. c.ctx_ = ctx
  35099. return c
  35100. }
  35101. // Header returns an http.Header that can be modified by the caller to
  35102. // add HTTP headers to the request.
  35103. func (c *BackendBucketsPatchCall) Header() http.Header {
  35104. if c.header_ == nil {
  35105. c.header_ = make(http.Header)
  35106. }
  35107. return c.header_
  35108. }
  35109. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  35110. reqHeaders := make(http.Header)
  35111. for k, v := range c.header_ {
  35112. reqHeaders[k] = v
  35113. }
  35114. reqHeaders.Set("User-Agent", c.s.userAgent())
  35115. var body io.Reader = nil
  35116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  35117. if err != nil {
  35118. return nil, err
  35119. }
  35120. reqHeaders.Set("Content-Type", "application/json")
  35121. c.urlParams_.Set("alt", alt)
  35122. c.urlParams_.Set("prettyPrint", "false")
  35123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  35124. urls += "?" + c.urlParams_.Encode()
  35125. req, err := http.NewRequest("PATCH", urls, body)
  35126. if err != nil {
  35127. return nil, err
  35128. }
  35129. req.Header = reqHeaders
  35130. googleapi.Expand(req.URL, map[string]string{
  35131. "project": c.project,
  35132. "backendBucket": c.backendBucket,
  35133. })
  35134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35135. }
  35136. // Do executes the "compute.backendBuckets.patch" call.
  35137. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35138. // status code is an error. Response headers are in either
  35139. // *Operation.ServerResponse.Header or (if a response was returned at
  35140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35141. // to check whether the returned error was because
  35142. // http.StatusNotModified was returned.
  35143. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35144. gensupport.SetOptions(c.urlParams_, opts...)
  35145. res, err := c.doRequest("json")
  35146. if res != nil && res.StatusCode == http.StatusNotModified {
  35147. if res.Body != nil {
  35148. res.Body.Close()
  35149. }
  35150. return nil, &googleapi.Error{
  35151. Code: res.StatusCode,
  35152. Header: res.Header,
  35153. }
  35154. }
  35155. if err != nil {
  35156. return nil, err
  35157. }
  35158. defer googleapi.CloseBody(res)
  35159. if err := googleapi.CheckResponse(res); err != nil {
  35160. return nil, err
  35161. }
  35162. ret := &Operation{
  35163. ServerResponse: googleapi.ServerResponse{
  35164. Header: res.Header,
  35165. HTTPStatusCode: res.StatusCode,
  35166. },
  35167. }
  35168. target := &ret
  35169. if err := gensupport.DecodeResponse(target, res); err != nil {
  35170. return nil, err
  35171. }
  35172. return ret, nil
  35173. // {
  35174. // "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.",
  35175. // "httpMethod": "PATCH",
  35176. // "id": "compute.backendBuckets.patch",
  35177. // "parameterOrder": [
  35178. // "project",
  35179. // "backendBucket"
  35180. // ],
  35181. // "parameters": {
  35182. // "backendBucket": {
  35183. // "description": "Name of the BackendBucket resource to patch.",
  35184. // "location": "path",
  35185. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35186. // "required": true,
  35187. // "type": "string"
  35188. // },
  35189. // "project": {
  35190. // "description": "Project ID for this request.",
  35191. // "location": "path",
  35192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35193. // "required": true,
  35194. // "type": "string"
  35195. // },
  35196. // "requestId": {
  35197. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35198. // "location": "query",
  35199. // "type": "string"
  35200. // }
  35201. // },
  35202. // "path": "{project}/global/backendBuckets/{backendBucket}",
  35203. // "request": {
  35204. // "$ref": "BackendBucket"
  35205. // },
  35206. // "response": {
  35207. // "$ref": "Operation"
  35208. // },
  35209. // "scopes": [
  35210. // "https://www.googleapis.com/auth/cloud-platform",
  35211. // "https://www.googleapis.com/auth/compute"
  35212. // ]
  35213. // }
  35214. }
  35215. // method id "compute.backendBuckets.update":
  35216. type BackendBucketsUpdateCall struct {
  35217. s *Service
  35218. project string
  35219. backendBucket string
  35220. backendbucket *BackendBucket
  35221. urlParams_ gensupport.URLParams
  35222. ctx_ context.Context
  35223. header_ http.Header
  35224. }
  35225. // Update: Updates the specified BackendBucket resource with the data
  35226. // included in the request.
  35227. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  35228. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35229. c.project = project
  35230. c.backendBucket = backendBucket
  35231. c.backendbucket = backendbucket
  35232. return c
  35233. }
  35234. // RequestId sets the optional parameter "requestId": An optional
  35235. // request ID to identify requests. Specify a unique request ID so that
  35236. // if you must retry your request, the server will know to ignore the
  35237. // request if it has already been completed.
  35238. //
  35239. // For example, consider a situation where you make an initial request
  35240. // and the request times out. If you make the request again with the
  35241. // same request ID, the server can check if original operation with the
  35242. // same request ID was received, and if so, will ignore the second
  35243. // request. This prevents clients from accidentally creating duplicate
  35244. // commitments.
  35245. //
  35246. // The request ID must be a valid UUID with the exception that zero UUID
  35247. // is not supported (00000000-0000-0000-0000-000000000000).
  35248. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  35249. c.urlParams_.Set("requestId", requestId)
  35250. return c
  35251. }
  35252. // Fields allows partial responses to be retrieved. See
  35253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35254. // for more information.
  35255. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  35256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35257. return c
  35258. }
  35259. // Context sets the context to be used in this call's Do method. Any
  35260. // pending HTTP request will be aborted if the provided context is
  35261. // canceled.
  35262. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  35263. c.ctx_ = ctx
  35264. return c
  35265. }
  35266. // Header returns an http.Header that can be modified by the caller to
  35267. // add HTTP headers to the request.
  35268. func (c *BackendBucketsUpdateCall) Header() http.Header {
  35269. if c.header_ == nil {
  35270. c.header_ = make(http.Header)
  35271. }
  35272. return c.header_
  35273. }
  35274. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35275. reqHeaders := make(http.Header)
  35276. for k, v := range c.header_ {
  35277. reqHeaders[k] = v
  35278. }
  35279. reqHeaders.Set("User-Agent", c.s.userAgent())
  35280. var body io.Reader = nil
  35281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  35282. if err != nil {
  35283. return nil, err
  35284. }
  35285. reqHeaders.Set("Content-Type", "application/json")
  35286. c.urlParams_.Set("alt", alt)
  35287. c.urlParams_.Set("prettyPrint", "false")
  35288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  35289. urls += "?" + c.urlParams_.Encode()
  35290. req, err := http.NewRequest("PUT", urls, body)
  35291. if err != nil {
  35292. return nil, err
  35293. }
  35294. req.Header = reqHeaders
  35295. googleapi.Expand(req.URL, map[string]string{
  35296. "project": c.project,
  35297. "backendBucket": c.backendBucket,
  35298. })
  35299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35300. }
  35301. // Do executes the "compute.backendBuckets.update" call.
  35302. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35303. // status code is an error. Response headers are in either
  35304. // *Operation.ServerResponse.Header or (if a response was returned at
  35305. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35306. // to check whether the returned error was because
  35307. // http.StatusNotModified was returned.
  35308. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35309. gensupport.SetOptions(c.urlParams_, opts...)
  35310. res, err := c.doRequest("json")
  35311. if res != nil && res.StatusCode == http.StatusNotModified {
  35312. if res.Body != nil {
  35313. res.Body.Close()
  35314. }
  35315. return nil, &googleapi.Error{
  35316. Code: res.StatusCode,
  35317. Header: res.Header,
  35318. }
  35319. }
  35320. if err != nil {
  35321. return nil, err
  35322. }
  35323. defer googleapi.CloseBody(res)
  35324. if err := googleapi.CheckResponse(res); err != nil {
  35325. return nil, err
  35326. }
  35327. ret := &Operation{
  35328. ServerResponse: googleapi.ServerResponse{
  35329. Header: res.Header,
  35330. HTTPStatusCode: res.StatusCode,
  35331. },
  35332. }
  35333. target := &ret
  35334. if err := gensupport.DecodeResponse(target, res); err != nil {
  35335. return nil, err
  35336. }
  35337. return ret, nil
  35338. // {
  35339. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  35340. // "httpMethod": "PUT",
  35341. // "id": "compute.backendBuckets.update",
  35342. // "parameterOrder": [
  35343. // "project",
  35344. // "backendBucket"
  35345. // ],
  35346. // "parameters": {
  35347. // "backendBucket": {
  35348. // "description": "Name of the BackendBucket resource to update.",
  35349. // "location": "path",
  35350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35351. // "required": true,
  35352. // "type": "string"
  35353. // },
  35354. // "project": {
  35355. // "description": "Project ID for this request.",
  35356. // "location": "path",
  35357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35358. // "required": true,
  35359. // "type": "string"
  35360. // },
  35361. // "requestId": {
  35362. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35363. // "location": "query",
  35364. // "type": "string"
  35365. // }
  35366. // },
  35367. // "path": "{project}/global/backendBuckets/{backendBucket}",
  35368. // "request": {
  35369. // "$ref": "BackendBucket"
  35370. // },
  35371. // "response": {
  35372. // "$ref": "Operation"
  35373. // },
  35374. // "scopes": [
  35375. // "https://www.googleapis.com/auth/cloud-platform",
  35376. // "https://www.googleapis.com/auth/compute"
  35377. // ]
  35378. // }
  35379. }
  35380. // method id "compute.backendServices.addSignedUrlKey":
  35381. type BackendServicesAddSignedUrlKeyCall struct {
  35382. s *Service
  35383. project string
  35384. backendService string
  35385. signedurlkey *SignedUrlKey
  35386. urlParams_ gensupport.URLParams
  35387. ctx_ context.Context
  35388. header_ http.Header
  35389. }
  35390. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  35391. // for this backend service.
  35392. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  35393. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35394. c.project = project
  35395. c.backendService = backendService
  35396. c.signedurlkey = signedurlkey
  35397. return c
  35398. }
  35399. // RequestId sets the optional parameter "requestId": An optional
  35400. // request ID to identify requests. Specify a unique request ID so that
  35401. // if you must retry your request, the server will know to ignore the
  35402. // request if it has already been completed.
  35403. //
  35404. // For example, consider a situation where you make an initial request
  35405. // and the request times out. If you make the request again with the
  35406. // same request ID, the server can check if original operation with the
  35407. // same request ID was received, and if so, will ignore the second
  35408. // request. This prevents clients from accidentally creating duplicate
  35409. // commitments.
  35410. //
  35411. // The request ID must be a valid UUID with the exception that zero UUID
  35412. // is not supported (00000000-0000-0000-0000-000000000000).
  35413. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  35414. c.urlParams_.Set("requestId", requestId)
  35415. return c
  35416. }
  35417. // Fields allows partial responses to be retrieved. See
  35418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35419. // for more information.
  35420. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  35421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35422. return c
  35423. }
  35424. // Context sets the context to be used in this call's Do method. Any
  35425. // pending HTTP request will be aborted if the provided context is
  35426. // canceled.
  35427. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  35428. c.ctx_ = ctx
  35429. return c
  35430. }
  35431. // Header returns an http.Header that can be modified by the caller to
  35432. // add HTTP headers to the request.
  35433. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  35434. if c.header_ == nil {
  35435. c.header_ = make(http.Header)
  35436. }
  35437. return c.header_
  35438. }
  35439. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  35440. reqHeaders := make(http.Header)
  35441. for k, v := range c.header_ {
  35442. reqHeaders[k] = v
  35443. }
  35444. reqHeaders.Set("User-Agent", c.s.userAgent())
  35445. var body io.Reader = nil
  35446. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  35447. if err != nil {
  35448. return nil, err
  35449. }
  35450. reqHeaders.Set("Content-Type", "application/json")
  35451. c.urlParams_.Set("alt", alt)
  35452. c.urlParams_.Set("prettyPrint", "false")
  35453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  35454. urls += "?" + c.urlParams_.Encode()
  35455. req, err := http.NewRequest("POST", urls, body)
  35456. if err != nil {
  35457. return nil, err
  35458. }
  35459. req.Header = reqHeaders
  35460. googleapi.Expand(req.URL, map[string]string{
  35461. "project": c.project,
  35462. "backendService": c.backendService,
  35463. })
  35464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35465. }
  35466. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  35467. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35468. // status code is an error. Response headers are in either
  35469. // *Operation.ServerResponse.Header or (if a response was returned at
  35470. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35471. // to check whether the returned error was because
  35472. // http.StatusNotModified was returned.
  35473. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35474. gensupport.SetOptions(c.urlParams_, opts...)
  35475. res, err := c.doRequest("json")
  35476. if res != nil && res.StatusCode == http.StatusNotModified {
  35477. if res.Body != nil {
  35478. res.Body.Close()
  35479. }
  35480. return nil, &googleapi.Error{
  35481. Code: res.StatusCode,
  35482. Header: res.Header,
  35483. }
  35484. }
  35485. if err != nil {
  35486. return nil, err
  35487. }
  35488. defer googleapi.CloseBody(res)
  35489. if err := googleapi.CheckResponse(res); err != nil {
  35490. return nil, err
  35491. }
  35492. ret := &Operation{
  35493. ServerResponse: googleapi.ServerResponse{
  35494. Header: res.Header,
  35495. HTTPStatusCode: res.StatusCode,
  35496. },
  35497. }
  35498. target := &ret
  35499. if err := gensupport.DecodeResponse(target, res); err != nil {
  35500. return nil, err
  35501. }
  35502. return ret, nil
  35503. // {
  35504. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  35505. // "httpMethod": "POST",
  35506. // "id": "compute.backendServices.addSignedUrlKey",
  35507. // "parameterOrder": [
  35508. // "project",
  35509. // "backendService"
  35510. // ],
  35511. // "parameters": {
  35512. // "backendService": {
  35513. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  35514. // "location": "path",
  35515. // "required": true,
  35516. // "type": "string"
  35517. // },
  35518. // "project": {
  35519. // "description": "Project ID for this request.",
  35520. // "location": "path",
  35521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35522. // "required": true,
  35523. // "type": "string"
  35524. // },
  35525. // "requestId": {
  35526. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35527. // "location": "query",
  35528. // "type": "string"
  35529. // }
  35530. // },
  35531. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  35532. // "request": {
  35533. // "$ref": "SignedUrlKey"
  35534. // },
  35535. // "response": {
  35536. // "$ref": "Operation"
  35537. // },
  35538. // "scopes": [
  35539. // "https://www.googleapis.com/auth/cloud-platform",
  35540. // "https://www.googleapis.com/auth/compute"
  35541. // ]
  35542. // }
  35543. }
  35544. // method id "compute.backendServices.aggregatedList":
  35545. type BackendServicesAggregatedListCall struct {
  35546. s *Service
  35547. project string
  35548. urlParams_ gensupport.URLParams
  35549. ifNoneMatch_ string
  35550. ctx_ context.Context
  35551. header_ http.Header
  35552. }
  35553. // AggregatedList: Retrieves the list of all BackendService resources,
  35554. // regional and global, available to the specified project.
  35555. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  35556. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35557. c.project = project
  35558. return c
  35559. }
  35560. // Filter sets the optional parameter "filter": A filter expression that
  35561. // filters resources listed in the response. The expression must specify
  35562. // the field name, a comparison operator, and the value that you want to
  35563. // use for filtering. The value must be a string, a number, or a
  35564. // boolean. The comparison operator must be either =, !=, >, or <.
  35565. //
  35566. // For example, if you are filtering Compute Engine instances, you can
  35567. // exclude instances named example-instance by specifying name !=
  35568. // example-instance.
  35569. //
  35570. // You can also filter nested fields. For example, you could specify
  35571. // scheduling.automaticRestart = false to include instances only if they
  35572. // are not scheduled for automatic restarts. You can use filtering on
  35573. // nested fields to filter based on resource labels.
  35574. //
  35575. // To filter on multiple expressions, provide each separate expression
  35576. // within parentheses. For example, (scheduling.automaticRestart = true)
  35577. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35578. // AND expression. However, you can include AND and OR expressions
  35579. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35580. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35581. // true).
  35582. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  35583. c.urlParams_.Set("filter", filter)
  35584. return c
  35585. }
  35586. // MaxResults sets the optional parameter "maxResults": The maximum
  35587. // number of results per page that should be returned. If the number of
  35588. // available results is larger than maxResults, Compute Engine returns a
  35589. // nextPageToken that can be used to get the next page of results in
  35590. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35591. // (Default: 500)
  35592. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  35593. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35594. return c
  35595. }
  35596. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35597. // a certain order. By default, results are returned in alphanumerical
  35598. // order based on the resource name.
  35599. //
  35600. // You can also sort results in descending order based on the creation
  35601. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35602. // based on the creationTimestamp field in reverse chronological order
  35603. // (newest result first). Use this to sort resources like operations so
  35604. // that the newest operation is returned first.
  35605. //
  35606. // Currently, only sorting by name or creationTimestamp desc is
  35607. // supported.
  35608. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  35609. c.urlParams_.Set("orderBy", orderBy)
  35610. return c
  35611. }
  35612. // PageToken sets the optional parameter "pageToken": Specifies a page
  35613. // token to use. Set pageToken to the nextPageToken returned by a
  35614. // previous list request to get the next page of results.
  35615. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  35616. c.urlParams_.Set("pageToken", pageToken)
  35617. return c
  35618. }
  35619. // Fields allows partial responses to be retrieved. See
  35620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35621. // for more information.
  35622. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  35623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35624. return c
  35625. }
  35626. // IfNoneMatch sets the optional parameter which makes the operation
  35627. // fail if the object's ETag matches the given value. This is useful for
  35628. // getting updates only after the object has changed since the last
  35629. // request. Use googleapi.IsNotModified to check whether the response
  35630. // error from Do is the result of In-None-Match.
  35631. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  35632. c.ifNoneMatch_ = entityTag
  35633. return c
  35634. }
  35635. // Context sets the context to be used in this call's Do method. Any
  35636. // pending HTTP request will be aborted if the provided context is
  35637. // canceled.
  35638. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  35639. c.ctx_ = ctx
  35640. return c
  35641. }
  35642. // Header returns an http.Header that can be modified by the caller to
  35643. // add HTTP headers to the request.
  35644. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  35645. if c.header_ == nil {
  35646. c.header_ = make(http.Header)
  35647. }
  35648. return c.header_
  35649. }
  35650. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  35651. reqHeaders := make(http.Header)
  35652. for k, v := range c.header_ {
  35653. reqHeaders[k] = v
  35654. }
  35655. reqHeaders.Set("User-Agent", c.s.userAgent())
  35656. if c.ifNoneMatch_ != "" {
  35657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35658. }
  35659. var body io.Reader = nil
  35660. c.urlParams_.Set("alt", alt)
  35661. c.urlParams_.Set("prettyPrint", "false")
  35662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  35663. urls += "?" + c.urlParams_.Encode()
  35664. req, err := http.NewRequest("GET", urls, body)
  35665. if err != nil {
  35666. return nil, err
  35667. }
  35668. req.Header = reqHeaders
  35669. googleapi.Expand(req.URL, map[string]string{
  35670. "project": c.project,
  35671. })
  35672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35673. }
  35674. // Do executes the "compute.backendServices.aggregatedList" call.
  35675. // Exactly one of *BackendServiceAggregatedList or error will be
  35676. // non-nil. Any non-2xx status code is an error. Response headers are in
  35677. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  35678. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35679. // googleapi.IsNotModified to check whether the returned error was
  35680. // because http.StatusNotModified was returned.
  35681. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  35682. gensupport.SetOptions(c.urlParams_, opts...)
  35683. res, err := c.doRequest("json")
  35684. if res != nil && res.StatusCode == http.StatusNotModified {
  35685. if res.Body != nil {
  35686. res.Body.Close()
  35687. }
  35688. return nil, &googleapi.Error{
  35689. Code: res.StatusCode,
  35690. Header: res.Header,
  35691. }
  35692. }
  35693. if err != nil {
  35694. return nil, err
  35695. }
  35696. defer googleapi.CloseBody(res)
  35697. if err := googleapi.CheckResponse(res); err != nil {
  35698. return nil, err
  35699. }
  35700. ret := &BackendServiceAggregatedList{
  35701. ServerResponse: googleapi.ServerResponse{
  35702. Header: res.Header,
  35703. HTTPStatusCode: res.StatusCode,
  35704. },
  35705. }
  35706. target := &ret
  35707. if err := gensupport.DecodeResponse(target, res); err != nil {
  35708. return nil, err
  35709. }
  35710. return ret, nil
  35711. // {
  35712. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  35713. // "httpMethod": "GET",
  35714. // "id": "compute.backendServices.aggregatedList",
  35715. // "parameterOrder": [
  35716. // "project"
  35717. // ],
  35718. // "parameters": {
  35719. // "filter": {
  35720. // "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).",
  35721. // "location": "query",
  35722. // "type": "string"
  35723. // },
  35724. // "maxResults": {
  35725. // "default": "500",
  35726. // "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)",
  35727. // "format": "uint32",
  35728. // "location": "query",
  35729. // "minimum": "0",
  35730. // "type": "integer"
  35731. // },
  35732. // "orderBy": {
  35733. // "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.",
  35734. // "location": "query",
  35735. // "type": "string"
  35736. // },
  35737. // "pageToken": {
  35738. // "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.",
  35739. // "location": "query",
  35740. // "type": "string"
  35741. // },
  35742. // "project": {
  35743. // "description": "Name of the project scoping this request.",
  35744. // "location": "path",
  35745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35746. // "required": true,
  35747. // "type": "string"
  35748. // }
  35749. // },
  35750. // "path": "{project}/aggregated/backendServices",
  35751. // "response": {
  35752. // "$ref": "BackendServiceAggregatedList"
  35753. // },
  35754. // "scopes": [
  35755. // "https://www.googleapis.com/auth/cloud-platform",
  35756. // "https://www.googleapis.com/auth/compute",
  35757. // "https://www.googleapis.com/auth/compute.readonly"
  35758. // ]
  35759. // }
  35760. }
  35761. // Pages invokes f for each page of results.
  35762. // A non-nil error returned from f will halt the iteration.
  35763. // The provided context supersedes any context provided to the Context method.
  35764. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  35765. c.ctx_ = ctx
  35766. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35767. for {
  35768. x, err := c.Do()
  35769. if err != nil {
  35770. return err
  35771. }
  35772. if err := f(x); err != nil {
  35773. return err
  35774. }
  35775. if x.NextPageToken == "" {
  35776. return nil
  35777. }
  35778. c.PageToken(x.NextPageToken)
  35779. }
  35780. }
  35781. // method id "compute.backendServices.delete":
  35782. type BackendServicesDeleteCall struct {
  35783. s *Service
  35784. project string
  35785. backendService string
  35786. urlParams_ gensupport.URLParams
  35787. ctx_ context.Context
  35788. header_ http.Header
  35789. }
  35790. // Delete: Deletes the specified BackendService resource.
  35791. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  35792. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  35793. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35794. c.project = project
  35795. c.backendService = backendService
  35796. return c
  35797. }
  35798. // RequestId sets the optional parameter "requestId": An optional
  35799. // request ID to identify requests. Specify a unique request ID so that
  35800. // if you must retry your request, the server will know to ignore the
  35801. // request if it has already been completed.
  35802. //
  35803. // For example, consider a situation where you make an initial request
  35804. // and the request times out. If you make the request again with the
  35805. // same request ID, the server can check if original operation with the
  35806. // same request ID was received, and if so, will ignore the second
  35807. // request. This prevents clients from accidentally creating duplicate
  35808. // commitments.
  35809. //
  35810. // The request ID must be a valid UUID with the exception that zero UUID
  35811. // is not supported (00000000-0000-0000-0000-000000000000).
  35812. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  35813. c.urlParams_.Set("requestId", requestId)
  35814. return c
  35815. }
  35816. // Fields allows partial responses to be retrieved. See
  35817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35818. // for more information.
  35819. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  35820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35821. return c
  35822. }
  35823. // Context sets the context to be used in this call's Do method. Any
  35824. // pending HTTP request will be aborted if the provided context is
  35825. // canceled.
  35826. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  35827. c.ctx_ = ctx
  35828. return c
  35829. }
  35830. // Header returns an http.Header that can be modified by the caller to
  35831. // add HTTP headers to the request.
  35832. func (c *BackendServicesDeleteCall) Header() http.Header {
  35833. if c.header_ == nil {
  35834. c.header_ = make(http.Header)
  35835. }
  35836. return c.header_
  35837. }
  35838. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  35839. reqHeaders := make(http.Header)
  35840. for k, v := range c.header_ {
  35841. reqHeaders[k] = v
  35842. }
  35843. reqHeaders.Set("User-Agent", c.s.userAgent())
  35844. var body io.Reader = nil
  35845. c.urlParams_.Set("alt", alt)
  35846. c.urlParams_.Set("prettyPrint", "false")
  35847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  35848. urls += "?" + c.urlParams_.Encode()
  35849. req, err := http.NewRequest("DELETE", urls, body)
  35850. if err != nil {
  35851. return nil, err
  35852. }
  35853. req.Header = reqHeaders
  35854. googleapi.Expand(req.URL, map[string]string{
  35855. "project": c.project,
  35856. "backendService": c.backendService,
  35857. })
  35858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35859. }
  35860. // Do executes the "compute.backendServices.delete" call.
  35861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35862. // status code is an error. Response headers are in either
  35863. // *Operation.ServerResponse.Header or (if a response was returned at
  35864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35865. // to check whether the returned error was because
  35866. // http.StatusNotModified was returned.
  35867. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35868. gensupport.SetOptions(c.urlParams_, opts...)
  35869. res, err := c.doRequest("json")
  35870. if res != nil && res.StatusCode == http.StatusNotModified {
  35871. if res.Body != nil {
  35872. res.Body.Close()
  35873. }
  35874. return nil, &googleapi.Error{
  35875. Code: res.StatusCode,
  35876. Header: res.Header,
  35877. }
  35878. }
  35879. if err != nil {
  35880. return nil, err
  35881. }
  35882. defer googleapi.CloseBody(res)
  35883. if err := googleapi.CheckResponse(res); err != nil {
  35884. return nil, err
  35885. }
  35886. ret := &Operation{
  35887. ServerResponse: googleapi.ServerResponse{
  35888. Header: res.Header,
  35889. HTTPStatusCode: res.StatusCode,
  35890. },
  35891. }
  35892. target := &ret
  35893. if err := gensupport.DecodeResponse(target, res); err != nil {
  35894. return nil, err
  35895. }
  35896. return ret, nil
  35897. // {
  35898. // "description": "Deletes the specified BackendService resource.",
  35899. // "httpMethod": "DELETE",
  35900. // "id": "compute.backendServices.delete",
  35901. // "parameterOrder": [
  35902. // "project",
  35903. // "backendService"
  35904. // ],
  35905. // "parameters": {
  35906. // "backendService": {
  35907. // "description": "Name of the BackendService resource to delete.",
  35908. // "location": "path",
  35909. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35910. // "required": true,
  35911. // "type": "string"
  35912. // },
  35913. // "project": {
  35914. // "description": "Project ID for this request.",
  35915. // "location": "path",
  35916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35917. // "required": true,
  35918. // "type": "string"
  35919. // },
  35920. // "requestId": {
  35921. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35922. // "location": "query",
  35923. // "type": "string"
  35924. // }
  35925. // },
  35926. // "path": "{project}/global/backendServices/{backendService}",
  35927. // "response": {
  35928. // "$ref": "Operation"
  35929. // },
  35930. // "scopes": [
  35931. // "https://www.googleapis.com/auth/cloud-platform",
  35932. // "https://www.googleapis.com/auth/compute"
  35933. // ]
  35934. // }
  35935. }
  35936. // method id "compute.backendServices.deleteSignedUrlKey":
  35937. type BackendServicesDeleteSignedUrlKeyCall struct {
  35938. s *Service
  35939. project string
  35940. backendService string
  35941. urlParams_ gensupport.URLParams
  35942. ctx_ context.Context
  35943. header_ http.Header
  35944. }
  35945. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  35946. // URLs for this backend service.
  35947. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  35948. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35949. c.project = project
  35950. c.backendService = backendService
  35951. c.urlParams_.Set("keyName", keyName)
  35952. return c
  35953. }
  35954. // RequestId sets the optional parameter "requestId": An optional
  35955. // request ID to identify requests. Specify a unique request ID so that
  35956. // if you must retry your request, the server will know to ignore the
  35957. // request if it has already been completed.
  35958. //
  35959. // For example, consider a situation where you make an initial request
  35960. // and the request times out. If you make the request again with the
  35961. // same request ID, the server can check if original operation with the
  35962. // same request ID was received, and if so, will ignore the second
  35963. // request. This prevents clients from accidentally creating duplicate
  35964. // commitments.
  35965. //
  35966. // The request ID must be a valid UUID with the exception that zero UUID
  35967. // is not supported (00000000-0000-0000-0000-000000000000).
  35968. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  35969. c.urlParams_.Set("requestId", requestId)
  35970. return c
  35971. }
  35972. // Fields allows partial responses to be retrieved. See
  35973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35974. // for more information.
  35975. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  35976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35977. return c
  35978. }
  35979. // Context sets the context to be used in this call's Do method. Any
  35980. // pending HTTP request will be aborted if the provided context is
  35981. // canceled.
  35982. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  35983. c.ctx_ = ctx
  35984. return c
  35985. }
  35986. // Header returns an http.Header that can be modified by the caller to
  35987. // add HTTP headers to the request.
  35988. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  35989. if c.header_ == nil {
  35990. c.header_ = make(http.Header)
  35991. }
  35992. return c.header_
  35993. }
  35994. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  35995. reqHeaders := make(http.Header)
  35996. for k, v := range c.header_ {
  35997. reqHeaders[k] = v
  35998. }
  35999. reqHeaders.Set("User-Agent", c.s.userAgent())
  36000. var body io.Reader = nil
  36001. c.urlParams_.Set("alt", alt)
  36002. c.urlParams_.Set("prettyPrint", "false")
  36003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  36004. urls += "?" + c.urlParams_.Encode()
  36005. req, err := http.NewRequest("POST", urls, body)
  36006. if err != nil {
  36007. return nil, err
  36008. }
  36009. req.Header = reqHeaders
  36010. googleapi.Expand(req.URL, map[string]string{
  36011. "project": c.project,
  36012. "backendService": c.backendService,
  36013. })
  36014. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36015. }
  36016. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  36017. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36018. // status code is an error. Response headers are in either
  36019. // *Operation.ServerResponse.Header or (if a response was returned at
  36020. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36021. // to check whether the returned error was because
  36022. // http.StatusNotModified was returned.
  36023. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36024. gensupport.SetOptions(c.urlParams_, opts...)
  36025. res, err := c.doRequest("json")
  36026. if res != nil && res.StatusCode == http.StatusNotModified {
  36027. if res.Body != nil {
  36028. res.Body.Close()
  36029. }
  36030. return nil, &googleapi.Error{
  36031. Code: res.StatusCode,
  36032. Header: res.Header,
  36033. }
  36034. }
  36035. if err != nil {
  36036. return nil, err
  36037. }
  36038. defer googleapi.CloseBody(res)
  36039. if err := googleapi.CheckResponse(res); err != nil {
  36040. return nil, err
  36041. }
  36042. ret := &Operation{
  36043. ServerResponse: googleapi.ServerResponse{
  36044. Header: res.Header,
  36045. HTTPStatusCode: res.StatusCode,
  36046. },
  36047. }
  36048. target := &ret
  36049. if err := gensupport.DecodeResponse(target, res); err != nil {
  36050. return nil, err
  36051. }
  36052. return ret, nil
  36053. // {
  36054. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  36055. // "httpMethod": "POST",
  36056. // "id": "compute.backendServices.deleteSignedUrlKey",
  36057. // "parameterOrder": [
  36058. // "project",
  36059. // "backendService",
  36060. // "keyName"
  36061. // ],
  36062. // "parameters": {
  36063. // "backendService": {
  36064. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  36065. // "location": "path",
  36066. // "required": true,
  36067. // "type": "string"
  36068. // },
  36069. // "keyName": {
  36070. // "description": "The name of the Signed URL Key to delete.",
  36071. // "location": "query",
  36072. // "required": true,
  36073. // "type": "string"
  36074. // },
  36075. // "project": {
  36076. // "description": "Project ID for this request.",
  36077. // "location": "path",
  36078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36079. // "required": true,
  36080. // "type": "string"
  36081. // },
  36082. // "requestId": {
  36083. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36084. // "location": "query",
  36085. // "type": "string"
  36086. // }
  36087. // },
  36088. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  36089. // "response": {
  36090. // "$ref": "Operation"
  36091. // },
  36092. // "scopes": [
  36093. // "https://www.googleapis.com/auth/cloud-platform",
  36094. // "https://www.googleapis.com/auth/compute"
  36095. // ]
  36096. // }
  36097. }
  36098. // method id "compute.backendServices.get":
  36099. type BackendServicesGetCall struct {
  36100. s *Service
  36101. project string
  36102. backendService string
  36103. urlParams_ gensupport.URLParams
  36104. ifNoneMatch_ string
  36105. ctx_ context.Context
  36106. header_ http.Header
  36107. }
  36108. // Get: Returns the specified BackendService resource. Gets a list of
  36109. // available backend services.
  36110. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  36111. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  36112. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36113. c.project = project
  36114. c.backendService = backendService
  36115. return c
  36116. }
  36117. // Fields allows partial responses to be retrieved. See
  36118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36119. // for more information.
  36120. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  36121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36122. return c
  36123. }
  36124. // IfNoneMatch sets the optional parameter which makes the operation
  36125. // fail if the object's ETag matches the given value. This is useful for
  36126. // getting updates only after the object has changed since the last
  36127. // request. Use googleapi.IsNotModified to check whether the response
  36128. // error from Do is the result of In-None-Match.
  36129. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  36130. c.ifNoneMatch_ = entityTag
  36131. return c
  36132. }
  36133. // Context sets the context to be used in this call's Do method. Any
  36134. // pending HTTP request will be aborted if the provided context is
  36135. // canceled.
  36136. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  36137. c.ctx_ = ctx
  36138. return c
  36139. }
  36140. // Header returns an http.Header that can be modified by the caller to
  36141. // add HTTP headers to the request.
  36142. func (c *BackendServicesGetCall) Header() http.Header {
  36143. if c.header_ == nil {
  36144. c.header_ = make(http.Header)
  36145. }
  36146. return c.header_
  36147. }
  36148. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  36149. reqHeaders := make(http.Header)
  36150. for k, v := range c.header_ {
  36151. reqHeaders[k] = v
  36152. }
  36153. reqHeaders.Set("User-Agent", c.s.userAgent())
  36154. if c.ifNoneMatch_ != "" {
  36155. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36156. }
  36157. var body io.Reader = nil
  36158. c.urlParams_.Set("alt", alt)
  36159. c.urlParams_.Set("prettyPrint", "false")
  36160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  36161. urls += "?" + c.urlParams_.Encode()
  36162. req, err := http.NewRequest("GET", urls, body)
  36163. if err != nil {
  36164. return nil, err
  36165. }
  36166. req.Header = reqHeaders
  36167. googleapi.Expand(req.URL, map[string]string{
  36168. "project": c.project,
  36169. "backendService": c.backendService,
  36170. })
  36171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36172. }
  36173. // Do executes the "compute.backendServices.get" call.
  36174. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  36175. // status code is an error. Response headers are in either
  36176. // *BackendService.ServerResponse.Header or (if a response was returned
  36177. // at all) in error.(*googleapi.Error).Header. Use
  36178. // googleapi.IsNotModified to check whether the returned error was
  36179. // because http.StatusNotModified was returned.
  36180. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  36181. gensupport.SetOptions(c.urlParams_, opts...)
  36182. res, err := c.doRequest("json")
  36183. if res != nil && res.StatusCode == http.StatusNotModified {
  36184. if res.Body != nil {
  36185. res.Body.Close()
  36186. }
  36187. return nil, &googleapi.Error{
  36188. Code: res.StatusCode,
  36189. Header: res.Header,
  36190. }
  36191. }
  36192. if err != nil {
  36193. return nil, err
  36194. }
  36195. defer googleapi.CloseBody(res)
  36196. if err := googleapi.CheckResponse(res); err != nil {
  36197. return nil, err
  36198. }
  36199. ret := &BackendService{
  36200. ServerResponse: googleapi.ServerResponse{
  36201. Header: res.Header,
  36202. HTTPStatusCode: res.StatusCode,
  36203. },
  36204. }
  36205. target := &ret
  36206. if err := gensupport.DecodeResponse(target, res); err != nil {
  36207. return nil, err
  36208. }
  36209. return ret, nil
  36210. // {
  36211. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  36212. // "httpMethod": "GET",
  36213. // "id": "compute.backendServices.get",
  36214. // "parameterOrder": [
  36215. // "project",
  36216. // "backendService"
  36217. // ],
  36218. // "parameters": {
  36219. // "backendService": {
  36220. // "description": "Name of the BackendService resource to return.",
  36221. // "location": "path",
  36222. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36223. // "required": true,
  36224. // "type": "string"
  36225. // },
  36226. // "project": {
  36227. // "description": "Project ID for this request.",
  36228. // "location": "path",
  36229. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36230. // "required": true,
  36231. // "type": "string"
  36232. // }
  36233. // },
  36234. // "path": "{project}/global/backendServices/{backendService}",
  36235. // "response": {
  36236. // "$ref": "BackendService"
  36237. // },
  36238. // "scopes": [
  36239. // "https://www.googleapis.com/auth/cloud-platform",
  36240. // "https://www.googleapis.com/auth/compute",
  36241. // "https://www.googleapis.com/auth/compute.readonly"
  36242. // ]
  36243. // }
  36244. }
  36245. // method id "compute.backendServices.getHealth":
  36246. type BackendServicesGetHealthCall struct {
  36247. s *Service
  36248. project string
  36249. backendService string
  36250. resourcegroupreference *ResourceGroupReference
  36251. urlParams_ gensupport.URLParams
  36252. ctx_ context.Context
  36253. header_ http.Header
  36254. }
  36255. // GetHealth: Gets the most recent health check results for this
  36256. // BackendService.
  36257. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  36258. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  36259. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36260. c.project = project
  36261. c.backendService = backendService
  36262. c.resourcegroupreference = resourcegroupreference
  36263. return c
  36264. }
  36265. // Fields allows partial responses to be retrieved. See
  36266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36267. // for more information.
  36268. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  36269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36270. return c
  36271. }
  36272. // Context sets the context to be used in this call's Do method. Any
  36273. // pending HTTP request will be aborted if the provided context is
  36274. // canceled.
  36275. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  36276. c.ctx_ = ctx
  36277. return c
  36278. }
  36279. // Header returns an http.Header that can be modified by the caller to
  36280. // add HTTP headers to the request.
  36281. func (c *BackendServicesGetHealthCall) Header() http.Header {
  36282. if c.header_ == nil {
  36283. c.header_ = make(http.Header)
  36284. }
  36285. return c.header_
  36286. }
  36287. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  36288. reqHeaders := make(http.Header)
  36289. for k, v := range c.header_ {
  36290. reqHeaders[k] = v
  36291. }
  36292. reqHeaders.Set("User-Agent", c.s.userAgent())
  36293. var body io.Reader = nil
  36294. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  36295. if err != nil {
  36296. return nil, err
  36297. }
  36298. reqHeaders.Set("Content-Type", "application/json")
  36299. c.urlParams_.Set("alt", alt)
  36300. c.urlParams_.Set("prettyPrint", "false")
  36301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  36302. urls += "?" + c.urlParams_.Encode()
  36303. req, err := http.NewRequest("POST", urls, body)
  36304. if err != nil {
  36305. return nil, err
  36306. }
  36307. req.Header = reqHeaders
  36308. googleapi.Expand(req.URL, map[string]string{
  36309. "project": c.project,
  36310. "backendService": c.backendService,
  36311. })
  36312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36313. }
  36314. // Do executes the "compute.backendServices.getHealth" call.
  36315. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  36316. // Any non-2xx status code is an error. Response headers are in either
  36317. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  36318. // was returned at all) in error.(*googleapi.Error).Header. Use
  36319. // googleapi.IsNotModified to check whether the returned error was
  36320. // because http.StatusNotModified was returned.
  36321. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  36322. gensupport.SetOptions(c.urlParams_, opts...)
  36323. res, err := c.doRequest("json")
  36324. if res != nil && res.StatusCode == http.StatusNotModified {
  36325. if res.Body != nil {
  36326. res.Body.Close()
  36327. }
  36328. return nil, &googleapi.Error{
  36329. Code: res.StatusCode,
  36330. Header: res.Header,
  36331. }
  36332. }
  36333. if err != nil {
  36334. return nil, err
  36335. }
  36336. defer googleapi.CloseBody(res)
  36337. if err := googleapi.CheckResponse(res); err != nil {
  36338. return nil, err
  36339. }
  36340. ret := &BackendServiceGroupHealth{
  36341. ServerResponse: googleapi.ServerResponse{
  36342. Header: res.Header,
  36343. HTTPStatusCode: res.StatusCode,
  36344. },
  36345. }
  36346. target := &ret
  36347. if err := gensupport.DecodeResponse(target, res); err != nil {
  36348. return nil, err
  36349. }
  36350. return ret, nil
  36351. // {
  36352. // "description": "Gets the most recent health check results for this BackendService.",
  36353. // "httpMethod": "POST",
  36354. // "id": "compute.backendServices.getHealth",
  36355. // "parameterOrder": [
  36356. // "project",
  36357. // "backendService"
  36358. // ],
  36359. // "parameters": {
  36360. // "backendService": {
  36361. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  36362. // "location": "path",
  36363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36364. // "required": true,
  36365. // "type": "string"
  36366. // },
  36367. // "project": {
  36368. // "location": "path",
  36369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36370. // "required": true,
  36371. // "type": "string"
  36372. // }
  36373. // },
  36374. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  36375. // "request": {
  36376. // "$ref": "ResourceGroupReference"
  36377. // },
  36378. // "response": {
  36379. // "$ref": "BackendServiceGroupHealth"
  36380. // },
  36381. // "scopes": [
  36382. // "https://www.googleapis.com/auth/cloud-platform",
  36383. // "https://www.googleapis.com/auth/compute",
  36384. // "https://www.googleapis.com/auth/compute.readonly"
  36385. // ]
  36386. // }
  36387. }
  36388. // method id "compute.backendServices.insert":
  36389. type BackendServicesInsertCall struct {
  36390. s *Service
  36391. project string
  36392. backendservice *BackendService
  36393. urlParams_ gensupport.URLParams
  36394. ctx_ context.Context
  36395. header_ http.Header
  36396. }
  36397. // Insert: Creates a BackendService resource in the specified project
  36398. // using the data included in the request. There are several
  36399. // restrictions and guidelines to keep in mind when creating a backend
  36400. // service. Read Restrictions and Guidelines for more information.
  36401. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  36402. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  36403. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36404. c.project = project
  36405. c.backendservice = backendservice
  36406. return c
  36407. }
  36408. // RequestId sets the optional parameter "requestId": An optional
  36409. // request ID to identify requests. Specify a unique request ID so that
  36410. // if you must retry your request, the server will know to ignore the
  36411. // request if it has already been completed.
  36412. //
  36413. // For example, consider a situation where you make an initial request
  36414. // and the request times out. If you make the request again with the
  36415. // same request ID, the server can check if original operation with the
  36416. // same request ID was received, and if so, will ignore the second
  36417. // request. This prevents clients from accidentally creating duplicate
  36418. // commitments.
  36419. //
  36420. // The request ID must be a valid UUID with the exception that zero UUID
  36421. // is not supported (00000000-0000-0000-0000-000000000000).
  36422. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  36423. c.urlParams_.Set("requestId", requestId)
  36424. return c
  36425. }
  36426. // Fields allows partial responses to be retrieved. See
  36427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36428. // for more information.
  36429. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  36430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36431. return c
  36432. }
  36433. // Context sets the context to be used in this call's Do method. Any
  36434. // pending HTTP request will be aborted if the provided context is
  36435. // canceled.
  36436. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  36437. c.ctx_ = ctx
  36438. return c
  36439. }
  36440. // Header returns an http.Header that can be modified by the caller to
  36441. // add HTTP headers to the request.
  36442. func (c *BackendServicesInsertCall) Header() http.Header {
  36443. if c.header_ == nil {
  36444. c.header_ = make(http.Header)
  36445. }
  36446. return c.header_
  36447. }
  36448. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  36449. reqHeaders := make(http.Header)
  36450. for k, v := range c.header_ {
  36451. reqHeaders[k] = v
  36452. }
  36453. reqHeaders.Set("User-Agent", c.s.userAgent())
  36454. var body io.Reader = nil
  36455. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  36456. if err != nil {
  36457. return nil, err
  36458. }
  36459. reqHeaders.Set("Content-Type", "application/json")
  36460. c.urlParams_.Set("alt", alt)
  36461. c.urlParams_.Set("prettyPrint", "false")
  36462. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  36463. urls += "?" + c.urlParams_.Encode()
  36464. req, err := http.NewRequest("POST", urls, body)
  36465. if err != nil {
  36466. return nil, err
  36467. }
  36468. req.Header = reqHeaders
  36469. googleapi.Expand(req.URL, map[string]string{
  36470. "project": c.project,
  36471. })
  36472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36473. }
  36474. // Do executes the "compute.backendServices.insert" call.
  36475. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36476. // status code is an error. Response headers are in either
  36477. // *Operation.ServerResponse.Header or (if a response was returned at
  36478. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36479. // to check whether the returned error was because
  36480. // http.StatusNotModified was returned.
  36481. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36482. gensupport.SetOptions(c.urlParams_, opts...)
  36483. res, err := c.doRequest("json")
  36484. if res != nil && res.StatusCode == http.StatusNotModified {
  36485. if res.Body != nil {
  36486. res.Body.Close()
  36487. }
  36488. return nil, &googleapi.Error{
  36489. Code: res.StatusCode,
  36490. Header: res.Header,
  36491. }
  36492. }
  36493. if err != nil {
  36494. return nil, err
  36495. }
  36496. defer googleapi.CloseBody(res)
  36497. if err := googleapi.CheckResponse(res); err != nil {
  36498. return nil, err
  36499. }
  36500. ret := &Operation{
  36501. ServerResponse: googleapi.ServerResponse{
  36502. Header: res.Header,
  36503. HTTPStatusCode: res.StatusCode,
  36504. },
  36505. }
  36506. target := &ret
  36507. if err := gensupport.DecodeResponse(target, res); err != nil {
  36508. return nil, err
  36509. }
  36510. return ret, nil
  36511. // {
  36512. // "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.",
  36513. // "httpMethod": "POST",
  36514. // "id": "compute.backendServices.insert",
  36515. // "parameterOrder": [
  36516. // "project"
  36517. // ],
  36518. // "parameters": {
  36519. // "project": {
  36520. // "description": "Project ID for this request.",
  36521. // "location": "path",
  36522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36523. // "required": true,
  36524. // "type": "string"
  36525. // },
  36526. // "requestId": {
  36527. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36528. // "location": "query",
  36529. // "type": "string"
  36530. // }
  36531. // },
  36532. // "path": "{project}/global/backendServices",
  36533. // "request": {
  36534. // "$ref": "BackendService"
  36535. // },
  36536. // "response": {
  36537. // "$ref": "Operation"
  36538. // },
  36539. // "scopes": [
  36540. // "https://www.googleapis.com/auth/cloud-platform",
  36541. // "https://www.googleapis.com/auth/compute"
  36542. // ]
  36543. // }
  36544. }
  36545. // method id "compute.backendServices.list":
  36546. type BackendServicesListCall struct {
  36547. s *Service
  36548. project string
  36549. urlParams_ gensupport.URLParams
  36550. ifNoneMatch_ string
  36551. ctx_ context.Context
  36552. header_ http.Header
  36553. }
  36554. // List: Retrieves the list of BackendService resources available to the
  36555. // specified project.
  36556. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  36557. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  36558. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36559. c.project = project
  36560. return c
  36561. }
  36562. // Filter sets the optional parameter "filter": A filter expression that
  36563. // filters resources listed in the response. The expression must specify
  36564. // the field name, a comparison operator, and the value that you want to
  36565. // use for filtering. The value must be a string, a number, or a
  36566. // boolean. The comparison operator must be either =, !=, >, or <.
  36567. //
  36568. // For example, if you are filtering Compute Engine instances, you can
  36569. // exclude instances named example-instance by specifying name !=
  36570. // example-instance.
  36571. //
  36572. // You can also filter nested fields. For example, you could specify
  36573. // scheduling.automaticRestart = false to include instances only if they
  36574. // are not scheduled for automatic restarts. You can use filtering on
  36575. // nested fields to filter based on resource labels.
  36576. //
  36577. // To filter on multiple expressions, provide each separate expression
  36578. // within parentheses. For example, (scheduling.automaticRestart = true)
  36579. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36580. // AND expression. However, you can include AND and OR expressions
  36581. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36582. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36583. // true).
  36584. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  36585. c.urlParams_.Set("filter", filter)
  36586. return c
  36587. }
  36588. // MaxResults sets the optional parameter "maxResults": The maximum
  36589. // number of results per page that should be returned. If the number of
  36590. // available results is larger than maxResults, Compute Engine returns a
  36591. // nextPageToken that can be used to get the next page of results in
  36592. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36593. // (Default: 500)
  36594. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  36595. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36596. return c
  36597. }
  36598. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36599. // a certain order. By default, results are returned in alphanumerical
  36600. // order based on the resource name.
  36601. //
  36602. // You can also sort results in descending order based on the creation
  36603. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36604. // based on the creationTimestamp field in reverse chronological order
  36605. // (newest result first). Use this to sort resources like operations so
  36606. // that the newest operation is returned first.
  36607. //
  36608. // Currently, only sorting by name or creationTimestamp desc is
  36609. // supported.
  36610. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  36611. c.urlParams_.Set("orderBy", orderBy)
  36612. return c
  36613. }
  36614. // PageToken sets the optional parameter "pageToken": Specifies a page
  36615. // token to use. Set pageToken to the nextPageToken returned by a
  36616. // previous list request to get the next page of results.
  36617. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  36618. c.urlParams_.Set("pageToken", pageToken)
  36619. return c
  36620. }
  36621. // Fields allows partial responses to be retrieved. See
  36622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36623. // for more information.
  36624. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  36625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36626. return c
  36627. }
  36628. // IfNoneMatch sets the optional parameter which makes the operation
  36629. // fail if the object's ETag matches the given value. This is useful for
  36630. // getting updates only after the object has changed since the last
  36631. // request. Use googleapi.IsNotModified to check whether the response
  36632. // error from Do is the result of In-None-Match.
  36633. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  36634. c.ifNoneMatch_ = entityTag
  36635. return c
  36636. }
  36637. // Context sets the context to be used in this call's Do method. Any
  36638. // pending HTTP request will be aborted if the provided context is
  36639. // canceled.
  36640. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  36641. c.ctx_ = ctx
  36642. return c
  36643. }
  36644. // Header returns an http.Header that can be modified by the caller to
  36645. // add HTTP headers to the request.
  36646. func (c *BackendServicesListCall) Header() http.Header {
  36647. if c.header_ == nil {
  36648. c.header_ = make(http.Header)
  36649. }
  36650. return c.header_
  36651. }
  36652. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  36653. reqHeaders := make(http.Header)
  36654. for k, v := range c.header_ {
  36655. reqHeaders[k] = v
  36656. }
  36657. reqHeaders.Set("User-Agent", c.s.userAgent())
  36658. if c.ifNoneMatch_ != "" {
  36659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36660. }
  36661. var body io.Reader = nil
  36662. c.urlParams_.Set("alt", alt)
  36663. c.urlParams_.Set("prettyPrint", "false")
  36664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  36665. urls += "?" + c.urlParams_.Encode()
  36666. req, err := http.NewRequest("GET", urls, body)
  36667. if err != nil {
  36668. return nil, err
  36669. }
  36670. req.Header = reqHeaders
  36671. googleapi.Expand(req.URL, map[string]string{
  36672. "project": c.project,
  36673. })
  36674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36675. }
  36676. // Do executes the "compute.backendServices.list" call.
  36677. // Exactly one of *BackendServiceList or error will be non-nil. Any
  36678. // non-2xx status code is an error. Response headers are in either
  36679. // *BackendServiceList.ServerResponse.Header or (if a response was
  36680. // returned at all) in error.(*googleapi.Error).Header. Use
  36681. // googleapi.IsNotModified to check whether the returned error was
  36682. // because http.StatusNotModified was returned.
  36683. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  36684. gensupport.SetOptions(c.urlParams_, opts...)
  36685. res, err := c.doRequest("json")
  36686. if res != nil && res.StatusCode == http.StatusNotModified {
  36687. if res.Body != nil {
  36688. res.Body.Close()
  36689. }
  36690. return nil, &googleapi.Error{
  36691. Code: res.StatusCode,
  36692. Header: res.Header,
  36693. }
  36694. }
  36695. if err != nil {
  36696. return nil, err
  36697. }
  36698. defer googleapi.CloseBody(res)
  36699. if err := googleapi.CheckResponse(res); err != nil {
  36700. return nil, err
  36701. }
  36702. ret := &BackendServiceList{
  36703. ServerResponse: googleapi.ServerResponse{
  36704. Header: res.Header,
  36705. HTTPStatusCode: res.StatusCode,
  36706. },
  36707. }
  36708. target := &ret
  36709. if err := gensupport.DecodeResponse(target, res); err != nil {
  36710. return nil, err
  36711. }
  36712. return ret, nil
  36713. // {
  36714. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  36715. // "httpMethod": "GET",
  36716. // "id": "compute.backendServices.list",
  36717. // "parameterOrder": [
  36718. // "project"
  36719. // ],
  36720. // "parameters": {
  36721. // "filter": {
  36722. // "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).",
  36723. // "location": "query",
  36724. // "type": "string"
  36725. // },
  36726. // "maxResults": {
  36727. // "default": "500",
  36728. // "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)",
  36729. // "format": "uint32",
  36730. // "location": "query",
  36731. // "minimum": "0",
  36732. // "type": "integer"
  36733. // },
  36734. // "orderBy": {
  36735. // "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.",
  36736. // "location": "query",
  36737. // "type": "string"
  36738. // },
  36739. // "pageToken": {
  36740. // "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.",
  36741. // "location": "query",
  36742. // "type": "string"
  36743. // },
  36744. // "project": {
  36745. // "description": "Project ID for this request.",
  36746. // "location": "path",
  36747. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36748. // "required": true,
  36749. // "type": "string"
  36750. // }
  36751. // },
  36752. // "path": "{project}/global/backendServices",
  36753. // "response": {
  36754. // "$ref": "BackendServiceList"
  36755. // },
  36756. // "scopes": [
  36757. // "https://www.googleapis.com/auth/cloud-platform",
  36758. // "https://www.googleapis.com/auth/compute",
  36759. // "https://www.googleapis.com/auth/compute.readonly"
  36760. // ]
  36761. // }
  36762. }
  36763. // Pages invokes f for each page of results.
  36764. // A non-nil error returned from f will halt the iteration.
  36765. // The provided context supersedes any context provided to the Context method.
  36766. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  36767. c.ctx_ = ctx
  36768. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36769. for {
  36770. x, err := c.Do()
  36771. if err != nil {
  36772. return err
  36773. }
  36774. if err := f(x); err != nil {
  36775. return err
  36776. }
  36777. if x.NextPageToken == "" {
  36778. return nil
  36779. }
  36780. c.PageToken(x.NextPageToken)
  36781. }
  36782. }
  36783. // method id "compute.backendServices.patch":
  36784. type BackendServicesPatchCall struct {
  36785. s *Service
  36786. project string
  36787. backendService string
  36788. backendservice *BackendService
  36789. urlParams_ gensupport.URLParams
  36790. ctx_ context.Context
  36791. header_ http.Header
  36792. }
  36793. // Patch: Patches the specified BackendService resource with the data
  36794. // included in the request. There are several restrictions and
  36795. // guidelines to keep in mind when updating a backend service. Read
  36796. // Restrictions and Guidelines for more information. This method
  36797. // supports PATCH semantics and uses the JSON merge patch format and
  36798. // processing rules.
  36799. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  36800. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  36801. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36802. c.project = project
  36803. c.backendService = backendService
  36804. c.backendservice = backendservice
  36805. return c
  36806. }
  36807. // RequestId sets the optional parameter "requestId": An optional
  36808. // request ID to identify requests. Specify a unique request ID so that
  36809. // if you must retry your request, the server will know to ignore the
  36810. // request if it has already been completed.
  36811. //
  36812. // For example, consider a situation where you make an initial request
  36813. // and the request times out. If you make the request again with the
  36814. // same request ID, the server can check if original operation with the
  36815. // same request ID was received, and if so, will ignore the second
  36816. // request. This prevents clients from accidentally creating duplicate
  36817. // commitments.
  36818. //
  36819. // The request ID must be a valid UUID with the exception that zero UUID
  36820. // is not supported (00000000-0000-0000-0000-000000000000).
  36821. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  36822. c.urlParams_.Set("requestId", requestId)
  36823. return c
  36824. }
  36825. // Fields allows partial responses to be retrieved. See
  36826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36827. // for more information.
  36828. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  36829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36830. return c
  36831. }
  36832. // Context sets the context to be used in this call's Do method. Any
  36833. // pending HTTP request will be aborted if the provided context is
  36834. // canceled.
  36835. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  36836. c.ctx_ = ctx
  36837. return c
  36838. }
  36839. // Header returns an http.Header that can be modified by the caller to
  36840. // add HTTP headers to the request.
  36841. func (c *BackendServicesPatchCall) Header() http.Header {
  36842. if c.header_ == nil {
  36843. c.header_ = make(http.Header)
  36844. }
  36845. return c.header_
  36846. }
  36847. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  36848. reqHeaders := make(http.Header)
  36849. for k, v := range c.header_ {
  36850. reqHeaders[k] = v
  36851. }
  36852. reqHeaders.Set("User-Agent", c.s.userAgent())
  36853. var body io.Reader = nil
  36854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  36855. if err != nil {
  36856. return nil, err
  36857. }
  36858. reqHeaders.Set("Content-Type", "application/json")
  36859. c.urlParams_.Set("alt", alt)
  36860. c.urlParams_.Set("prettyPrint", "false")
  36861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  36862. urls += "?" + c.urlParams_.Encode()
  36863. req, err := http.NewRequest("PATCH", urls, body)
  36864. if err != nil {
  36865. return nil, err
  36866. }
  36867. req.Header = reqHeaders
  36868. googleapi.Expand(req.URL, map[string]string{
  36869. "project": c.project,
  36870. "backendService": c.backendService,
  36871. })
  36872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36873. }
  36874. // Do executes the "compute.backendServices.patch" call.
  36875. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36876. // status code is an error. Response headers are in either
  36877. // *Operation.ServerResponse.Header or (if a response was returned at
  36878. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36879. // to check whether the returned error was because
  36880. // http.StatusNotModified was returned.
  36881. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36882. gensupport.SetOptions(c.urlParams_, opts...)
  36883. res, err := c.doRequest("json")
  36884. if res != nil && res.StatusCode == http.StatusNotModified {
  36885. if res.Body != nil {
  36886. res.Body.Close()
  36887. }
  36888. return nil, &googleapi.Error{
  36889. Code: res.StatusCode,
  36890. Header: res.Header,
  36891. }
  36892. }
  36893. if err != nil {
  36894. return nil, err
  36895. }
  36896. defer googleapi.CloseBody(res)
  36897. if err := googleapi.CheckResponse(res); err != nil {
  36898. return nil, err
  36899. }
  36900. ret := &Operation{
  36901. ServerResponse: googleapi.ServerResponse{
  36902. Header: res.Header,
  36903. HTTPStatusCode: res.StatusCode,
  36904. },
  36905. }
  36906. target := &ret
  36907. if err := gensupport.DecodeResponse(target, res); err != nil {
  36908. return nil, err
  36909. }
  36910. return ret, nil
  36911. // {
  36912. // "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.",
  36913. // "httpMethod": "PATCH",
  36914. // "id": "compute.backendServices.patch",
  36915. // "parameterOrder": [
  36916. // "project",
  36917. // "backendService"
  36918. // ],
  36919. // "parameters": {
  36920. // "backendService": {
  36921. // "description": "Name of the BackendService resource to patch.",
  36922. // "location": "path",
  36923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36924. // "required": true,
  36925. // "type": "string"
  36926. // },
  36927. // "project": {
  36928. // "description": "Project ID for this request.",
  36929. // "location": "path",
  36930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36931. // "required": true,
  36932. // "type": "string"
  36933. // },
  36934. // "requestId": {
  36935. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36936. // "location": "query",
  36937. // "type": "string"
  36938. // }
  36939. // },
  36940. // "path": "{project}/global/backendServices/{backendService}",
  36941. // "request": {
  36942. // "$ref": "BackendService"
  36943. // },
  36944. // "response": {
  36945. // "$ref": "Operation"
  36946. // },
  36947. // "scopes": [
  36948. // "https://www.googleapis.com/auth/cloud-platform",
  36949. // "https://www.googleapis.com/auth/compute"
  36950. // ]
  36951. // }
  36952. }
  36953. // method id "compute.backendServices.setSecurityPolicy":
  36954. type BackendServicesSetSecurityPolicyCall struct {
  36955. s *Service
  36956. project string
  36957. backendService string
  36958. securitypolicyreference *SecurityPolicyReference
  36959. urlParams_ gensupport.URLParams
  36960. ctx_ context.Context
  36961. header_ http.Header
  36962. }
  36963. // SetSecurityPolicy: Sets the security policy for the specified backend
  36964. // service.
  36965. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  36966. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36967. c.project = project
  36968. c.backendService = backendService
  36969. c.securitypolicyreference = securitypolicyreference
  36970. return c
  36971. }
  36972. // RequestId sets the optional parameter "requestId": An optional
  36973. // request ID to identify requests. Specify a unique request ID so that
  36974. // if you must retry your request, the server will know to ignore the
  36975. // request if it has already been completed.
  36976. //
  36977. // For example, consider a situation where you make an initial request
  36978. // and the request times out. If you make the request again with the
  36979. // same request ID, the server can check if original operation with the
  36980. // same request ID was received, and if so, will ignore the second
  36981. // request. This prevents clients from accidentally creating duplicate
  36982. // commitments.
  36983. //
  36984. // The request ID must be a valid UUID with the exception that zero UUID
  36985. // is not supported (00000000-0000-0000-0000-000000000000).
  36986. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  36987. c.urlParams_.Set("requestId", requestId)
  36988. return c
  36989. }
  36990. // Fields allows partial responses to be retrieved. See
  36991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36992. // for more information.
  36993. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  36994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36995. return c
  36996. }
  36997. // Context sets the context to be used in this call's Do method. Any
  36998. // pending HTTP request will be aborted if the provided context is
  36999. // canceled.
  37000. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  37001. c.ctx_ = ctx
  37002. return c
  37003. }
  37004. // Header returns an http.Header that can be modified by the caller to
  37005. // add HTTP headers to the request.
  37006. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  37007. if c.header_ == nil {
  37008. c.header_ = make(http.Header)
  37009. }
  37010. return c.header_
  37011. }
  37012. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  37013. reqHeaders := make(http.Header)
  37014. for k, v := range c.header_ {
  37015. reqHeaders[k] = v
  37016. }
  37017. reqHeaders.Set("User-Agent", c.s.userAgent())
  37018. var body io.Reader = nil
  37019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  37020. if err != nil {
  37021. return nil, err
  37022. }
  37023. reqHeaders.Set("Content-Type", "application/json")
  37024. c.urlParams_.Set("alt", alt)
  37025. c.urlParams_.Set("prettyPrint", "false")
  37026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  37027. urls += "?" + c.urlParams_.Encode()
  37028. req, err := http.NewRequest("POST", urls, body)
  37029. if err != nil {
  37030. return nil, err
  37031. }
  37032. req.Header = reqHeaders
  37033. googleapi.Expand(req.URL, map[string]string{
  37034. "project": c.project,
  37035. "backendService": c.backendService,
  37036. })
  37037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37038. }
  37039. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  37040. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37041. // status code is an error. Response headers are in either
  37042. // *Operation.ServerResponse.Header or (if a response was returned at
  37043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37044. // to check whether the returned error was because
  37045. // http.StatusNotModified was returned.
  37046. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37047. gensupport.SetOptions(c.urlParams_, opts...)
  37048. res, err := c.doRequest("json")
  37049. if res != nil && res.StatusCode == http.StatusNotModified {
  37050. if res.Body != nil {
  37051. res.Body.Close()
  37052. }
  37053. return nil, &googleapi.Error{
  37054. Code: res.StatusCode,
  37055. Header: res.Header,
  37056. }
  37057. }
  37058. if err != nil {
  37059. return nil, err
  37060. }
  37061. defer googleapi.CloseBody(res)
  37062. if err := googleapi.CheckResponse(res); err != nil {
  37063. return nil, err
  37064. }
  37065. ret := &Operation{
  37066. ServerResponse: googleapi.ServerResponse{
  37067. Header: res.Header,
  37068. HTTPStatusCode: res.StatusCode,
  37069. },
  37070. }
  37071. target := &ret
  37072. if err := gensupport.DecodeResponse(target, res); err != nil {
  37073. return nil, err
  37074. }
  37075. return ret, nil
  37076. // {
  37077. // "description": "Sets the security policy for the specified backend service.",
  37078. // "httpMethod": "POST",
  37079. // "id": "compute.backendServices.setSecurityPolicy",
  37080. // "parameterOrder": [
  37081. // "project",
  37082. // "backendService"
  37083. // ],
  37084. // "parameters": {
  37085. // "backendService": {
  37086. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  37087. // "location": "path",
  37088. // "required": true,
  37089. // "type": "string"
  37090. // },
  37091. // "project": {
  37092. // "description": "Project ID for this request.",
  37093. // "location": "path",
  37094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37095. // "required": true,
  37096. // "type": "string"
  37097. // },
  37098. // "requestId": {
  37099. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37100. // "location": "query",
  37101. // "type": "string"
  37102. // }
  37103. // },
  37104. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  37105. // "request": {
  37106. // "$ref": "SecurityPolicyReference"
  37107. // },
  37108. // "response": {
  37109. // "$ref": "Operation"
  37110. // },
  37111. // "scopes": [
  37112. // "https://www.googleapis.com/auth/cloud-platform",
  37113. // "https://www.googleapis.com/auth/compute"
  37114. // ]
  37115. // }
  37116. }
  37117. // method id "compute.backendServices.testIamPermissions":
  37118. type BackendServicesTestIamPermissionsCall struct {
  37119. s *Service
  37120. project string
  37121. resource string
  37122. testpermissionsrequest *TestPermissionsRequest
  37123. urlParams_ gensupport.URLParams
  37124. ctx_ context.Context
  37125. header_ http.Header
  37126. }
  37127. // TestIamPermissions: Returns permissions that a caller has on the
  37128. // specified resource.
  37129. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  37130. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37131. c.project = project
  37132. c.resource = resource
  37133. c.testpermissionsrequest = testpermissionsrequest
  37134. return c
  37135. }
  37136. // Fields allows partial responses to be retrieved. See
  37137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37138. // for more information.
  37139. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  37140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37141. return c
  37142. }
  37143. // Context sets the context to be used in this call's Do method. Any
  37144. // pending HTTP request will be aborted if the provided context is
  37145. // canceled.
  37146. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  37147. c.ctx_ = ctx
  37148. return c
  37149. }
  37150. // Header returns an http.Header that can be modified by the caller to
  37151. // add HTTP headers to the request.
  37152. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  37153. if c.header_ == nil {
  37154. c.header_ = make(http.Header)
  37155. }
  37156. return c.header_
  37157. }
  37158. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  37159. reqHeaders := make(http.Header)
  37160. for k, v := range c.header_ {
  37161. reqHeaders[k] = v
  37162. }
  37163. reqHeaders.Set("User-Agent", c.s.userAgent())
  37164. var body io.Reader = nil
  37165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  37166. if err != nil {
  37167. return nil, err
  37168. }
  37169. reqHeaders.Set("Content-Type", "application/json")
  37170. c.urlParams_.Set("alt", alt)
  37171. c.urlParams_.Set("prettyPrint", "false")
  37172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  37173. urls += "?" + c.urlParams_.Encode()
  37174. req, err := http.NewRequest("POST", urls, body)
  37175. if err != nil {
  37176. return nil, err
  37177. }
  37178. req.Header = reqHeaders
  37179. googleapi.Expand(req.URL, map[string]string{
  37180. "project": c.project,
  37181. "resource": c.resource,
  37182. })
  37183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37184. }
  37185. // Do executes the "compute.backendServices.testIamPermissions" call.
  37186. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  37187. // non-2xx status code is an error. Response headers are in either
  37188. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  37189. // returned at all) in error.(*googleapi.Error).Header. Use
  37190. // googleapi.IsNotModified to check whether the returned error was
  37191. // because http.StatusNotModified was returned.
  37192. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  37193. gensupport.SetOptions(c.urlParams_, opts...)
  37194. res, err := c.doRequest("json")
  37195. if res != nil && res.StatusCode == http.StatusNotModified {
  37196. if res.Body != nil {
  37197. res.Body.Close()
  37198. }
  37199. return nil, &googleapi.Error{
  37200. Code: res.StatusCode,
  37201. Header: res.Header,
  37202. }
  37203. }
  37204. if err != nil {
  37205. return nil, err
  37206. }
  37207. defer googleapi.CloseBody(res)
  37208. if err := googleapi.CheckResponse(res); err != nil {
  37209. return nil, err
  37210. }
  37211. ret := &TestPermissionsResponse{
  37212. ServerResponse: googleapi.ServerResponse{
  37213. Header: res.Header,
  37214. HTTPStatusCode: res.StatusCode,
  37215. },
  37216. }
  37217. target := &ret
  37218. if err := gensupport.DecodeResponse(target, res); err != nil {
  37219. return nil, err
  37220. }
  37221. return ret, nil
  37222. // {
  37223. // "description": "Returns permissions that a caller has on the specified resource.",
  37224. // "httpMethod": "POST",
  37225. // "id": "compute.backendServices.testIamPermissions",
  37226. // "parameterOrder": [
  37227. // "project",
  37228. // "resource"
  37229. // ],
  37230. // "parameters": {
  37231. // "project": {
  37232. // "description": "Project ID for this request.",
  37233. // "location": "path",
  37234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37235. // "required": true,
  37236. // "type": "string"
  37237. // },
  37238. // "resource": {
  37239. // "description": "Name or id of the resource for this request.",
  37240. // "location": "path",
  37241. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37242. // "required": true,
  37243. // "type": "string"
  37244. // }
  37245. // },
  37246. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  37247. // "request": {
  37248. // "$ref": "TestPermissionsRequest"
  37249. // },
  37250. // "response": {
  37251. // "$ref": "TestPermissionsResponse"
  37252. // },
  37253. // "scopes": [
  37254. // "https://www.googleapis.com/auth/cloud-platform",
  37255. // "https://www.googleapis.com/auth/compute",
  37256. // "https://www.googleapis.com/auth/compute.readonly"
  37257. // ]
  37258. // }
  37259. }
  37260. // method id "compute.backendServices.update":
  37261. type BackendServicesUpdateCall struct {
  37262. s *Service
  37263. project string
  37264. backendService string
  37265. backendservice *BackendService
  37266. urlParams_ gensupport.URLParams
  37267. ctx_ context.Context
  37268. header_ http.Header
  37269. }
  37270. // Update: Updates the specified BackendService resource with the data
  37271. // included in the request. There are several restrictions and
  37272. // guidelines to keep in mind when updating a backend service. Read
  37273. // Restrictions and Guidelines for more information.
  37274. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  37275. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  37276. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37277. c.project = project
  37278. c.backendService = backendService
  37279. c.backendservice = backendservice
  37280. return c
  37281. }
  37282. // RequestId sets the optional parameter "requestId": An optional
  37283. // request ID to identify requests. Specify a unique request ID so that
  37284. // if you must retry your request, the server will know to ignore the
  37285. // request if it has already been completed.
  37286. //
  37287. // For example, consider a situation where you make an initial request
  37288. // and the request times out. If you make the request again with the
  37289. // same request ID, the server can check if original operation with the
  37290. // same request ID was received, and if so, will ignore the second
  37291. // request. This prevents clients from accidentally creating duplicate
  37292. // commitments.
  37293. //
  37294. // The request ID must be a valid UUID with the exception that zero UUID
  37295. // is not supported (00000000-0000-0000-0000-000000000000).
  37296. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  37297. c.urlParams_.Set("requestId", requestId)
  37298. return c
  37299. }
  37300. // Fields allows partial responses to be retrieved. See
  37301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37302. // for more information.
  37303. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  37304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37305. return c
  37306. }
  37307. // Context sets the context to be used in this call's Do method. Any
  37308. // pending HTTP request will be aborted if the provided context is
  37309. // canceled.
  37310. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  37311. c.ctx_ = ctx
  37312. return c
  37313. }
  37314. // Header returns an http.Header that can be modified by the caller to
  37315. // add HTTP headers to the request.
  37316. func (c *BackendServicesUpdateCall) Header() http.Header {
  37317. if c.header_ == nil {
  37318. c.header_ = make(http.Header)
  37319. }
  37320. return c.header_
  37321. }
  37322. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  37323. reqHeaders := make(http.Header)
  37324. for k, v := range c.header_ {
  37325. reqHeaders[k] = v
  37326. }
  37327. reqHeaders.Set("User-Agent", c.s.userAgent())
  37328. var body io.Reader = nil
  37329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  37330. if err != nil {
  37331. return nil, err
  37332. }
  37333. reqHeaders.Set("Content-Type", "application/json")
  37334. c.urlParams_.Set("alt", alt)
  37335. c.urlParams_.Set("prettyPrint", "false")
  37336. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  37337. urls += "?" + c.urlParams_.Encode()
  37338. req, err := http.NewRequest("PUT", urls, body)
  37339. if err != nil {
  37340. return nil, err
  37341. }
  37342. req.Header = reqHeaders
  37343. googleapi.Expand(req.URL, map[string]string{
  37344. "project": c.project,
  37345. "backendService": c.backendService,
  37346. })
  37347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37348. }
  37349. // Do executes the "compute.backendServices.update" call.
  37350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37351. // status code is an error. Response headers are in either
  37352. // *Operation.ServerResponse.Header or (if a response was returned at
  37353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37354. // to check whether the returned error was because
  37355. // http.StatusNotModified was returned.
  37356. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37357. gensupport.SetOptions(c.urlParams_, opts...)
  37358. res, err := c.doRequest("json")
  37359. if res != nil && res.StatusCode == http.StatusNotModified {
  37360. if res.Body != nil {
  37361. res.Body.Close()
  37362. }
  37363. return nil, &googleapi.Error{
  37364. Code: res.StatusCode,
  37365. Header: res.Header,
  37366. }
  37367. }
  37368. if err != nil {
  37369. return nil, err
  37370. }
  37371. defer googleapi.CloseBody(res)
  37372. if err := googleapi.CheckResponse(res); err != nil {
  37373. return nil, err
  37374. }
  37375. ret := &Operation{
  37376. ServerResponse: googleapi.ServerResponse{
  37377. Header: res.Header,
  37378. HTTPStatusCode: res.StatusCode,
  37379. },
  37380. }
  37381. target := &ret
  37382. if err := gensupport.DecodeResponse(target, res); err != nil {
  37383. return nil, err
  37384. }
  37385. return ret, nil
  37386. // {
  37387. // "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.",
  37388. // "httpMethod": "PUT",
  37389. // "id": "compute.backendServices.update",
  37390. // "parameterOrder": [
  37391. // "project",
  37392. // "backendService"
  37393. // ],
  37394. // "parameters": {
  37395. // "backendService": {
  37396. // "description": "Name of the BackendService resource to update.",
  37397. // "location": "path",
  37398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37399. // "required": true,
  37400. // "type": "string"
  37401. // },
  37402. // "project": {
  37403. // "description": "Project ID for this request.",
  37404. // "location": "path",
  37405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37406. // "required": true,
  37407. // "type": "string"
  37408. // },
  37409. // "requestId": {
  37410. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37411. // "location": "query",
  37412. // "type": "string"
  37413. // }
  37414. // },
  37415. // "path": "{project}/global/backendServices/{backendService}",
  37416. // "request": {
  37417. // "$ref": "BackendService"
  37418. // },
  37419. // "response": {
  37420. // "$ref": "Operation"
  37421. // },
  37422. // "scopes": [
  37423. // "https://www.googleapis.com/auth/cloud-platform",
  37424. // "https://www.googleapis.com/auth/compute"
  37425. // ]
  37426. // }
  37427. }
  37428. // method id "compute.diskTypes.aggregatedList":
  37429. type DiskTypesAggregatedListCall struct {
  37430. s *Service
  37431. project string
  37432. urlParams_ gensupport.URLParams
  37433. ifNoneMatch_ string
  37434. ctx_ context.Context
  37435. header_ http.Header
  37436. }
  37437. // AggregatedList: Retrieves an aggregated list of disk types.
  37438. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  37439. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  37440. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37441. c.project = project
  37442. return c
  37443. }
  37444. // Filter sets the optional parameter "filter": A filter expression that
  37445. // filters resources listed in the response. The expression must specify
  37446. // the field name, a comparison operator, and the value that you want to
  37447. // use for filtering. The value must be a string, a number, or a
  37448. // boolean. The comparison operator must be either =, !=, >, or <.
  37449. //
  37450. // For example, if you are filtering Compute Engine instances, you can
  37451. // exclude instances named example-instance by specifying name !=
  37452. // example-instance.
  37453. //
  37454. // You can also filter nested fields. For example, you could specify
  37455. // scheduling.automaticRestart = false to include instances only if they
  37456. // are not scheduled for automatic restarts. You can use filtering on
  37457. // nested fields to filter based on resource labels.
  37458. //
  37459. // To filter on multiple expressions, provide each separate expression
  37460. // within parentheses. For example, (scheduling.automaticRestart = true)
  37461. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37462. // AND expression. However, you can include AND and OR expressions
  37463. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37464. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37465. // true).
  37466. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  37467. c.urlParams_.Set("filter", filter)
  37468. return c
  37469. }
  37470. // MaxResults sets the optional parameter "maxResults": The maximum
  37471. // number of results per page that should be returned. If the number of
  37472. // available results is larger than maxResults, Compute Engine returns a
  37473. // nextPageToken that can be used to get the next page of results in
  37474. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37475. // (Default: 500)
  37476. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  37477. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37478. return c
  37479. }
  37480. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37481. // a certain order. By default, results are returned in alphanumerical
  37482. // order based on the resource name.
  37483. //
  37484. // You can also sort results in descending order based on the creation
  37485. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37486. // based on the creationTimestamp field in reverse chronological order
  37487. // (newest result first). Use this to sort resources like operations so
  37488. // that the newest operation is returned first.
  37489. //
  37490. // Currently, only sorting by name or creationTimestamp desc is
  37491. // supported.
  37492. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  37493. c.urlParams_.Set("orderBy", orderBy)
  37494. return c
  37495. }
  37496. // PageToken sets the optional parameter "pageToken": Specifies a page
  37497. // token to use. Set pageToken to the nextPageToken returned by a
  37498. // previous list request to get the next page of results.
  37499. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  37500. c.urlParams_.Set("pageToken", pageToken)
  37501. return c
  37502. }
  37503. // Fields allows partial responses to be retrieved. See
  37504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37505. // for more information.
  37506. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  37507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37508. return c
  37509. }
  37510. // IfNoneMatch sets the optional parameter which makes the operation
  37511. // fail if the object's ETag matches the given value. This is useful for
  37512. // getting updates only after the object has changed since the last
  37513. // request. Use googleapi.IsNotModified to check whether the response
  37514. // error from Do is the result of In-None-Match.
  37515. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  37516. c.ifNoneMatch_ = entityTag
  37517. return c
  37518. }
  37519. // Context sets the context to be used in this call's Do method. Any
  37520. // pending HTTP request will be aborted if the provided context is
  37521. // canceled.
  37522. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  37523. c.ctx_ = ctx
  37524. return c
  37525. }
  37526. // Header returns an http.Header that can be modified by the caller to
  37527. // add HTTP headers to the request.
  37528. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  37529. if c.header_ == nil {
  37530. c.header_ = make(http.Header)
  37531. }
  37532. return c.header_
  37533. }
  37534. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37535. reqHeaders := make(http.Header)
  37536. for k, v := range c.header_ {
  37537. reqHeaders[k] = v
  37538. }
  37539. reqHeaders.Set("User-Agent", c.s.userAgent())
  37540. if c.ifNoneMatch_ != "" {
  37541. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37542. }
  37543. var body io.Reader = nil
  37544. c.urlParams_.Set("alt", alt)
  37545. c.urlParams_.Set("prettyPrint", "false")
  37546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  37547. urls += "?" + c.urlParams_.Encode()
  37548. req, err := http.NewRequest("GET", urls, body)
  37549. if err != nil {
  37550. return nil, err
  37551. }
  37552. req.Header = reqHeaders
  37553. googleapi.Expand(req.URL, map[string]string{
  37554. "project": c.project,
  37555. })
  37556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37557. }
  37558. // Do executes the "compute.diskTypes.aggregatedList" call.
  37559. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  37560. // non-2xx status code is an error. Response headers are in either
  37561. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  37562. // returned at all) in error.(*googleapi.Error).Header. Use
  37563. // googleapi.IsNotModified to check whether the returned error was
  37564. // because http.StatusNotModified was returned.
  37565. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  37566. gensupport.SetOptions(c.urlParams_, opts...)
  37567. res, err := c.doRequest("json")
  37568. if res != nil && res.StatusCode == http.StatusNotModified {
  37569. if res.Body != nil {
  37570. res.Body.Close()
  37571. }
  37572. return nil, &googleapi.Error{
  37573. Code: res.StatusCode,
  37574. Header: res.Header,
  37575. }
  37576. }
  37577. if err != nil {
  37578. return nil, err
  37579. }
  37580. defer googleapi.CloseBody(res)
  37581. if err := googleapi.CheckResponse(res); err != nil {
  37582. return nil, err
  37583. }
  37584. ret := &DiskTypeAggregatedList{
  37585. ServerResponse: googleapi.ServerResponse{
  37586. Header: res.Header,
  37587. HTTPStatusCode: res.StatusCode,
  37588. },
  37589. }
  37590. target := &ret
  37591. if err := gensupport.DecodeResponse(target, res); err != nil {
  37592. return nil, err
  37593. }
  37594. return ret, nil
  37595. // {
  37596. // "description": "Retrieves an aggregated list of disk types.",
  37597. // "httpMethod": "GET",
  37598. // "id": "compute.diskTypes.aggregatedList",
  37599. // "parameterOrder": [
  37600. // "project"
  37601. // ],
  37602. // "parameters": {
  37603. // "filter": {
  37604. // "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).",
  37605. // "location": "query",
  37606. // "type": "string"
  37607. // },
  37608. // "maxResults": {
  37609. // "default": "500",
  37610. // "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)",
  37611. // "format": "uint32",
  37612. // "location": "query",
  37613. // "minimum": "0",
  37614. // "type": "integer"
  37615. // },
  37616. // "orderBy": {
  37617. // "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.",
  37618. // "location": "query",
  37619. // "type": "string"
  37620. // },
  37621. // "pageToken": {
  37622. // "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.",
  37623. // "location": "query",
  37624. // "type": "string"
  37625. // },
  37626. // "project": {
  37627. // "description": "Project ID for this request.",
  37628. // "location": "path",
  37629. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37630. // "required": true,
  37631. // "type": "string"
  37632. // }
  37633. // },
  37634. // "path": "{project}/aggregated/diskTypes",
  37635. // "response": {
  37636. // "$ref": "DiskTypeAggregatedList"
  37637. // },
  37638. // "scopes": [
  37639. // "https://www.googleapis.com/auth/cloud-platform",
  37640. // "https://www.googleapis.com/auth/compute",
  37641. // "https://www.googleapis.com/auth/compute.readonly"
  37642. // ]
  37643. // }
  37644. }
  37645. // Pages invokes f for each page of results.
  37646. // A non-nil error returned from f will halt the iteration.
  37647. // The provided context supersedes any context provided to the Context method.
  37648. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  37649. c.ctx_ = ctx
  37650. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37651. for {
  37652. x, err := c.Do()
  37653. if err != nil {
  37654. return err
  37655. }
  37656. if err := f(x); err != nil {
  37657. return err
  37658. }
  37659. if x.NextPageToken == "" {
  37660. return nil
  37661. }
  37662. c.PageToken(x.NextPageToken)
  37663. }
  37664. }
  37665. // method id "compute.diskTypes.get":
  37666. type DiskTypesGetCall struct {
  37667. s *Service
  37668. project string
  37669. zone string
  37670. diskType string
  37671. urlParams_ gensupport.URLParams
  37672. ifNoneMatch_ string
  37673. ctx_ context.Context
  37674. header_ http.Header
  37675. }
  37676. // Get: Returns the specified disk type. Gets a list of available disk
  37677. // types by making a list() request.
  37678. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  37679. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  37680. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37681. c.project = project
  37682. c.zone = zone
  37683. c.diskType = diskType
  37684. return c
  37685. }
  37686. // Fields allows partial responses to be retrieved. See
  37687. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37688. // for more information.
  37689. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  37690. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37691. return c
  37692. }
  37693. // IfNoneMatch sets the optional parameter which makes the operation
  37694. // fail if the object's ETag matches the given value. This is useful for
  37695. // getting updates only after the object has changed since the last
  37696. // request. Use googleapi.IsNotModified to check whether the response
  37697. // error from Do is the result of In-None-Match.
  37698. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  37699. c.ifNoneMatch_ = entityTag
  37700. return c
  37701. }
  37702. // Context sets the context to be used in this call's Do method. Any
  37703. // pending HTTP request will be aborted if the provided context is
  37704. // canceled.
  37705. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  37706. c.ctx_ = ctx
  37707. return c
  37708. }
  37709. // Header returns an http.Header that can be modified by the caller to
  37710. // add HTTP headers to the request.
  37711. func (c *DiskTypesGetCall) Header() http.Header {
  37712. if c.header_ == nil {
  37713. c.header_ = make(http.Header)
  37714. }
  37715. return c.header_
  37716. }
  37717. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  37718. reqHeaders := make(http.Header)
  37719. for k, v := range c.header_ {
  37720. reqHeaders[k] = v
  37721. }
  37722. reqHeaders.Set("User-Agent", c.s.userAgent())
  37723. if c.ifNoneMatch_ != "" {
  37724. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37725. }
  37726. var body io.Reader = nil
  37727. c.urlParams_.Set("alt", alt)
  37728. c.urlParams_.Set("prettyPrint", "false")
  37729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  37730. urls += "?" + c.urlParams_.Encode()
  37731. req, err := http.NewRequest("GET", urls, body)
  37732. if err != nil {
  37733. return nil, err
  37734. }
  37735. req.Header = reqHeaders
  37736. googleapi.Expand(req.URL, map[string]string{
  37737. "project": c.project,
  37738. "zone": c.zone,
  37739. "diskType": c.diskType,
  37740. })
  37741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37742. }
  37743. // Do executes the "compute.diskTypes.get" call.
  37744. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  37745. // code is an error. Response headers are in either
  37746. // *DiskType.ServerResponse.Header or (if a response was returned at
  37747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37748. // to check whether the returned error was because
  37749. // http.StatusNotModified was returned.
  37750. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  37751. gensupport.SetOptions(c.urlParams_, opts...)
  37752. res, err := c.doRequest("json")
  37753. if res != nil && res.StatusCode == http.StatusNotModified {
  37754. if res.Body != nil {
  37755. res.Body.Close()
  37756. }
  37757. return nil, &googleapi.Error{
  37758. Code: res.StatusCode,
  37759. Header: res.Header,
  37760. }
  37761. }
  37762. if err != nil {
  37763. return nil, err
  37764. }
  37765. defer googleapi.CloseBody(res)
  37766. if err := googleapi.CheckResponse(res); err != nil {
  37767. return nil, err
  37768. }
  37769. ret := &DiskType{
  37770. ServerResponse: googleapi.ServerResponse{
  37771. Header: res.Header,
  37772. HTTPStatusCode: res.StatusCode,
  37773. },
  37774. }
  37775. target := &ret
  37776. if err := gensupport.DecodeResponse(target, res); err != nil {
  37777. return nil, err
  37778. }
  37779. return ret, nil
  37780. // {
  37781. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  37782. // "httpMethod": "GET",
  37783. // "id": "compute.diskTypes.get",
  37784. // "parameterOrder": [
  37785. // "project",
  37786. // "zone",
  37787. // "diskType"
  37788. // ],
  37789. // "parameters": {
  37790. // "diskType": {
  37791. // "description": "Name of the disk type to return.",
  37792. // "location": "path",
  37793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37794. // "required": true,
  37795. // "type": "string"
  37796. // },
  37797. // "project": {
  37798. // "description": "Project ID for this request.",
  37799. // "location": "path",
  37800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37801. // "required": true,
  37802. // "type": "string"
  37803. // },
  37804. // "zone": {
  37805. // "description": "The name of the zone for this request.",
  37806. // "location": "path",
  37807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37808. // "required": true,
  37809. // "type": "string"
  37810. // }
  37811. // },
  37812. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  37813. // "response": {
  37814. // "$ref": "DiskType"
  37815. // },
  37816. // "scopes": [
  37817. // "https://www.googleapis.com/auth/cloud-platform",
  37818. // "https://www.googleapis.com/auth/compute",
  37819. // "https://www.googleapis.com/auth/compute.readonly"
  37820. // ]
  37821. // }
  37822. }
  37823. // method id "compute.diskTypes.list":
  37824. type DiskTypesListCall struct {
  37825. s *Service
  37826. project string
  37827. zone string
  37828. urlParams_ gensupport.URLParams
  37829. ifNoneMatch_ string
  37830. ctx_ context.Context
  37831. header_ http.Header
  37832. }
  37833. // List: Retrieves a list of disk types available to the specified
  37834. // project.
  37835. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  37836. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  37837. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37838. c.project = project
  37839. c.zone = zone
  37840. return c
  37841. }
  37842. // Filter sets the optional parameter "filter": A filter expression that
  37843. // filters resources listed in the response. The expression must specify
  37844. // the field name, a comparison operator, and the value that you want to
  37845. // use for filtering. The value must be a string, a number, or a
  37846. // boolean. The comparison operator must be either =, !=, >, or <.
  37847. //
  37848. // For example, if you are filtering Compute Engine instances, you can
  37849. // exclude instances named example-instance by specifying name !=
  37850. // example-instance.
  37851. //
  37852. // You can also filter nested fields. For example, you could specify
  37853. // scheduling.automaticRestart = false to include instances only if they
  37854. // are not scheduled for automatic restarts. You can use filtering on
  37855. // nested fields to filter based on resource labels.
  37856. //
  37857. // To filter on multiple expressions, provide each separate expression
  37858. // within parentheses. For example, (scheduling.automaticRestart = true)
  37859. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37860. // AND expression. However, you can include AND and OR expressions
  37861. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37862. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37863. // true).
  37864. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  37865. c.urlParams_.Set("filter", filter)
  37866. return c
  37867. }
  37868. // MaxResults sets the optional parameter "maxResults": The maximum
  37869. // number of results per page that should be returned. If the number of
  37870. // available results is larger than maxResults, Compute Engine returns a
  37871. // nextPageToken that can be used to get the next page of results in
  37872. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37873. // (Default: 500)
  37874. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  37875. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37876. return c
  37877. }
  37878. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37879. // a certain order. By default, results are returned in alphanumerical
  37880. // order based on the resource name.
  37881. //
  37882. // You can also sort results in descending order based on the creation
  37883. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37884. // based on the creationTimestamp field in reverse chronological order
  37885. // (newest result first). Use this to sort resources like operations so
  37886. // that the newest operation is returned first.
  37887. //
  37888. // Currently, only sorting by name or creationTimestamp desc is
  37889. // supported.
  37890. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  37891. c.urlParams_.Set("orderBy", orderBy)
  37892. return c
  37893. }
  37894. // PageToken sets the optional parameter "pageToken": Specifies a page
  37895. // token to use. Set pageToken to the nextPageToken returned by a
  37896. // previous list request to get the next page of results.
  37897. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  37898. c.urlParams_.Set("pageToken", pageToken)
  37899. return c
  37900. }
  37901. // Fields allows partial responses to be retrieved. See
  37902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37903. // for more information.
  37904. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  37905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37906. return c
  37907. }
  37908. // IfNoneMatch sets the optional parameter which makes the operation
  37909. // fail if the object's ETag matches the given value. This is useful for
  37910. // getting updates only after the object has changed since the last
  37911. // request. Use googleapi.IsNotModified to check whether the response
  37912. // error from Do is the result of In-None-Match.
  37913. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  37914. c.ifNoneMatch_ = entityTag
  37915. return c
  37916. }
  37917. // Context sets the context to be used in this call's Do method. Any
  37918. // pending HTTP request will be aborted if the provided context is
  37919. // canceled.
  37920. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  37921. c.ctx_ = ctx
  37922. return c
  37923. }
  37924. // Header returns an http.Header that can be modified by the caller to
  37925. // add HTTP headers to the request.
  37926. func (c *DiskTypesListCall) Header() http.Header {
  37927. if c.header_ == nil {
  37928. c.header_ = make(http.Header)
  37929. }
  37930. return c.header_
  37931. }
  37932. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  37933. reqHeaders := make(http.Header)
  37934. for k, v := range c.header_ {
  37935. reqHeaders[k] = v
  37936. }
  37937. reqHeaders.Set("User-Agent", c.s.userAgent())
  37938. if c.ifNoneMatch_ != "" {
  37939. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37940. }
  37941. var body io.Reader = nil
  37942. c.urlParams_.Set("alt", alt)
  37943. c.urlParams_.Set("prettyPrint", "false")
  37944. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  37945. urls += "?" + c.urlParams_.Encode()
  37946. req, err := http.NewRequest("GET", urls, body)
  37947. if err != nil {
  37948. return nil, err
  37949. }
  37950. req.Header = reqHeaders
  37951. googleapi.Expand(req.URL, map[string]string{
  37952. "project": c.project,
  37953. "zone": c.zone,
  37954. })
  37955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37956. }
  37957. // Do executes the "compute.diskTypes.list" call.
  37958. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  37959. // status code is an error. Response headers are in either
  37960. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  37961. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37962. // to check whether the returned error was because
  37963. // http.StatusNotModified was returned.
  37964. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  37965. gensupport.SetOptions(c.urlParams_, opts...)
  37966. res, err := c.doRequest("json")
  37967. if res != nil && res.StatusCode == http.StatusNotModified {
  37968. if res.Body != nil {
  37969. res.Body.Close()
  37970. }
  37971. return nil, &googleapi.Error{
  37972. Code: res.StatusCode,
  37973. Header: res.Header,
  37974. }
  37975. }
  37976. if err != nil {
  37977. return nil, err
  37978. }
  37979. defer googleapi.CloseBody(res)
  37980. if err := googleapi.CheckResponse(res); err != nil {
  37981. return nil, err
  37982. }
  37983. ret := &DiskTypeList{
  37984. ServerResponse: googleapi.ServerResponse{
  37985. Header: res.Header,
  37986. HTTPStatusCode: res.StatusCode,
  37987. },
  37988. }
  37989. target := &ret
  37990. if err := gensupport.DecodeResponse(target, res); err != nil {
  37991. return nil, err
  37992. }
  37993. return ret, nil
  37994. // {
  37995. // "description": "Retrieves a list of disk types available to the specified project.",
  37996. // "httpMethod": "GET",
  37997. // "id": "compute.diskTypes.list",
  37998. // "parameterOrder": [
  37999. // "project",
  38000. // "zone"
  38001. // ],
  38002. // "parameters": {
  38003. // "filter": {
  38004. // "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).",
  38005. // "location": "query",
  38006. // "type": "string"
  38007. // },
  38008. // "maxResults": {
  38009. // "default": "500",
  38010. // "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)",
  38011. // "format": "uint32",
  38012. // "location": "query",
  38013. // "minimum": "0",
  38014. // "type": "integer"
  38015. // },
  38016. // "orderBy": {
  38017. // "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.",
  38018. // "location": "query",
  38019. // "type": "string"
  38020. // },
  38021. // "pageToken": {
  38022. // "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.",
  38023. // "location": "query",
  38024. // "type": "string"
  38025. // },
  38026. // "project": {
  38027. // "description": "Project ID for this request.",
  38028. // "location": "path",
  38029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38030. // "required": true,
  38031. // "type": "string"
  38032. // },
  38033. // "zone": {
  38034. // "description": "The name of the zone for this request.",
  38035. // "location": "path",
  38036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38037. // "required": true,
  38038. // "type": "string"
  38039. // }
  38040. // },
  38041. // "path": "{project}/zones/{zone}/diskTypes",
  38042. // "response": {
  38043. // "$ref": "DiskTypeList"
  38044. // },
  38045. // "scopes": [
  38046. // "https://www.googleapis.com/auth/cloud-platform",
  38047. // "https://www.googleapis.com/auth/compute",
  38048. // "https://www.googleapis.com/auth/compute.readonly"
  38049. // ]
  38050. // }
  38051. }
  38052. // Pages invokes f for each page of results.
  38053. // A non-nil error returned from f will halt the iteration.
  38054. // The provided context supersedes any context provided to the Context method.
  38055. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  38056. c.ctx_ = ctx
  38057. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38058. for {
  38059. x, err := c.Do()
  38060. if err != nil {
  38061. return err
  38062. }
  38063. if err := f(x); err != nil {
  38064. return err
  38065. }
  38066. if x.NextPageToken == "" {
  38067. return nil
  38068. }
  38069. c.PageToken(x.NextPageToken)
  38070. }
  38071. }
  38072. // method id "compute.disks.addResourcePolicies":
  38073. type DisksAddResourcePoliciesCall struct {
  38074. s *Service
  38075. project string
  38076. zone string
  38077. disk string
  38078. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  38079. urlParams_ gensupport.URLParams
  38080. ctx_ context.Context
  38081. header_ http.Header
  38082. }
  38083. // AddResourcePolicies: Adds existing resource policies to a disk. You
  38084. // can only add one policy which will be applied to this disk for
  38085. // scheduling snapshot creation.
  38086. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  38087. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38088. c.project = project
  38089. c.zone = zone
  38090. c.disk = disk
  38091. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  38092. return c
  38093. }
  38094. // RequestId sets the optional parameter "requestId": An optional
  38095. // request ID to identify requests. Specify a unique request ID so that
  38096. // if you must retry your request, the server will know to ignore the
  38097. // request if it has already been completed.
  38098. //
  38099. // For example, consider a situation where you make an initial request
  38100. // and the request times out. If you make the request again with the
  38101. // same request ID, the server can check if original operation with the
  38102. // same request ID was received, and if so, will ignore the second
  38103. // request. This prevents clients from accidentally creating duplicate
  38104. // commitments.
  38105. //
  38106. // The request ID must be a valid UUID with the exception that zero UUID
  38107. // is not supported (00000000-0000-0000-0000-000000000000).
  38108. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  38109. c.urlParams_.Set("requestId", requestId)
  38110. return c
  38111. }
  38112. // Fields allows partial responses to be retrieved. See
  38113. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38114. // for more information.
  38115. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  38116. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38117. return c
  38118. }
  38119. // Context sets the context to be used in this call's Do method. Any
  38120. // pending HTTP request will be aborted if the provided context is
  38121. // canceled.
  38122. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  38123. c.ctx_ = ctx
  38124. return c
  38125. }
  38126. // Header returns an http.Header that can be modified by the caller to
  38127. // add HTTP headers to the request.
  38128. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  38129. if c.header_ == nil {
  38130. c.header_ = make(http.Header)
  38131. }
  38132. return c.header_
  38133. }
  38134. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  38135. reqHeaders := make(http.Header)
  38136. for k, v := range c.header_ {
  38137. reqHeaders[k] = v
  38138. }
  38139. reqHeaders.Set("User-Agent", c.s.userAgent())
  38140. var body io.Reader = nil
  38141. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  38142. if err != nil {
  38143. return nil, err
  38144. }
  38145. reqHeaders.Set("Content-Type", "application/json")
  38146. c.urlParams_.Set("alt", alt)
  38147. c.urlParams_.Set("prettyPrint", "false")
  38148. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  38149. urls += "?" + c.urlParams_.Encode()
  38150. req, err := http.NewRequest("POST", urls, body)
  38151. if err != nil {
  38152. return nil, err
  38153. }
  38154. req.Header = reqHeaders
  38155. googleapi.Expand(req.URL, map[string]string{
  38156. "project": c.project,
  38157. "zone": c.zone,
  38158. "disk": c.disk,
  38159. })
  38160. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38161. }
  38162. // Do executes the "compute.disks.addResourcePolicies" call.
  38163. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38164. // status code is an error. Response headers are in either
  38165. // *Operation.ServerResponse.Header or (if a response was returned at
  38166. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38167. // to check whether the returned error was because
  38168. // http.StatusNotModified was returned.
  38169. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38170. gensupport.SetOptions(c.urlParams_, opts...)
  38171. res, err := c.doRequest("json")
  38172. if res != nil && res.StatusCode == http.StatusNotModified {
  38173. if res.Body != nil {
  38174. res.Body.Close()
  38175. }
  38176. return nil, &googleapi.Error{
  38177. Code: res.StatusCode,
  38178. Header: res.Header,
  38179. }
  38180. }
  38181. if err != nil {
  38182. return nil, err
  38183. }
  38184. defer googleapi.CloseBody(res)
  38185. if err := googleapi.CheckResponse(res); err != nil {
  38186. return nil, err
  38187. }
  38188. ret := &Operation{
  38189. ServerResponse: googleapi.ServerResponse{
  38190. Header: res.Header,
  38191. HTTPStatusCode: res.StatusCode,
  38192. },
  38193. }
  38194. target := &ret
  38195. if err := gensupport.DecodeResponse(target, res); err != nil {
  38196. return nil, err
  38197. }
  38198. return ret, nil
  38199. // {
  38200. // "description": "Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
  38201. // "httpMethod": "POST",
  38202. // "id": "compute.disks.addResourcePolicies",
  38203. // "parameterOrder": [
  38204. // "project",
  38205. // "zone",
  38206. // "disk"
  38207. // ],
  38208. // "parameters": {
  38209. // "disk": {
  38210. // "description": "The disk name for this request.",
  38211. // "location": "path",
  38212. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38213. // "required": true,
  38214. // "type": "string"
  38215. // },
  38216. // "project": {
  38217. // "description": "Project ID for this request.",
  38218. // "location": "path",
  38219. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38220. // "required": true,
  38221. // "type": "string"
  38222. // },
  38223. // "requestId": {
  38224. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38225. // "location": "query",
  38226. // "type": "string"
  38227. // },
  38228. // "zone": {
  38229. // "description": "The name of the zone for this request.",
  38230. // "location": "path",
  38231. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38232. // "required": true,
  38233. // "type": "string"
  38234. // }
  38235. // },
  38236. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  38237. // "request": {
  38238. // "$ref": "DisksAddResourcePoliciesRequest"
  38239. // },
  38240. // "response": {
  38241. // "$ref": "Operation"
  38242. // },
  38243. // "scopes": [
  38244. // "https://www.googleapis.com/auth/cloud-platform",
  38245. // "https://www.googleapis.com/auth/compute"
  38246. // ]
  38247. // }
  38248. }
  38249. // method id "compute.disks.aggregatedList":
  38250. type DisksAggregatedListCall struct {
  38251. s *Service
  38252. project string
  38253. urlParams_ gensupport.URLParams
  38254. ifNoneMatch_ string
  38255. ctx_ context.Context
  38256. header_ http.Header
  38257. }
  38258. // AggregatedList: Retrieves an aggregated list of persistent disks.
  38259. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  38260. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  38261. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38262. c.project = project
  38263. return c
  38264. }
  38265. // Filter sets the optional parameter "filter": A filter expression that
  38266. // filters resources listed in the response. The expression must specify
  38267. // the field name, a comparison operator, and the value that you want to
  38268. // use for filtering. The value must be a string, a number, or a
  38269. // boolean. The comparison operator must be either =, !=, >, or <.
  38270. //
  38271. // For example, if you are filtering Compute Engine instances, you can
  38272. // exclude instances named example-instance by specifying name !=
  38273. // example-instance.
  38274. //
  38275. // You can also filter nested fields. For example, you could specify
  38276. // scheduling.automaticRestart = false to include instances only if they
  38277. // are not scheduled for automatic restarts. You can use filtering on
  38278. // nested fields to filter based on resource labels.
  38279. //
  38280. // To filter on multiple expressions, provide each separate expression
  38281. // within parentheses. For example, (scheduling.automaticRestart = true)
  38282. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38283. // AND expression. However, you can include AND and OR expressions
  38284. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38285. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38286. // true).
  38287. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  38288. c.urlParams_.Set("filter", filter)
  38289. return c
  38290. }
  38291. // MaxResults sets the optional parameter "maxResults": The maximum
  38292. // number of results per page that should be returned. If the number of
  38293. // available results is larger than maxResults, Compute Engine returns a
  38294. // nextPageToken that can be used to get the next page of results in
  38295. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38296. // (Default: 500)
  38297. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  38298. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38299. return c
  38300. }
  38301. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38302. // a certain order. By default, results are returned in alphanumerical
  38303. // order based on the resource name.
  38304. //
  38305. // You can also sort results in descending order based on the creation
  38306. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38307. // based on the creationTimestamp field in reverse chronological order
  38308. // (newest result first). Use this to sort resources like operations so
  38309. // that the newest operation is returned first.
  38310. //
  38311. // Currently, only sorting by name or creationTimestamp desc is
  38312. // supported.
  38313. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  38314. c.urlParams_.Set("orderBy", orderBy)
  38315. return c
  38316. }
  38317. // PageToken sets the optional parameter "pageToken": Specifies a page
  38318. // token to use. Set pageToken to the nextPageToken returned by a
  38319. // previous list request to get the next page of results.
  38320. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  38321. c.urlParams_.Set("pageToken", pageToken)
  38322. return c
  38323. }
  38324. // Fields allows partial responses to be retrieved. See
  38325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38326. // for more information.
  38327. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  38328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38329. return c
  38330. }
  38331. // IfNoneMatch sets the optional parameter which makes the operation
  38332. // fail if the object's ETag matches the given value. This is useful for
  38333. // getting updates only after the object has changed since the last
  38334. // request. Use googleapi.IsNotModified to check whether the response
  38335. // error from Do is the result of In-None-Match.
  38336. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  38337. c.ifNoneMatch_ = entityTag
  38338. return c
  38339. }
  38340. // Context sets the context to be used in this call's Do method. Any
  38341. // pending HTTP request will be aborted if the provided context is
  38342. // canceled.
  38343. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  38344. c.ctx_ = ctx
  38345. return c
  38346. }
  38347. // Header returns an http.Header that can be modified by the caller to
  38348. // add HTTP headers to the request.
  38349. func (c *DisksAggregatedListCall) Header() http.Header {
  38350. if c.header_ == nil {
  38351. c.header_ = make(http.Header)
  38352. }
  38353. return c.header_
  38354. }
  38355. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38356. reqHeaders := make(http.Header)
  38357. for k, v := range c.header_ {
  38358. reqHeaders[k] = v
  38359. }
  38360. reqHeaders.Set("User-Agent", c.s.userAgent())
  38361. if c.ifNoneMatch_ != "" {
  38362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38363. }
  38364. var body io.Reader = nil
  38365. c.urlParams_.Set("alt", alt)
  38366. c.urlParams_.Set("prettyPrint", "false")
  38367. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  38368. urls += "?" + c.urlParams_.Encode()
  38369. req, err := http.NewRequest("GET", urls, body)
  38370. if err != nil {
  38371. return nil, err
  38372. }
  38373. req.Header = reqHeaders
  38374. googleapi.Expand(req.URL, map[string]string{
  38375. "project": c.project,
  38376. })
  38377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38378. }
  38379. // Do executes the "compute.disks.aggregatedList" call.
  38380. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  38381. // non-2xx status code is an error. Response headers are in either
  38382. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  38383. // returned at all) in error.(*googleapi.Error).Header. Use
  38384. // googleapi.IsNotModified to check whether the returned error was
  38385. // because http.StatusNotModified was returned.
  38386. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  38387. gensupport.SetOptions(c.urlParams_, opts...)
  38388. res, err := c.doRequest("json")
  38389. if res != nil && res.StatusCode == http.StatusNotModified {
  38390. if res.Body != nil {
  38391. res.Body.Close()
  38392. }
  38393. return nil, &googleapi.Error{
  38394. Code: res.StatusCode,
  38395. Header: res.Header,
  38396. }
  38397. }
  38398. if err != nil {
  38399. return nil, err
  38400. }
  38401. defer googleapi.CloseBody(res)
  38402. if err := googleapi.CheckResponse(res); err != nil {
  38403. return nil, err
  38404. }
  38405. ret := &DiskAggregatedList{
  38406. ServerResponse: googleapi.ServerResponse{
  38407. Header: res.Header,
  38408. HTTPStatusCode: res.StatusCode,
  38409. },
  38410. }
  38411. target := &ret
  38412. if err := gensupport.DecodeResponse(target, res); err != nil {
  38413. return nil, err
  38414. }
  38415. return ret, nil
  38416. // {
  38417. // "description": "Retrieves an aggregated list of persistent disks.",
  38418. // "httpMethod": "GET",
  38419. // "id": "compute.disks.aggregatedList",
  38420. // "parameterOrder": [
  38421. // "project"
  38422. // ],
  38423. // "parameters": {
  38424. // "filter": {
  38425. // "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).",
  38426. // "location": "query",
  38427. // "type": "string"
  38428. // },
  38429. // "maxResults": {
  38430. // "default": "500",
  38431. // "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)",
  38432. // "format": "uint32",
  38433. // "location": "query",
  38434. // "minimum": "0",
  38435. // "type": "integer"
  38436. // },
  38437. // "orderBy": {
  38438. // "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.",
  38439. // "location": "query",
  38440. // "type": "string"
  38441. // },
  38442. // "pageToken": {
  38443. // "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.",
  38444. // "location": "query",
  38445. // "type": "string"
  38446. // },
  38447. // "project": {
  38448. // "description": "Project ID for this request.",
  38449. // "location": "path",
  38450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38451. // "required": true,
  38452. // "type": "string"
  38453. // }
  38454. // },
  38455. // "path": "{project}/aggregated/disks",
  38456. // "response": {
  38457. // "$ref": "DiskAggregatedList"
  38458. // },
  38459. // "scopes": [
  38460. // "https://www.googleapis.com/auth/cloud-platform",
  38461. // "https://www.googleapis.com/auth/compute",
  38462. // "https://www.googleapis.com/auth/compute.readonly"
  38463. // ]
  38464. // }
  38465. }
  38466. // Pages invokes f for each page of results.
  38467. // A non-nil error returned from f will halt the iteration.
  38468. // The provided context supersedes any context provided to the Context method.
  38469. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  38470. c.ctx_ = ctx
  38471. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38472. for {
  38473. x, err := c.Do()
  38474. if err != nil {
  38475. return err
  38476. }
  38477. if err := f(x); err != nil {
  38478. return err
  38479. }
  38480. if x.NextPageToken == "" {
  38481. return nil
  38482. }
  38483. c.PageToken(x.NextPageToken)
  38484. }
  38485. }
  38486. // method id "compute.disks.createSnapshot":
  38487. type DisksCreateSnapshotCall struct {
  38488. s *Service
  38489. project string
  38490. zone string
  38491. disk string
  38492. snapshot *Snapshot
  38493. urlParams_ gensupport.URLParams
  38494. ctx_ context.Context
  38495. header_ http.Header
  38496. }
  38497. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  38498. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  38499. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  38500. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38501. c.project = project
  38502. c.zone = zone
  38503. c.disk = disk
  38504. c.snapshot = snapshot
  38505. return c
  38506. }
  38507. // GuestFlush sets the optional parameter "guestFlush":
  38508. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  38509. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  38510. return c
  38511. }
  38512. // RequestId sets the optional parameter "requestId": An optional
  38513. // request ID to identify requests. Specify a unique request ID so that
  38514. // if you must retry your request, the server will know to ignore the
  38515. // request if it has already been completed.
  38516. //
  38517. // For example, consider a situation where you make an initial request
  38518. // and the request times out. If you make the request again with the
  38519. // same request ID, the server can check if original operation with the
  38520. // same request ID was received, and if so, will ignore the second
  38521. // request. This prevents clients from accidentally creating duplicate
  38522. // commitments.
  38523. //
  38524. // The request ID must be a valid UUID with the exception that zero UUID
  38525. // is not supported (00000000-0000-0000-0000-000000000000).
  38526. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  38527. c.urlParams_.Set("requestId", requestId)
  38528. return c
  38529. }
  38530. // Fields allows partial responses to be retrieved. See
  38531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38532. // for more information.
  38533. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  38534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38535. return c
  38536. }
  38537. // Context sets the context to be used in this call's Do method. Any
  38538. // pending HTTP request will be aborted if the provided context is
  38539. // canceled.
  38540. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  38541. c.ctx_ = ctx
  38542. return c
  38543. }
  38544. // Header returns an http.Header that can be modified by the caller to
  38545. // add HTTP headers to the request.
  38546. func (c *DisksCreateSnapshotCall) Header() http.Header {
  38547. if c.header_ == nil {
  38548. c.header_ = make(http.Header)
  38549. }
  38550. return c.header_
  38551. }
  38552. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  38553. reqHeaders := make(http.Header)
  38554. for k, v := range c.header_ {
  38555. reqHeaders[k] = v
  38556. }
  38557. reqHeaders.Set("User-Agent", c.s.userAgent())
  38558. var body io.Reader = nil
  38559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  38560. if err != nil {
  38561. return nil, err
  38562. }
  38563. reqHeaders.Set("Content-Type", "application/json")
  38564. c.urlParams_.Set("alt", alt)
  38565. c.urlParams_.Set("prettyPrint", "false")
  38566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  38567. urls += "?" + c.urlParams_.Encode()
  38568. req, err := http.NewRequest("POST", urls, body)
  38569. if err != nil {
  38570. return nil, err
  38571. }
  38572. req.Header = reqHeaders
  38573. googleapi.Expand(req.URL, map[string]string{
  38574. "project": c.project,
  38575. "zone": c.zone,
  38576. "disk": c.disk,
  38577. })
  38578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38579. }
  38580. // Do executes the "compute.disks.createSnapshot" call.
  38581. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38582. // status code is an error. Response headers are in either
  38583. // *Operation.ServerResponse.Header or (if a response was returned at
  38584. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38585. // to check whether the returned error was because
  38586. // http.StatusNotModified was returned.
  38587. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38588. gensupport.SetOptions(c.urlParams_, opts...)
  38589. res, err := c.doRequest("json")
  38590. if res != nil && res.StatusCode == http.StatusNotModified {
  38591. if res.Body != nil {
  38592. res.Body.Close()
  38593. }
  38594. return nil, &googleapi.Error{
  38595. Code: res.StatusCode,
  38596. Header: res.Header,
  38597. }
  38598. }
  38599. if err != nil {
  38600. return nil, err
  38601. }
  38602. defer googleapi.CloseBody(res)
  38603. if err := googleapi.CheckResponse(res); err != nil {
  38604. return nil, err
  38605. }
  38606. ret := &Operation{
  38607. ServerResponse: googleapi.ServerResponse{
  38608. Header: res.Header,
  38609. HTTPStatusCode: res.StatusCode,
  38610. },
  38611. }
  38612. target := &ret
  38613. if err := gensupport.DecodeResponse(target, res); err != nil {
  38614. return nil, err
  38615. }
  38616. return ret, nil
  38617. // {
  38618. // "description": "Creates a snapshot of a specified persistent disk.",
  38619. // "httpMethod": "POST",
  38620. // "id": "compute.disks.createSnapshot",
  38621. // "parameterOrder": [
  38622. // "project",
  38623. // "zone",
  38624. // "disk"
  38625. // ],
  38626. // "parameters": {
  38627. // "disk": {
  38628. // "description": "Name of the persistent disk to snapshot.",
  38629. // "location": "path",
  38630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38631. // "required": true,
  38632. // "type": "string"
  38633. // },
  38634. // "guestFlush": {
  38635. // "location": "query",
  38636. // "type": "boolean"
  38637. // },
  38638. // "project": {
  38639. // "description": "Project ID for this request.",
  38640. // "location": "path",
  38641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38642. // "required": true,
  38643. // "type": "string"
  38644. // },
  38645. // "requestId": {
  38646. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38647. // "location": "query",
  38648. // "type": "string"
  38649. // },
  38650. // "zone": {
  38651. // "description": "The name of the zone for this request.",
  38652. // "location": "path",
  38653. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38654. // "required": true,
  38655. // "type": "string"
  38656. // }
  38657. // },
  38658. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  38659. // "request": {
  38660. // "$ref": "Snapshot"
  38661. // },
  38662. // "response": {
  38663. // "$ref": "Operation"
  38664. // },
  38665. // "scopes": [
  38666. // "https://www.googleapis.com/auth/cloud-platform",
  38667. // "https://www.googleapis.com/auth/compute"
  38668. // ]
  38669. // }
  38670. }
  38671. // method id "compute.disks.delete":
  38672. type DisksDeleteCall struct {
  38673. s *Service
  38674. project string
  38675. zone string
  38676. disk string
  38677. urlParams_ gensupport.URLParams
  38678. ctx_ context.Context
  38679. header_ http.Header
  38680. }
  38681. // Delete: Deletes the specified persistent disk. Deleting a disk
  38682. // removes its data permanently and is irreversible. However, deleting a
  38683. // disk does not delete any snapshots previously made from the disk. You
  38684. // must separately delete snapshots.
  38685. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  38686. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  38687. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38688. c.project = project
  38689. c.zone = zone
  38690. c.disk = disk
  38691. return c
  38692. }
  38693. // RequestId sets the optional parameter "requestId": An optional
  38694. // request ID to identify requests. Specify a unique request ID so that
  38695. // if you must retry your request, the server will know to ignore the
  38696. // request if it has already been completed.
  38697. //
  38698. // For example, consider a situation where you make an initial request
  38699. // and the request times out. If you make the request again with the
  38700. // same request ID, the server can check if original operation with the
  38701. // same request ID was received, and if so, will ignore the second
  38702. // request. This prevents clients from accidentally creating duplicate
  38703. // commitments.
  38704. //
  38705. // The request ID must be a valid UUID with the exception that zero UUID
  38706. // is not supported (00000000-0000-0000-0000-000000000000).
  38707. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  38708. c.urlParams_.Set("requestId", requestId)
  38709. return c
  38710. }
  38711. // Fields allows partial responses to be retrieved. See
  38712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38713. // for more information.
  38714. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  38715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38716. return c
  38717. }
  38718. // Context sets the context to be used in this call's Do method. Any
  38719. // pending HTTP request will be aborted if the provided context is
  38720. // canceled.
  38721. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  38722. c.ctx_ = ctx
  38723. return c
  38724. }
  38725. // Header returns an http.Header that can be modified by the caller to
  38726. // add HTTP headers to the request.
  38727. func (c *DisksDeleteCall) Header() http.Header {
  38728. if c.header_ == nil {
  38729. c.header_ = make(http.Header)
  38730. }
  38731. return c.header_
  38732. }
  38733. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  38734. reqHeaders := make(http.Header)
  38735. for k, v := range c.header_ {
  38736. reqHeaders[k] = v
  38737. }
  38738. reqHeaders.Set("User-Agent", c.s.userAgent())
  38739. var body io.Reader = nil
  38740. c.urlParams_.Set("alt", alt)
  38741. c.urlParams_.Set("prettyPrint", "false")
  38742. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  38743. urls += "?" + c.urlParams_.Encode()
  38744. req, err := http.NewRequest("DELETE", urls, body)
  38745. if err != nil {
  38746. return nil, err
  38747. }
  38748. req.Header = reqHeaders
  38749. googleapi.Expand(req.URL, map[string]string{
  38750. "project": c.project,
  38751. "zone": c.zone,
  38752. "disk": c.disk,
  38753. })
  38754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38755. }
  38756. // Do executes the "compute.disks.delete" call.
  38757. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38758. // status code is an error. Response headers are in either
  38759. // *Operation.ServerResponse.Header or (if a response was returned at
  38760. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38761. // to check whether the returned error was because
  38762. // http.StatusNotModified was returned.
  38763. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38764. gensupport.SetOptions(c.urlParams_, opts...)
  38765. res, err := c.doRequest("json")
  38766. if res != nil && res.StatusCode == http.StatusNotModified {
  38767. if res.Body != nil {
  38768. res.Body.Close()
  38769. }
  38770. return nil, &googleapi.Error{
  38771. Code: res.StatusCode,
  38772. Header: res.Header,
  38773. }
  38774. }
  38775. if err != nil {
  38776. return nil, err
  38777. }
  38778. defer googleapi.CloseBody(res)
  38779. if err := googleapi.CheckResponse(res); err != nil {
  38780. return nil, err
  38781. }
  38782. ret := &Operation{
  38783. ServerResponse: googleapi.ServerResponse{
  38784. Header: res.Header,
  38785. HTTPStatusCode: res.StatusCode,
  38786. },
  38787. }
  38788. target := &ret
  38789. if err := gensupport.DecodeResponse(target, res); err != nil {
  38790. return nil, err
  38791. }
  38792. return ret, nil
  38793. // {
  38794. // "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.",
  38795. // "httpMethod": "DELETE",
  38796. // "id": "compute.disks.delete",
  38797. // "parameterOrder": [
  38798. // "project",
  38799. // "zone",
  38800. // "disk"
  38801. // ],
  38802. // "parameters": {
  38803. // "disk": {
  38804. // "description": "Name of the persistent disk to delete.",
  38805. // "location": "path",
  38806. // "required": true,
  38807. // "type": "string"
  38808. // },
  38809. // "project": {
  38810. // "description": "Project ID for this request.",
  38811. // "location": "path",
  38812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38813. // "required": true,
  38814. // "type": "string"
  38815. // },
  38816. // "requestId": {
  38817. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38818. // "location": "query",
  38819. // "type": "string"
  38820. // },
  38821. // "zone": {
  38822. // "description": "The name of the zone for this request.",
  38823. // "location": "path",
  38824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38825. // "required": true,
  38826. // "type": "string"
  38827. // }
  38828. // },
  38829. // "path": "{project}/zones/{zone}/disks/{disk}",
  38830. // "response": {
  38831. // "$ref": "Operation"
  38832. // },
  38833. // "scopes": [
  38834. // "https://www.googleapis.com/auth/cloud-platform",
  38835. // "https://www.googleapis.com/auth/compute"
  38836. // ]
  38837. // }
  38838. }
  38839. // method id "compute.disks.get":
  38840. type DisksGetCall struct {
  38841. s *Service
  38842. project string
  38843. zone string
  38844. disk string
  38845. urlParams_ gensupport.URLParams
  38846. ifNoneMatch_ string
  38847. ctx_ context.Context
  38848. header_ http.Header
  38849. }
  38850. // Get: Returns a specified persistent disk. Gets a list of available
  38851. // persistent disks by making a list() request.
  38852. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  38853. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  38854. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38855. c.project = project
  38856. c.zone = zone
  38857. c.disk = disk
  38858. return c
  38859. }
  38860. // Fields allows partial responses to be retrieved. See
  38861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38862. // for more information.
  38863. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  38864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38865. return c
  38866. }
  38867. // IfNoneMatch sets the optional parameter which makes the operation
  38868. // fail if the object's ETag matches the given value. This is useful for
  38869. // getting updates only after the object has changed since the last
  38870. // request. Use googleapi.IsNotModified to check whether the response
  38871. // error from Do is the result of In-None-Match.
  38872. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  38873. c.ifNoneMatch_ = entityTag
  38874. return c
  38875. }
  38876. // Context sets the context to be used in this call's Do method. Any
  38877. // pending HTTP request will be aborted if the provided context is
  38878. // canceled.
  38879. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  38880. c.ctx_ = ctx
  38881. return c
  38882. }
  38883. // Header returns an http.Header that can be modified by the caller to
  38884. // add HTTP headers to the request.
  38885. func (c *DisksGetCall) Header() http.Header {
  38886. if c.header_ == nil {
  38887. c.header_ = make(http.Header)
  38888. }
  38889. return c.header_
  38890. }
  38891. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  38892. reqHeaders := make(http.Header)
  38893. for k, v := range c.header_ {
  38894. reqHeaders[k] = v
  38895. }
  38896. reqHeaders.Set("User-Agent", c.s.userAgent())
  38897. if c.ifNoneMatch_ != "" {
  38898. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38899. }
  38900. var body io.Reader = nil
  38901. c.urlParams_.Set("alt", alt)
  38902. c.urlParams_.Set("prettyPrint", "false")
  38903. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  38904. urls += "?" + c.urlParams_.Encode()
  38905. req, err := http.NewRequest("GET", urls, body)
  38906. if err != nil {
  38907. return nil, err
  38908. }
  38909. req.Header = reqHeaders
  38910. googleapi.Expand(req.URL, map[string]string{
  38911. "project": c.project,
  38912. "zone": c.zone,
  38913. "disk": c.disk,
  38914. })
  38915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38916. }
  38917. // Do executes the "compute.disks.get" call.
  38918. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  38919. // code is an error. Response headers are in either
  38920. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  38921. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  38922. // whether the returned error was because http.StatusNotModified was
  38923. // returned.
  38924. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  38925. gensupport.SetOptions(c.urlParams_, opts...)
  38926. res, err := c.doRequest("json")
  38927. if res != nil && res.StatusCode == http.StatusNotModified {
  38928. if res.Body != nil {
  38929. res.Body.Close()
  38930. }
  38931. return nil, &googleapi.Error{
  38932. Code: res.StatusCode,
  38933. Header: res.Header,
  38934. }
  38935. }
  38936. if err != nil {
  38937. return nil, err
  38938. }
  38939. defer googleapi.CloseBody(res)
  38940. if err := googleapi.CheckResponse(res); err != nil {
  38941. return nil, err
  38942. }
  38943. ret := &Disk{
  38944. ServerResponse: googleapi.ServerResponse{
  38945. Header: res.Header,
  38946. HTTPStatusCode: res.StatusCode,
  38947. },
  38948. }
  38949. target := &ret
  38950. if err := gensupport.DecodeResponse(target, res); err != nil {
  38951. return nil, err
  38952. }
  38953. return ret, nil
  38954. // {
  38955. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  38956. // "httpMethod": "GET",
  38957. // "id": "compute.disks.get",
  38958. // "parameterOrder": [
  38959. // "project",
  38960. // "zone",
  38961. // "disk"
  38962. // ],
  38963. // "parameters": {
  38964. // "disk": {
  38965. // "description": "Name of the persistent disk to return.",
  38966. // "location": "path",
  38967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38968. // "required": true,
  38969. // "type": "string"
  38970. // },
  38971. // "project": {
  38972. // "description": "Project ID for this request.",
  38973. // "location": "path",
  38974. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38975. // "required": true,
  38976. // "type": "string"
  38977. // },
  38978. // "zone": {
  38979. // "description": "The name of the zone for this request.",
  38980. // "location": "path",
  38981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38982. // "required": true,
  38983. // "type": "string"
  38984. // }
  38985. // },
  38986. // "path": "{project}/zones/{zone}/disks/{disk}",
  38987. // "response": {
  38988. // "$ref": "Disk"
  38989. // },
  38990. // "scopes": [
  38991. // "https://www.googleapis.com/auth/cloud-platform",
  38992. // "https://www.googleapis.com/auth/compute",
  38993. // "https://www.googleapis.com/auth/compute.readonly"
  38994. // ]
  38995. // }
  38996. }
  38997. // method id "compute.disks.getIamPolicy":
  38998. type DisksGetIamPolicyCall struct {
  38999. s *Service
  39000. project string
  39001. zone string
  39002. resource string
  39003. urlParams_ gensupport.URLParams
  39004. ifNoneMatch_ string
  39005. ctx_ context.Context
  39006. header_ http.Header
  39007. }
  39008. // GetIamPolicy: Gets the access control policy for a resource. May be
  39009. // empty if no such policy or resource exists.
  39010. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  39011. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39012. c.project = project
  39013. c.zone = zone
  39014. c.resource = resource
  39015. return c
  39016. }
  39017. // Fields allows partial responses to be retrieved. See
  39018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39019. // for more information.
  39020. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  39021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39022. return c
  39023. }
  39024. // IfNoneMatch sets the optional parameter which makes the operation
  39025. // fail if the object's ETag matches the given value. This is useful for
  39026. // getting updates only after the object has changed since the last
  39027. // request. Use googleapi.IsNotModified to check whether the response
  39028. // error from Do is the result of In-None-Match.
  39029. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  39030. c.ifNoneMatch_ = entityTag
  39031. return c
  39032. }
  39033. // Context sets the context to be used in this call's Do method. Any
  39034. // pending HTTP request will be aborted if the provided context is
  39035. // canceled.
  39036. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  39037. c.ctx_ = ctx
  39038. return c
  39039. }
  39040. // Header returns an http.Header that can be modified by the caller to
  39041. // add HTTP headers to the request.
  39042. func (c *DisksGetIamPolicyCall) Header() http.Header {
  39043. if c.header_ == nil {
  39044. c.header_ = make(http.Header)
  39045. }
  39046. return c.header_
  39047. }
  39048. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  39049. reqHeaders := make(http.Header)
  39050. for k, v := range c.header_ {
  39051. reqHeaders[k] = v
  39052. }
  39053. reqHeaders.Set("User-Agent", c.s.userAgent())
  39054. if c.ifNoneMatch_ != "" {
  39055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39056. }
  39057. var body io.Reader = nil
  39058. c.urlParams_.Set("alt", alt)
  39059. c.urlParams_.Set("prettyPrint", "false")
  39060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  39061. urls += "?" + c.urlParams_.Encode()
  39062. req, err := http.NewRequest("GET", urls, body)
  39063. if err != nil {
  39064. return nil, err
  39065. }
  39066. req.Header = reqHeaders
  39067. googleapi.Expand(req.URL, map[string]string{
  39068. "project": c.project,
  39069. "zone": c.zone,
  39070. "resource": c.resource,
  39071. })
  39072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39073. }
  39074. // Do executes the "compute.disks.getIamPolicy" call.
  39075. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  39076. // code is an error. Response headers are in either
  39077. // *Policy.ServerResponse.Header or (if a response was returned at all)
  39078. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39079. // check whether the returned error was because http.StatusNotModified
  39080. // was returned.
  39081. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  39082. gensupport.SetOptions(c.urlParams_, opts...)
  39083. res, err := c.doRequest("json")
  39084. if res != nil && res.StatusCode == http.StatusNotModified {
  39085. if res.Body != nil {
  39086. res.Body.Close()
  39087. }
  39088. return nil, &googleapi.Error{
  39089. Code: res.StatusCode,
  39090. Header: res.Header,
  39091. }
  39092. }
  39093. if err != nil {
  39094. return nil, err
  39095. }
  39096. defer googleapi.CloseBody(res)
  39097. if err := googleapi.CheckResponse(res); err != nil {
  39098. return nil, err
  39099. }
  39100. ret := &Policy{
  39101. ServerResponse: googleapi.ServerResponse{
  39102. Header: res.Header,
  39103. HTTPStatusCode: res.StatusCode,
  39104. },
  39105. }
  39106. target := &ret
  39107. if err := gensupport.DecodeResponse(target, res); err != nil {
  39108. return nil, err
  39109. }
  39110. return ret, nil
  39111. // {
  39112. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  39113. // "httpMethod": "GET",
  39114. // "id": "compute.disks.getIamPolicy",
  39115. // "parameterOrder": [
  39116. // "project",
  39117. // "zone",
  39118. // "resource"
  39119. // ],
  39120. // "parameters": {
  39121. // "project": {
  39122. // "description": "Project ID for this request.",
  39123. // "location": "path",
  39124. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39125. // "required": true,
  39126. // "type": "string"
  39127. // },
  39128. // "resource": {
  39129. // "description": "Name or id of the resource for this request.",
  39130. // "location": "path",
  39131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39132. // "required": true,
  39133. // "type": "string"
  39134. // },
  39135. // "zone": {
  39136. // "description": "The name of the zone for this request.",
  39137. // "location": "path",
  39138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39139. // "required": true,
  39140. // "type": "string"
  39141. // }
  39142. // },
  39143. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  39144. // "response": {
  39145. // "$ref": "Policy"
  39146. // },
  39147. // "scopes": [
  39148. // "https://www.googleapis.com/auth/cloud-platform",
  39149. // "https://www.googleapis.com/auth/compute",
  39150. // "https://www.googleapis.com/auth/compute.readonly"
  39151. // ]
  39152. // }
  39153. }
  39154. // method id "compute.disks.insert":
  39155. type DisksInsertCall struct {
  39156. s *Service
  39157. project string
  39158. zone string
  39159. disk *Disk
  39160. urlParams_ gensupport.URLParams
  39161. ctx_ context.Context
  39162. header_ http.Header
  39163. }
  39164. // Insert: Creates a persistent disk in the specified project using the
  39165. // data in the request. You can create a disk with a sourceImage, a
  39166. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  39167. // properties. You can also create a disk that is larger than the
  39168. // default size by specifying the sizeGb property.
  39169. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  39170. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  39171. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39172. c.project = project
  39173. c.zone = zone
  39174. c.disk = disk
  39175. return c
  39176. }
  39177. // RequestId sets the optional parameter "requestId": An optional
  39178. // request ID to identify requests. Specify a unique request ID so that
  39179. // if you must retry your request, the server will know to ignore the
  39180. // request if it has already been completed.
  39181. //
  39182. // For example, consider a situation where you make an initial request
  39183. // and the request times out. If you make the request again with the
  39184. // same request ID, the server can check if original operation with the
  39185. // same request ID was received, and if so, will ignore the second
  39186. // request. This prevents clients from accidentally creating duplicate
  39187. // commitments.
  39188. //
  39189. // The request ID must be a valid UUID with the exception that zero UUID
  39190. // is not supported (00000000-0000-0000-0000-000000000000).
  39191. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  39192. c.urlParams_.Set("requestId", requestId)
  39193. return c
  39194. }
  39195. // SourceImage sets the optional parameter "sourceImage": Source image
  39196. // to restore onto a disk.
  39197. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  39198. c.urlParams_.Set("sourceImage", sourceImage)
  39199. return c
  39200. }
  39201. // Fields allows partial responses to be retrieved. See
  39202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39203. // for more information.
  39204. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  39205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39206. return c
  39207. }
  39208. // Context sets the context to be used in this call's Do method. Any
  39209. // pending HTTP request will be aborted if the provided context is
  39210. // canceled.
  39211. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  39212. c.ctx_ = ctx
  39213. return c
  39214. }
  39215. // Header returns an http.Header that can be modified by the caller to
  39216. // add HTTP headers to the request.
  39217. func (c *DisksInsertCall) Header() http.Header {
  39218. if c.header_ == nil {
  39219. c.header_ = make(http.Header)
  39220. }
  39221. return c.header_
  39222. }
  39223. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  39224. reqHeaders := make(http.Header)
  39225. for k, v := range c.header_ {
  39226. reqHeaders[k] = v
  39227. }
  39228. reqHeaders.Set("User-Agent", c.s.userAgent())
  39229. var body io.Reader = nil
  39230. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  39231. if err != nil {
  39232. return nil, err
  39233. }
  39234. reqHeaders.Set("Content-Type", "application/json")
  39235. c.urlParams_.Set("alt", alt)
  39236. c.urlParams_.Set("prettyPrint", "false")
  39237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  39238. urls += "?" + c.urlParams_.Encode()
  39239. req, err := http.NewRequest("POST", urls, body)
  39240. if err != nil {
  39241. return nil, err
  39242. }
  39243. req.Header = reqHeaders
  39244. googleapi.Expand(req.URL, map[string]string{
  39245. "project": c.project,
  39246. "zone": c.zone,
  39247. })
  39248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39249. }
  39250. // Do executes the "compute.disks.insert" call.
  39251. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39252. // status code is an error. Response headers are in either
  39253. // *Operation.ServerResponse.Header or (if a response was returned at
  39254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39255. // to check whether the returned error was because
  39256. // http.StatusNotModified was returned.
  39257. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39258. gensupport.SetOptions(c.urlParams_, opts...)
  39259. res, err := c.doRequest("json")
  39260. if res != nil && res.StatusCode == http.StatusNotModified {
  39261. if res.Body != nil {
  39262. res.Body.Close()
  39263. }
  39264. return nil, &googleapi.Error{
  39265. Code: res.StatusCode,
  39266. Header: res.Header,
  39267. }
  39268. }
  39269. if err != nil {
  39270. return nil, err
  39271. }
  39272. defer googleapi.CloseBody(res)
  39273. if err := googleapi.CheckResponse(res); err != nil {
  39274. return nil, err
  39275. }
  39276. ret := &Operation{
  39277. ServerResponse: googleapi.ServerResponse{
  39278. Header: res.Header,
  39279. HTTPStatusCode: res.StatusCode,
  39280. },
  39281. }
  39282. target := &ret
  39283. if err := gensupport.DecodeResponse(target, res); err != nil {
  39284. return nil, err
  39285. }
  39286. return ret, nil
  39287. // {
  39288. // "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.",
  39289. // "httpMethod": "POST",
  39290. // "id": "compute.disks.insert",
  39291. // "parameterOrder": [
  39292. // "project",
  39293. // "zone"
  39294. // ],
  39295. // "parameters": {
  39296. // "project": {
  39297. // "description": "Project ID for this request.",
  39298. // "location": "path",
  39299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39300. // "required": true,
  39301. // "type": "string"
  39302. // },
  39303. // "requestId": {
  39304. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39305. // "location": "query",
  39306. // "type": "string"
  39307. // },
  39308. // "sourceImage": {
  39309. // "description": "Optional. Source image to restore onto a disk.",
  39310. // "location": "query",
  39311. // "type": "string"
  39312. // },
  39313. // "zone": {
  39314. // "description": "The name of the zone for this request.",
  39315. // "location": "path",
  39316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39317. // "required": true,
  39318. // "type": "string"
  39319. // }
  39320. // },
  39321. // "path": "{project}/zones/{zone}/disks",
  39322. // "request": {
  39323. // "$ref": "Disk"
  39324. // },
  39325. // "response": {
  39326. // "$ref": "Operation"
  39327. // },
  39328. // "scopes": [
  39329. // "https://www.googleapis.com/auth/cloud-platform",
  39330. // "https://www.googleapis.com/auth/compute"
  39331. // ]
  39332. // }
  39333. }
  39334. // method id "compute.disks.list":
  39335. type DisksListCall struct {
  39336. s *Service
  39337. project string
  39338. zone string
  39339. urlParams_ gensupport.URLParams
  39340. ifNoneMatch_ string
  39341. ctx_ context.Context
  39342. header_ http.Header
  39343. }
  39344. // List: Retrieves a list of persistent disks contained within the
  39345. // specified zone.
  39346. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  39347. func (r *DisksService) List(project string, zone string) *DisksListCall {
  39348. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39349. c.project = project
  39350. c.zone = zone
  39351. return c
  39352. }
  39353. // Filter sets the optional parameter "filter": A filter expression that
  39354. // filters resources listed in the response. The expression must specify
  39355. // the field name, a comparison operator, and the value that you want to
  39356. // use for filtering. The value must be a string, a number, or a
  39357. // boolean. The comparison operator must be either =, !=, >, or <.
  39358. //
  39359. // For example, if you are filtering Compute Engine instances, you can
  39360. // exclude instances named example-instance by specifying name !=
  39361. // example-instance.
  39362. //
  39363. // You can also filter nested fields. For example, you could specify
  39364. // scheduling.automaticRestart = false to include instances only if they
  39365. // are not scheduled for automatic restarts. You can use filtering on
  39366. // nested fields to filter based on resource labels.
  39367. //
  39368. // To filter on multiple expressions, provide each separate expression
  39369. // within parentheses. For example, (scheduling.automaticRestart = true)
  39370. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39371. // AND expression. However, you can include AND and OR expressions
  39372. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39373. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39374. // true).
  39375. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  39376. c.urlParams_.Set("filter", filter)
  39377. return c
  39378. }
  39379. // MaxResults sets the optional parameter "maxResults": The maximum
  39380. // number of results per page that should be returned. If the number of
  39381. // available results is larger than maxResults, Compute Engine returns a
  39382. // nextPageToken that can be used to get the next page of results in
  39383. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39384. // (Default: 500)
  39385. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  39386. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39387. return c
  39388. }
  39389. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39390. // a certain order. By default, results are returned in alphanumerical
  39391. // order based on the resource name.
  39392. //
  39393. // You can also sort results in descending order based on the creation
  39394. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39395. // based on the creationTimestamp field in reverse chronological order
  39396. // (newest result first). Use this to sort resources like operations so
  39397. // that the newest operation is returned first.
  39398. //
  39399. // Currently, only sorting by name or creationTimestamp desc is
  39400. // supported.
  39401. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  39402. c.urlParams_.Set("orderBy", orderBy)
  39403. return c
  39404. }
  39405. // PageToken sets the optional parameter "pageToken": Specifies a page
  39406. // token to use. Set pageToken to the nextPageToken returned by a
  39407. // previous list request to get the next page of results.
  39408. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  39409. c.urlParams_.Set("pageToken", pageToken)
  39410. return c
  39411. }
  39412. // Fields allows partial responses to be retrieved. See
  39413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39414. // for more information.
  39415. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  39416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39417. return c
  39418. }
  39419. // IfNoneMatch sets the optional parameter which makes the operation
  39420. // fail if the object's ETag matches the given value. This is useful for
  39421. // getting updates only after the object has changed since the last
  39422. // request. Use googleapi.IsNotModified to check whether the response
  39423. // error from Do is the result of In-None-Match.
  39424. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  39425. c.ifNoneMatch_ = entityTag
  39426. return c
  39427. }
  39428. // Context sets the context to be used in this call's Do method. Any
  39429. // pending HTTP request will be aborted if the provided context is
  39430. // canceled.
  39431. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  39432. c.ctx_ = ctx
  39433. return c
  39434. }
  39435. // Header returns an http.Header that can be modified by the caller to
  39436. // add HTTP headers to the request.
  39437. func (c *DisksListCall) Header() http.Header {
  39438. if c.header_ == nil {
  39439. c.header_ = make(http.Header)
  39440. }
  39441. return c.header_
  39442. }
  39443. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  39444. reqHeaders := make(http.Header)
  39445. for k, v := range c.header_ {
  39446. reqHeaders[k] = v
  39447. }
  39448. reqHeaders.Set("User-Agent", c.s.userAgent())
  39449. if c.ifNoneMatch_ != "" {
  39450. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39451. }
  39452. var body io.Reader = nil
  39453. c.urlParams_.Set("alt", alt)
  39454. c.urlParams_.Set("prettyPrint", "false")
  39455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  39456. urls += "?" + c.urlParams_.Encode()
  39457. req, err := http.NewRequest("GET", urls, body)
  39458. if err != nil {
  39459. return nil, err
  39460. }
  39461. req.Header = reqHeaders
  39462. googleapi.Expand(req.URL, map[string]string{
  39463. "project": c.project,
  39464. "zone": c.zone,
  39465. })
  39466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39467. }
  39468. // Do executes the "compute.disks.list" call.
  39469. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  39470. // code is an error. Response headers are in either
  39471. // *DiskList.ServerResponse.Header or (if a response was returned at
  39472. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39473. // to check whether the returned error was because
  39474. // http.StatusNotModified was returned.
  39475. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  39476. gensupport.SetOptions(c.urlParams_, opts...)
  39477. res, err := c.doRequest("json")
  39478. if res != nil && res.StatusCode == http.StatusNotModified {
  39479. if res.Body != nil {
  39480. res.Body.Close()
  39481. }
  39482. return nil, &googleapi.Error{
  39483. Code: res.StatusCode,
  39484. Header: res.Header,
  39485. }
  39486. }
  39487. if err != nil {
  39488. return nil, err
  39489. }
  39490. defer googleapi.CloseBody(res)
  39491. if err := googleapi.CheckResponse(res); err != nil {
  39492. return nil, err
  39493. }
  39494. ret := &DiskList{
  39495. ServerResponse: googleapi.ServerResponse{
  39496. Header: res.Header,
  39497. HTTPStatusCode: res.StatusCode,
  39498. },
  39499. }
  39500. target := &ret
  39501. if err := gensupport.DecodeResponse(target, res); err != nil {
  39502. return nil, err
  39503. }
  39504. return ret, nil
  39505. // {
  39506. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  39507. // "httpMethod": "GET",
  39508. // "id": "compute.disks.list",
  39509. // "parameterOrder": [
  39510. // "project",
  39511. // "zone"
  39512. // ],
  39513. // "parameters": {
  39514. // "filter": {
  39515. // "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).",
  39516. // "location": "query",
  39517. // "type": "string"
  39518. // },
  39519. // "maxResults": {
  39520. // "default": "500",
  39521. // "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)",
  39522. // "format": "uint32",
  39523. // "location": "query",
  39524. // "minimum": "0",
  39525. // "type": "integer"
  39526. // },
  39527. // "orderBy": {
  39528. // "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.",
  39529. // "location": "query",
  39530. // "type": "string"
  39531. // },
  39532. // "pageToken": {
  39533. // "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.",
  39534. // "location": "query",
  39535. // "type": "string"
  39536. // },
  39537. // "project": {
  39538. // "description": "Project ID for this request.",
  39539. // "location": "path",
  39540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39541. // "required": true,
  39542. // "type": "string"
  39543. // },
  39544. // "zone": {
  39545. // "description": "The name of the zone for this request.",
  39546. // "location": "path",
  39547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39548. // "required": true,
  39549. // "type": "string"
  39550. // }
  39551. // },
  39552. // "path": "{project}/zones/{zone}/disks",
  39553. // "response": {
  39554. // "$ref": "DiskList"
  39555. // },
  39556. // "scopes": [
  39557. // "https://www.googleapis.com/auth/cloud-platform",
  39558. // "https://www.googleapis.com/auth/compute",
  39559. // "https://www.googleapis.com/auth/compute.readonly"
  39560. // ]
  39561. // }
  39562. }
  39563. // Pages invokes f for each page of results.
  39564. // A non-nil error returned from f will halt the iteration.
  39565. // The provided context supersedes any context provided to the Context method.
  39566. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  39567. c.ctx_ = ctx
  39568. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39569. for {
  39570. x, err := c.Do()
  39571. if err != nil {
  39572. return err
  39573. }
  39574. if err := f(x); err != nil {
  39575. return err
  39576. }
  39577. if x.NextPageToken == "" {
  39578. return nil
  39579. }
  39580. c.PageToken(x.NextPageToken)
  39581. }
  39582. }
  39583. // method id "compute.disks.removeResourcePolicies":
  39584. type DisksRemoveResourcePoliciesCall struct {
  39585. s *Service
  39586. project string
  39587. zone string
  39588. disk string
  39589. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  39590. urlParams_ gensupport.URLParams
  39591. ctx_ context.Context
  39592. header_ http.Header
  39593. }
  39594. // RemoveResourcePolicies: Removes resource policies from a disk.
  39595. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  39596. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39597. c.project = project
  39598. c.zone = zone
  39599. c.disk = disk
  39600. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  39601. return c
  39602. }
  39603. // RequestId sets the optional parameter "requestId": An optional
  39604. // request ID to identify requests. Specify a unique request ID so that
  39605. // if you must retry your request, the server will know to ignore the
  39606. // request if it has already been completed.
  39607. //
  39608. // For example, consider a situation where you make an initial request
  39609. // and the request times out. If you make the request again with the
  39610. // same request ID, the server can check if original operation with the
  39611. // same request ID was received, and if so, will ignore the second
  39612. // request. This prevents clients from accidentally creating duplicate
  39613. // commitments.
  39614. //
  39615. // The request ID must be a valid UUID with the exception that zero UUID
  39616. // is not supported (00000000-0000-0000-0000-000000000000).
  39617. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  39618. c.urlParams_.Set("requestId", requestId)
  39619. return c
  39620. }
  39621. // Fields allows partial responses to be retrieved. See
  39622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39623. // for more information.
  39624. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  39625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39626. return c
  39627. }
  39628. // Context sets the context to be used in this call's Do method. Any
  39629. // pending HTTP request will be aborted if the provided context is
  39630. // canceled.
  39631. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  39632. c.ctx_ = ctx
  39633. return c
  39634. }
  39635. // Header returns an http.Header that can be modified by the caller to
  39636. // add HTTP headers to the request.
  39637. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  39638. if c.header_ == nil {
  39639. c.header_ = make(http.Header)
  39640. }
  39641. return c.header_
  39642. }
  39643. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  39644. reqHeaders := make(http.Header)
  39645. for k, v := range c.header_ {
  39646. reqHeaders[k] = v
  39647. }
  39648. reqHeaders.Set("User-Agent", c.s.userAgent())
  39649. var body io.Reader = nil
  39650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  39651. if err != nil {
  39652. return nil, err
  39653. }
  39654. reqHeaders.Set("Content-Type", "application/json")
  39655. c.urlParams_.Set("alt", alt)
  39656. c.urlParams_.Set("prettyPrint", "false")
  39657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  39658. urls += "?" + c.urlParams_.Encode()
  39659. req, err := http.NewRequest("POST", urls, body)
  39660. if err != nil {
  39661. return nil, err
  39662. }
  39663. req.Header = reqHeaders
  39664. googleapi.Expand(req.URL, map[string]string{
  39665. "project": c.project,
  39666. "zone": c.zone,
  39667. "disk": c.disk,
  39668. })
  39669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39670. }
  39671. // Do executes the "compute.disks.removeResourcePolicies" call.
  39672. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39673. // status code is an error. Response headers are in either
  39674. // *Operation.ServerResponse.Header or (if a response was returned at
  39675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39676. // to check whether the returned error was because
  39677. // http.StatusNotModified was returned.
  39678. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39679. gensupport.SetOptions(c.urlParams_, opts...)
  39680. res, err := c.doRequest("json")
  39681. if res != nil && res.StatusCode == http.StatusNotModified {
  39682. if res.Body != nil {
  39683. res.Body.Close()
  39684. }
  39685. return nil, &googleapi.Error{
  39686. Code: res.StatusCode,
  39687. Header: res.Header,
  39688. }
  39689. }
  39690. if err != nil {
  39691. return nil, err
  39692. }
  39693. defer googleapi.CloseBody(res)
  39694. if err := googleapi.CheckResponse(res); err != nil {
  39695. return nil, err
  39696. }
  39697. ret := &Operation{
  39698. ServerResponse: googleapi.ServerResponse{
  39699. Header: res.Header,
  39700. HTTPStatusCode: res.StatusCode,
  39701. },
  39702. }
  39703. target := &ret
  39704. if err := gensupport.DecodeResponse(target, res); err != nil {
  39705. return nil, err
  39706. }
  39707. return ret, nil
  39708. // {
  39709. // "description": "Removes resource policies from a disk.",
  39710. // "httpMethod": "POST",
  39711. // "id": "compute.disks.removeResourcePolicies",
  39712. // "parameterOrder": [
  39713. // "project",
  39714. // "zone",
  39715. // "disk"
  39716. // ],
  39717. // "parameters": {
  39718. // "disk": {
  39719. // "description": "The disk name for this request.",
  39720. // "location": "path",
  39721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39722. // "required": true,
  39723. // "type": "string"
  39724. // },
  39725. // "project": {
  39726. // "description": "Project ID for this request.",
  39727. // "location": "path",
  39728. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39729. // "required": true,
  39730. // "type": "string"
  39731. // },
  39732. // "requestId": {
  39733. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39734. // "location": "query",
  39735. // "type": "string"
  39736. // },
  39737. // "zone": {
  39738. // "description": "The name of the zone for this request.",
  39739. // "location": "path",
  39740. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39741. // "required": true,
  39742. // "type": "string"
  39743. // }
  39744. // },
  39745. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  39746. // "request": {
  39747. // "$ref": "DisksRemoveResourcePoliciesRequest"
  39748. // },
  39749. // "response": {
  39750. // "$ref": "Operation"
  39751. // },
  39752. // "scopes": [
  39753. // "https://www.googleapis.com/auth/cloud-platform",
  39754. // "https://www.googleapis.com/auth/compute"
  39755. // ]
  39756. // }
  39757. }
  39758. // method id "compute.disks.resize":
  39759. type DisksResizeCall struct {
  39760. s *Service
  39761. project string
  39762. zone string
  39763. disk string
  39764. disksresizerequest *DisksResizeRequest
  39765. urlParams_ gensupport.URLParams
  39766. ctx_ context.Context
  39767. header_ http.Header
  39768. }
  39769. // Resize: Resizes the specified persistent disk. You can only increase
  39770. // the size of the disk.
  39771. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  39772. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39773. c.project = project
  39774. c.zone = zone
  39775. c.disk = disk
  39776. c.disksresizerequest = disksresizerequest
  39777. return c
  39778. }
  39779. // RequestId sets the optional parameter "requestId": An optional
  39780. // request ID to identify requests. Specify a unique request ID so that
  39781. // if you must retry your request, the server will know to ignore the
  39782. // request if it has already been completed.
  39783. //
  39784. // For example, consider a situation where you make an initial request
  39785. // and the request times out. If you make the request again with the
  39786. // same request ID, the server can check if original operation with the
  39787. // same request ID was received, and if so, will ignore the second
  39788. // request. This prevents clients from accidentally creating duplicate
  39789. // commitments.
  39790. //
  39791. // The request ID must be a valid UUID with the exception that zero UUID
  39792. // is not supported (00000000-0000-0000-0000-000000000000).
  39793. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  39794. c.urlParams_.Set("requestId", requestId)
  39795. return c
  39796. }
  39797. // Fields allows partial responses to be retrieved. See
  39798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39799. // for more information.
  39800. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  39801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39802. return c
  39803. }
  39804. // Context sets the context to be used in this call's Do method. Any
  39805. // pending HTTP request will be aborted if the provided context is
  39806. // canceled.
  39807. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  39808. c.ctx_ = ctx
  39809. return c
  39810. }
  39811. // Header returns an http.Header that can be modified by the caller to
  39812. // add HTTP headers to the request.
  39813. func (c *DisksResizeCall) Header() http.Header {
  39814. if c.header_ == nil {
  39815. c.header_ = make(http.Header)
  39816. }
  39817. return c.header_
  39818. }
  39819. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  39820. reqHeaders := make(http.Header)
  39821. for k, v := range c.header_ {
  39822. reqHeaders[k] = v
  39823. }
  39824. reqHeaders.Set("User-Agent", c.s.userAgent())
  39825. var body io.Reader = nil
  39826. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  39827. if err != nil {
  39828. return nil, err
  39829. }
  39830. reqHeaders.Set("Content-Type", "application/json")
  39831. c.urlParams_.Set("alt", alt)
  39832. c.urlParams_.Set("prettyPrint", "false")
  39833. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  39834. urls += "?" + c.urlParams_.Encode()
  39835. req, err := http.NewRequest("POST", urls, body)
  39836. if err != nil {
  39837. return nil, err
  39838. }
  39839. req.Header = reqHeaders
  39840. googleapi.Expand(req.URL, map[string]string{
  39841. "project": c.project,
  39842. "zone": c.zone,
  39843. "disk": c.disk,
  39844. })
  39845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39846. }
  39847. // Do executes the "compute.disks.resize" call.
  39848. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39849. // status code is an error. Response headers are in either
  39850. // *Operation.ServerResponse.Header or (if a response was returned at
  39851. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39852. // to check whether the returned error was because
  39853. // http.StatusNotModified was returned.
  39854. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39855. gensupport.SetOptions(c.urlParams_, opts...)
  39856. res, err := c.doRequest("json")
  39857. if res != nil && res.StatusCode == http.StatusNotModified {
  39858. if res.Body != nil {
  39859. res.Body.Close()
  39860. }
  39861. return nil, &googleapi.Error{
  39862. Code: res.StatusCode,
  39863. Header: res.Header,
  39864. }
  39865. }
  39866. if err != nil {
  39867. return nil, err
  39868. }
  39869. defer googleapi.CloseBody(res)
  39870. if err := googleapi.CheckResponse(res); err != nil {
  39871. return nil, err
  39872. }
  39873. ret := &Operation{
  39874. ServerResponse: googleapi.ServerResponse{
  39875. Header: res.Header,
  39876. HTTPStatusCode: res.StatusCode,
  39877. },
  39878. }
  39879. target := &ret
  39880. if err := gensupport.DecodeResponse(target, res); err != nil {
  39881. return nil, err
  39882. }
  39883. return ret, nil
  39884. // {
  39885. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  39886. // "httpMethod": "POST",
  39887. // "id": "compute.disks.resize",
  39888. // "parameterOrder": [
  39889. // "project",
  39890. // "zone",
  39891. // "disk"
  39892. // ],
  39893. // "parameters": {
  39894. // "disk": {
  39895. // "description": "The name of the persistent disk.",
  39896. // "location": "path",
  39897. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39898. // "required": true,
  39899. // "type": "string"
  39900. // },
  39901. // "project": {
  39902. // "description": "Project ID for this request.",
  39903. // "location": "path",
  39904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39905. // "required": true,
  39906. // "type": "string"
  39907. // },
  39908. // "requestId": {
  39909. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39910. // "location": "query",
  39911. // "type": "string"
  39912. // },
  39913. // "zone": {
  39914. // "description": "The name of the zone for this request.",
  39915. // "location": "path",
  39916. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39917. // "required": true,
  39918. // "type": "string"
  39919. // }
  39920. // },
  39921. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  39922. // "request": {
  39923. // "$ref": "DisksResizeRequest"
  39924. // },
  39925. // "response": {
  39926. // "$ref": "Operation"
  39927. // },
  39928. // "scopes": [
  39929. // "https://www.googleapis.com/auth/cloud-platform",
  39930. // "https://www.googleapis.com/auth/compute"
  39931. // ]
  39932. // }
  39933. }
  39934. // method id "compute.disks.setIamPolicy":
  39935. type DisksSetIamPolicyCall struct {
  39936. s *Service
  39937. project string
  39938. zone string
  39939. resource string
  39940. zonesetpolicyrequest *ZoneSetPolicyRequest
  39941. urlParams_ gensupport.URLParams
  39942. ctx_ context.Context
  39943. header_ http.Header
  39944. }
  39945. // SetIamPolicy: Sets the access control policy on the specified
  39946. // resource. Replaces any existing policy.
  39947. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  39948. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39949. c.project = project
  39950. c.zone = zone
  39951. c.resource = resource
  39952. c.zonesetpolicyrequest = zonesetpolicyrequest
  39953. return c
  39954. }
  39955. // Fields allows partial responses to be retrieved. See
  39956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39957. // for more information.
  39958. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  39959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39960. return c
  39961. }
  39962. // Context sets the context to be used in this call's Do method. Any
  39963. // pending HTTP request will be aborted if the provided context is
  39964. // canceled.
  39965. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  39966. c.ctx_ = ctx
  39967. return c
  39968. }
  39969. // Header returns an http.Header that can be modified by the caller to
  39970. // add HTTP headers to the request.
  39971. func (c *DisksSetIamPolicyCall) Header() http.Header {
  39972. if c.header_ == nil {
  39973. c.header_ = make(http.Header)
  39974. }
  39975. return c.header_
  39976. }
  39977. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  39978. reqHeaders := make(http.Header)
  39979. for k, v := range c.header_ {
  39980. reqHeaders[k] = v
  39981. }
  39982. reqHeaders.Set("User-Agent", c.s.userAgent())
  39983. var body io.Reader = nil
  39984. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  39985. if err != nil {
  39986. return nil, err
  39987. }
  39988. reqHeaders.Set("Content-Type", "application/json")
  39989. c.urlParams_.Set("alt", alt)
  39990. c.urlParams_.Set("prettyPrint", "false")
  39991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  39992. urls += "?" + c.urlParams_.Encode()
  39993. req, err := http.NewRequest("POST", urls, body)
  39994. if err != nil {
  39995. return nil, err
  39996. }
  39997. req.Header = reqHeaders
  39998. googleapi.Expand(req.URL, map[string]string{
  39999. "project": c.project,
  40000. "zone": c.zone,
  40001. "resource": c.resource,
  40002. })
  40003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40004. }
  40005. // Do executes the "compute.disks.setIamPolicy" call.
  40006. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40007. // code is an error. Response headers are in either
  40008. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40009. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40010. // check whether the returned error was because http.StatusNotModified
  40011. // was returned.
  40012. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40013. gensupport.SetOptions(c.urlParams_, opts...)
  40014. res, err := c.doRequest("json")
  40015. if res != nil && res.StatusCode == http.StatusNotModified {
  40016. if res.Body != nil {
  40017. res.Body.Close()
  40018. }
  40019. return nil, &googleapi.Error{
  40020. Code: res.StatusCode,
  40021. Header: res.Header,
  40022. }
  40023. }
  40024. if err != nil {
  40025. return nil, err
  40026. }
  40027. defer googleapi.CloseBody(res)
  40028. if err := googleapi.CheckResponse(res); err != nil {
  40029. return nil, err
  40030. }
  40031. ret := &Policy{
  40032. ServerResponse: googleapi.ServerResponse{
  40033. Header: res.Header,
  40034. HTTPStatusCode: res.StatusCode,
  40035. },
  40036. }
  40037. target := &ret
  40038. if err := gensupport.DecodeResponse(target, res); err != nil {
  40039. return nil, err
  40040. }
  40041. return ret, nil
  40042. // {
  40043. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  40044. // "httpMethod": "POST",
  40045. // "id": "compute.disks.setIamPolicy",
  40046. // "parameterOrder": [
  40047. // "project",
  40048. // "zone",
  40049. // "resource"
  40050. // ],
  40051. // "parameters": {
  40052. // "project": {
  40053. // "description": "Project ID for this request.",
  40054. // "location": "path",
  40055. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40056. // "required": true,
  40057. // "type": "string"
  40058. // },
  40059. // "resource": {
  40060. // "description": "Name or id of the resource for this request.",
  40061. // "location": "path",
  40062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40063. // "required": true,
  40064. // "type": "string"
  40065. // },
  40066. // "zone": {
  40067. // "description": "The name of the zone for this request.",
  40068. // "location": "path",
  40069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40070. // "required": true,
  40071. // "type": "string"
  40072. // }
  40073. // },
  40074. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  40075. // "request": {
  40076. // "$ref": "ZoneSetPolicyRequest"
  40077. // },
  40078. // "response": {
  40079. // "$ref": "Policy"
  40080. // },
  40081. // "scopes": [
  40082. // "https://www.googleapis.com/auth/cloud-platform",
  40083. // "https://www.googleapis.com/auth/compute"
  40084. // ]
  40085. // }
  40086. }
  40087. // method id "compute.disks.setLabels":
  40088. type DisksSetLabelsCall struct {
  40089. s *Service
  40090. project string
  40091. zone string
  40092. resource string
  40093. zonesetlabelsrequest *ZoneSetLabelsRequest
  40094. urlParams_ gensupport.URLParams
  40095. ctx_ context.Context
  40096. header_ http.Header
  40097. }
  40098. // SetLabels: Sets the labels on a disk. To learn more about labels,
  40099. // read the Labeling Resources documentation.
  40100. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  40101. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40102. c.project = project
  40103. c.zone = zone
  40104. c.resource = resource
  40105. c.zonesetlabelsrequest = zonesetlabelsrequest
  40106. return c
  40107. }
  40108. // RequestId sets the optional parameter "requestId": An optional
  40109. // request ID to identify requests. Specify a unique request ID so that
  40110. // if you must retry your request, the server will know to ignore the
  40111. // request if it has already been completed.
  40112. //
  40113. // For example, consider a situation where you make an initial request
  40114. // and the request times out. If you make the request again with the
  40115. // same request ID, the server can check if original operation with the
  40116. // same request ID was received, and if so, will ignore the second
  40117. // request. This prevents clients from accidentally creating duplicate
  40118. // commitments.
  40119. //
  40120. // The request ID must be a valid UUID with the exception that zero UUID
  40121. // is not supported (00000000-0000-0000-0000-000000000000).
  40122. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  40123. c.urlParams_.Set("requestId", requestId)
  40124. return c
  40125. }
  40126. // Fields allows partial responses to be retrieved. See
  40127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40128. // for more information.
  40129. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  40130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40131. return c
  40132. }
  40133. // Context sets the context to be used in this call's Do method. Any
  40134. // pending HTTP request will be aborted if the provided context is
  40135. // canceled.
  40136. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  40137. c.ctx_ = ctx
  40138. return c
  40139. }
  40140. // Header returns an http.Header that can be modified by the caller to
  40141. // add HTTP headers to the request.
  40142. func (c *DisksSetLabelsCall) Header() http.Header {
  40143. if c.header_ == nil {
  40144. c.header_ = make(http.Header)
  40145. }
  40146. return c.header_
  40147. }
  40148. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  40149. reqHeaders := make(http.Header)
  40150. for k, v := range c.header_ {
  40151. reqHeaders[k] = v
  40152. }
  40153. reqHeaders.Set("User-Agent", c.s.userAgent())
  40154. var body io.Reader = nil
  40155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  40156. if err != nil {
  40157. return nil, err
  40158. }
  40159. reqHeaders.Set("Content-Type", "application/json")
  40160. c.urlParams_.Set("alt", alt)
  40161. c.urlParams_.Set("prettyPrint", "false")
  40162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  40163. urls += "?" + c.urlParams_.Encode()
  40164. req, err := http.NewRequest("POST", urls, body)
  40165. if err != nil {
  40166. return nil, err
  40167. }
  40168. req.Header = reqHeaders
  40169. googleapi.Expand(req.URL, map[string]string{
  40170. "project": c.project,
  40171. "zone": c.zone,
  40172. "resource": c.resource,
  40173. })
  40174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40175. }
  40176. // Do executes the "compute.disks.setLabels" call.
  40177. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40178. // status code is an error. Response headers are in either
  40179. // *Operation.ServerResponse.Header or (if a response was returned at
  40180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40181. // to check whether the returned error was because
  40182. // http.StatusNotModified was returned.
  40183. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40184. gensupport.SetOptions(c.urlParams_, opts...)
  40185. res, err := c.doRequest("json")
  40186. if res != nil && res.StatusCode == http.StatusNotModified {
  40187. if res.Body != nil {
  40188. res.Body.Close()
  40189. }
  40190. return nil, &googleapi.Error{
  40191. Code: res.StatusCode,
  40192. Header: res.Header,
  40193. }
  40194. }
  40195. if err != nil {
  40196. return nil, err
  40197. }
  40198. defer googleapi.CloseBody(res)
  40199. if err := googleapi.CheckResponse(res); err != nil {
  40200. return nil, err
  40201. }
  40202. ret := &Operation{
  40203. ServerResponse: googleapi.ServerResponse{
  40204. Header: res.Header,
  40205. HTTPStatusCode: res.StatusCode,
  40206. },
  40207. }
  40208. target := &ret
  40209. if err := gensupport.DecodeResponse(target, res); err != nil {
  40210. return nil, err
  40211. }
  40212. return ret, nil
  40213. // {
  40214. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  40215. // "httpMethod": "POST",
  40216. // "id": "compute.disks.setLabels",
  40217. // "parameterOrder": [
  40218. // "project",
  40219. // "zone",
  40220. // "resource"
  40221. // ],
  40222. // "parameters": {
  40223. // "project": {
  40224. // "description": "Project ID for this request.",
  40225. // "location": "path",
  40226. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40227. // "required": true,
  40228. // "type": "string"
  40229. // },
  40230. // "requestId": {
  40231. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40232. // "location": "query",
  40233. // "type": "string"
  40234. // },
  40235. // "resource": {
  40236. // "description": "Name or id of the resource for this request.",
  40237. // "location": "path",
  40238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40239. // "required": true,
  40240. // "type": "string"
  40241. // },
  40242. // "zone": {
  40243. // "description": "The name of the zone for this request.",
  40244. // "location": "path",
  40245. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40246. // "required": true,
  40247. // "type": "string"
  40248. // }
  40249. // },
  40250. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  40251. // "request": {
  40252. // "$ref": "ZoneSetLabelsRequest"
  40253. // },
  40254. // "response": {
  40255. // "$ref": "Operation"
  40256. // },
  40257. // "scopes": [
  40258. // "https://www.googleapis.com/auth/cloud-platform",
  40259. // "https://www.googleapis.com/auth/compute"
  40260. // ]
  40261. // }
  40262. }
  40263. // method id "compute.disks.testIamPermissions":
  40264. type DisksTestIamPermissionsCall struct {
  40265. s *Service
  40266. project string
  40267. zone string
  40268. resource string
  40269. testpermissionsrequest *TestPermissionsRequest
  40270. urlParams_ gensupport.URLParams
  40271. ctx_ context.Context
  40272. header_ http.Header
  40273. }
  40274. // TestIamPermissions: Returns permissions that a caller has on the
  40275. // specified resource.
  40276. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  40277. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40278. c.project = project
  40279. c.zone = zone
  40280. c.resource = resource
  40281. c.testpermissionsrequest = testpermissionsrequest
  40282. return c
  40283. }
  40284. // Fields allows partial responses to be retrieved. See
  40285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40286. // for more information.
  40287. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  40288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40289. return c
  40290. }
  40291. // Context sets the context to be used in this call's Do method. Any
  40292. // pending HTTP request will be aborted if the provided context is
  40293. // canceled.
  40294. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  40295. c.ctx_ = ctx
  40296. return c
  40297. }
  40298. // Header returns an http.Header that can be modified by the caller to
  40299. // add HTTP headers to the request.
  40300. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  40301. if c.header_ == nil {
  40302. c.header_ = make(http.Header)
  40303. }
  40304. return c.header_
  40305. }
  40306. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  40307. reqHeaders := make(http.Header)
  40308. for k, v := range c.header_ {
  40309. reqHeaders[k] = v
  40310. }
  40311. reqHeaders.Set("User-Agent", c.s.userAgent())
  40312. var body io.Reader = nil
  40313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  40314. if err != nil {
  40315. return nil, err
  40316. }
  40317. reqHeaders.Set("Content-Type", "application/json")
  40318. c.urlParams_.Set("alt", alt)
  40319. c.urlParams_.Set("prettyPrint", "false")
  40320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  40321. urls += "?" + c.urlParams_.Encode()
  40322. req, err := http.NewRequest("POST", urls, body)
  40323. if err != nil {
  40324. return nil, err
  40325. }
  40326. req.Header = reqHeaders
  40327. googleapi.Expand(req.URL, map[string]string{
  40328. "project": c.project,
  40329. "zone": c.zone,
  40330. "resource": c.resource,
  40331. })
  40332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40333. }
  40334. // Do executes the "compute.disks.testIamPermissions" call.
  40335. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  40336. // non-2xx status code is an error. Response headers are in either
  40337. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  40338. // returned at all) in error.(*googleapi.Error).Header. Use
  40339. // googleapi.IsNotModified to check whether the returned error was
  40340. // because http.StatusNotModified was returned.
  40341. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  40342. gensupport.SetOptions(c.urlParams_, opts...)
  40343. res, err := c.doRequest("json")
  40344. if res != nil && res.StatusCode == http.StatusNotModified {
  40345. if res.Body != nil {
  40346. res.Body.Close()
  40347. }
  40348. return nil, &googleapi.Error{
  40349. Code: res.StatusCode,
  40350. Header: res.Header,
  40351. }
  40352. }
  40353. if err != nil {
  40354. return nil, err
  40355. }
  40356. defer googleapi.CloseBody(res)
  40357. if err := googleapi.CheckResponse(res); err != nil {
  40358. return nil, err
  40359. }
  40360. ret := &TestPermissionsResponse{
  40361. ServerResponse: googleapi.ServerResponse{
  40362. Header: res.Header,
  40363. HTTPStatusCode: res.StatusCode,
  40364. },
  40365. }
  40366. target := &ret
  40367. if err := gensupport.DecodeResponse(target, res); err != nil {
  40368. return nil, err
  40369. }
  40370. return ret, nil
  40371. // {
  40372. // "description": "Returns permissions that a caller has on the specified resource.",
  40373. // "httpMethod": "POST",
  40374. // "id": "compute.disks.testIamPermissions",
  40375. // "parameterOrder": [
  40376. // "project",
  40377. // "zone",
  40378. // "resource"
  40379. // ],
  40380. // "parameters": {
  40381. // "project": {
  40382. // "description": "Project ID for this request.",
  40383. // "location": "path",
  40384. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40385. // "required": true,
  40386. // "type": "string"
  40387. // },
  40388. // "resource": {
  40389. // "description": "Name or id of the resource for this request.",
  40390. // "location": "path",
  40391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40392. // "required": true,
  40393. // "type": "string"
  40394. // },
  40395. // "zone": {
  40396. // "description": "The name of the zone for this request.",
  40397. // "location": "path",
  40398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40399. // "required": true,
  40400. // "type": "string"
  40401. // }
  40402. // },
  40403. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  40404. // "request": {
  40405. // "$ref": "TestPermissionsRequest"
  40406. // },
  40407. // "response": {
  40408. // "$ref": "TestPermissionsResponse"
  40409. // },
  40410. // "scopes": [
  40411. // "https://www.googleapis.com/auth/cloud-platform",
  40412. // "https://www.googleapis.com/auth/compute",
  40413. // "https://www.googleapis.com/auth/compute.readonly"
  40414. // ]
  40415. // }
  40416. }
  40417. // method id "compute.firewalls.delete":
  40418. type FirewallsDeleteCall struct {
  40419. s *Service
  40420. project string
  40421. firewall string
  40422. urlParams_ gensupport.URLParams
  40423. ctx_ context.Context
  40424. header_ http.Header
  40425. }
  40426. // Delete: Deletes the specified firewall.
  40427. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  40428. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  40429. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40430. c.project = project
  40431. c.firewall = firewall
  40432. return c
  40433. }
  40434. // RequestId sets the optional parameter "requestId": An optional
  40435. // request ID to identify requests. Specify a unique request ID so that
  40436. // if you must retry your request, the server will know to ignore the
  40437. // request if it has already been completed.
  40438. //
  40439. // For example, consider a situation where you make an initial request
  40440. // and the request times out. If you make the request again with the
  40441. // same request ID, the server can check if original operation with the
  40442. // same request ID was received, and if so, will ignore the second
  40443. // request. This prevents clients from accidentally creating duplicate
  40444. // commitments.
  40445. //
  40446. // The request ID must be a valid UUID with the exception that zero UUID
  40447. // is not supported (00000000-0000-0000-0000-000000000000).
  40448. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  40449. c.urlParams_.Set("requestId", requestId)
  40450. return c
  40451. }
  40452. // Fields allows partial responses to be retrieved. See
  40453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40454. // for more information.
  40455. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  40456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40457. return c
  40458. }
  40459. // Context sets the context to be used in this call's Do method. Any
  40460. // pending HTTP request will be aborted if the provided context is
  40461. // canceled.
  40462. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  40463. c.ctx_ = ctx
  40464. return c
  40465. }
  40466. // Header returns an http.Header that can be modified by the caller to
  40467. // add HTTP headers to the request.
  40468. func (c *FirewallsDeleteCall) Header() http.Header {
  40469. if c.header_ == nil {
  40470. c.header_ = make(http.Header)
  40471. }
  40472. return c.header_
  40473. }
  40474. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  40475. reqHeaders := make(http.Header)
  40476. for k, v := range c.header_ {
  40477. reqHeaders[k] = v
  40478. }
  40479. reqHeaders.Set("User-Agent", c.s.userAgent())
  40480. var body io.Reader = nil
  40481. c.urlParams_.Set("alt", alt)
  40482. c.urlParams_.Set("prettyPrint", "false")
  40483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  40484. urls += "?" + c.urlParams_.Encode()
  40485. req, err := http.NewRequest("DELETE", urls, body)
  40486. if err != nil {
  40487. return nil, err
  40488. }
  40489. req.Header = reqHeaders
  40490. googleapi.Expand(req.URL, map[string]string{
  40491. "project": c.project,
  40492. "firewall": c.firewall,
  40493. })
  40494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40495. }
  40496. // Do executes the "compute.firewalls.delete" call.
  40497. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40498. // status code is an error. Response headers are in either
  40499. // *Operation.ServerResponse.Header or (if a response was returned at
  40500. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40501. // to check whether the returned error was because
  40502. // http.StatusNotModified was returned.
  40503. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40504. gensupport.SetOptions(c.urlParams_, opts...)
  40505. res, err := c.doRequest("json")
  40506. if res != nil && res.StatusCode == http.StatusNotModified {
  40507. if res.Body != nil {
  40508. res.Body.Close()
  40509. }
  40510. return nil, &googleapi.Error{
  40511. Code: res.StatusCode,
  40512. Header: res.Header,
  40513. }
  40514. }
  40515. if err != nil {
  40516. return nil, err
  40517. }
  40518. defer googleapi.CloseBody(res)
  40519. if err := googleapi.CheckResponse(res); err != nil {
  40520. return nil, err
  40521. }
  40522. ret := &Operation{
  40523. ServerResponse: googleapi.ServerResponse{
  40524. Header: res.Header,
  40525. HTTPStatusCode: res.StatusCode,
  40526. },
  40527. }
  40528. target := &ret
  40529. if err := gensupport.DecodeResponse(target, res); err != nil {
  40530. return nil, err
  40531. }
  40532. return ret, nil
  40533. // {
  40534. // "description": "Deletes the specified firewall.",
  40535. // "httpMethod": "DELETE",
  40536. // "id": "compute.firewalls.delete",
  40537. // "parameterOrder": [
  40538. // "project",
  40539. // "firewall"
  40540. // ],
  40541. // "parameters": {
  40542. // "firewall": {
  40543. // "description": "Name of the firewall rule to delete.",
  40544. // "location": "path",
  40545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40546. // "required": true,
  40547. // "type": "string"
  40548. // },
  40549. // "project": {
  40550. // "description": "Project ID for this request.",
  40551. // "location": "path",
  40552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40553. // "required": true,
  40554. // "type": "string"
  40555. // },
  40556. // "requestId": {
  40557. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40558. // "location": "query",
  40559. // "type": "string"
  40560. // }
  40561. // },
  40562. // "path": "{project}/global/firewalls/{firewall}",
  40563. // "response": {
  40564. // "$ref": "Operation"
  40565. // },
  40566. // "scopes": [
  40567. // "https://www.googleapis.com/auth/cloud-platform",
  40568. // "https://www.googleapis.com/auth/compute"
  40569. // ]
  40570. // }
  40571. }
  40572. // method id "compute.firewalls.get":
  40573. type FirewallsGetCall struct {
  40574. s *Service
  40575. project string
  40576. firewall string
  40577. urlParams_ gensupport.URLParams
  40578. ifNoneMatch_ string
  40579. ctx_ context.Context
  40580. header_ http.Header
  40581. }
  40582. // Get: Returns the specified firewall.
  40583. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  40584. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  40585. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40586. c.project = project
  40587. c.firewall = firewall
  40588. return c
  40589. }
  40590. // Fields allows partial responses to be retrieved. See
  40591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40592. // for more information.
  40593. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  40594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40595. return c
  40596. }
  40597. // IfNoneMatch sets the optional parameter which makes the operation
  40598. // fail if the object's ETag matches the given value. This is useful for
  40599. // getting updates only after the object has changed since the last
  40600. // request. Use googleapi.IsNotModified to check whether the response
  40601. // error from Do is the result of In-None-Match.
  40602. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  40603. c.ifNoneMatch_ = entityTag
  40604. return c
  40605. }
  40606. // Context sets the context to be used in this call's Do method. Any
  40607. // pending HTTP request will be aborted if the provided context is
  40608. // canceled.
  40609. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  40610. c.ctx_ = ctx
  40611. return c
  40612. }
  40613. // Header returns an http.Header that can be modified by the caller to
  40614. // add HTTP headers to the request.
  40615. func (c *FirewallsGetCall) Header() http.Header {
  40616. if c.header_ == nil {
  40617. c.header_ = make(http.Header)
  40618. }
  40619. return c.header_
  40620. }
  40621. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  40622. reqHeaders := make(http.Header)
  40623. for k, v := range c.header_ {
  40624. reqHeaders[k] = v
  40625. }
  40626. reqHeaders.Set("User-Agent", c.s.userAgent())
  40627. if c.ifNoneMatch_ != "" {
  40628. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40629. }
  40630. var body io.Reader = nil
  40631. c.urlParams_.Set("alt", alt)
  40632. c.urlParams_.Set("prettyPrint", "false")
  40633. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  40634. urls += "?" + c.urlParams_.Encode()
  40635. req, err := http.NewRequest("GET", urls, body)
  40636. if err != nil {
  40637. return nil, err
  40638. }
  40639. req.Header = reqHeaders
  40640. googleapi.Expand(req.URL, map[string]string{
  40641. "project": c.project,
  40642. "firewall": c.firewall,
  40643. })
  40644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40645. }
  40646. // Do executes the "compute.firewalls.get" call.
  40647. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  40648. // code is an error. Response headers are in either
  40649. // *Firewall.ServerResponse.Header or (if a response was returned at
  40650. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40651. // to check whether the returned error was because
  40652. // http.StatusNotModified was returned.
  40653. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  40654. gensupport.SetOptions(c.urlParams_, opts...)
  40655. res, err := c.doRequest("json")
  40656. if res != nil && res.StatusCode == http.StatusNotModified {
  40657. if res.Body != nil {
  40658. res.Body.Close()
  40659. }
  40660. return nil, &googleapi.Error{
  40661. Code: res.StatusCode,
  40662. Header: res.Header,
  40663. }
  40664. }
  40665. if err != nil {
  40666. return nil, err
  40667. }
  40668. defer googleapi.CloseBody(res)
  40669. if err := googleapi.CheckResponse(res); err != nil {
  40670. return nil, err
  40671. }
  40672. ret := &Firewall{
  40673. ServerResponse: googleapi.ServerResponse{
  40674. Header: res.Header,
  40675. HTTPStatusCode: res.StatusCode,
  40676. },
  40677. }
  40678. target := &ret
  40679. if err := gensupport.DecodeResponse(target, res); err != nil {
  40680. return nil, err
  40681. }
  40682. return ret, nil
  40683. // {
  40684. // "description": "Returns the specified firewall.",
  40685. // "httpMethod": "GET",
  40686. // "id": "compute.firewalls.get",
  40687. // "parameterOrder": [
  40688. // "project",
  40689. // "firewall"
  40690. // ],
  40691. // "parameters": {
  40692. // "firewall": {
  40693. // "description": "Name of the firewall rule to return.",
  40694. // "location": "path",
  40695. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40696. // "required": true,
  40697. // "type": "string"
  40698. // },
  40699. // "project": {
  40700. // "description": "Project ID for this request.",
  40701. // "location": "path",
  40702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40703. // "required": true,
  40704. // "type": "string"
  40705. // }
  40706. // },
  40707. // "path": "{project}/global/firewalls/{firewall}",
  40708. // "response": {
  40709. // "$ref": "Firewall"
  40710. // },
  40711. // "scopes": [
  40712. // "https://www.googleapis.com/auth/cloud-platform",
  40713. // "https://www.googleapis.com/auth/compute",
  40714. // "https://www.googleapis.com/auth/compute.readonly"
  40715. // ]
  40716. // }
  40717. }
  40718. // method id "compute.firewalls.insert":
  40719. type FirewallsInsertCall struct {
  40720. s *Service
  40721. project string
  40722. firewall *Firewall
  40723. urlParams_ gensupport.URLParams
  40724. ctx_ context.Context
  40725. header_ http.Header
  40726. }
  40727. // Insert: Creates a firewall rule in the specified project using the
  40728. // data included in the request.
  40729. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  40730. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  40731. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40732. c.project = project
  40733. c.firewall = firewall
  40734. return c
  40735. }
  40736. // RequestId sets the optional parameter "requestId": An optional
  40737. // request ID to identify requests. Specify a unique request ID so that
  40738. // if you must retry your request, the server will know to ignore the
  40739. // request if it has already been completed.
  40740. //
  40741. // For example, consider a situation where you make an initial request
  40742. // and the request times out. If you make the request again with the
  40743. // same request ID, the server can check if original operation with the
  40744. // same request ID was received, and if so, will ignore the second
  40745. // request. This prevents clients from accidentally creating duplicate
  40746. // commitments.
  40747. //
  40748. // The request ID must be a valid UUID with the exception that zero UUID
  40749. // is not supported (00000000-0000-0000-0000-000000000000).
  40750. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  40751. c.urlParams_.Set("requestId", requestId)
  40752. return c
  40753. }
  40754. // Fields allows partial responses to be retrieved. See
  40755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40756. // for more information.
  40757. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  40758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40759. return c
  40760. }
  40761. // Context sets the context to be used in this call's Do method. Any
  40762. // pending HTTP request will be aborted if the provided context is
  40763. // canceled.
  40764. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  40765. c.ctx_ = ctx
  40766. return c
  40767. }
  40768. // Header returns an http.Header that can be modified by the caller to
  40769. // add HTTP headers to the request.
  40770. func (c *FirewallsInsertCall) Header() http.Header {
  40771. if c.header_ == nil {
  40772. c.header_ = make(http.Header)
  40773. }
  40774. return c.header_
  40775. }
  40776. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  40777. reqHeaders := make(http.Header)
  40778. for k, v := range c.header_ {
  40779. reqHeaders[k] = v
  40780. }
  40781. reqHeaders.Set("User-Agent", c.s.userAgent())
  40782. var body io.Reader = nil
  40783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  40784. if err != nil {
  40785. return nil, err
  40786. }
  40787. reqHeaders.Set("Content-Type", "application/json")
  40788. c.urlParams_.Set("alt", alt)
  40789. c.urlParams_.Set("prettyPrint", "false")
  40790. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  40791. urls += "?" + c.urlParams_.Encode()
  40792. req, err := http.NewRequest("POST", urls, body)
  40793. if err != nil {
  40794. return nil, err
  40795. }
  40796. req.Header = reqHeaders
  40797. googleapi.Expand(req.URL, map[string]string{
  40798. "project": c.project,
  40799. })
  40800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40801. }
  40802. // Do executes the "compute.firewalls.insert" call.
  40803. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40804. // status code is an error. Response headers are in either
  40805. // *Operation.ServerResponse.Header or (if a response was returned at
  40806. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40807. // to check whether the returned error was because
  40808. // http.StatusNotModified was returned.
  40809. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40810. gensupport.SetOptions(c.urlParams_, opts...)
  40811. res, err := c.doRequest("json")
  40812. if res != nil && res.StatusCode == http.StatusNotModified {
  40813. if res.Body != nil {
  40814. res.Body.Close()
  40815. }
  40816. return nil, &googleapi.Error{
  40817. Code: res.StatusCode,
  40818. Header: res.Header,
  40819. }
  40820. }
  40821. if err != nil {
  40822. return nil, err
  40823. }
  40824. defer googleapi.CloseBody(res)
  40825. if err := googleapi.CheckResponse(res); err != nil {
  40826. return nil, err
  40827. }
  40828. ret := &Operation{
  40829. ServerResponse: googleapi.ServerResponse{
  40830. Header: res.Header,
  40831. HTTPStatusCode: res.StatusCode,
  40832. },
  40833. }
  40834. target := &ret
  40835. if err := gensupport.DecodeResponse(target, res); err != nil {
  40836. return nil, err
  40837. }
  40838. return ret, nil
  40839. // {
  40840. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  40841. // "httpMethod": "POST",
  40842. // "id": "compute.firewalls.insert",
  40843. // "parameterOrder": [
  40844. // "project"
  40845. // ],
  40846. // "parameters": {
  40847. // "project": {
  40848. // "description": "Project ID for this request.",
  40849. // "location": "path",
  40850. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40851. // "required": true,
  40852. // "type": "string"
  40853. // },
  40854. // "requestId": {
  40855. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40856. // "location": "query",
  40857. // "type": "string"
  40858. // }
  40859. // },
  40860. // "path": "{project}/global/firewalls",
  40861. // "request": {
  40862. // "$ref": "Firewall"
  40863. // },
  40864. // "response": {
  40865. // "$ref": "Operation"
  40866. // },
  40867. // "scopes": [
  40868. // "https://www.googleapis.com/auth/cloud-platform",
  40869. // "https://www.googleapis.com/auth/compute"
  40870. // ]
  40871. // }
  40872. }
  40873. // method id "compute.firewalls.list":
  40874. type FirewallsListCall struct {
  40875. s *Service
  40876. project string
  40877. urlParams_ gensupport.URLParams
  40878. ifNoneMatch_ string
  40879. ctx_ context.Context
  40880. header_ http.Header
  40881. }
  40882. // List: Retrieves the list of firewall rules available to the specified
  40883. // project.
  40884. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  40885. func (r *FirewallsService) List(project string) *FirewallsListCall {
  40886. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40887. c.project = project
  40888. return c
  40889. }
  40890. // Filter sets the optional parameter "filter": A filter expression that
  40891. // filters resources listed in the response. The expression must specify
  40892. // the field name, a comparison operator, and the value that you want to
  40893. // use for filtering. The value must be a string, a number, or a
  40894. // boolean. The comparison operator must be either =, !=, >, or <.
  40895. //
  40896. // For example, if you are filtering Compute Engine instances, you can
  40897. // exclude instances named example-instance by specifying name !=
  40898. // example-instance.
  40899. //
  40900. // You can also filter nested fields. For example, you could specify
  40901. // scheduling.automaticRestart = false to include instances only if they
  40902. // are not scheduled for automatic restarts. You can use filtering on
  40903. // nested fields to filter based on resource labels.
  40904. //
  40905. // To filter on multiple expressions, provide each separate expression
  40906. // within parentheses. For example, (scheduling.automaticRestart = true)
  40907. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40908. // AND expression. However, you can include AND and OR expressions
  40909. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40910. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40911. // true).
  40912. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  40913. c.urlParams_.Set("filter", filter)
  40914. return c
  40915. }
  40916. // MaxResults sets the optional parameter "maxResults": The maximum
  40917. // number of results per page that should be returned. If the number of
  40918. // available results is larger than maxResults, Compute Engine returns a
  40919. // nextPageToken that can be used to get the next page of results in
  40920. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40921. // (Default: 500)
  40922. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  40923. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40924. return c
  40925. }
  40926. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40927. // a certain order. By default, results are returned in alphanumerical
  40928. // order based on the resource name.
  40929. //
  40930. // You can also sort results in descending order based on the creation
  40931. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40932. // based on the creationTimestamp field in reverse chronological order
  40933. // (newest result first). Use this to sort resources like operations so
  40934. // that the newest operation is returned first.
  40935. //
  40936. // Currently, only sorting by name or creationTimestamp desc is
  40937. // supported.
  40938. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  40939. c.urlParams_.Set("orderBy", orderBy)
  40940. return c
  40941. }
  40942. // PageToken sets the optional parameter "pageToken": Specifies a page
  40943. // token to use. Set pageToken to the nextPageToken returned by a
  40944. // previous list request to get the next page of results.
  40945. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  40946. c.urlParams_.Set("pageToken", pageToken)
  40947. return c
  40948. }
  40949. // Fields allows partial responses to be retrieved. See
  40950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40951. // for more information.
  40952. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  40953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40954. return c
  40955. }
  40956. // IfNoneMatch sets the optional parameter which makes the operation
  40957. // fail if the object's ETag matches the given value. This is useful for
  40958. // getting updates only after the object has changed since the last
  40959. // request. Use googleapi.IsNotModified to check whether the response
  40960. // error from Do is the result of In-None-Match.
  40961. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  40962. c.ifNoneMatch_ = entityTag
  40963. return c
  40964. }
  40965. // Context sets the context to be used in this call's Do method. Any
  40966. // pending HTTP request will be aborted if the provided context is
  40967. // canceled.
  40968. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  40969. c.ctx_ = ctx
  40970. return c
  40971. }
  40972. // Header returns an http.Header that can be modified by the caller to
  40973. // add HTTP headers to the request.
  40974. func (c *FirewallsListCall) Header() http.Header {
  40975. if c.header_ == nil {
  40976. c.header_ = make(http.Header)
  40977. }
  40978. return c.header_
  40979. }
  40980. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  40981. reqHeaders := make(http.Header)
  40982. for k, v := range c.header_ {
  40983. reqHeaders[k] = v
  40984. }
  40985. reqHeaders.Set("User-Agent", c.s.userAgent())
  40986. if c.ifNoneMatch_ != "" {
  40987. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40988. }
  40989. var body io.Reader = nil
  40990. c.urlParams_.Set("alt", alt)
  40991. c.urlParams_.Set("prettyPrint", "false")
  40992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  40993. urls += "?" + c.urlParams_.Encode()
  40994. req, err := http.NewRequest("GET", urls, body)
  40995. if err != nil {
  40996. return nil, err
  40997. }
  40998. req.Header = reqHeaders
  40999. googleapi.Expand(req.URL, map[string]string{
  41000. "project": c.project,
  41001. })
  41002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41003. }
  41004. // Do executes the "compute.firewalls.list" call.
  41005. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  41006. // status code is an error. Response headers are in either
  41007. // *FirewallList.ServerResponse.Header or (if a response was returned at
  41008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41009. // to check whether the returned error was because
  41010. // http.StatusNotModified was returned.
  41011. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  41012. gensupport.SetOptions(c.urlParams_, opts...)
  41013. res, err := c.doRequest("json")
  41014. if res != nil && res.StatusCode == http.StatusNotModified {
  41015. if res.Body != nil {
  41016. res.Body.Close()
  41017. }
  41018. return nil, &googleapi.Error{
  41019. Code: res.StatusCode,
  41020. Header: res.Header,
  41021. }
  41022. }
  41023. if err != nil {
  41024. return nil, err
  41025. }
  41026. defer googleapi.CloseBody(res)
  41027. if err := googleapi.CheckResponse(res); err != nil {
  41028. return nil, err
  41029. }
  41030. ret := &FirewallList{
  41031. ServerResponse: googleapi.ServerResponse{
  41032. Header: res.Header,
  41033. HTTPStatusCode: res.StatusCode,
  41034. },
  41035. }
  41036. target := &ret
  41037. if err := gensupport.DecodeResponse(target, res); err != nil {
  41038. return nil, err
  41039. }
  41040. return ret, nil
  41041. // {
  41042. // "description": "Retrieves the list of firewall rules available to the specified project.",
  41043. // "httpMethod": "GET",
  41044. // "id": "compute.firewalls.list",
  41045. // "parameterOrder": [
  41046. // "project"
  41047. // ],
  41048. // "parameters": {
  41049. // "filter": {
  41050. // "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).",
  41051. // "location": "query",
  41052. // "type": "string"
  41053. // },
  41054. // "maxResults": {
  41055. // "default": "500",
  41056. // "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)",
  41057. // "format": "uint32",
  41058. // "location": "query",
  41059. // "minimum": "0",
  41060. // "type": "integer"
  41061. // },
  41062. // "orderBy": {
  41063. // "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.",
  41064. // "location": "query",
  41065. // "type": "string"
  41066. // },
  41067. // "pageToken": {
  41068. // "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.",
  41069. // "location": "query",
  41070. // "type": "string"
  41071. // },
  41072. // "project": {
  41073. // "description": "Project ID for this request.",
  41074. // "location": "path",
  41075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41076. // "required": true,
  41077. // "type": "string"
  41078. // }
  41079. // },
  41080. // "path": "{project}/global/firewalls",
  41081. // "response": {
  41082. // "$ref": "FirewallList"
  41083. // },
  41084. // "scopes": [
  41085. // "https://www.googleapis.com/auth/cloud-platform",
  41086. // "https://www.googleapis.com/auth/compute",
  41087. // "https://www.googleapis.com/auth/compute.readonly"
  41088. // ]
  41089. // }
  41090. }
  41091. // Pages invokes f for each page of results.
  41092. // A non-nil error returned from f will halt the iteration.
  41093. // The provided context supersedes any context provided to the Context method.
  41094. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  41095. c.ctx_ = ctx
  41096. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41097. for {
  41098. x, err := c.Do()
  41099. if err != nil {
  41100. return err
  41101. }
  41102. if err := f(x); err != nil {
  41103. return err
  41104. }
  41105. if x.NextPageToken == "" {
  41106. return nil
  41107. }
  41108. c.PageToken(x.NextPageToken)
  41109. }
  41110. }
  41111. // method id "compute.firewalls.patch":
  41112. type FirewallsPatchCall struct {
  41113. s *Service
  41114. project string
  41115. firewall string
  41116. firewall2 *Firewall
  41117. urlParams_ gensupport.URLParams
  41118. ctx_ context.Context
  41119. header_ http.Header
  41120. }
  41121. // Patch: Updates the specified firewall rule with the data included in
  41122. // the request. This method supports PATCH semantics and uses the JSON
  41123. // merge patch format and processing rules.
  41124. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  41125. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  41126. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41127. c.project = project
  41128. c.firewall = firewall
  41129. c.firewall2 = firewall2
  41130. return c
  41131. }
  41132. // RequestId sets the optional parameter "requestId": An optional
  41133. // request ID to identify requests. Specify a unique request ID so that
  41134. // if you must retry your request, the server will know to ignore the
  41135. // request if it has already been completed.
  41136. //
  41137. // For example, consider a situation where you make an initial request
  41138. // and the request times out. If you make the request again with the
  41139. // same request ID, the server can check if original operation with the
  41140. // same request ID was received, and if so, will ignore the second
  41141. // request. This prevents clients from accidentally creating duplicate
  41142. // commitments.
  41143. //
  41144. // The request ID must be a valid UUID with the exception that zero UUID
  41145. // is not supported (00000000-0000-0000-0000-000000000000).
  41146. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  41147. c.urlParams_.Set("requestId", requestId)
  41148. return c
  41149. }
  41150. // Fields allows partial responses to be retrieved. See
  41151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41152. // for more information.
  41153. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  41154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41155. return c
  41156. }
  41157. // Context sets the context to be used in this call's Do method. Any
  41158. // pending HTTP request will be aborted if the provided context is
  41159. // canceled.
  41160. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  41161. c.ctx_ = ctx
  41162. return c
  41163. }
  41164. // Header returns an http.Header that can be modified by the caller to
  41165. // add HTTP headers to the request.
  41166. func (c *FirewallsPatchCall) Header() http.Header {
  41167. if c.header_ == nil {
  41168. c.header_ = make(http.Header)
  41169. }
  41170. return c.header_
  41171. }
  41172. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  41173. reqHeaders := make(http.Header)
  41174. for k, v := range c.header_ {
  41175. reqHeaders[k] = v
  41176. }
  41177. reqHeaders.Set("User-Agent", c.s.userAgent())
  41178. var body io.Reader = nil
  41179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  41180. if err != nil {
  41181. return nil, err
  41182. }
  41183. reqHeaders.Set("Content-Type", "application/json")
  41184. c.urlParams_.Set("alt", alt)
  41185. c.urlParams_.Set("prettyPrint", "false")
  41186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  41187. urls += "?" + c.urlParams_.Encode()
  41188. req, err := http.NewRequest("PATCH", urls, body)
  41189. if err != nil {
  41190. return nil, err
  41191. }
  41192. req.Header = reqHeaders
  41193. googleapi.Expand(req.URL, map[string]string{
  41194. "project": c.project,
  41195. "firewall": c.firewall,
  41196. })
  41197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41198. }
  41199. // Do executes the "compute.firewalls.patch" call.
  41200. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41201. // status code is an error. Response headers are in either
  41202. // *Operation.ServerResponse.Header or (if a response was returned at
  41203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41204. // to check whether the returned error was because
  41205. // http.StatusNotModified was returned.
  41206. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41207. gensupport.SetOptions(c.urlParams_, opts...)
  41208. res, err := c.doRequest("json")
  41209. if res != nil && res.StatusCode == http.StatusNotModified {
  41210. if res.Body != nil {
  41211. res.Body.Close()
  41212. }
  41213. return nil, &googleapi.Error{
  41214. Code: res.StatusCode,
  41215. Header: res.Header,
  41216. }
  41217. }
  41218. if err != nil {
  41219. return nil, err
  41220. }
  41221. defer googleapi.CloseBody(res)
  41222. if err := googleapi.CheckResponse(res); err != nil {
  41223. return nil, err
  41224. }
  41225. ret := &Operation{
  41226. ServerResponse: googleapi.ServerResponse{
  41227. Header: res.Header,
  41228. HTTPStatusCode: res.StatusCode,
  41229. },
  41230. }
  41231. target := &ret
  41232. if err := gensupport.DecodeResponse(target, res); err != nil {
  41233. return nil, err
  41234. }
  41235. return ret, nil
  41236. // {
  41237. // "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.",
  41238. // "httpMethod": "PATCH",
  41239. // "id": "compute.firewalls.patch",
  41240. // "parameterOrder": [
  41241. // "project",
  41242. // "firewall"
  41243. // ],
  41244. // "parameters": {
  41245. // "firewall": {
  41246. // "description": "Name of the firewall rule to patch.",
  41247. // "location": "path",
  41248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41249. // "required": true,
  41250. // "type": "string"
  41251. // },
  41252. // "project": {
  41253. // "description": "Project ID for this request.",
  41254. // "location": "path",
  41255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41256. // "required": true,
  41257. // "type": "string"
  41258. // },
  41259. // "requestId": {
  41260. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41261. // "location": "query",
  41262. // "type": "string"
  41263. // }
  41264. // },
  41265. // "path": "{project}/global/firewalls/{firewall}",
  41266. // "request": {
  41267. // "$ref": "Firewall"
  41268. // },
  41269. // "response": {
  41270. // "$ref": "Operation"
  41271. // },
  41272. // "scopes": [
  41273. // "https://www.googleapis.com/auth/cloud-platform",
  41274. // "https://www.googleapis.com/auth/compute"
  41275. // ]
  41276. // }
  41277. }
  41278. // method id "compute.firewalls.testIamPermissions":
  41279. type FirewallsTestIamPermissionsCall struct {
  41280. s *Service
  41281. project string
  41282. resource string
  41283. testpermissionsrequest *TestPermissionsRequest
  41284. urlParams_ gensupport.URLParams
  41285. ctx_ context.Context
  41286. header_ http.Header
  41287. }
  41288. // TestIamPermissions: Returns permissions that a caller has on the
  41289. // specified resource.
  41290. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  41291. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41292. c.project = project
  41293. c.resource = resource
  41294. c.testpermissionsrequest = testpermissionsrequest
  41295. return c
  41296. }
  41297. // Fields allows partial responses to be retrieved. See
  41298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41299. // for more information.
  41300. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  41301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41302. return c
  41303. }
  41304. // Context sets the context to be used in this call's Do method. Any
  41305. // pending HTTP request will be aborted if the provided context is
  41306. // canceled.
  41307. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  41308. c.ctx_ = ctx
  41309. return c
  41310. }
  41311. // Header returns an http.Header that can be modified by the caller to
  41312. // add HTTP headers to the request.
  41313. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  41314. if c.header_ == nil {
  41315. c.header_ = make(http.Header)
  41316. }
  41317. return c.header_
  41318. }
  41319. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  41320. reqHeaders := make(http.Header)
  41321. for k, v := range c.header_ {
  41322. reqHeaders[k] = v
  41323. }
  41324. reqHeaders.Set("User-Agent", c.s.userAgent())
  41325. var body io.Reader = nil
  41326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  41327. if err != nil {
  41328. return nil, err
  41329. }
  41330. reqHeaders.Set("Content-Type", "application/json")
  41331. c.urlParams_.Set("alt", alt)
  41332. c.urlParams_.Set("prettyPrint", "false")
  41333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  41334. urls += "?" + c.urlParams_.Encode()
  41335. req, err := http.NewRequest("POST", urls, body)
  41336. if err != nil {
  41337. return nil, err
  41338. }
  41339. req.Header = reqHeaders
  41340. googleapi.Expand(req.URL, map[string]string{
  41341. "project": c.project,
  41342. "resource": c.resource,
  41343. })
  41344. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41345. }
  41346. // Do executes the "compute.firewalls.testIamPermissions" call.
  41347. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  41348. // non-2xx status code is an error. Response headers are in either
  41349. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  41350. // returned at all) in error.(*googleapi.Error).Header. Use
  41351. // googleapi.IsNotModified to check whether the returned error was
  41352. // because http.StatusNotModified was returned.
  41353. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  41354. gensupport.SetOptions(c.urlParams_, opts...)
  41355. res, err := c.doRequest("json")
  41356. if res != nil && res.StatusCode == http.StatusNotModified {
  41357. if res.Body != nil {
  41358. res.Body.Close()
  41359. }
  41360. return nil, &googleapi.Error{
  41361. Code: res.StatusCode,
  41362. Header: res.Header,
  41363. }
  41364. }
  41365. if err != nil {
  41366. return nil, err
  41367. }
  41368. defer googleapi.CloseBody(res)
  41369. if err := googleapi.CheckResponse(res); err != nil {
  41370. return nil, err
  41371. }
  41372. ret := &TestPermissionsResponse{
  41373. ServerResponse: googleapi.ServerResponse{
  41374. Header: res.Header,
  41375. HTTPStatusCode: res.StatusCode,
  41376. },
  41377. }
  41378. target := &ret
  41379. if err := gensupport.DecodeResponse(target, res); err != nil {
  41380. return nil, err
  41381. }
  41382. return ret, nil
  41383. // {
  41384. // "description": "Returns permissions that a caller has on the specified resource.",
  41385. // "httpMethod": "POST",
  41386. // "id": "compute.firewalls.testIamPermissions",
  41387. // "parameterOrder": [
  41388. // "project",
  41389. // "resource"
  41390. // ],
  41391. // "parameters": {
  41392. // "project": {
  41393. // "description": "Project ID for this request.",
  41394. // "location": "path",
  41395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41396. // "required": true,
  41397. // "type": "string"
  41398. // },
  41399. // "resource": {
  41400. // "description": "Name or id of the resource for this request.",
  41401. // "location": "path",
  41402. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41403. // "required": true,
  41404. // "type": "string"
  41405. // }
  41406. // },
  41407. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  41408. // "request": {
  41409. // "$ref": "TestPermissionsRequest"
  41410. // },
  41411. // "response": {
  41412. // "$ref": "TestPermissionsResponse"
  41413. // },
  41414. // "scopes": [
  41415. // "https://www.googleapis.com/auth/cloud-platform",
  41416. // "https://www.googleapis.com/auth/compute",
  41417. // "https://www.googleapis.com/auth/compute.readonly"
  41418. // ]
  41419. // }
  41420. }
  41421. // method id "compute.firewalls.update":
  41422. type FirewallsUpdateCall struct {
  41423. s *Service
  41424. project string
  41425. firewall string
  41426. firewall2 *Firewall
  41427. urlParams_ gensupport.URLParams
  41428. ctx_ context.Context
  41429. header_ http.Header
  41430. }
  41431. // Update: Updates the specified firewall rule with the data included in
  41432. // the request. The PUT method can only update the following fields of
  41433. // firewall rule: allowed, description, sourceRanges, sourceTags,
  41434. // targetTags.
  41435. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  41436. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  41437. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41438. c.project = project
  41439. c.firewall = firewall
  41440. c.firewall2 = firewall2
  41441. return c
  41442. }
  41443. // RequestId sets the optional parameter "requestId": An optional
  41444. // request ID to identify requests. Specify a unique request ID so that
  41445. // if you must retry your request, the server will know to ignore the
  41446. // request if it has already been completed.
  41447. //
  41448. // For example, consider a situation where you make an initial request
  41449. // and the request times out. If you make the request again with the
  41450. // same request ID, the server can check if original operation with the
  41451. // same request ID was received, and if so, will ignore the second
  41452. // request. This prevents clients from accidentally creating duplicate
  41453. // commitments.
  41454. //
  41455. // The request ID must be a valid UUID with the exception that zero UUID
  41456. // is not supported (00000000-0000-0000-0000-000000000000).
  41457. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  41458. c.urlParams_.Set("requestId", requestId)
  41459. return c
  41460. }
  41461. // Fields allows partial responses to be retrieved. See
  41462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41463. // for more information.
  41464. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  41465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41466. return c
  41467. }
  41468. // Context sets the context to be used in this call's Do method. Any
  41469. // pending HTTP request will be aborted if the provided context is
  41470. // canceled.
  41471. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  41472. c.ctx_ = ctx
  41473. return c
  41474. }
  41475. // Header returns an http.Header that can be modified by the caller to
  41476. // add HTTP headers to the request.
  41477. func (c *FirewallsUpdateCall) Header() http.Header {
  41478. if c.header_ == nil {
  41479. c.header_ = make(http.Header)
  41480. }
  41481. return c.header_
  41482. }
  41483. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  41484. reqHeaders := make(http.Header)
  41485. for k, v := range c.header_ {
  41486. reqHeaders[k] = v
  41487. }
  41488. reqHeaders.Set("User-Agent", c.s.userAgent())
  41489. var body io.Reader = nil
  41490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  41491. if err != nil {
  41492. return nil, err
  41493. }
  41494. reqHeaders.Set("Content-Type", "application/json")
  41495. c.urlParams_.Set("alt", alt)
  41496. c.urlParams_.Set("prettyPrint", "false")
  41497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  41498. urls += "?" + c.urlParams_.Encode()
  41499. req, err := http.NewRequest("PUT", urls, body)
  41500. if err != nil {
  41501. return nil, err
  41502. }
  41503. req.Header = reqHeaders
  41504. googleapi.Expand(req.URL, map[string]string{
  41505. "project": c.project,
  41506. "firewall": c.firewall,
  41507. })
  41508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41509. }
  41510. // Do executes the "compute.firewalls.update" call.
  41511. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41512. // status code is an error. Response headers are in either
  41513. // *Operation.ServerResponse.Header or (if a response was returned at
  41514. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41515. // to check whether the returned error was because
  41516. // http.StatusNotModified was returned.
  41517. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41518. gensupport.SetOptions(c.urlParams_, opts...)
  41519. res, err := c.doRequest("json")
  41520. if res != nil && res.StatusCode == http.StatusNotModified {
  41521. if res.Body != nil {
  41522. res.Body.Close()
  41523. }
  41524. return nil, &googleapi.Error{
  41525. Code: res.StatusCode,
  41526. Header: res.Header,
  41527. }
  41528. }
  41529. if err != nil {
  41530. return nil, err
  41531. }
  41532. defer googleapi.CloseBody(res)
  41533. if err := googleapi.CheckResponse(res); err != nil {
  41534. return nil, err
  41535. }
  41536. ret := &Operation{
  41537. ServerResponse: googleapi.ServerResponse{
  41538. Header: res.Header,
  41539. HTTPStatusCode: res.StatusCode,
  41540. },
  41541. }
  41542. target := &ret
  41543. if err := gensupport.DecodeResponse(target, res); err != nil {
  41544. return nil, err
  41545. }
  41546. return ret, nil
  41547. // {
  41548. // "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.",
  41549. // "httpMethod": "PUT",
  41550. // "id": "compute.firewalls.update",
  41551. // "parameterOrder": [
  41552. // "project",
  41553. // "firewall"
  41554. // ],
  41555. // "parameters": {
  41556. // "firewall": {
  41557. // "description": "Name of the firewall rule to update.",
  41558. // "location": "path",
  41559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41560. // "required": true,
  41561. // "type": "string"
  41562. // },
  41563. // "project": {
  41564. // "description": "Project ID for this request.",
  41565. // "location": "path",
  41566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41567. // "required": true,
  41568. // "type": "string"
  41569. // },
  41570. // "requestId": {
  41571. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41572. // "location": "query",
  41573. // "type": "string"
  41574. // }
  41575. // },
  41576. // "path": "{project}/global/firewalls/{firewall}",
  41577. // "request": {
  41578. // "$ref": "Firewall"
  41579. // },
  41580. // "response": {
  41581. // "$ref": "Operation"
  41582. // },
  41583. // "scopes": [
  41584. // "https://www.googleapis.com/auth/cloud-platform",
  41585. // "https://www.googleapis.com/auth/compute"
  41586. // ]
  41587. // }
  41588. }
  41589. // method id "compute.forwardingRules.aggregatedList":
  41590. type ForwardingRulesAggregatedListCall struct {
  41591. s *Service
  41592. project string
  41593. urlParams_ gensupport.URLParams
  41594. ifNoneMatch_ string
  41595. ctx_ context.Context
  41596. header_ http.Header
  41597. }
  41598. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  41599. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  41600. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  41601. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41602. c.project = project
  41603. return c
  41604. }
  41605. // Filter sets the optional parameter "filter": A filter expression that
  41606. // filters resources listed in the response. The expression must specify
  41607. // the field name, a comparison operator, and the value that you want to
  41608. // use for filtering. The value must be a string, a number, or a
  41609. // boolean. The comparison operator must be either =, !=, >, or <.
  41610. //
  41611. // For example, if you are filtering Compute Engine instances, you can
  41612. // exclude instances named example-instance by specifying name !=
  41613. // example-instance.
  41614. //
  41615. // You can also filter nested fields. For example, you could specify
  41616. // scheduling.automaticRestart = false to include instances only if they
  41617. // are not scheduled for automatic restarts. You can use filtering on
  41618. // nested fields to filter based on resource labels.
  41619. //
  41620. // To filter on multiple expressions, provide each separate expression
  41621. // within parentheses. For example, (scheduling.automaticRestart = true)
  41622. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41623. // AND expression. However, you can include AND and OR expressions
  41624. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41625. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41626. // true).
  41627. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  41628. c.urlParams_.Set("filter", filter)
  41629. return c
  41630. }
  41631. // MaxResults sets the optional parameter "maxResults": The maximum
  41632. // number of results per page that should be returned. If the number of
  41633. // available results is larger than maxResults, Compute Engine returns a
  41634. // nextPageToken that can be used to get the next page of results in
  41635. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41636. // (Default: 500)
  41637. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  41638. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41639. return c
  41640. }
  41641. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41642. // a certain order. By default, results are returned in alphanumerical
  41643. // order based on the resource name.
  41644. //
  41645. // You can also sort results in descending order based on the creation
  41646. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41647. // based on the creationTimestamp field in reverse chronological order
  41648. // (newest result first). Use this to sort resources like operations so
  41649. // that the newest operation is returned first.
  41650. //
  41651. // Currently, only sorting by name or creationTimestamp desc is
  41652. // supported.
  41653. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  41654. c.urlParams_.Set("orderBy", orderBy)
  41655. return c
  41656. }
  41657. // PageToken sets the optional parameter "pageToken": Specifies a page
  41658. // token to use. Set pageToken to the nextPageToken returned by a
  41659. // previous list request to get the next page of results.
  41660. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  41661. c.urlParams_.Set("pageToken", pageToken)
  41662. return c
  41663. }
  41664. // Fields allows partial responses to be retrieved. See
  41665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41666. // for more information.
  41667. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  41668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41669. return c
  41670. }
  41671. // IfNoneMatch sets the optional parameter which makes the operation
  41672. // fail if the object's ETag matches the given value. This is useful for
  41673. // getting updates only after the object has changed since the last
  41674. // request. Use googleapi.IsNotModified to check whether the response
  41675. // error from Do is the result of In-None-Match.
  41676. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  41677. c.ifNoneMatch_ = entityTag
  41678. return c
  41679. }
  41680. // Context sets the context to be used in this call's Do method. Any
  41681. // pending HTTP request will be aborted if the provided context is
  41682. // canceled.
  41683. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  41684. c.ctx_ = ctx
  41685. return c
  41686. }
  41687. // Header returns an http.Header that can be modified by the caller to
  41688. // add HTTP headers to the request.
  41689. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  41690. if c.header_ == nil {
  41691. c.header_ = make(http.Header)
  41692. }
  41693. return c.header_
  41694. }
  41695. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  41696. reqHeaders := make(http.Header)
  41697. for k, v := range c.header_ {
  41698. reqHeaders[k] = v
  41699. }
  41700. reqHeaders.Set("User-Agent", c.s.userAgent())
  41701. if c.ifNoneMatch_ != "" {
  41702. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41703. }
  41704. var body io.Reader = nil
  41705. c.urlParams_.Set("alt", alt)
  41706. c.urlParams_.Set("prettyPrint", "false")
  41707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  41708. urls += "?" + c.urlParams_.Encode()
  41709. req, err := http.NewRequest("GET", urls, body)
  41710. if err != nil {
  41711. return nil, err
  41712. }
  41713. req.Header = reqHeaders
  41714. googleapi.Expand(req.URL, map[string]string{
  41715. "project": c.project,
  41716. })
  41717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41718. }
  41719. // Do executes the "compute.forwardingRules.aggregatedList" call.
  41720. // Exactly one of *ForwardingRuleAggregatedList or error will be
  41721. // non-nil. Any non-2xx status code is an error. Response headers are in
  41722. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  41723. // response was returned at all) in error.(*googleapi.Error).Header. Use
  41724. // googleapi.IsNotModified to check whether the returned error was
  41725. // because http.StatusNotModified was returned.
  41726. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  41727. gensupport.SetOptions(c.urlParams_, opts...)
  41728. res, err := c.doRequest("json")
  41729. if res != nil && res.StatusCode == http.StatusNotModified {
  41730. if res.Body != nil {
  41731. res.Body.Close()
  41732. }
  41733. return nil, &googleapi.Error{
  41734. Code: res.StatusCode,
  41735. Header: res.Header,
  41736. }
  41737. }
  41738. if err != nil {
  41739. return nil, err
  41740. }
  41741. defer googleapi.CloseBody(res)
  41742. if err := googleapi.CheckResponse(res); err != nil {
  41743. return nil, err
  41744. }
  41745. ret := &ForwardingRuleAggregatedList{
  41746. ServerResponse: googleapi.ServerResponse{
  41747. Header: res.Header,
  41748. HTTPStatusCode: res.StatusCode,
  41749. },
  41750. }
  41751. target := &ret
  41752. if err := gensupport.DecodeResponse(target, res); err != nil {
  41753. return nil, err
  41754. }
  41755. return ret, nil
  41756. // {
  41757. // "description": "Retrieves an aggregated list of forwarding rules.",
  41758. // "httpMethod": "GET",
  41759. // "id": "compute.forwardingRules.aggregatedList",
  41760. // "parameterOrder": [
  41761. // "project"
  41762. // ],
  41763. // "parameters": {
  41764. // "filter": {
  41765. // "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).",
  41766. // "location": "query",
  41767. // "type": "string"
  41768. // },
  41769. // "maxResults": {
  41770. // "default": "500",
  41771. // "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)",
  41772. // "format": "uint32",
  41773. // "location": "query",
  41774. // "minimum": "0",
  41775. // "type": "integer"
  41776. // },
  41777. // "orderBy": {
  41778. // "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.",
  41779. // "location": "query",
  41780. // "type": "string"
  41781. // },
  41782. // "pageToken": {
  41783. // "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.",
  41784. // "location": "query",
  41785. // "type": "string"
  41786. // },
  41787. // "project": {
  41788. // "description": "Project ID for this request.",
  41789. // "location": "path",
  41790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41791. // "required": true,
  41792. // "type": "string"
  41793. // }
  41794. // },
  41795. // "path": "{project}/aggregated/forwardingRules",
  41796. // "response": {
  41797. // "$ref": "ForwardingRuleAggregatedList"
  41798. // },
  41799. // "scopes": [
  41800. // "https://www.googleapis.com/auth/cloud-platform",
  41801. // "https://www.googleapis.com/auth/compute",
  41802. // "https://www.googleapis.com/auth/compute.readonly"
  41803. // ]
  41804. // }
  41805. }
  41806. // Pages invokes f for each page of results.
  41807. // A non-nil error returned from f will halt the iteration.
  41808. // The provided context supersedes any context provided to the Context method.
  41809. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  41810. c.ctx_ = ctx
  41811. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41812. for {
  41813. x, err := c.Do()
  41814. if err != nil {
  41815. return err
  41816. }
  41817. if err := f(x); err != nil {
  41818. return err
  41819. }
  41820. if x.NextPageToken == "" {
  41821. return nil
  41822. }
  41823. c.PageToken(x.NextPageToken)
  41824. }
  41825. }
  41826. // method id "compute.forwardingRules.delete":
  41827. type ForwardingRulesDeleteCall struct {
  41828. s *Service
  41829. project string
  41830. region string
  41831. forwardingRule string
  41832. urlParams_ gensupport.URLParams
  41833. ctx_ context.Context
  41834. header_ http.Header
  41835. }
  41836. // Delete: Deletes the specified ForwardingRule resource.
  41837. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  41838. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  41839. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41840. c.project = project
  41841. c.region = region
  41842. c.forwardingRule = forwardingRule
  41843. return c
  41844. }
  41845. // RequestId sets the optional parameter "requestId": An optional
  41846. // request ID to identify requests. Specify a unique request ID so that
  41847. // if you must retry your request, the server will know to ignore the
  41848. // request if it has already been completed.
  41849. //
  41850. // For example, consider a situation where you make an initial request
  41851. // and the request times out. If you make the request again with the
  41852. // same request ID, the server can check if original operation with the
  41853. // same request ID was received, and if so, will ignore the second
  41854. // request. This prevents clients from accidentally creating duplicate
  41855. // commitments.
  41856. //
  41857. // The request ID must be a valid UUID with the exception that zero UUID
  41858. // is not supported (00000000-0000-0000-0000-000000000000).
  41859. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  41860. c.urlParams_.Set("requestId", requestId)
  41861. return c
  41862. }
  41863. // Fields allows partial responses to be retrieved. See
  41864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41865. // for more information.
  41866. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  41867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41868. return c
  41869. }
  41870. // Context sets the context to be used in this call's Do method. Any
  41871. // pending HTTP request will be aborted if the provided context is
  41872. // canceled.
  41873. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  41874. c.ctx_ = ctx
  41875. return c
  41876. }
  41877. // Header returns an http.Header that can be modified by the caller to
  41878. // add HTTP headers to the request.
  41879. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  41880. if c.header_ == nil {
  41881. c.header_ = make(http.Header)
  41882. }
  41883. return c.header_
  41884. }
  41885. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  41886. reqHeaders := make(http.Header)
  41887. for k, v := range c.header_ {
  41888. reqHeaders[k] = v
  41889. }
  41890. reqHeaders.Set("User-Agent", c.s.userAgent())
  41891. var body io.Reader = nil
  41892. c.urlParams_.Set("alt", alt)
  41893. c.urlParams_.Set("prettyPrint", "false")
  41894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  41895. urls += "?" + c.urlParams_.Encode()
  41896. req, err := http.NewRequest("DELETE", urls, body)
  41897. if err != nil {
  41898. return nil, err
  41899. }
  41900. req.Header = reqHeaders
  41901. googleapi.Expand(req.URL, map[string]string{
  41902. "project": c.project,
  41903. "region": c.region,
  41904. "forwardingRule": c.forwardingRule,
  41905. })
  41906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41907. }
  41908. // Do executes the "compute.forwardingRules.delete" call.
  41909. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41910. // status code is an error. Response headers are in either
  41911. // *Operation.ServerResponse.Header or (if a response was returned at
  41912. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41913. // to check whether the returned error was because
  41914. // http.StatusNotModified was returned.
  41915. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41916. gensupport.SetOptions(c.urlParams_, opts...)
  41917. res, err := c.doRequest("json")
  41918. if res != nil && res.StatusCode == http.StatusNotModified {
  41919. if res.Body != nil {
  41920. res.Body.Close()
  41921. }
  41922. return nil, &googleapi.Error{
  41923. Code: res.StatusCode,
  41924. Header: res.Header,
  41925. }
  41926. }
  41927. if err != nil {
  41928. return nil, err
  41929. }
  41930. defer googleapi.CloseBody(res)
  41931. if err := googleapi.CheckResponse(res); err != nil {
  41932. return nil, err
  41933. }
  41934. ret := &Operation{
  41935. ServerResponse: googleapi.ServerResponse{
  41936. Header: res.Header,
  41937. HTTPStatusCode: res.StatusCode,
  41938. },
  41939. }
  41940. target := &ret
  41941. if err := gensupport.DecodeResponse(target, res); err != nil {
  41942. return nil, err
  41943. }
  41944. return ret, nil
  41945. // {
  41946. // "description": "Deletes the specified ForwardingRule resource.",
  41947. // "httpMethod": "DELETE",
  41948. // "id": "compute.forwardingRules.delete",
  41949. // "parameterOrder": [
  41950. // "project",
  41951. // "region",
  41952. // "forwardingRule"
  41953. // ],
  41954. // "parameters": {
  41955. // "forwardingRule": {
  41956. // "description": "Name of the ForwardingRule resource to delete.",
  41957. // "location": "path",
  41958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41959. // "required": true,
  41960. // "type": "string"
  41961. // },
  41962. // "project": {
  41963. // "description": "Project ID for this request.",
  41964. // "location": "path",
  41965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41966. // "required": true,
  41967. // "type": "string"
  41968. // },
  41969. // "region": {
  41970. // "description": "Name of the region scoping this request.",
  41971. // "location": "path",
  41972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41973. // "required": true,
  41974. // "type": "string"
  41975. // },
  41976. // "requestId": {
  41977. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41978. // "location": "query",
  41979. // "type": "string"
  41980. // }
  41981. // },
  41982. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  41983. // "response": {
  41984. // "$ref": "Operation"
  41985. // },
  41986. // "scopes": [
  41987. // "https://www.googleapis.com/auth/cloud-platform",
  41988. // "https://www.googleapis.com/auth/compute"
  41989. // ]
  41990. // }
  41991. }
  41992. // method id "compute.forwardingRules.get":
  41993. type ForwardingRulesGetCall struct {
  41994. s *Service
  41995. project string
  41996. region string
  41997. forwardingRule string
  41998. urlParams_ gensupport.URLParams
  41999. ifNoneMatch_ string
  42000. ctx_ context.Context
  42001. header_ http.Header
  42002. }
  42003. // Get: Returns the specified ForwardingRule resource.
  42004. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  42005. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  42006. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42007. c.project = project
  42008. c.region = region
  42009. c.forwardingRule = forwardingRule
  42010. return c
  42011. }
  42012. // Fields allows partial responses to be retrieved. See
  42013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42014. // for more information.
  42015. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  42016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42017. return c
  42018. }
  42019. // IfNoneMatch sets the optional parameter which makes the operation
  42020. // fail if the object's ETag matches the given value. This is useful for
  42021. // getting updates only after the object has changed since the last
  42022. // request. Use googleapi.IsNotModified to check whether the response
  42023. // error from Do is the result of In-None-Match.
  42024. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  42025. c.ifNoneMatch_ = entityTag
  42026. return c
  42027. }
  42028. // Context sets the context to be used in this call's Do method. Any
  42029. // pending HTTP request will be aborted if the provided context is
  42030. // canceled.
  42031. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  42032. c.ctx_ = ctx
  42033. return c
  42034. }
  42035. // Header returns an http.Header that can be modified by the caller to
  42036. // add HTTP headers to the request.
  42037. func (c *ForwardingRulesGetCall) Header() http.Header {
  42038. if c.header_ == nil {
  42039. c.header_ = make(http.Header)
  42040. }
  42041. return c.header_
  42042. }
  42043. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  42044. reqHeaders := make(http.Header)
  42045. for k, v := range c.header_ {
  42046. reqHeaders[k] = v
  42047. }
  42048. reqHeaders.Set("User-Agent", c.s.userAgent())
  42049. if c.ifNoneMatch_ != "" {
  42050. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42051. }
  42052. var body io.Reader = nil
  42053. c.urlParams_.Set("alt", alt)
  42054. c.urlParams_.Set("prettyPrint", "false")
  42055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  42056. urls += "?" + c.urlParams_.Encode()
  42057. req, err := http.NewRequest("GET", urls, body)
  42058. if err != nil {
  42059. return nil, err
  42060. }
  42061. req.Header = reqHeaders
  42062. googleapi.Expand(req.URL, map[string]string{
  42063. "project": c.project,
  42064. "region": c.region,
  42065. "forwardingRule": c.forwardingRule,
  42066. })
  42067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42068. }
  42069. // Do executes the "compute.forwardingRules.get" call.
  42070. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  42071. // status code is an error. Response headers are in either
  42072. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  42073. // at all) in error.(*googleapi.Error).Header. Use
  42074. // googleapi.IsNotModified to check whether the returned error was
  42075. // because http.StatusNotModified was returned.
  42076. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  42077. gensupport.SetOptions(c.urlParams_, opts...)
  42078. res, err := c.doRequest("json")
  42079. if res != nil && res.StatusCode == http.StatusNotModified {
  42080. if res.Body != nil {
  42081. res.Body.Close()
  42082. }
  42083. return nil, &googleapi.Error{
  42084. Code: res.StatusCode,
  42085. Header: res.Header,
  42086. }
  42087. }
  42088. if err != nil {
  42089. return nil, err
  42090. }
  42091. defer googleapi.CloseBody(res)
  42092. if err := googleapi.CheckResponse(res); err != nil {
  42093. return nil, err
  42094. }
  42095. ret := &ForwardingRule{
  42096. ServerResponse: googleapi.ServerResponse{
  42097. Header: res.Header,
  42098. HTTPStatusCode: res.StatusCode,
  42099. },
  42100. }
  42101. target := &ret
  42102. if err := gensupport.DecodeResponse(target, res); err != nil {
  42103. return nil, err
  42104. }
  42105. return ret, nil
  42106. // {
  42107. // "description": "Returns the specified ForwardingRule resource.",
  42108. // "httpMethod": "GET",
  42109. // "id": "compute.forwardingRules.get",
  42110. // "parameterOrder": [
  42111. // "project",
  42112. // "region",
  42113. // "forwardingRule"
  42114. // ],
  42115. // "parameters": {
  42116. // "forwardingRule": {
  42117. // "description": "Name of the ForwardingRule resource to return.",
  42118. // "location": "path",
  42119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42120. // "required": true,
  42121. // "type": "string"
  42122. // },
  42123. // "project": {
  42124. // "description": "Project ID for this request.",
  42125. // "location": "path",
  42126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42127. // "required": true,
  42128. // "type": "string"
  42129. // },
  42130. // "region": {
  42131. // "description": "Name of the region scoping this request.",
  42132. // "location": "path",
  42133. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42134. // "required": true,
  42135. // "type": "string"
  42136. // }
  42137. // },
  42138. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  42139. // "response": {
  42140. // "$ref": "ForwardingRule"
  42141. // },
  42142. // "scopes": [
  42143. // "https://www.googleapis.com/auth/cloud-platform",
  42144. // "https://www.googleapis.com/auth/compute",
  42145. // "https://www.googleapis.com/auth/compute.readonly"
  42146. // ]
  42147. // }
  42148. }
  42149. // method id "compute.forwardingRules.insert":
  42150. type ForwardingRulesInsertCall struct {
  42151. s *Service
  42152. project string
  42153. region string
  42154. forwardingrule *ForwardingRule
  42155. urlParams_ gensupport.URLParams
  42156. ctx_ context.Context
  42157. header_ http.Header
  42158. }
  42159. // Insert: Creates a ForwardingRule resource in the specified project
  42160. // and region using the data included in the request.
  42161. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  42162. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  42163. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42164. c.project = project
  42165. c.region = region
  42166. c.forwardingrule = forwardingrule
  42167. return c
  42168. }
  42169. // RequestId sets the optional parameter "requestId": An optional
  42170. // request ID to identify requests. Specify a unique request ID so that
  42171. // if you must retry your request, the server will know to ignore the
  42172. // request if it has already been completed.
  42173. //
  42174. // For example, consider a situation where you make an initial request
  42175. // and the request times out. If you make the request again with the
  42176. // same request ID, the server can check if original operation with the
  42177. // same request ID was received, and if so, will ignore the second
  42178. // request. This prevents clients from accidentally creating duplicate
  42179. // commitments.
  42180. //
  42181. // The request ID must be a valid UUID with the exception that zero UUID
  42182. // is not supported (00000000-0000-0000-0000-000000000000).
  42183. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  42184. c.urlParams_.Set("requestId", requestId)
  42185. return c
  42186. }
  42187. // Fields allows partial responses to be retrieved. See
  42188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42189. // for more information.
  42190. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  42191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42192. return c
  42193. }
  42194. // Context sets the context to be used in this call's Do method. Any
  42195. // pending HTTP request will be aborted if the provided context is
  42196. // canceled.
  42197. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  42198. c.ctx_ = ctx
  42199. return c
  42200. }
  42201. // Header returns an http.Header that can be modified by the caller to
  42202. // add HTTP headers to the request.
  42203. func (c *ForwardingRulesInsertCall) Header() http.Header {
  42204. if c.header_ == nil {
  42205. c.header_ = make(http.Header)
  42206. }
  42207. return c.header_
  42208. }
  42209. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  42210. reqHeaders := make(http.Header)
  42211. for k, v := range c.header_ {
  42212. reqHeaders[k] = v
  42213. }
  42214. reqHeaders.Set("User-Agent", c.s.userAgent())
  42215. var body io.Reader = nil
  42216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  42217. if err != nil {
  42218. return nil, err
  42219. }
  42220. reqHeaders.Set("Content-Type", "application/json")
  42221. c.urlParams_.Set("alt", alt)
  42222. c.urlParams_.Set("prettyPrint", "false")
  42223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  42224. urls += "?" + c.urlParams_.Encode()
  42225. req, err := http.NewRequest("POST", urls, body)
  42226. if err != nil {
  42227. return nil, err
  42228. }
  42229. req.Header = reqHeaders
  42230. googleapi.Expand(req.URL, map[string]string{
  42231. "project": c.project,
  42232. "region": c.region,
  42233. })
  42234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42235. }
  42236. // Do executes the "compute.forwardingRules.insert" call.
  42237. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42238. // status code is an error. Response headers are in either
  42239. // *Operation.ServerResponse.Header or (if a response was returned at
  42240. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42241. // to check whether the returned error was because
  42242. // http.StatusNotModified was returned.
  42243. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42244. gensupport.SetOptions(c.urlParams_, opts...)
  42245. res, err := c.doRequest("json")
  42246. if res != nil && res.StatusCode == http.StatusNotModified {
  42247. if res.Body != nil {
  42248. res.Body.Close()
  42249. }
  42250. return nil, &googleapi.Error{
  42251. Code: res.StatusCode,
  42252. Header: res.Header,
  42253. }
  42254. }
  42255. if err != nil {
  42256. return nil, err
  42257. }
  42258. defer googleapi.CloseBody(res)
  42259. if err := googleapi.CheckResponse(res); err != nil {
  42260. return nil, err
  42261. }
  42262. ret := &Operation{
  42263. ServerResponse: googleapi.ServerResponse{
  42264. Header: res.Header,
  42265. HTTPStatusCode: res.StatusCode,
  42266. },
  42267. }
  42268. target := &ret
  42269. if err := gensupport.DecodeResponse(target, res); err != nil {
  42270. return nil, err
  42271. }
  42272. return ret, nil
  42273. // {
  42274. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  42275. // "httpMethod": "POST",
  42276. // "id": "compute.forwardingRules.insert",
  42277. // "parameterOrder": [
  42278. // "project",
  42279. // "region"
  42280. // ],
  42281. // "parameters": {
  42282. // "project": {
  42283. // "description": "Project ID for this request.",
  42284. // "location": "path",
  42285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42286. // "required": true,
  42287. // "type": "string"
  42288. // },
  42289. // "region": {
  42290. // "description": "Name of the region scoping this request.",
  42291. // "location": "path",
  42292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42293. // "required": true,
  42294. // "type": "string"
  42295. // },
  42296. // "requestId": {
  42297. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42298. // "location": "query",
  42299. // "type": "string"
  42300. // }
  42301. // },
  42302. // "path": "{project}/regions/{region}/forwardingRules",
  42303. // "request": {
  42304. // "$ref": "ForwardingRule"
  42305. // },
  42306. // "response": {
  42307. // "$ref": "Operation"
  42308. // },
  42309. // "scopes": [
  42310. // "https://www.googleapis.com/auth/cloud-platform",
  42311. // "https://www.googleapis.com/auth/compute"
  42312. // ]
  42313. // }
  42314. }
  42315. // method id "compute.forwardingRules.list":
  42316. type ForwardingRulesListCall struct {
  42317. s *Service
  42318. project string
  42319. region string
  42320. urlParams_ gensupport.URLParams
  42321. ifNoneMatch_ string
  42322. ctx_ context.Context
  42323. header_ http.Header
  42324. }
  42325. // List: Retrieves a list of ForwardingRule resources available to the
  42326. // specified project and region.
  42327. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  42328. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  42329. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42330. c.project = project
  42331. c.region = region
  42332. return c
  42333. }
  42334. // Filter sets the optional parameter "filter": A filter expression that
  42335. // filters resources listed in the response. The expression must specify
  42336. // the field name, a comparison operator, and the value that you want to
  42337. // use for filtering. The value must be a string, a number, or a
  42338. // boolean. The comparison operator must be either =, !=, >, or <.
  42339. //
  42340. // For example, if you are filtering Compute Engine instances, you can
  42341. // exclude instances named example-instance by specifying name !=
  42342. // example-instance.
  42343. //
  42344. // You can also filter nested fields. For example, you could specify
  42345. // scheduling.automaticRestart = false to include instances only if they
  42346. // are not scheduled for automatic restarts. You can use filtering on
  42347. // nested fields to filter based on resource labels.
  42348. //
  42349. // To filter on multiple expressions, provide each separate expression
  42350. // within parentheses. For example, (scheduling.automaticRestart = true)
  42351. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42352. // AND expression. However, you can include AND and OR expressions
  42353. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42354. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42355. // true).
  42356. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  42357. c.urlParams_.Set("filter", filter)
  42358. return c
  42359. }
  42360. // MaxResults sets the optional parameter "maxResults": The maximum
  42361. // number of results per page that should be returned. If the number of
  42362. // available results is larger than maxResults, Compute Engine returns a
  42363. // nextPageToken that can be used to get the next page of results in
  42364. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42365. // (Default: 500)
  42366. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  42367. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42368. return c
  42369. }
  42370. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42371. // a certain order. By default, results are returned in alphanumerical
  42372. // order based on the resource name.
  42373. //
  42374. // You can also sort results in descending order based on the creation
  42375. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42376. // based on the creationTimestamp field in reverse chronological order
  42377. // (newest result first). Use this to sort resources like operations so
  42378. // that the newest operation is returned first.
  42379. //
  42380. // Currently, only sorting by name or creationTimestamp desc is
  42381. // supported.
  42382. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  42383. c.urlParams_.Set("orderBy", orderBy)
  42384. return c
  42385. }
  42386. // PageToken sets the optional parameter "pageToken": Specifies a page
  42387. // token to use. Set pageToken to the nextPageToken returned by a
  42388. // previous list request to get the next page of results.
  42389. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  42390. c.urlParams_.Set("pageToken", pageToken)
  42391. return c
  42392. }
  42393. // Fields allows partial responses to be retrieved. See
  42394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42395. // for more information.
  42396. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  42397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42398. return c
  42399. }
  42400. // IfNoneMatch sets the optional parameter which makes the operation
  42401. // fail if the object's ETag matches the given value. This is useful for
  42402. // getting updates only after the object has changed since the last
  42403. // request. Use googleapi.IsNotModified to check whether the response
  42404. // error from Do is the result of In-None-Match.
  42405. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  42406. c.ifNoneMatch_ = entityTag
  42407. return c
  42408. }
  42409. // Context sets the context to be used in this call's Do method. Any
  42410. // pending HTTP request will be aborted if the provided context is
  42411. // canceled.
  42412. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  42413. c.ctx_ = ctx
  42414. return c
  42415. }
  42416. // Header returns an http.Header that can be modified by the caller to
  42417. // add HTTP headers to the request.
  42418. func (c *ForwardingRulesListCall) Header() http.Header {
  42419. if c.header_ == nil {
  42420. c.header_ = make(http.Header)
  42421. }
  42422. return c.header_
  42423. }
  42424. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  42425. reqHeaders := make(http.Header)
  42426. for k, v := range c.header_ {
  42427. reqHeaders[k] = v
  42428. }
  42429. reqHeaders.Set("User-Agent", c.s.userAgent())
  42430. if c.ifNoneMatch_ != "" {
  42431. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42432. }
  42433. var body io.Reader = nil
  42434. c.urlParams_.Set("alt", alt)
  42435. c.urlParams_.Set("prettyPrint", "false")
  42436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  42437. urls += "?" + c.urlParams_.Encode()
  42438. req, err := http.NewRequest("GET", urls, body)
  42439. if err != nil {
  42440. return nil, err
  42441. }
  42442. req.Header = reqHeaders
  42443. googleapi.Expand(req.URL, map[string]string{
  42444. "project": c.project,
  42445. "region": c.region,
  42446. })
  42447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42448. }
  42449. // Do executes the "compute.forwardingRules.list" call.
  42450. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  42451. // non-2xx status code is an error. Response headers are in either
  42452. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  42453. // returned at all) in error.(*googleapi.Error).Header. Use
  42454. // googleapi.IsNotModified to check whether the returned error was
  42455. // because http.StatusNotModified was returned.
  42456. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  42457. gensupport.SetOptions(c.urlParams_, opts...)
  42458. res, err := c.doRequest("json")
  42459. if res != nil && res.StatusCode == http.StatusNotModified {
  42460. if res.Body != nil {
  42461. res.Body.Close()
  42462. }
  42463. return nil, &googleapi.Error{
  42464. Code: res.StatusCode,
  42465. Header: res.Header,
  42466. }
  42467. }
  42468. if err != nil {
  42469. return nil, err
  42470. }
  42471. defer googleapi.CloseBody(res)
  42472. if err := googleapi.CheckResponse(res); err != nil {
  42473. return nil, err
  42474. }
  42475. ret := &ForwardingRuleList{
  42476. ServerResponse: googleapi.ServerResponse{
  42477. Header: res.Header,
  42478. HTTPStatusCode: res.StatusCode,
  42479. },
  42480. }
  42481. target := &ret
  42482. if err := gensupport.DecodeResponse(target, res); err != nil {
  42483. return nil, err
  42484. }
  42485. return ret, nil
  42486. // {
  42487. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  42488. // "httpMethod": "GET",
  42489. // "id": "compute.forwardingRules.list",
  42490. // "parameterOrder": [
  42491. // "project",
  42492. // "region"
  42493. // ],
  42494. // "parameters": {
  42495. // "filter": {
  42496. // "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).",
  42497. // "location": "query",
  42498. // "type": "string"
  42499. // },
  42500. // "maxResults": {
  42501. // "default": "500",
  42502. // "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)",
  42503. // "format": "uint32",
  42504. // "location": "query",
  42505. // "minimum": "0",
  42506. // "type": "integer"
  42507. // },
  42508. // "orderBy": {
  42509. // "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.",
  42510. // "location": "query",
  42511. // "type": "string"
  42512. // },
  42513. // "pageToken": {
  42514. // "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.",
  42515. // "location": "query",
  42516. // "type": "string"
  42517. // },
  42518. // "project": {
  42519. // "description": "Project ID for this request.",
  42520. // "location": "path",
  42521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42522. // "required": true,
  42523. // "type": "string"
  42524. // },
  42525. // "region": {
  42526. // "description": "Name of the region scoping this request.",
  42527. // "location": "path",
  42528. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42529. // "required": true,
  42530. // "type": "string"
  42531. // }
  42532. // },
  42533. // "path": "{project}/regions/{region}/forwardingRules",
  42534. // "response": {
  42535. // "$ref": "ForwardingRuleList"
  42536. // },
  42537. // "scopes": [
  42538. // "https://www.googleapis.com/auth/cloud-platform",
  42539. // "https://www.googleapis.com/auth/compute",
  42540. // "https://www.googleapis.com/auth/compute.readonly"
  42541. // ]
  42542. // }
  42543. }
  42544. // Pages invokes f for each page of results.
  42545. // A non-nil error returned from f will halt the iteration.
  42546. // The provided context supersedes any context provided to the Context method.
  42547. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  42548. c.ctx_ = ctx
  42549. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42550. for {
  42551. x, err := c.Do()
  42552. if err != nil {
  42553. return err
  42554. }
  42555. if err := f(x); err != nil {
  42556. return err
  42557. }
  42558. if x.NextPageToken == "" {
  42559. return nil
  42560. }
  42561. c.PageToken(x.NextPageToken)
  42562. }
  42563. }
  42564. // method id "compute.forwardingRules.setLabels":
  42565. type ForwardingRulesSetLabelsCall struct {
  42566. s *Service
  42567. project string
  42568. region string
  42569. resource string
  42570. regionsetlabelsrequest *RegionSetLabelsRequest
  42571. urlParams_ gensupport.URLParams
  42572. ctx_ context.Context
  42573. header_ http.Header
  42574. }
  42575. // SetLabels: Sets the labels on the specified resource. To learn more
  42576. // about labels, read the Labeling Resources documentation.
  42577. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  42578. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42579. c.project = project
  42580. c.region = region
  42581. c.resource = resource
  42582. c.regionsetlabelsrequest = regionsetlabelsrequest
  42583. return c
  42584. }
  42585. // RequestId sets the optional parameter "requestId": An optional
  42586. // request ID to identify requests. Specify a unique request ID so that
  42587. // if you must retry your request, the server will know to ignore the
  42588. // request if it has already been completed.
  42589. //
  42590. // For example, consider a situation where you make an initial request
  42591. // and the request times out. If you make the request again with the
  42592. // same request ID, the server can check if original operation with the
  42593. // same request ID was received, and if so, will ignore the second
  42594. // request. This prevents clients from accidentally creating duplicate
  42595. // commitments.
  42596. //
  42597. // The request ID must be a valid UUID with the exception that zero UUID
  42598. // is not supported (00000000-0000-0000-0000-000000000000).
  42599. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  42600. c.urlParams_.Set("requestId", requestId)
  42601. return c
  42602. }
  42603. // Fields allows partial responses to be retrieved. See
  42604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42605. // for more information.
  42606. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  42607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42608. return c
  42609. }
  42610. // Context sets the context to be used in this call's Do method. Any
  42611. // pending HTTP request will be aborted if the provided context is
  42612. // canceled.
  42613. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  42614. c.ctx_ = ctx
  42615. return c
  42616. }
  42617. // Header returns an http.Header that can be modified by the caller to
  42618. // add HTTP headers to the request.
  42619. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  42620. if c.header_ == nil {
  42621. c.header_ = make(http.Header)
  42622. }
  42623. return c.header_
  42624. }
  42625. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  42626. reqHeaders := make(http.Header)
  42627. for k, v := range c.header_ {
  42628. reqHeaders[k] = v
  42629. }
  42630. reqHeaders.Set("User-Agent", c.s.userAgent())
  42631. var body io.Reader = nil
  42632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  42633. if err != nil {
  42634. return nil, err
  42635. }
  42636. reqHeaders.Set("Content-Type", "application/json")
  42637. c.urlParams_.Set("alt", alt)
  42638. c.urlParams_.Set("prettyPrint", "false")
  42639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  42640. urls += "?" + c.urlParams_.Encode()
  42641. req, err := http.NewRequest("POST", urls, body)
  42642. if err != nil {
  42643. return nil, err
  42644. }
  42645. req.Header = reqHeaders
  42646. googleapi.Expand(req.URL, map[string]string{
  42647. "project": c.project,
  42648. "region": c.region,
  42649. "resource": c.resource,
  42650. })
  42651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42652. }
  42653. // Do executes the "compute.forwardingRules.setLabels" call.
  42654. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42655. // status code is an error. Response headers are in either
  42656. // *Operation.ServerResponse.Header or (if a response was returned at
  42657. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42658. // to check whether the returned error was because
  42659. // http.StatusNotModified was returned.
  42660. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42661. gensupport.SetOptions(c.urlParams_, opts...)
  42662. res, err := c.doRequest("json")
  42663. if res != nil && res.StatusCode == http.StatusNotModified {
  42664. if res.Body != nil {
  42665. res.Body.Close()
  42666. }
  42667. return nil, &googleapi.Error{
  42668. Code: res.StatusCode,
  42669. Header: res.Header,
  42670. }
  42671. }
  42672. if err != nil {
  42673. return nil, err
  42674. }
  42675. defer googleapi.CloseBody(res)
  42676. if err := googleapi.CheckResponse(res); err != nil {
  42677. return nil, err
  42678. }
  42679. ret := &Operation{
  42680. ServerResponse: googleapi.ServerResponse{
  42681. Header: res.Header,
  42682. HTTPStatusCode: res.StatusCode,
  42683. },
  42684. }
  42685. target := &ret
  42686. if err := gensupport.DecodeResponse(target, res); err != nil {
  42687. return nil, err
  42688. }
  42689. return ret, nil
  42690. // {
  42691. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  42692. // "httpMethod": "POST",
  42693. // "id": "compute.forwardingRules.setLabels",
  42694. // "parameterOrder": [
  42695. // "project",
  42696. // "region",
  42697. // "resource"
  42698. // ],
  42699. // "parameters": {
  42700. // "project": {
  42701. // "description": "Project ID for this request.",
  42702. // "location": "path",
  42703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42704. // "required": true,
  42705. // "type": "string"
  42706. // },
  42707. // "region": {
  42708. // "description": "The region for this request.",
  42709. // "location": "path",
  42710. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42711. // "required": true,
  42712. // "type": "string"
  42713. // },
  42714. // "requestId": {
  42715. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42716. // "location": "query",
  42717. // "type": "string"
  42718. // },
  42719. // "resource": {
  42720. // "description": "Name or id of the resource for this request.",
  42721. // "location": "path",
  42722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42723. // "required": true,
  42724. // "type": "string"
  42725. // }
  42726. // },
  42727. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  42728. // "request": {
  42729. // "$ref": "RegionSetLabelsRequest"
  42730. // },
  42731. // "response": {
  42732. // "$ref": "Operation"
  42733. // },
  42734. // "scopes": [
  42735. // "https://www.googleapis.com/auth/cloud-platform",
  42736. // "https://www.googleapis.com/auth/compute"
  42737. // ]
  42738. // }
  42739. }
  42740. // method id "compute.forwardingRules.setTarget":
  42741. type ForwardingRulesSetTargetCall struct {
  42742. s *Service
  42743. project string
  42744. region string
  42745. forwardingRule string
  42746. targetreference *TargetReference
  42747. urlParams_ gensupport.URLParams
  42748. ctx_ context.Context
  42749. header_ http.Header
  42750. }
  42751. // SetTarget: Changes target URL for forwarding rule. The new target
  42752. // should be of the same type as the old target.
  42753. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  42754. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  42755. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42756. c.project = project
  42757. c.region = region
  42758. c.forwardingRule = forwardingRule
  42759. c.targetreference = targetreference
  42760. return c
  42761. }
  42762. // RequestId sets the optional parameter "requestId": An optional
  42763. // request ID to identify requests. Specify a unique request ID so that
  42764. // if you must retry your request, the server will know to ignore the
  42765. // request if it has already been completed.
  42766. //
  42767. // For example, consider a situation where you make an initial request
  42768. // and the request times out. If you make the request again with the
  42769. // same request ID, the server can check if original operation with the
  42770. // same request ID was received, and if so, will ignore the second
  42771. // request. This prevents clients from accidentally creating duplicate
  42772. // commitments.
  42773. //
  42774. // The request ID must be a valid UUID with the exception that zero UUID
  42775. // is not supported (00000000-0000-0000-0000-000000000000).
  42776. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  42777. c.urlParams_.Set("requestId", requestId)
  42778. return c
  42779. }
  42780. // Fields allows partial responses to be retrieved. See
  42781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42782. // for more information.
  42783. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  42784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42785. return c
  42786. }
  42787. // Context sets the context to be used in this call's Do method. Any
  42788. // pending HTTP request will be aborted if the provided context is
  42789. // canceled.
  42790. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  42791. c.ctx_ = ctx
  42792. return c
  42793. }
  42794. // Header returns an http.Header that can be modified by the caller to
  42795. // add HTTP headers to the request.
  42796. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  42797. if c.header_ == nil {
  42798. c.header_ = make(http.Header)
  42799. }
  42800. return c.header_
  42801. }
  42802. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  42803. reqHeaders := make(http.Header)
  42804. for k, v := range c.header_ {
  42805. reqHeaders[k] = v
  42806. }
  42807. reqHeaders.Set("User-Agent", c.s.userAgent())
  42808. var body io.Reader = nil
  42809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  42810. if err != nil {
  42811. return nil, err
  42812. }
  42813. reqHeaders.Set("Content-Type", "application/json")
  42814. c.urlParams_.Set("alt", alt)
  42815. c.urlParams_.Set("prettyPrint", "false")
  42816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  42817. urls += "?" + c.urlParams_.Encode()
  42818. req, err := http.NewRequest("POST", urls, body)
  42819. if err != nil {
  42820. return nil, err
  42821. }
  42822. req.Header = reqHeaders
  42823. googleapi.Expand(req.URL, map[string]string{
  42824. "project": c.project,
  42825. "region": c.region,
  42826. "forwardingRule": c.forwardingRule,
  42827. })
  42828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42829. }
  42830. // Do executes the "compute.forwardingRules.setTarget" call.
  42831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42832. // status code is an error. Response headers are in either
  42833. // *Operation.ServerResponse.Header or (if a response was returned at
  42834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42835. // to check whether the returned error was because
  42836. // http.StatusNotModified was returned.
  42837. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42838. gensupport.SetOptions(c.urlParams_, opts...)
  42839. res, err := c.doRequest("json")
  42840. if res != nil && res.StatusCode == http.StatusNotModified {
  42841. if res.Body != nil {
  42842. res.Body.Close()
  42843. }
  42844. return nil, &googleapi.Error{
  42845. Code: res.StatusCode,
  42846. Header: res.Header,
  42847. }
  42848. }
  42849. if err != nil {
  42850. return nil, err
  42851. }
  42852. defer googleapi.CloseBody(res)
  42853. if err := googleapi.CheckResponse(res); err != nil {
  42854. return nil, err
  42855. }
  42856. ret := &Operation{
  42857. ServerResponse: googleapi.ServerResponse{
  42858. Header: res.Header,
  42859. HTTPStatusCode: res.StatusCode,
  42860. },
  42861. }
  42862. target := &ret
  42863. if err := gensupport.DecodeResponse(target, res); err != nil {
  42864. return nil, err
  42865. }
  42866. return ret, nil
  42867. // {
  42868. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  42869. // "httpMethod": "POST",
  42870. // "id": "compute.forwardingRules.setTarget",
  42871. // "parameterOrder": [
  42872. // "project",
  42873. // "region",
  42874. // "forwardingRule"
  42875. // ],
  42876. // "parameters": {
  42877. // "forwardingRule": {
  42878. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  42879. // "location": "path",
  42880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42881. // "required": true,
  42882. // "type": "string"
  42883. // },
  42884. // "project": {
  42885. // "description": "Project ID for this request.",
  42886. // "location": "path",
  42887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42888. // "required": true,
  42889. // "type": "string"
  42890. // },
  42891. // "region": {
  42892. // "description": "Name of the region scoping this request.",
  42893. // "location": "path",
  42894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42895. // "required": true,
  42896. // "type": "string"
  42897. // },
  42898. // "requestId": {
  42899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42900. // "location": "query",
  42901. // "type": "string"
  42902. // }
  42903. // },
  42904. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  42905. // "request": {
  42906. // "$ref": "TargetReference"
  42907. // },
  42908. // "response": {
  42909. // "$ref": "Operation"
  42910. // },
  42911. // "scopes": [
  42912. // "https://www.googleapis.com/auth/cloud-platform",
  42913. // "https://www.googleapis.com/auth/compute"
  42914. // ]
  42915. // }
  42916. }
  42917. // method id "compute.forwardingRules.testIamPermissions":
  42918. type ForwardingRulesTestIamPermissionsCall struct {
  42919. s *Service
  42920. project string
  42921. region string
  42922. resource string
  42923. testpermissionsrequest *TestPermissionsRequest
  42924. urlParams_ gensupport.URLParams
  42925. ctx_ context.Context
  42926. header_ http.Header
  42927. }
  42928. // TestIamPermissions: Returns permissions that a caller has on the
  42929. // specified resource.
  42930. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  42931. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42932. c.project = project
  42933. c.region = region
  42934. c.resource = resource
  42935. c.testpermissionsrequest = testpermissionsrequest
  42936. return c
  42937. }
  42938. // Fields allows partial responses to be retrieved. See
  42939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42940. // for more information.
  42941. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  42942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42943. return c
  42944. }
  42945. // Context sets the context to be used in this call's Do method. Any
  42946. // pending HTTP request will be aborted if the provided context is
  42947. // canceled.
  42948. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  42949. c.ctx_ = ctx
  42950. return c
  42951. }
  42952. // Header returns an http.Header that can be modified by the caller to
  42953. // add HTTP headers to the request.
  42954. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  42955. if c.header_ == nil {
  42956. c.header_ = make(http.Header)
  42957. }
  42958. return c.header_
  42959. }
  42960. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  42961. reqHeaders := make(http.Header)
  42962. for k, v := range c.header_ {
  42963. reqHeaders[k] = v
  42964. }
  42965. reqHeaders.Set("User-Agent", c.s.userAgent())
  42966. var body io.Reader = nil
  42967. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  42968. if err != nil {
  42969. return nil, err
  42970. }
  42971. reqHeaders.Set("Content-Type", "application/json")
  42972. c.urlParams_.Set("alt", alt)
  42973. c.urlParams_.Set("prettyPrint", "false")
  42974. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  42975. urls += "?" + c.urlParams_.Encode()
  42976. req, err := http.NewRequest("POST", urls, body)
  42977. if err != nil {
  42978. return nil, err
  42979. }
  42980. req.Header = reqHeaders
  42981. googleapi.Expand(req.URL, map[string]string{
  42982. "project": c.project,
  42983. "region": c.region,
  42984. "resource": c.resource,
  42985. })
  42986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42987. }
  42988. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  42989. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  42990. // non-2xx status code is an error. Response headers are in either
  42991. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  42992. // returned at all) in error.(*googleapi.Error).Header. Use
  42993. // googleapi.IsNotModified to check whether the returned error was
  42994. // because http.StatusNotModified was returned.
  42995. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  42996. gensupport.SetOptions(c.urlParams_, opts...)
  42997. res, err := c.doRequest("json")
  42998. if res != nil && res.StatusCode == http.StatusNotModified {
  42999. if res.Body != nil {
  43000. res.Body.Close()
  43001. }
  43002. return nil, &googleapi.Error{
  43003. Code: res.StatusCode,
  43004. Header: res.Header,
  43005. }
  43006. }
  43007. if err != nil {
  43008. return nil, err
  43009. }
  43010. defer googleapi.CloseBody(res)
  43011. if err := googleapi.CheckResponse(res); err != nil {
  43012. return nil, err
  43013. }
  43014. ret := &TestPermissionsResponse{
  43015. ServerResponse: googleapi.ServerResponse{
  43016. Header: res.Header,
  43017. HTTPStatusCode: res.StatusCode,
  43018. },
  43019. }
  43020. target := &ret
  43021. if err := gensupport.DecodeResponse(target, res); err != nil {
  43022. return nil, err
  43023. }
  43024. return ret, nil
  43025. // {
  43026. // "description": "Returns permissions that a caller has on the specified resource.",
  43027. // "httpMethod": "POST",
  43028. // "id": "compute.forwardingRules.testIamPermissions",
  43029. // "parameterOrder": [
  43030. // "project",
  43031. // "region",
  43032. // "resource"
  43033. // ],
  43034. // "parameters": {
  43035. // "project": {
  43036. // "description": "Project ID for this request.",
  43037. // "location": "path",
  43038. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43039. // "required": true,
  43040. // "type": "string"
  43041. // },
  43042. // "region": {
  43043. // "description": "The name of the region for this request.",
  43044. // "location": "path",
  43045. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43046. // "required": true,
  43047. // "type": "string"
  43048. // },
  43049. // "resource": {
  43050. // "description": "Name or id of the resource for this request.",
  43051. // "location": "path",
  43052. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43053. // "required": true,
  43054. // "type": "string"
  43055. // }
  43056. // },
  43057. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  43058. // "request": {
  43059. // "$ref": "TestPermissionsRequest"
  43060. // },
  43061. // "response": {
  43062. // "$ref": "TestPermissionsResponse"
  43063. // },
  43064. // "scopes": [
  43065. // "https://www.googleapis.com/auth/cloud-platform",
  43066. // "https://www.googleapis.com/auth/compute",
  43067. // "https://www.googleapis.com/auth/compute.readonly"
  43068. // ]
  43069. // }
  43070. }
  43071. // method id "compute.globalAddresses.delete":
  43072. type GlobalAddressesDeleteCall struct {
  43073. s *Service
  43074. project string
  43075. address string
  43076. urlParams_ gensupport.URLParams
  43077. ctx_ context.Context
  43078. header_ http.Header
  43079. }
  43080. // Delete: Deletes the specified address resource.
  43081. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  43082. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  43083. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43084. c.project = project
  43085. c.address = address
  43086. return c
  43087. }
  43088. // RequestId sets the optional parameter "requestId": An optional
  43089. // request ID to identify requests. Specify a unique request ID so that
  43090. // if you must retry your request, the server will know to ignore the
  43091. // request if it has already been completed.
  43092. //
  43093. // For example, consider a situation where you make an initial request
  43094. // and the request times out. If you make the request again with the
  43095. // same request ID, the server can check if original operation with the
  43096. // same request ID was received, and if so, will ignore the second
  43097. // request. This prevents clients from accidentally creating duplicate
  43098. // commitments.
  43099. //
  43100. // The request ID must be a valid UUID with the exception that zero UUID
  43101. // is not supported (00000000-0000-0000-0000-000000000000).
  43102. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  43103. c.urlParams_.Set("requestId", requestId)
  43104. return c
  43105. }
  43106. // Fields allows partial responses to be retrieved. See
  43107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43108. // for more information.
  43109. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  43110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43111. return c
  43112. }
  43113. // Context sets the context to be used in this call's Do method. Any
  43114. // pending HTTP request will be aborted if the provided context is
  43115. // canceled.
  43116. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  43117. c.ctx_ = ctx
  43118. return c
  43119. }
  43120. // Header returns an http.Header that can be modified by the caller to
  43121. // add HTTP headers to the request.
  43122. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  43123. if c.header_ == nil {
  43124. c.header_ = make(http.Header)
  43125. }
  43126. return c.header_
  43127. }
  43128. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43129. reqHeaders := make(http.Header)
  43130. for k, v := range c.header_ {
  43131. reqHeaders[k] = v
  43132. }
  43133. reqHeaders.Set("User-Agent", c.s.userAgent())
  43134. var body io.Reader = nil
  43135. c.urlParams_.Set("alt", alt)
  43136. c.urlParams_.Set("prettyPrint", "false")
  43137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  43138. urls += "?" + c.urlParams_.Encode()
  43139. req, err := http.NewRequest("DELETE", urls, body)
  43140. if err != nil {
  43141. return nil, err
  43142. }
  43143. req.Header = reqHeaders
  43144. googleapi.Expand(req.URL, map[string]string{
  43145. "project": c.project,
  43146. "address": c.address,
  43147. })
  43148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43149. }
  43150. // Do executes the "compute.globalAddresses.delete" call.
  43151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43152. // status code is an error. Response headers are in either
  43153. // *Operation.ServerResponse.Header or (if a response was returned at
  43154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43155. // to check whether the returned error was because
  43156. // http.StatusNotModified was returned.
  43157. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43158. gensupport.SetOptions(c.urlParams_, opts...)
  43159. res, err := c.doRequest("json")
  43160. if res != nil && res.StatusCode == http.StatusNotModified {
  43161. if res.Body != nil {
  43162. res.Body.Close()
  43163. }
  43164. return nil, &googleapi.Error{
  43165. Code: res.StatusCode,
  43166. Header: res.Header,
  43167. }
  43168. }
  43169. if err != nil {
  43170. return nil, err
  43171. }
  43172. defer googleapi.CloseBody(res)
  43173. if err := googleapi.CheckResponse(res); err != nil {
  43174. return nil, err
  43175. }
  43176. ret := &Operation{
  43177. ServerResponse: googleapi.ServerResponse{
  43178. Header: res.Header,
  43179. HTTPStatusCode: res.StatusCode,
  43180. },
  43181. }
  43182. target := &ret
  43183. if err := gensupport.DecodeResponse(target, res); err != nil {
  43184. return nil, err
  43185. }
  43186. return ret, nil
  43187. // {
  43188. // "description": "Deletes the specified address resource.",
  43189. // "httpMethod": "DELETE",
  43190. // "id": "compute.globalAddresses.delete",
  43191. // "parameterOrder": [
  43192. // "project",
  43193. // "address"
  43194. // ],
  43195. // "parameters": {
  43196. // "address": {
  43197. // "description": "Name of the address resource to delete.",
  43198. // "location": "path",
  43199. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43200. // "required": true,
  43201. // "type": "string"
  43202. // },
  43203. // "project": {
  43204. // "description": "Project ID for this request.",
  43205. // "location": "path",
  43206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43207. // "required": true,
  43208. // "type": "string"
  43209. // },
  43210. // "requestId": {
  43211. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43212. // "location": "query",
  43213. // "type": "string"
  43214. // }
  43215. // },
  43216. // "path": "{project}/global/addresses/{address}",
  43217. // "response": {
  43218. // "$ref": "Operation"
  43219. // },
  43220. // "scopes": [
  43221. // "https://www.googleapis.com/auth/cloud-platform",
  43222. // "https://www.googleapis.com/auth/compute"
  43223. // ]
  43224. // }
  43225. }
  43226. // method id "compute.globalAddresses.get":
  43227. type GlobalAddressesGetCall struct {
  43228. s *Service
  43229. project string
  43230. address string
  43231. urlParams_ gensupport.URLParams
  43232. ifNoneMatch_ string
  43233. ctx_ context.Context
  43234. header_ http.Header
  43235. }
  43236. // Get: Returns the specified address resource. Gets a list of available
  43237. // addresses by making a list() request.
  43238. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  43239. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  43240. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43241. c.project = project
  43242. c.address = address
  43243. return c
  43244. }
  43245. // Fields allows partial responses to be retrieved. See
  43246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43247. // for more information.
  43248. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  43249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43250. return c
  43251. }
  43252. // IfNoneMatch sets the optional parameter which makes the operation
  43253. // fail if the object's ETag matches the given value. This is useful for
  43254. // getting updates only after the object has changed since the last
  43255. // request. Use googleapi.IsNotModified to check whether the response
  43256. // error from Do is the result of In-None-Match.
  43257. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  43258. c.ifNoneMatch_ = entityTag
  43259. return c
  43260. }
  43261. // Context sets the context to be used in this call's Do method. Any
  43262. // pending HTTP request will be aborted if the provided context is
  43263. // canceled.
  43264. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  43265. c.ctx_ = ctx
  43266. return c
  43267. }
  43268. // Header returns an http.Header that can be modified by the caller to
  43269. // add HTTP headers to the request.
  43270. func (c *GlobalAddressesGetCall) Header() http.Header {
  43271. if c.header_ == nil {
  43272. c.header_ = make(http.Header)
  43273. }
  43274. return c.header_
  43275. }
  43276. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  43277. reqHeaders := make(http.Header)
  43278. for k, v := range c.header_ {
  43279. reqHeaders[k] = v
  43280. }
  43281. reqHeaders.Set("User-Agent", c.s.userAgent())
  43282. if c.ifNoneMatch_ != "" {
  43283. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43284. }
  43285. var body io.Reader = nil
  43286. c.urlParams_.Set("alt", alt)
  43287. c.urlParams_.Set("prettyPrint", "false")
  43288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  43289. urls += "?" + c.urlParams_.Encode()
  43290. req, err := http.NewRequest("GET", urls, body)
  43291. if err != nil {
  43292. return nil, err
  43293. }
  43294. req.Header = reqHeaders
  43295. googleapi.Expand(req.URL, map[string]string{
  43296. "project": c.project,
  43297. "address": c.address,
  43298. })
  43299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43300. }
  43301. // Do executes the "compute.globalAddresses.get" call.
  43302. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  43303. // code is an error. Response headers are in either
  43304. // *Address.ServerResponse.Header or (if a response was returned at all)
  43305. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43306. // check whether the returned error was because http.StatusNotModified
  43307. // was returned.
  43308. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  43309. gensupport.SetOptions(c.urlParams_, opts...)
  43310. res, err := c.doRequest("json")
  43311. if res != nil && res.StatusCode == http.StatusNotModified {
  43312. if res.Body != nil {
  43313. res.Body.Close()
  43314. }
  43315. return nil, &googleapi.Error{
  43316. Code: res.StatusCode,
  43317. Header: res.Header,
  43318. }
  43319. }
  43320. if err != nil {
  43321. return nil, err
  43322. }
  43323. defer googleapi.CloseBody(res)
  43324. if err := googleapi.CheckResponse(res); err != nil {
  43325. return nil, err
  43326. }
  43327. ret := &Address{
  43328. ServerResponse: googleapi.ServerResponse{
  43329. Header: res.Header,
  43330. HTTPStatusCode: res.StatusCode,
  43331. },
  43332. }
  43333. target := &ret
  43334. if err := gensupport.DecodeResponse(target, res); err != nil {
  43335. return nil, err
  43336. }
  43337. return ret, nil
  43338. // {
  43339. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  43340. // "httpMethod": "GET",
  43341. // "id": "compute.globalAddresses.get",
  43342. // "parameterOrder": [
  43343. // "project",
  43344. // "address"
  43345. // ],
  43346. // "parameters": {
  43347. // "address": {
  43348. // "description": "Name of the address resource to return.",
  43349. // "location": "path",
  43350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43351. // "required": true,
  43352. // "type": "string"
  43353. // },
  43354. // "project": {
  43355. // "description": "Project ID for this request.",
  43356. // "location": "path",
  43357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43358. // "required": true,
  43359. // "type": "string"
  43360. // }
  43361. // },
  43362. // "path": "{project}/global/addresses/{address}",
  43363. // "response": {
  43364. // "$ref": "Address"
  43365. // },
  43366. // "scopes": [
  43367. // "https://www.googleapis.com/auth/cloud-platform",
  43368. // "https://www.googleapis.com/auth/compute",
  43369. // "https://www.googleapis.com/auth/compute.readonly"
  43370. // ]
  43371. // }
  43372. }
  43373. // method id "compute.globalAddresses.insert":
  43374. type GlobalAddressesInsertCall struct {
  43375. s *Service
  43376. project string
  43377. address *Address
  43378. urlParams_ gensupport.URLParams
  43379. ctx_ context.Context
  43380. header_ http.Header
  43381. }
  43382. // Insert: Creates an address resource in the specified project using
  43383. // the data included in the request.
  43384. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  43385. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  43386. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43387. c.project = project
  43388. c.address = address
  43389. return c
  43390. }
  43391. // RequestId sets the optional parameter "requestId": An optional
  43392. // request ID to identify requests. Specify a unique request ID so that
  43393. // if you must retry your request, the server will know to ignore the
  43394. // request if it has already been completed.
  43395. //
  43396. // For example, consider a situation where you make an initial request
  43397. // and the request times out. If you make the request again with the
  43398. // same request ID, the server can check if original operation with the
  43399. // same request ID was received, and if so, will ignore the second
  43400. // request. This prevents clients from accidentally creating duplicate
  43401. // commitments.
  43402. //
  43403. // The request ID must be a valid UUID with the exception that zero UUID
  43404. // is not supported (00000000-0000-0000-0000-000000000000).
  43405. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  43406. c.urlParams_.Set("requestId", requestId)
  43407. return c
  43408. }
  43409. // Fields allows partial responses to be retrieved. See
  43410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43411. // for more information.
  43412. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  43413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43414. return c
  43415. }
  43416. // Context sets the context to be used in this call's Do method. Any
  43417. // pending HTTP request will be aborted if the provided context is
  43418. // canceled.
  43419. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  43420. c.ctx_ = ctx
  43421. return c
  43422. }
  43423. // Header returns an http.Header that can be modified by the caller to
  43424. // add HTTP headers to the request.
  43425. func (c *GlobalAddressesInsertCall) Header() http.Header {
  43426. if c.header_ == nil {
  43427. c.header_ = make(http.Header)
  43428. }
  43429. return c.header_
  43430. }
  43431. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  43432. reqHeaders := make(http.Header)
  43433. for k, v := range c.header_ {
  43434. reqHeaders[k] = v
  43435. }
  43436. reqHeaders.Set("User-Agent", c.s.userAgent())
  43437. var body io.Reader = nil
  43438. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  43439. if err != nil {
  43440. return nil, err
  43441. }
  43442. reqHeaders.Set("Content-Type", "application/json")
  43443. c.urlParams_.Set("alt", alt)
  43444. c.urlParams_.Set("prettyPrint", "false")
  43445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  43446. urls += "?" + c.urlParams_.Encode()
  43447. req, err := http.NewRequest("POST", urls, body)
  43448. if err != nil {
  43449. return nil, err
  43450. }
  43451. req.Header = reqHeaders
  43452. googleapi.Expand(req.URL, map[string]string{
  43453. "project": c.project,
  43454. })
  43455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43456. }
  43457. // Do executes the "compute.globalAddresses.insert" call.
  43458. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43459. // status code is an error. Response headers are in either
  43460. // *Operation.ServerResponse.Header or (if a response was returned at
  43461. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43462. // to check whether the returned error was because
  43463. // http.StatusNotModified was returned.
  43464. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43465. gensupport.SetOptions(c.urlParams_, opts...)
  43466. res, err := c.doRequest("json")
  43467. if res != nil && res.StatusCode == http.StatusNotModified {
  43468. if res.Body != nil {
  43469. res.Body.Close()
  43470. }
  43471. return nil, &googleapi.Error{
  43472. Code: res.StatusCode,
  43473. Header: res.Header,
  43474. }
  43475. }
  43476. if err != nil {
  43477. return nil, err
  43478. }
  43479. defer googleapi.CloseBody(res)
  43480. if err := googleapi.CheckResponse(res); err != nil {
  43481. return nil, err
  43482. }
  43483. ret := &Operation{
  43484. ServerResponse: googleapi.ServerResponse{
  43485. Header: res.Header,
  43486. HTTPStatusCode: res.StatusCode,
  43487. },
  43488. }
  43489. target := &ret
  43490. if err := gensupport.DecodeResponse(target, res); err != nil {
  43491. return nil, err
  43492. }
  43493. return ret, nil
  43494. // {
  43495. // "description": "Creates an address resource in the specified project using the data included in the request.",
  43496. // "httpMethod": "POST",
  43497. // "id": "compute.globalAddresses.insert",
  43498. // "parameterOrder": [
  43499. // "project"
  43500. // ],
  43501. // "parameters": {
  43502. // "project": {
  43503. // "description": "Project ID for this request.",
  43504. // "location": "path",
  43505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43506. // "required": true,
  43507. // "type": "string"
  43508. // },
  43509. // "requestId": {
  43510. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43511. // "location": "query",
  43512. // "type": "string"
  43513. // }
  43514. // },
  43515. // "path": "{project}/global/addresses",
  43516. // "request": {
  43517. // "$ref": "Address"
  43518. // },
  43519. // "response": {
  43520. // "$ref": "Operation"
  43521. // },
  43522. // "scopes": [
  43523. // "https://www.googleapis.com/auth/cloud-platform",
  43524. // "https://www.googleapis.com/auth/compute"
  43525. // ]
  43526. // }
  43527. }
  43528. // method id "compute.globalAddresses.list":
  43529. type GlobalAddressesListCall struct {
  43530. s *Service
  43531. project string
  43532. urlParams_ gensupport.URLParams
  43533. ifNoneMatch_ string
  43534. ctx_ context.Context
  43535. header_ http.Header
  43536. }
  43537. // List: Retrieves a list of global addresses.
  43538. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  43539. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  43540. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43541. c.project = project
  43542. return c
  43543. }
  43544. // Filter sets the optional parameter "filter": A filter expression that
  43545. // filters resources listed in the response. The expression must specify
  43546. // the field name, a comparison operator, and the value that you want to
  43547. // use for filtering. The value must be a string, a number, or a
  43548. // boolean. The comparison operator must be either =, !=, >, or <.
  43549. //
  43550. // For example, if you are filtering Compute Engine instances, you can
  43551. // exclude instances named example-instance by specifying name !=
  43552. // example-instance.
  43553. //
  43554. // You can also filter nested fields. For example, you could specify
  43555. // scheduling.automaticRestart = false to include instances only if they
  43556. // are not scheduled for automatic restarts. You can use filtering on
  43557. // nested fields to filter based on resource labels.
  43558. //
  43559. // To filter on multiple expressions, provide each separate expression
  43560. // within parentheses. For example, (scheduling.automaticRestart = true)
  43561. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43562. // AND expression. However, you can include AND and OR expressions
  43563. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43564. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43565. // true).
  43566. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  43567. c.urlParams_.Set("filter", filter)
  43568. return c
  43569. }
  43570. // MaxResults sets the optional parameter "maxResults": The maximum
  43571. // number of results per page that should be returned. If the number of
  43572. // available results is larger than maxResults, Compute Engine returns a
  43573. // nextPageToken that can be used to get the next page of results in
  43574. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43575. // (Default: 500)
  43576. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  43577. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43578. return c
  43579. }
  43580. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43581. // a certain order. By default, results are returned in alphanumerical
  43582. // order based on the resource name.
  43583. //
  43584. // You can also sort results in descending order based on the creation
  43585. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43586. // based on the creationTimestamp field in reverse chronological order
  43587. // (newest result first). Use this to sort resources like operations so
  43588. // that the newest operation is returned first.
  43589. //
  43590. // Currently, only sorting by name or creationTimestamp desc is
  43591. // supported.
  43592. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  43593. c.urlParams_.Set("orderBy", orderBy)
  43594. return c
  43595. }
  43596. // PageToken sets the optional parameter "pageToken": Specifies a page
  43597. // token to use. Set pageToken to the nextPageToken returned by a
  43598. // previous list request to get the next page of results.
  43599. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  43600. c.urlParams_.Set("pageToken", pageToken)
  43601. return c
  43602. }
  43603. // Fields allows partial responses to be retrieved. See
  43604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43605. // for more information.
  43606. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  43607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43608. return c
  43609. }
  43610. // IfNoneMatch sets the optional parameter which makes the operation
  43611. // fail if the object's ETag matches the given value. This is useful for
  43612. // getting updates only after the object has changed since the last
  43613. // request. Use googleapi.IsNotModified to check whether the response
  43614. // error from Do is the result of In-None-Match.
  43615. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  43616. c.ifNoneMatch_ = entityTag
  43617. return c
  43618. }
  43619. // Context sets the context to be used in this call's Do method. Any
  43620. // pending HTTP request will be aborted if the provided context is
  43621. // canceled.
  43622. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  43623. c.ctx_ = ctx
  43624. return c
  43625. }
  43626. // Header returns an http.Header that can be modified by the caller to
  43627. // add HTTP headers to the request.
  43628. func (c *GlobalAddressesListCall) Header() http.Header {
  43629. if c.header_ == nil {
  43630. c.header_ = make(http.Header)
  43631. }
  43632. return c.header_
  43633. }
  43634. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  43635. reqHeaders := make(http.Header)
  43636. for k, v := range c.header_ {
  43637. reqHeaders[k] = v
  43638. }
  43639. reqHeaders.Set("User-Agent", c.s.userAgent())
  43640. if c.ifNoneMatch_ != "" {
  43641. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43642. }
  43643. var body io.Reader = nil
  43644. c.urlParams_.Set("alt", alt)
  43645. c.urlParams_.Set("prettyPrint", "false")
  43646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  43647. urls += "?" + c.urlParams_.Encode()
  43648. req, err := http.NewRequest("GET", urls, body)
  43649. if err != nil {
  43650. return nil, err
  43651. }
  43652. req.Header = reqHeaders
  43653. googleapi.Expand(req.URL, map[string]string{
  43654. "project": c.project,
  43655. })
  43656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43657. }
  43658. // Do executes the "compute.globalAddresses.list" call.
  43659. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  43660. // status code is an error. Response headers are in either
  43661. // *AddressList.ServerResponse.Header or (if a response was returned at
  43662. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43663. // to check whether the returned error was because
  43664. // http.StatusNotModified was returned.
  43665. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  43666. gensupport.SetOptions(c.urlParams_, opts...)
  43667. res, err := c.doRequest("json")
  43668. if res != nil && res.StatusCode == http.StatusNotModified {
  43669. if res.Body != nil {
  43670. res.Body.Close()
  43671. }
  43672. return nil, &googleapi.Error{
  43673. Code: res.StatusCode,
  43674. Header: res.Header,
  43675. }
  43676. }
  43677. if err != nil {
  43678. return nil, err
  43679. }
  43680. defer googleapi.CloseBody(res)
  43681. if err := googleapi.CheckResponse(res); err != nil {
  43682. return nil, err
  43683. }
  43684. ret := &AddressList{
  43685. ServerResponse: googleapi.ServerResponse{
  43686. Header: res.Header,
  43687. HTTPStatusCode: res.StatusCode,
  43688. },
  43689. }
  43690. target := &ret
  43691. if err := gensupport.DecodeResponse(target, res); err != nil {
  43692. return nil, err
  43693. }
  43694. return ret, nil
  43695. // {
  43696. // "description": "Retrieves a list of global addresses.",
  43697. // "httpMethod": "GET",
  43698. // "id": "compute.globalAddresses.list",
  43699. // "parameterOrder": [
  43700. // "project"
  43701. // ],
  43702. // "parameters": {
  43703. // "filter": {
  43704. // "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).",
  43705. // "location": "query",
  43706. // "type": "string"
  43707. // },
  43708. // "maxResults": {
  43709. // "default": "500",
  43710. // "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)",
  43711. // "format": "uint32",
  43712. // "location": "query",
  43713. // "minimum": "0",
  43714. // "type": "integer"
  43715. // },
  43716. // "orderBy": {
  43717. // "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.",
  43718. // "location": "query",
  43719. // "type": "string"
  43720. // },
  43721. // "pageToken": {
  43722. // "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.",
  43723. // "location": "query",
  43724. // "type": "string"
  43725. // },
  43726. // "project": {
  43727. // "description": "Project ID for this request.",
  43728. // "location": "path",
  43729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43730. // "required": true,
  43731. // "type": "string"
  43732. // }
  43733. // },
  43734. // "path": "{project}/global/addresses",
  43735. // "response": {
  43736. // "$ref": "AddressList"
  43737. // },
  43738. // "scopes": [
  43739. // "https://www.googleapis.com/auth/cloud-platform",
  43740. // "https://www.googleapis.com/auth/compute",
  43741. // "https://www.googleapis.com/auth/compute.readonly"
  43742. // ]
  43743. // }
  43744. }
  43745. // Pages invokes f for each page of results.
  43746. // A non-nil error returned from f will halt the iteration.
  43747. // The provided context supersedes any context provided to the Context method.
  43748. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  43749. c.ctx_ = ctx
  43750. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43751. for {
  43752. x, err := c.Do()
  43753. if err != nil {
  43754. return err
  43755. }
  43756. if err := f(x); err != nil {
  43757. return err
  43758. }
  43759. if x.NextPageToken == "" {
  43760. return nil
  43761. }
  43762. c.PageToken(x.NextPageToken)
  43763. }
  43764. }
  43765. // method id "compute.globalAddresses.setLabels":
  43766. type GlobalAddressesSetLabelsCall struct {
  43767. s *Service
  43768. project string
  43769. resource string
  43770. globalsetlabelsrequest *GlobalSetLabelsRequest
  43771. urlParams_ gensupport.URLParams
  43772. ctx_ context.Context
  43773. header_ http.Header
  43774. }
  43775. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  43776. // labels, read the Labeling Resources documentation.
  43777. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  43778. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43779. c.project = project
  43780. c.resource = resource
  43781. c.globalsetlabelsrequest = globalsetlabelsrequest
  43782. return c
  43783. }
  43784. // Fields allows partial responses to be retrieved. See
  43785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43786. // for more information.
  43787. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  43788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43789. return c
  43790. }
  43791. // Context sets the context to be used in this call's Do method. Any
  43792. // pending HTTP request will be aborted if the provided context is
  43793. // canceled.
  43794. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  43795. c.ctx_ = ctx
  43796. return c
  43797. }
  43798. // Header returns an http.Header that can be modified by the caller to
  43799. // add HTTP headers to the request.
  43800. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  43801. if c.header_ == nil {
  43802. c.header_ = make(http.Header)
  43803. }
  43804. return c.header_
  43805. }
  43806. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  43807. reqHeaders := make(http.Header)
  43808. for k, v := range c.header_ {
  43809. reqHeaders[k] = v
  43810. }
  43811. reqHeaders.Set("User-Agent", c.s.userAgent())
  43812. var body io.Reader = nil
  43813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  43814. if err != nil {
  43815. return nil, err
  43816. }
  43817. reqHeaders.Set("Content-Type", "application/json")
  43818. c.urlParams_.Set("alt", alt)
  43819. c.urlParams_.Set("prettyPrint", "false")
  43820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  43821. urls += "?" + c.urlParams_.Encode()
  43822. req, err := http.NewRequest("POST", urls, body)
  43823. if err != nil {
  43824. return nil, err
  43825. }
  43826. req.Header = reqHeaders
  43827. googleapi.Expand(req.URL, map[string]string{
  43828. "project": c.project,
  43829. "resource": c.resource,
  43830. })
  43831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43832. }
  43833. // Do executes the "compute.globalAddresses.setLabels" call.
  43834. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43835. // status code is an error. Response headers are in either
  43836. // *Operation.ServerResponse.Header or (if a response was returned at
  43837. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43838. // to check whether the returned error was because
  43839. // http.StatusNotModified was returned.
  43840. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43841. gensupport.SetOptions(c.urlParams_, opts...)
  43842. res, err := c.doRequest("json")
  43843. if res != nil && res.StatusCode == http.StatusNotModified {
  43844. if res.Body != nil {
  43845. res.Body.Close()
  43846. }
  43847. return nil, &googleapi.Error{
  43848. Code: res.StatusCode,
  43849. Header: res.Header,
  43850. }
  43851. }
  43852. if err != nil {
  43853. return nil, err
  43854. }
  43855. defer googleapi.CloseBody(res)
  43856. if err := googleapi.CheckResponse(res); err != nil {
  43857. return nil, err
  43858. }
  43859. ret := &Operation{
  43860. ServerResponse: googleapi.ServerResponse{
  43861. Header: res.Header,
  43862. HTTPStatusCode: res.StatusCode,
  43863. },
  43864. }
  43865. target := &ret
  43866. if err := gensupport.DecodeResponse(target, res); err != nil {
  43867. return nil, err
  43868. }
  43869. return ret, nil
  43870. // {
  43871. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  43872. // "httpMethod": "POST",
  43873. // "id": "compute.globalAddresses.setLabels",
  43874. // "parameterOrder": [
  43875. // "project",
  43876. // "resource"
  43877. // ],
  43878. // "parameters": {
  43879. // "project": {
  43880. // "description": "Project ID for this request.",
  43881. // "location": "path",
  43882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43883. // "required": true,
  43884. // "type": "string"
  43885. // },
  43886. // "resource": {
  43887. // "description": "Name or id of the resource for this request.",
  43888. // "location": "path",
  43889. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43890. // "required": true,
  43891. // "type": "string"
  43892. // }
  43893. // },
  43894. // "path": "{project}/global/addresses/{resource}/setLabels",
  43895. // "request": {
  43896. // "$ref": "GlobalSetLabelsRequest"
  43897. // },
  43898. // "response": {
  43899. // "$ref": "Operation"
  43900. // },
  43901. // "scopes": [
  43902. // "https://www.googleapis.com/auth/cloud-platform",
  43903. // "https://www.googleapis.com/auth/compute"
  43904. // ]
  43905. // }
  43906. }
  43907. // method id "compute.globalAddresses.testIamPermissions":
  43908. type GlobalAddressesTestIamPermissionsCall struct {
  43909. s *Service
  43910. project string
  43911. resource string
  43912. testpermissionsrequest *TestPermissionsRequest
  43913. urlParams_ gensupport.URLParams
  43914. ctx_ context.Context
  43915. header_ http.Header
  43916. }
  43917. // TestIamPermissions: Returns permissions that a caller has on the
  43918. // specified resource.
  43919. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  43920. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43921. c.project = project
  43922. c.resource = resource
  43923. c.testpermissionsrequest = testpermissionsrequest
  43924. return c
  43925. }
  43926. // Fields allows partial responses to be retrieved. See
  43927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43928. // for more information.
  43929. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  43930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43931. return c
  43932. }
  43933. // Context sets the context to be used in this call's Do method. Any
  43934. // pending HTTP request will be aborted if the provided context is
  43935. // canceled.
  43936. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  43937. c.ctx_ = ctx
  43938. return c
  43939. }
  43940. // Header returns an http.Header that can be modified by the caller to
  43941. // add HTTP headers to the request.
  43942. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  43943. if c.header_ == nil {
  43944. c.header_ = make(http.Header)
  43945. }
  43946. return c.header_
  43947. }
  43948. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43949. reqHeaders := make(http.Header)
  43950. for k, v := range c.header_ {
  43951. reqHeaders[k] = v
  43952. }
  43953. reqHeaders.Set("User-Agent", c.s.userAgent())
  43954. var body io.Reader = nil
  43955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43956. if err != nil {
  43957. return nil, err
  43958. }
  43959. reqHeaders.Set("Content-Type", "application/json")
  43960. c.urlParams_.Set("alt", alt)
  43961. c.urlParams_.Set("prettyPrint", "false")
  43962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  43963. urls += "?" + c.urlParams_.Encode()
  43964. req, err := http.NewRequest("POST", urls, body)
  43965. if err != nil {
  43966. return nil, err
  43967. }
  43968. req.Header = reqHeaders
  43969. googleapi.Expand(req.URL, map[string]string{
  43970. "project": c.project,
  43971. "resource": c.resource,
  43972. })
  43973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43974. }
  43975. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  43976. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43977. // non-2xx status code is an error. Response headers are in either
  43978. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43979. // returned at all) in error.(*googleapi.Error).Header. Use
  43980. // googleapi.IsNotModified to check whether the returned error was
  43981. // because http.StatusNotModified was returned.
  43982. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43983. gensupport.SetOptions(c.urlParams_, opts...)
  43984. res, err := c.doRequest("json")
  43985. if res != nil && res.StatusCode == http.StatusNotModified {
  43986. if res.Body != nil {
  43987. res.Body.Close()
  43988. }
  43989. return nil, &googleapi.Error{
  43990. Code: res.StatusCode,
  43991. Header: res.Header,
  43992. }
  43993. }
  43994. if err != nil {
  43995. return nil, err
  43996. }
  43997. defer googleapi.CloseBody(res)
  43998. if err := googleapi.CheckResponse(res); err != nil {
  43999. return nil, err
  44000. }
  44001. ret := &TestPermissionsResponse{
  44002. ServerResponse: googleapi.ServerResponse{
  44003. Header: res.Header,
  44004. HTTPStatusCode: res.StatusCode,
  44005. },
  44006. }
  44007. target := &ret
  44008. if err := gensupport.DecodeResponse(target, res); err != nil {
  44009. return nil, err
  44010. }
  44011. return ret, nil
  44012. // {
  44013. // "description": "Returns permissions that a caller has on the specified resource.",
  44014. // "httpMethod": "POST",
  44015. // "id": "compute.globalAddresses.testIamPermissions",
  44016. // "parameterOrder": [
  44017. // "project",
  44018. // "resource"
  44019. // ],
  44020. // "parameters": {
  44021. // "project": {
  44022. // "description": "Project ID for this request.",
  44023. // "location": "path",
  44024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44025. // "required": true,
  44026. // "type": "string"
  44027. // },
  44028. // "resource": {
  44029. // "description": "Name or id of the resource for this request.",
  44030. // "location": "path",
  44031. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44032. // "required": true,
  44033. // "type": "string"
  44034. // }
  44035. // },
  44036. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  44037. // "request": {
  44038. // "$ref": "TestPermissionsRequest"
  44039. // },
  44040. // "response": {
  44041. // "$ref": "TestPermissionsResponse"
  44042. // },
  44043. // "scopes": [
  44044. // "https://www.googleapis.com/auth/cloud-platform",
  44045. // "https://www.googleapis.com/auth/compute",
  44046. // "https://www.googleapis.com/auth/compute.readonly"
  44047. // ]
  44048. // }
  44049. }
  44050. // method id "compute.globalForwardingRules.delete":
  44051. type GlobalForwardingRulesDeleteCall struct {
  44052. s *Service
  44053. project string
  44054. forwardingRule string
  44055. urlParams_ gensupport.URLParams
  44056. ctx_ context.Context
  44057. header_ http.Header
  44058. }
  44059. // Delete: Deletes the specified GlobalForwardingRule resource.
  44060. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  44061. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  44062. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44063. c.project = project
  44064. c.forwardingRule = forwardingRule
  44065. return c
  44066. }
  44067. // RequestId sets the optional parameter "requestId": An optional
  44068. // request ID to identify requests. Specify a unique request ID so that
  44069. // if you must retry your request, the server will know to ignore the
  44070. // request if it has already been completed.
  44071. //
  44072. // For example, consider a situation where you make an initial request
  44073. // and the request times out. If you make the request again with the
  44074. // same request ID, the server can check if original operation with the
  44075. // same request ID was received, and if so, will ignore the second
  44076. // request. This prevents clients from accidentally creating duplicate
  44077. // commitments.
  44078. //
  44079. // The request ID must be a valid UUID with the exception that zero UUID
  44080. // is not supported (00000000-0000-0000-0000-000000000000).
  44081. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  44082. c.urlParams_.Set("requestId", requestId)
  44083. return c
  44084. }
  44085. // Fields allows partial responses to be retrieved. See
  44086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44087. // for more information.
  44088. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  44089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44090. return c
  44091. }
  44092. // Context sets the context to be used in this call's Do method. Any
  44093. // pending HTTP request will be aborted if the provided context is
  44094. // canceled.
  44095. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  44096. c.ctx_ = ctx
  44097. return c
  44098. }
  44099. // Header returns an http.Header that can be modified by the caller to
  44100. // add HTTP headers to the request.
  44101. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  44102. if c.header_ == nil {
  44103. c.header_ = make(http.Header)
  44104. }
  44105. return c.header_
  44106. }
  44107. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44108. reqHeaders := make(http.Header)
  44109. for k, v := range c.header_ {
  44110. reqHeaders[k] = v
  44111. }
  44112. reqHeaders.Set("User-Agent", c.s.userAgent())
  44113. var body io.Reader = nil
  44114. c.urlParams_.Set("alt", alt)
  44115. c.urlParams_.Set("prettyPrint", "false")
  44116. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  44117. urls += "?" + c.urlParams_.Encode()
  44118. req, err := http.NewRequest("DELETE", urls, body)
  44119. if err != nil {
  44120. return nil, err
  44121. }
  44122. req.Header = reqHeaders
  44123. googleapi.Expand(req.URL, map[string]string{
  44124. "project": c.project,
  44125. "forwardingRule": c.forwardingRule,
  44126. })
  44127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44128. }
  44129. // Do executes the "compute.globalForwardingRules.delete" call.
  44130. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44131. // status code is an error. Response headers are in either
  44132. // *Operation.ServerResponse.Header or (if a response was returned at
  44133. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44134. // to check whether the returned error was because
  44135. // http.StatusNotModified was returned.
  44136. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44137. gensupport.SetOptions(c.urlParams_, opts...)
  44138. res, err := c.doRequest("json")
  44139. if res != nil && res.StatusCode == http.StatusNotModified {
  44140. if res.Body != nil {
  44141. res.Body.Close()
  44142. }
  44143. return nil, &googleapi.Error{
  44144. Code: res.StatusCode,
  44145. Header: res.Header,
  44146. }
  44147. }
  44148. if err != nil {
  44149. return nil, err
  44150. }
  44151. defer googleapi.CloseBody(res)
  44152. if err := googleapi.CheckResponse(res); err != nil {
  44153. return nil, err
  44154. }
  44155. ret := &Operation{
  44156. ServerResponse: googleapi.ServerResponse{
  44157. Header: res.Header,
  44158. HTTPStatusCode: res.StatusCode,
  44159. },
  44160. }
  44161. target := &ret
  44162. if err := gensupport.DecodeResponse(target, res); err != nil {
  44163. return nil, err
  44164. }
  44165. return ret, nil
  44166. // {
  44167. // "description": "Deletes the specified GlobalForwardingRule resource.",
  44168. // "httpMethod": "DELETE",
  44169. // "id": "compute.globalForwardingRules.delete",
  44170. // "parameterOrder": [
  44171. // "project",
  44172. // "forwardingRule"
  44173. // ],
  44174. // "parameters": {
  44175. // "forwardingRule": {
  44176. // "description": "Name of the ForwardingRule resource to delete.",
  44177. // "location": "path",
  44178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44179. // "required": true,
  44180. // "type": "string"
  44181. // },
  44182. // "project": {
  44183. // "description": "Project ID for this request.",
  44184. // "location": "path",
  44185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44186. // "required": true,
  44187. // "type": "string"
  44188. // },
  44189. // "requestId": {
  44190. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44191. // "location": "query",
  44192. // "type": "string"
  44193. // }
  44194. // },
  44195. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  44196. // "response": {
  44197. // "$ref": "Operation"
  44198. // },
  44199. // "scopes": [
  44200. // "https://www.googleapis.com/auth/cloud-platform",
  44201. // "https://www.googleapis.com/auth/compute"
  44202. // ]
  44203. // }
  44204. }
  44205. // method id "compute.globalForwardingRules.get":
  44206. type GlobalForwardingRulesGetCall struct {
  44207. s *Service
  44208. project string
  44209. forwardingRule string
  44210. urlParams_ gensupport.URLParams
  44211. ifNoneMatch_ string
  44212. ctx_ context.Context
  44213. header_ http.Header
  44214. }
  44215. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  44216. // of available forwarding rules by making a list() request.
  44217. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  44218. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  44219. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44220. c.project = project
  44221. c.forwardingRule = forwardingRule
  44222. return c
  44223. }
  44224. // Fields allows partial responses to be retrieved. See
  44225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44226. // for more information.
  44227. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  44228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44229. return c
  44230. }
  44231. // IfNoneMatch sets the optional parameter which makes the operation
  44232. // fail if the object's ETag matches the given value. This is useful for
  44233. // getting updates only after the object has changed since the last
  44234. // request. Use googleapi.IsNotModified to check whether the response
  44235. // error from Do is the result of In-None-Match.
  44236. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  44237. c.ifNoneMatch_ = entityTag
  44238. return c
  44239. }
  44240. // Context sets the context to be used in this call's Do method. Any
  44241. // pending HTTP request will be aborted if the provided context is
  44242. // canceled.
  44243. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  44244. c.ctx_ = ctx
  44245. return c
  44246. }
  44247. // Header returns an http.Header that can be modified by the caller to
  44248. // add HTTP headers to the request.
  44249. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  44250. if c.header_ == nil {
  44251. c.header_ = make(http.Header)
  44252. }
  44253. return c.header_
  44254. }
  44255. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  44256. reqHeaders := make(http.Header)
  44257. for k, v := range c.header_ {
  44258. reqHeaders[k] = v
  44259. }
  44260. reqHeaders.Set("User-Agent", c.s.userAgent())
  44261. if c.ifNoneMatch_ != "" {
  44262. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44263. }
  44264. var body io.Reader = nil
  44265. c.urlParams_.Set("alt", alt)
  44266. c.urlParams_.Set("prettyPrint", "false")
  44267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  44268. urls += "?" + c.urlParams_.Encode()
  44269. req, err := http.NewRequest("GET", urls, body)
  44270. if err != nil {
  44271. return nil, err
  44272. }
  44273. req.Header = reqHeaders
  44274. googleapi.Expand(req.URL, map[string]string{
  44275. "project": c.project,
  44276. "forwardingRule": c.forwardingRule,
  44277. })
  44278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44279. }
  44280. // Do executes the "compute.globalForwardingRules.get" call.
  44281. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  44282. // status code is an error. Response headers are in either
  44283. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  44284. // at all) in error.(*googleapi.Error).Header. Use
  44285. // googleapi.IsNotModified to check whether the returned error was
  44286. // because http.StatusNotModified was returned.
  44287. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  44288. gensupport.SetOptions(c.urlParams_, opts...)
  44289. res, err := c.doRequest("json")
  44290. if res != nil && res.StatusCode == http.StatusNotModified {
  44291. if res.Body != nil {
  44292. res.Body.Close()
  44293. }
  44294. return nil, &googleapi.Error{
  44295. Code: res.StatusCode,
  44296. Header: res.Header,
  44297. }
  44298. }
  44299. if err != nil {
  44300. return nil, err
  44301. }
  44302. defer googleapi.CloseBody(res)
  44303. if err := googleapi.CheckResponse(res); err != nil {
  44304. return nil, err
  44305. }
  44306. ret := &ForwardingRule{
  44307. ServerResponse: googleapi.ServerResponse{
  44308. Header: res.Header,
  44309. HTTPStatusCode: res.StatusCode,
  44310. },
  44311. }
  44312. target := &ret
  44313. if err := gensupport.DecodeResponse(target, res); err != nil {
  44314. return nil, err
  44315. }
  44316. return ret, nil
  44317. // {
  44318. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  44319. // "httpMethod": "GET",
  44320. // "id": "compute.globalForwardingRules.get",
  44321. // "parameterOrder": [
  44322. // "project",
  44323. // "forwardingRule"
  44324. // ],
  44325. // "parameters": {
  44326. // "forwardingRule": {
  44327. // "description": "Name of the ForwardingRule resource to return.",
  44328. // "location": "path",
  44329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44330. // "required": true,
  44331. // "type": "string"
  44332. // },
  44333. // "project": {
  44334. // "description": "Project ID for this request.",
  44335. // "location": "path",
  44336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44337. // "required": true,
  44338. // "type": "string"
  44339. // }
  44340. // },
  44341. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  44342. // "response": {
  44343. // "$ref": "ForwardingRule"
  44344. // },
  44345. // "scopes": [
  44346. // "https://www.googleapis.com/auth/cloud-platform",
  44347. // "https://www.googleapis.com/auth/compute",
  44348. // "https://www.googleapis.com/auth/compute.readonly"
  44349. // ]
  44350. // }
  44351. }
  44352. // method id "compute.globalForwardingRules.insert":
  44353. type GlobalForwardingRulesInsertCall struct {
  44354. s *Service
  44355. project string
  44356. forwardingrule *ForwardingRule
  44357. urlParams_ gensupport.URLParams
  44358. ctx_ context.Context
  44359. header_ http.Header
  44360. }
  44361. // Insert: Creates a GlobalForwardingRule resource in the specified
  44362. // project using the data included in the request.
  44363. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  44364. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  44365. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44366. c.project = project
  44367. c.forwardingrule = forwardingrule
  44368. return c
  44369. }
  44370. // RequestId sets the optional parameter "requestId": An optional
  44371. // request ID to identify requests. Specify a unique request ID so that
  44372. // if you must retry your request, the server will know to ignore the
  44373. // request if it has already been completed.
  44374. //
  44375. // For example, consider a situation where you make an initial request
  44376. // and the request times out. If you make the request again with the
  44377. // same request ID, the server can check if original operation with the
  44378. // same request ID was received, and if so, will ignore the second
  44379. // request. This prevents clients from accidentally creating duplicate
  44380. // commitments.
  44381. //
  44382. // The request ID must be a valid UUID with the exception that zero UUID
  44383. // is not supported (00000000-0000-0000-0000-000000000000).
  44384. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  44385. c.urlParams_.Set("requestId", requestId)
  44386. return c
  44387. }
  44388. // Fields allows partial responses to be retrieved. See
  44389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44390. // for more information.
  44391. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  44392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44393. return c
  44394. }
  44395. // Context sets the context to be used in this call's Do method. Any
  44396. // pending HTTP request will be aborted if the provided context is
  44397. // canceled.
  44398. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  44399. c.ctx_ = ctx
  44400. return c
  44401. }
  44402. // Header returns an http.Header that can be modified by the caller to
  44403. // add HTTP headers to the request.
  44404. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  44405. if c.header_ == nil {
  44406. c.header_ = make(http.Header)
  44407. }
  44408. return c.header_
  44409. }
  44410. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  44411. reqHeaders := make(http.Header)
  44412. for k, v := range c.header_ {
  44413. reqHeaders[k] = v
  44414. }
  44415. reqHeaders.Set("User-Agent", c.s.userAgent())
  44416. var body io.Reader = nil
  44417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  44418. if err != nil {
  44419. return nil, err
  44420. }
  44421. reqHeaders.Set("Content-Type", "application/json")
  44422. c.urlParams_.Set("alt", alt)
  44423. c.urlParams_.Set("prettyPrint", "false")
  44424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  44425. urls += "?" + c.urlParams_.Encode()
  44426. req, err := http.NewRequest("POST", urls, body)
  44427. if err != nil {
  44428. return nil, err
  44429. }
  44430. req.Header = reqHeaders
  44431. googleapi.Expand(req.URL, map[string]string{
  44432. "project": c.project,
  44433. })
  44434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44435. }
  44436. // Do executes the "compute.globalForwardingRules.insert" call.
  44437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44438. // status code is an error. Response headers are in either
  44439. // *Operation.ServerResponse.Header or (if a response was returned at
  44440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44441. // to check whether the returned error was because
  44442. // http.StatusNotModified was returned.
  44443. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44444. gensupport.SetOptions(c.urlParams_, opts...)
  44445. res, err := c.doRequest("json")
  44446. if res != nil && res.StatusCode == http.StatusNotModified {
  44447. if res.Body != nil {
  44448. res.Body.Close()
  44449. }
  44450. return nil, &googleapi.Error{
  44451. Code: res.StatusCode,
  44452. Header: res.Header,
  44453. }
  44454. }
  44455. if err != nil {
  44456. return nil, err
  44457. }
  44458. defer googleapi.CloseBody(res)
  44459. if err := googleapi.CheckResponse(res); err != nil {
  44460. return nil, err
  44461. }
  44462. ret := &Operation{
  44463. ServerResponse: googleapi.ServerResponse{
  44464. Header: res.Header,
  44465. HTTPStatusCode: res.StatusCode,
  44466. },
  44467. }
  44468. target := &ret
  44469. if err := gensupport.DecodeResponse(target, res); err != nil {
  44470. return nil, err
  44471. }
  44472. return ret, nil
  44473. // {
  44474. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  44475. // "httpMethod": "POST",
  44476. // "id": "compute.globalForwardingRules.insert",
  44477. // "parameterOrder": [
  44478. // "project"
  44479. // ],
  44480. // "parameters": {
  44481. // "project": {
  44482. // "description": "Project ID for this request.",
  44483. // "location": "path",
  44484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44485. // "required": true,
  44486. // "type": "string"
  44487. // },
  44488. // "requestId": {
  44489. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44490. // "location": "query",
  44491. // "type": "string"
  44492. // }
  44493. // },
  44494. // "path": "{project}/global/forwardingRules",
  44495. // "request": {
  44496. // "$ref": "ForwardingRule"
  44497. // },
  44498. // "response": {
  44499. // "$ref": "Operation"
  44500. // },
  44501. // "scopes": [
  44502. // "https://www.googleapis.com/auth/cloud-platform",
  44503. // "https://www.googleapis.com/auth/compute"
  44504. // ]
  44505. // }
  44506. }
  44507. // method id "compute.globalForwardingRules.list":
  44508. type GlobalForwardingRulesListCall struct {
  44509. s *Service
  44510. project string
  44511. urlParams_ gensupport.URLParams
  44512. ifNoneMatch_ string
  44513. ctx_ context.Context
  44514. header_ http.Header
  44515. }
  44516. // List: Retrieves a list of GlobalForwardingRule resources available to
  44517. // the specified project.
  44518. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  44519. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  44520. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44521. c.project = project
  44522. return c
  44523. }
  44524. // Filter sets the optional parameter "filter": A filter expression that
  44525. // filters resources listed in the response. The expression must specify
  44526. // the field name, a comparison operator, and the value that you want to
  44527. // use for filtering. The value must be a string, a number, or a
  44528. // boolean. The comparison operator must be either =, !=, >, or <.
  44529. //
  44530. // For example, if you are filtering Compute Engine instances, you can
  44531. // exclude instances named example-instance by specifying name !=
  44532. // example-instance.
  44533. //
  44534. // You can also filter nested fields. For example, you could specify
  44535. // scheduling.automaticRestart = false to include instances only if they
  44536. // are not scheduled for automatic restarts. You can use filtering on
  44537. // nested fields to filter based on resource labels.
  44538. //
  44539. // To filter on multiple expressions, provide each separate expression
  44540. // within parentheses. For example, (scheduling.automaticRestart = true)
  44541. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44542. // AND expression. However, you can include AND and OR expressions
  44543. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44544. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44545. // true).
  44546. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  44547. c.urlParams_.Set("filter", filter)
  44548. return c
  44549. }
  44550. // MaxResults sets the optional parameter "maxResults": The maximum
  44551. // number of results per page that should be returned. If the number of
  44552. // available results is larger than maxResults, Compute Engine returns a
  44553. // nextPageToken that can be used to get the next page of results in
  44554. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44555. // (Default: 500)
  44556. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  44557. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44558. return c
  44559. }
  44560. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44561. // a certain order. By default, results are returned in alphanumerical
  44562. // order based on the resource name.
  44563. //
  44564. // You can also sort results in descending order based on the creation
  44565. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44566. // based on the creationTimestamp field in reverse chronological order
  44567. // (newest result first). Use this to sort resources like operations so
  44568. // that the newest operation is returned first.
  44569. //
  44570. // Currently, only sorting by name or creationTimestamp desc is
  44571. // supported.
  44572. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  44573. c.urlParams_.Set("orderBy", orderBy)
  44574. return c
  44575. }
  44576. // PageToken sets the optional parameter "pageToken": Specifies a page
  44577. // token to use. Set pageToken to the nextPageToken returned by a
  44578. // previous list request to get the next page of results.
  44579. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  44580. c.urlParams_.Set("pageToken", pageToken)
  44581. return c
  44582. }
  44583. // Fields allows partial responses to be retrieved. See
  44584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44585. // for more information.
  44586. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  44587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44588. return c
  44589. }
  44590. // IfNoneMatch sets the optional parameter which makes the operation
  44591. // fail if the object's ETag matches the given value. This is useful for
  44592. // getting updates only after the object has changed since the last
  44593. // request. Use googleapi.IsNotModified to check whether the response
  44594. // error from Do is the result of In-None-Match.
  44595. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  44596. c.ifNoneMatch_ = entityTag
  44597. return c
  44598. }
  44599. // Context sets the context to be used in this call's Do method. Any
  44600. // pending HTTP request will be aborted if the provided context is
  44601. // canceled.
  44602. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  44603. c.ctx_ = ctx
  44604. return c
  44605. }
  44606. // Header returns an http.Header that can be modified by the caller to
  44607. // add HTTP headers to the request.
  44608. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  44609. if c.header_ == nil {
  44610. c.header_ = make(http.Header)
  44611. }
  44612. return c.header_
  44613. }
  44614. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  44615. reqHeaders := make(http.Header)
  44616. for k, v := range c.header_ {
  44617. reqHeaders[k] = v
  44618. }
  44619. reqHeaders.Set("User-Agent", c.s.userAgent())
  44620. if c.ifNoneMatch_ != "" {
  44621. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44622. }
  44623. var body io.Reader = nil
  44624. c.urlParams_.Set("alt", alt)
  44625. c.urlParams_.Set("prettyPrint", "false")
  44626. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  44627. urls += "?" + c.urlParams_.Encode()
  44628. req, err := http.NewRequest("GET", urls, body)
  44629. if err != nil {
  44630. return nil, err
  44631. }
  44632. req.Header = reqHeaders
  44633. googleapi.Expand(req.URL, map[string]string{
  44634. "project": c.project,
  44635. })
  44636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44637. }
  44638. // Do executes the "compute.globalForwardingRules.list" call.
  44639. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  44640. // non-2xx status code is an error. Response headers are in either
  44641. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  44642. // returned at all) in error.(*googleapi.Error).Header. Use
  44643. // googleapi.IsNotModified to check whether the returned error was
  44644. // because http.StatusNotModified was returned.
  44645. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  44646. gensupport.SetOptions(c.urlParams_, opts...)
  44647. res, err := c.doRequest("json")
  44648. if res != nil && res.StatusCode == http.StatusNotModified {
  44649. if res.Body != nil {
  44650. res.Body.Close()
  44651. }
  44652. return nil, &googleapi.Error{
  44653. Code: res.StatusCode,
  44654. Header: res.Header,
  44655. }
  44656. }
  44657. if err != nil {
  44658. return nil, err
  44659. }
  44660. defer googleapi.CloseBody(res)
  44661. if err := googleapi.CheckResponse(res); err != nil {
  44662. return nil, err
  44663. }
  44664. ret := &ForwardingRuleList{
  44665. ServerResponse: googleapi.ServerResponse{
  44666. Header: res.Header,
  44667. HTTPStatusCode: res.StatusCode,
  44668. },
  44669. }
  44670. target := &ret
  44671. if err := gensupport.DecodeResponse(target, res); err != nil {
  44672. return nil, err
  44673. }
  44674. return ret, nil
  44675. // {
  44676. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  44677. // "httpMethod": "GET",
  44678. // "id": "compute.globalForwardingRules.list",
  44679. // "parameterOrder": [
  44680. // "project"
  44681. // ],
  44682. // "parameters": {
  44683. // "filter": {
  44684. // "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).",
  44685. // "location": "query",
  44686. // "type": "string"
  44687. // },
  44688. // "maxResults": {
  44689. // "default": "500",
  44690. // "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)",
  44691. // "format": "uint32",
  44692. // "location": "query",
  44693. // "minimum": "0",
  44694. // "type": "integer"
  44695. // },
  44696. // "orderBy": {
  44697. // "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.",
  44698. // "location": "query",
  44699. // "type": "string"
  44700. // },
  44701. // "pageToken": {
  44702. // "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.",
  44703. // "location": "query",
  44704. // "type": "string"
  44705. // },
  44706. // "project": {
  44707. // "description": "Project ID for this request.",
  44708. // "location": "path",
  44709. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44710. // "required": true,
  44711. // "type": "string"
  44712. // }
  44713. // },
  44714. // "path": "{project}/global/forwardingRules",
  44715. // "response": {
  44716. // "$ref": "ForwardingRuleList"
  44717. // },
  44718. // "scopes": [
  44719. // "https://www.googleapis.com/auth/cloud-platform",
  44720. // "https://www.googleapis.com/auth/compute",
  44721. // "https://www.googleapis.com/auth/compute.readonly"
  44722. // ]
  44723. // }
  44724. }
  44725. // Pages invokes f for each page of results.
  44726. // A non-nil error returned from f will halt the iteration.
  44727. // The provided context supersedes any context provided to the Context method.
  44728. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  44729. c.ctx_ = ctx
  44730. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44731. for {
  44732. x, err := c.Do()
  44733. if err != nil {
  44734. return err
  44735. }
  44736. if err := f(x); err != nil {
  44737. return err
  44738. }
  44739. if x.NextPageToken == "" {
  44740. return nil
  44741. }
  44742. c.PageToken(x.NextPageToken)
  44743. }
  44744. }
  44745. // method id "compute.globalForwardingRules.setLabels":
  44746. type GlobalForwardingRulesSetLabelsCall struct {
  44747. s *Service
  44748. project string
  44749. resource string
  44750. globalsetlabelsrequest *GlobalSetLabelsRequest
  44751. urlParams_ gensupport.URLParams
  44752. ctx_ context.Context
  44753. header_ http.Header
  44754. }
  44755. // SetLabels: Sets the labels on the specified resource. To learn more
  44756. // about labels, read the Labeling Resources documentation.
  44757. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  44758. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44759. c.project = project
  44760. c.resource = resource
  44761. c.globalsetlabelsrequest = globalsetlabelsrequest
  44762. return c
  44763. }
  44764. // Fields allows partial responses to be retrieved. See
  44765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44766. // for more information.
  44767. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  44768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44769. return c
  44770. }
  44771. // Context sets the context to be used in this call's Do method. Any
  44772. // pending HTTP request will be aborted if the provided context is
  44773. // canceled.
  44774. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  44775. c.ctx_ = ctx
  44776. return c
  44777. }
  44778. // Header returns an http.Header that can be modified by the caller to
  44779. // add HTTP headers to the request.
  44780. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  44781. if c.header_ == nil {
  44782. c.header_ = make(http.Header)
  44783. }
  44784. return c.header_
  44785. }
  44786. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  44787. reqHeaders := make(http.Header)
  44788. for k, v := range c.header_ {
  44789. reqHeaders[k] = v
  44790. }
  44791. reqHeaders.Set("User-Agent", c.s.userAgent())
  44792. var body io.Reader = nil
  44793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  44794. if err != nil {
  44795. return nil, err
  44796. }
  44797. reqHeaders.Set("Content-Type", "application/json")
  44798. c.urlParams_.Set("alt", alt)
  44799. c.urlParams_.Set("prettyPrint", "false")
  44800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  44801. urls += "?" + c.urlParams_.Encode()
  44802. req, err := http.NewRequest("POST", urls, body)
  44803. if err != nil {
  44804. return nil, err
  44805. }
  44806. req.Header = reqHeaders
  44807. googleapi.Expand(req.URL, map[string]string{
  44808. "project": c.project,
  44809. "resource": c.resource,
  44810. })
  44811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44812. }
  44813. // Do executes the "compute.globalForwardingRules.setLabels" call.
  44814. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44815. // status code is an error. Response headers are in either
  44816. // *Operation.ServerResponse.Header or (if a response was returned at
  44817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44818. // to check whether the returned error was because
  44819. // http.StatusNotModified was returned.
  44820. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44821. gensupport.SetOptions(c.urlParams_, opts...)
  44822. res, err := c.doRequest("json")
  44823. if res != nil && res.StatusCode == http.StatusNotModified {
  44824. if res.Body != nil {
  44825. res.Body.Close()
  44826. }
  44827. return nil, &googleapi.Error{
  44828. Code: res.StatusCode,
  44829. Header: res.Header,
  44830. }
  44831. }
  44832. if err != nil {
  44833. return nil, err
  44834. }
  44835. defer googleapi.CloseBody(res)
  44836. if err := googleapi.CheckResponse(res); err != nil {
  44837. return nil, err
  44838. }
  44839. ret := &Operation{
  44840. ServerResponse: googleapi.ServerResponse{
  44841. Header: res.Header,
  44842. HTTPStatusCode: res.StatusCode,
  44843. },
  44844. }
  44845. target := &ret
  44846. if err := gensupport.DecodeResponse(target, res); err != nil {
  44847. return nil, err
  44848. }
  44849. return ret, nil
  44850. // {
  44851. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  44852. // "httpMethod": "POST",
  44853. // "id": "compute.globalForwardingRules.setLabels",
  44854. // "parameterOrder": [
  44855. // "project",
  44856. // "resource"
  44857. // ],
  44858. // "parameters": {
  44859. // "project": {
  44860. // "description": "Project ID for this request.",
  44861. // "location": "path",
  44862. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44863. // "required": true,
  44864. // "type": "string"
  44865. // },
  44866. // "resource": {
  44867. // "description": "Name or id of the resource for this request.",
  44868. // "location": "path",
  44869. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44870. // "required": true,
  44871. // "type": "string"
  44872. // }
  44873. // },
  44874. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  44875. // "request": {
  44876. // "$ref": "GlobalSetLabelsRequest"
  44877. // },
  44878. // "response": {
  44879. // "$ref": "Operation"
  44880. // },
  44881. // "scopes": [
  44882. // "https://www.googleapis.com/auth/cloud-platform",
  44883. // "https://www.googleapis.com/auth/compute"
  44884. // ]
  44885. // }
  44886. }
  44887. // method id "compute.globalForwardingRules.setTarget":
  44888. type GlobalForwardingRulesSetTargetCall struct {
  44889. s *Service
  44890. project string
  44891. forwardingRule string
  44892. targetreference *TargetReference
  44893. urlParams_ gensupport.URLParams
  44894. ctx_ context.Context
  44895. header_ http.Header
  44896. }
  44897. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  44898. // The new target should be of the same type as the old target.
  44899. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  44900. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  44901. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44902. c.project = project
  44903. c.forwardingRule = forwardingRule
  44904. c.targetreference = targetreference
  44905. return c
  44906. }
  44907. // RequestId sets the optional parameter "requestId": An optional
  44908. // request ID to identify requests. Specify a unique request ID so that
  44909. // if you must retry your request, the server will know to ignore the
  44910. // request if it has already been completed.
  44911. //
  44912. // For example, consider a situation where you make an initial request
  44913. // and the request times out. If you make the request again with the
  44914. // same request ID, the server can check if original operation with the
  44915. // same request ID was received, and if so, will ignore the second
  44916. // request. This prevents clients from accidentally creating duplicate
  44917. // commitments.
  44918. //
  44919. // The request ID must be a valid UUID with the exception that zero UUID
  44920. // is not supported (00000000-0000-0000-0000-000000000000).
  44921. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  44922. c.urlParams_.Set("requestId", requestId)
  44923. return c
  44924. }
  44925. // Fields allows partial responses to be retrieved. See
  44926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44927. // for more information.
  44928. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  44929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44930. return c
  44931. }
  44932. // Context sets the context to be used in this call's Do method. Any
  44933. // pending HTTP request will be aborted if the provided context is
  44934. // canceled.
  44935. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  44936. c.ctx_ = ctx
  44937. return c
  44938. }
  44939. // Header returns an http.Header that can be modified by the caller to
  44940. // add HTTP headers to the request.
  44941. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  44942. if c.header_ == nil {
  44943. c.header_ = make(http.Header)
  44944. }
  44945. return c.header_
  44946. }
  44947. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  44948. reqHeaders := make(http.Header)
  44949. for k, v := range c.header_ {
  44950. reqHeaders[k] = v
  44951. }
  44952. reqHeaders.Set("User-Agent", c.s.userAgent())
  44953. var body io.Reader = nil
  44954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  44955. if err != nil {
  44956. return nil, err
  44957. }
  44958. reqHeaders.Set("Content-Type", "application/json")
  44959. c.urlParams_.Set("alt", alt)
  44960. c.urlParams_.Set("prettyPrint", "false")
  44961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  44962. urls += "?" + c.urlParams_.Encode()
  44963. req, err := http.NewRequest("POST", urls, body)
  44964. if err != nil {
  44965. return nil, err
  44966. }
  44967. req.Header = reqHeaders
  44968. googleapi.Expand(req.URL, map[string]string{
  44969. "project": c.project,
  44970. "forwardingRule": c.forwardingRule,
  44971. })
  44972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44973. }
  44974. // Do executes the "compute.globalForwardingRules.setTarget" call.
  44975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44976. // status code is an error. Response headers are in either
  44977. // *Operation.ServerResponse.Header or (if a response was returned at
  44978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44979. // to check whether the returned error was because
  44980. // http.StatusNotModified was returned.
  44981. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44982. gensupport.SetOptions(c.urlParams_, opts...)
  44983. res, err := c.doRequest("json")
  44984. if res != nil && res.StatusCode == http.StatusNotModified {
  44985. if res.Body != nil {
  44986. res.Body.Close()
  44987. }
  44988. return nil, &googleapi.Error{
  44989. Code: res.StatusCode,
  44990. Header: res.Header,
  44991. }
  44992. }
  44993. if err != nil {
  44994. return nil, err
  44995. }
  44996. defer googleapi.CloseBody(res)
  44997. if err := googleapi.CheckResponse(res); err != nil {
  44998. return nil, err
  44999. }
  45000. ret := &Operation{
  45001. ServerResponse: googleapi.ServerResponse{
  45002. Header: res.Header,
  45003. HTTPStatusCode: res.StatusCode,
  45004. },
  45005. }
  45006. target := &ret
  45007. if err := gensupport.DecodeResponse(target, res); err != nil {
  45008. return nil, err
  45009. }
  45010. return ret, nil
  45011. // {
  45012. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  45013. // "httpMethod": "POST",
  45014. // "id": "compute.globalForwardingRules.setTarget",
  45015. // "parameterOrder": [
  45016. // "project",
  45017. // "forwardingRule"
  45018. // ],
  45019. // "parameters": {
  45020. // "forwardingRule": {
  45021. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  45022. // "location": "path",
  45023. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45024. // "required": true,
  45025. // "type": "string"
  45026. // },
  45027. // "project": {
  45028. // "description": "Project ID for this request.",
  45029. // "location": "path",
  45030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45031. // "required": true,
  45032. // "type": "string"
  45033. // },
  45034. // "requestId": {
  45035. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45036. // "location": "query",
  45037. // "type": "string"
  45038. // }
  45039. // },
  45040. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  45041. // "request": {
  45042. // "$ref": "TargetReference"
  45043. // },
  45044. // "response": {
  45045. // "$ref": "Operation"
  45046. // },
  45047. // "scopes": [
  45048. // "https://www.googleapis.com/auth/cloud-platform",
  45049. // "https://www.googleapis.com/auth/compute"
  45050. // ]
  45051. // }
  45052. }
  45053. // method id "compute.globalForwardingRules.testIamPermissions":
  45054. type GlobalForwardingRulesTestIamPermissionsCall struct {
  45055. s *Service
  45056. project string
  45057. resource string
  45058. testpermissionsrequest *TestPermissionsRequest
  45059. urlParams_ gensupport.URLParams
  45060. ctx_ context.Context
  45061. header_ http.Header
  45062. }
  45063. // TestIamPermissions: Returns permissions that a caller has on the
  45064. // specified resource.
  45065. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  45066. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45067. c.project = project
  45068. c.resource = resource
  45069. c.testpermissionsrequest = testpermissionsrequest
  45070. return c
  45071. }
  45072. // Fields allows partial responses to be retrieved. See
  45073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45074. // for more information.
  45075. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  45076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45077. return c
  45078. }
  45079. // Context sets the context to be used in this call's Do method. Any
  45080. // pending HTTP request will be aborted if the provided context is
  45081. // canceled.
  45082. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  45083. c.ctx_ = ctx
  45084. return c
  45085. }
  45086. // Header returns an http.Header that can be modified by the caller to
  45087. // add HTTP headers to the request.
  45088. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  45089. if c.header_ == nil {
  45090. c.header_ = make(http.Header)
  45091. }
  45092. return c.header_
  45093. }
  45094. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45095. reqHeaders := make(http.Header)
  45096. for k, v := range c.header_ {
  45097. reqHeaders[k] = v
  45098. }
  45099. reqHeaders.Set("User-Agent", c.s.userAgent())
  45100. var body io.Reader = nil
  45101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45102. if err != nil {
  45103. return nil, err
  45104. }
  45105. reqHeaders.Set("Content-Type", "application/json")
  45106. c.urlParams_.Set("alt", alt)
  45107. c.urlParams_.Set("prettyPrint", "false")
  45108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  45109. urls += "?" + c.urlParams_.Encode()
  45110. req, err := http.NewRequest("POST", urls, body)
  45111. if err != nil {
  45112. return nil, err
  45113. }
  45114. req.Header = reqHeaders
  45115. googleapi.Expand(req.URL, map[string]string{
  45116. "project": c.project,
  45117. "resource": c.resource,
  45118. })
  45119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45120. }
  45121. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  45122. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45123. // non-2xx status code is an error. Response headers are in either
  45124. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45125. // returned at all) in error.(*googleapi.Error).Header. Use
  45126. // googleapi.IsNotModified to check whether the returned error was
  45127. // because http.StatusNotModified was returned.
  45128. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45129. gensupport.SetOptions(c.urlParams_, opts...)
  45130. res, err := c.doRequest("json")
  45131. if res != nil && res.StatusCode == http.StatusNotModified {
  45132. if res.Body != nil {
  45133. res.Body.Close()
  45134. }
  45135. return nil, &googleapi.Error{
  45136. Code: res.StatusCode,
  45137. Header: res.Header,
  45138. }
  45139. }
  45140. if err != nil {
  45141. return nil, err
  45142. }
  45143. defer googleapi.CloseBody(res)
  45144. if err := googleapi.CheckResponse(res); err != nil {
  45145. return nil, err
  45146. }
  45147. ret := &TestPermissionsResponse{
  45148. ServerResponse: googleapi.ServerResponse{
  45149. Header: res.Header,
  45150. HTTPStatusCode: res.StatusCode,
  45151. },
  45152. }
  45153. target := &ret
  45154. if err := gensupport.DecodeResponse(target, res); err != nil {
  45155. return nil, err
  45156. }
  45157. return ret, nil
  45158. // {
  45159. // "description": "Returns permissions that a caller has on the specified resource.",
  45160. // "httpMethod": "POST",
  45161. // "id": "compute.globalForwardingRules.testIamPermissions",
  45162. // "parameterOrder": [
  45163. // "project",
  45164. // "resource"
  45165. // ],
  45166. // "parameters": {
  45167. // "project": {
  45168. // "description": "Project ID for this request.",
  45169. // "location": "path",
  45170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45171. // "required": true,
  45172. // "type": "string"
  45173. // },
  45174. // "resource": {
  45175. // "description": "Name or id of the resource for this request.",
  45176. // "location": "path",
  45177. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45178. // "required": true,
  45179. // "type": "string"
  45180. // }
  45181. // },
  45182. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  45183. // "request": {
  45184. // "$ref": "TestPermissionsRequest"
  45185. // },
  45186. // "response": {
  45187. // "$ref": "TestPermissionsResponse"
  45188. // },
  45189. // "scopes": [
  45190. // "https://www.googleapis.com/auth/cloud-platform",
  45191. // "https://www.googleapis.com/auth/compute",
  45192. // "https://www.googleapis.com/auth/compute.readonly"
  45193. // ]
  45194. // }
  45195. }
  45196. // method id "compute.globalOperations.aggregatedList":
  45197. type GlobalOperationsAggregatedListCall struct {
  45198. s *Service
  45199. project string
  45200. urlParams_ gensupport.URLParams
  45201. ifNoneMatch_ string
  45202. ctx_ context.Context
  45203. header_ http.Header
  45204. }
  45205. // AggregatedList: Retrieves an aggregated list of all operations.
  45206. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  45207. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  45208. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45209. c.project = project
  45210. return c
  45211. }
  45212. // Filter sets the optional parameter "filter": A filter expression that
  45213. // filters resources listed in the response. The expression must specify
  45214. // the field name, a comparison operator, and the value that you want to
  45215. // use for filtering. The value must be a string, a number, or a
  45216. // boolean. The comparison operator must be either =, !=, >, or <.
  45217. //
  45218. // For example, if you are filtering Compute Engine instances, you can
  45219. // exclude instances named example-instance by specifying name !=
  45220. // example-instance.
  45221. //
  45222. // You can also filter nested fields. For example, you could specify
  45223. // scheduling.automaticRestart = false to include instances only if they
  45224. // are not scheduled for automatic restarts. You can use filtering on
  45225. // nested fields to filter based on resource labels.
  45226. //
  45227. // To filter on multiple expressions, provide each separate expression
  45228. // within parentheses. For example, (scheduling.automaticRestart = true)
  45229. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45230. // AND expression. However, you can include AND and OR expressions
  45231. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45232. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45233. // true).
  45234. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  45235. c.urlParams_.Set("filter", filter)
  45236. return c
  45237. }
  45238. // MaxResults sets the optional parameter "maxResults": The maximum
  45239. // number of results per page that should be returned. If the number of
  45240. // available results is larger than maxResults, Compute Engine returns a
  45241. // nextPageToken that can be used to get the next page of results in
  45242. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45243. // (Default: 500)
  45244. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  45245. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45246. return c
  45247. }
  45248. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45249. // a certain order. By default, results are returned in alphanumerical
  45250. // order based on the resource name.
  45251. //
  45252. // You can also sort results in descending order based on the creation
  45253. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45254. // based on the creationTimestamp field in reverse chronological order
  45255. // (newest result first). Use this to sort resources like operations so
  45256. // that the newest operation is returned first.
  45257. //
  45258. // Currently, only sorting by name or creationTimestamp desc is
  45259. // supported.
  45260. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  45261. c.urlParams_.Set("orderBy", orderBy)
  45262. return c
  45263. }
  45264. // PageToken sets the optional parameter "pageToken": Specifies a page
  45265. // token to use. Set pageToken to the nextPageToken returned by a
  45266. // previous list request to get the next page of results.
  45267. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  45268. c.urlParams_.Set("pageToken", pageToken)
  45269. return c
  45270. }
  45271. // Fields allows partial responses to be retrieved. See
  45272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45273. // for more information.
  45274. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  45275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45276. return c
  45277. }
  45278. // IfNoneMatch sets the optional parameter which makes the operation
  45279. // fail if the object's ETag matches the given value. This is useful for
  45280. // getting updates only after the object has changed since the last
  45281. // request. Use googleapi.IsNotModified to check whether the response
  45282. // error from Do is the result of In-None-Match.
  45283. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  45284. c.ifNoneMatch_ = entityTag
  45285. return c
  45286. }
  45287. // Context sets the context to be used in this call's Do method. Any
  45288. // pending HTTP request will be aborted if the provided context is
  45289. // canceled.
  45290. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  45291. c.ctx_ = ctx
  45292. return c
  45293. }
  45294. // Header returns an http.Header that can be modified by the caller to
  45295. // add HTTP headers to the request.
  45296. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  45297. if c.header_ == nil {
  45298. c.header_ = make(http.Header)
  45299. }
  45300. return c.header_
  45301. }
  45302. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  45303. reqHeaders := make(http.Header)
  45304. for k, v := range c.header_ {
  45305. reqHeaders[k] = v
  45306. }
  45307. reqHeaders.Set("User-Agent", c.s.userAgent())
  45308. if c.ifNoneMatch_ != "" {
  45309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45310. }
  45311. var body io.Reader = nil
  45312. c.urlParams_.Set("alt", alt)
  45313. c.urlParams_.Set("prettyPrint", "false")
  45314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  45315. urls += "?" + c.urlParams_.Encode()
  45316. req, err := http.NewRequest("GET", urls, body)
  45317. if err != nil {
  45318. return nil, err
  45319. }
  45320. req.Header = reqHeaders
  45321. googleapi.Expand(req.URL, map[string]string{
  45322. "project": c.project,
  45323. })
  45324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45325. }
  45326. // Do executes the "compute.globalOperations.aggregatedList" call.
  45327. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  45328. // non-2xx status code is an error. Response headers are in either
  45329. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  45330. // returned at all) in error.(*googleapi.Error).Header. Use
  45331. // googleapi.IsNotModified to check whether the returned error was
  45332. // because http.StatusNotModified was returned.
  45333. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  45334. gensupport.SetOptions(c.urlParams_, opts...)
  45335. res, err := c.doRequest("json")
  45336. if res != nil && res.StatusCode == http.StatusNotModified {
  45337. if res.Body != nil {
  45338. res.Body.Close()
  45339. }
  45340. return nil, &googleapi.Error{
  45341. Code: res.StatusCode,
  45342. Header: res.Header,
  45343. }
  45344. }
  45345. if err != nil {
  45346. return nil, err
  45347. }
  45348. defer googleapi.CloseBody(res)
  45349. if err := googleapi.CheckResponse(res); err != nil {
  45350. return nil, err
  45351. }
  45352. ret := &OperationAggregatedList{
  45353. ServerResponse: googleapi.ServerResponse{
  45354. Header: res.Header,
  45355. HTTPStatusCode: res.StatusCode,
  45356. },
  45357. }
  45358. target := &ret
  45359. if err := gensupport.DecodeResponse(target, res); err != nil {
  45360. return nil, err
  45361. }
  45362. return ret, nil
  45363. // {
  45364. // "description": "Retrieves an aggregated list of all operations.",
  45365. // "httpMethod": "GET",
  45366. // "id": "compute.globalOperations.aggregatedList",
  45367. // "parameterOrder": [
  45368. // "project"
  45369. // ],
  45370. // "parameters": {
  45371. // "filter": {
  45372. // "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).",
  45373. // "location": "query",
  45374. // "type": "string"
  45375. // },
  45376. // "maxResults": {
  45377. // "default": "500",
  45378. // "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)",
  45379. // "format": "uint32",
  45380. // "location": "query",
  45381. // "minimum": "0",
  45382. // "type": "integer"
  45383. // },
  45384. // "orderBy": {
  45385. // "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.",
  45386. // "location": "query",
  45387. // "type": "string"
  45388. // },
  45389. // "pageToken": {
  45390. // "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.",
  45391. // "location": "query",
  45392. // "type": "string"
  45393. // },
  45394. // "project": {
  45395. // "description": "Project ID for this request.",
  45396. // "location": "path",
  45397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45398. // "required": true,
  45399. // "type": "string"
  45400. // }
  45401. // },
  45402. // "path": "{project}/aggregated/operations",
  45403. // "response": {
  45404. // "$ref": "OperationAggregatedList"
  45405. // },
  45406. // "scopes": [
  45407. // "https://www.googleapis.com/auth/cloud-platform",
  45408. // "https://www.googleapis.com/auth/compute",
  45409. // "https://www.googleapis.com/auth/compute.readonly"
  45410. // ]
  45411. // }
  45412. }
  45413. // Pages invokes f for each page of results.
  45414. // A non-nil error returned from f will halt the iteration.
  45415. // The provided context supersedes any context provided to the Context method.
  45416. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  45417. c.ctx_ = ctx
  45418. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45419. for {
  45420. x, err := c.Do()
  45421. if err != nil {
  45422. return err
  45423. }
  45424. if err := f(x); err != nil {
  45425. return err
  45426. }
  45427. if x.NextPageToken == "" {
  45428. return nil
  45429. }
  45430. c.PageToken(x.NextPageToken)
  45431. }
  45432. }
  45433. // method id "compute.globalOperations.delete":
  45434. type GlobalOperationsDeleteCall struct {
  45435. s *Service
  45436. project string
  45437. operation string
  45438. urlParams_ gensupport.URLParams
  45439. ctx_ context.Context
  45440. header_ http.Header
  45441. }
  45442. // Delete: Deletes the specified Operations resource.
  45443. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  45444. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  45445. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45446. c.project = project
  45447. c.operation = operation
  45448. return c
  45449. }
  45450. // Fields allows partial responses to be retrieved. See
  45451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45452. // for more information.
  45453. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  45454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45455. return c
  45456. }
  45457. // Context sets the context to be used in this call's Do method. Any
  45458. // pending HTTP request will be aborted if the provided context is
  45459. // canceled.
  45460. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  45461. c.ctx_ = ctx
  45462. return c
  45463. }
  45464. // Header returns an http.Header that can be modified by the caller to
  45465. // add HTTP headers to the request.
  45466. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  45467. if c.header_ == nil {
  45468. c.header_ = make(http.Header)
  45469. }
  45470. return c.header_
  45471. }
  45472. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  45473. reqHeaders := make(http.Header)
  45474. for k, v := range c.header_ {
  45475. reqHeaders[k] = v
  45476. }
  45477. reqHeaders.Set("User-Agent", c.s.userAgent())
  45478. var body io.Reader = nil
  45479. c.urlParams_.Set("alt", alt)
  45480. c.urlParams_.Set("prettyPrint", "false")
  45481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  45482. urls += "?" + c.urlParams_.Encode()
  45483. req, err := http.NewRequest("DELETE", urls, body)
  45484. if err != nil {
  45485. return nil, err
  45486. }
  45487. req.Header = reqHeaders
  45488. googleapi.Expand(req.URL, map[string]string{
  45489. "project": c.project,
  45490. "operation": c.operation,
  45491. })
  45492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45493. }
  45494. // Do executes the "compute.globalOperations.delete" call.
  45495. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  45496. gensupport.SetOptions(c.urlParams_, opts...)
  45497. res, err := c.doRequest("json")
  45498. if err != nil {
  45499. return err
  45500. }
  45501. defer googleapi.CloseBody(res)
  45502. if err := googleapi.CheckResponse(res); err != nil {
  45503. return err
  45504. }
  45505. return nil
  45506. // {
  45507. // "description": "Deletes the specified Operations resource.",
  45508. // "httpMethod": "DELETE",
  45509. // "id": "compute.globalOperations.delete",
  45510. // "parameterOrder": [
  45511. // "project",
  45512. // "operation"
  45513. // ],
  45514. // "parameters": {
  45515. // "operation": {
  45516. // "description": "Name of the Operations resource to delete.",
  45517. // "location": "path",
  45518. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45519. // "required": true,
  45520. // "type": "string"
  45521. // },
  45522. // "project": {
  45523. // "description": "Project ID for this request.",
  45524. // "location": "path",
  45525. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45526. // "required": true,
  45527. // "type": "string"
  45528. // }
  45529. // },
  45530. // "path": "{project}/global/operations/{operation}",
  45531. // "scopes": [
  45532. // "https://www.googleapis.com/auth/cloud-platform",
  45533. // "https://www.googleapis.com/auth/compute"
  45534. // ]
  45535. // }
  45536. }
  45537. // method id "compute.globalOperations.get":
  45538. type GlobalOperationsGetCall struct {
  45539. s *Service
  45540. project string
  45541. operation string
  45542. urlParams_ gensupport.URLParams
  45543. ifNoneMatch_ string
  45544. ctx_ context.Context
  45545. header_ http.Header
  45546. }
  45547. // Get: Retrieves the specified Operations resource. Gets a list of
  45548. // operations by making a list() request.
  45549. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  45550. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  45551. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45552. c.project = project
  45553. c.operation = operation
  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 *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  45560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45561. return c
  45562. }
  45563. // IfNoneMatch sets the optional parameter which makes the operation
  45564. // fail if the object's ETag matches the given value. This is useful for
  45565. // getting updates only after the object has changed since the last
  45566. // request. Use googleapi.IsNotModified to check whether the response
  45567. // error from Do is the result of In-None-Match.
  45568. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  45569. c.ifNoneMatch_ = entityTag
  45570. return c
  45571. }
  45572. // Context sets the context to be used in this call's Do method. Any
  45573. // pending HTTP request will be aborted if the provided context is
  45574. // canceled.
  45575. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  45576. c.ctx_ = ctx
  45577. return c
  45578. }
  45579. // Header returns an http.Header that can be modified by the caller to
  45580. // add HTTP headers to the request.
  45581. func (c *GlobalOperationsGetCall) Header() http.Header {
  45582. if c.header_ == nil {
  45583. c.header_ = make(http.Header)
  45584. }
  45585. return c.header_
  45586. }
  45587. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  45588. reqHeaders := make(http.Header)
  45589. for k, v := range c.header_ {
  45590. reqHeaders[k] = v
  45591. }
  45592. reqHeaders.Set("User-Agent", c.s.userAgent())
  45593. if c.ifNoneMatch_ != "" {
  45594. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45595. }
  45596. var body io.Reader = nil
  45597. c.urlParams_.Set("alt", alt)
  45598. c.urlParams_.Set("prettyPrint", "false")
  45599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  45600. urls += "?" + c.urlParams_.Encode()
  45601. req, err := http.NewRequest("GET", urls, body)
  45602. if err != nil {
  45603. return nil, err
  45604. }
  45605. req.Header = reqHeaders
  45606. googleapi.Expand(req.URL, map[string]string{
  45607. "project": c.project,
  45608. "operation": c.operation,
  45609. })
  45610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45611. }
  45612. // Do executes the "compute.globalOperations.get" call.
  45613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45614. // status code is an error. Response headers are in either
  45615. // *Operation.ServerResponse.Header or (if a response was returned at
  45616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45617. // to check whether the returned error was because
  45618. // http.StatusNotModified was returned.
  45619. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45620. gensupport.SetOptions(c.urlParams_, opts...)
  45621. res, err := c.doRequest("json")
  45622. if res != nil && res.StatusCode == http.StatusNotModified {
  45623. if res.Body != nil {
  45624. res.Body.Close()
  45625. }
  45626. return nil, &googleapi.Error{
  45627. Code: res.StatusCode,
  45628. Header: res.Header,
  45629. }
  45630. }
  45631. if err != nil {
  45632. return nil, err
  45633. }
  45634. defer googleapi.CloseBody(res)
  45635. if err := googleapi.CheckResponse(res); err != nil {
  45636. return nil, err
  45637. }
  45638. ret := &Operation{
  45639. ServerResponse: googleapi.ServerResponse{
  45640. Header: res.Header,
  45641. HTTPStatusCode: res.StatusCode,
  45642. },
  45643. }
  45644. target := &ret
  45645. if err := gensupport.DecodeResponse(target, res); err != nil {
  45646. return nil, err
  45647. }
  45648. return ret, nil
  45649. // {
  45650. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  45651. // "httpMethod": "GET",
  45652. // "id": "compute.globalOperations.get",
  45653. // "parameterOrder": [
  45654. // "project",
  45655. // "operation"
  45656. // ],
  45657. // "parameters": {
  45658. // "operation": {
  45659. // "description": "Name of the Operations resource to return.",
  45660. // "location": "path",
  45661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45662. // "required": true,
  45663. // "type": "string"
  45664. // },
  45665. // "project": {
  45666. // "description": "Project ID for this request.",
  45667. // "location": "path",
  45668. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45669. // "required": true,
  45670. // "type": "string"
  45671. // }
  45672. // },
  45673. // "path": "{project}/global/operations/{operation}",
  45674. // "response": {
  45675. // "$ref": "Operation"
  45676. // },
  45677. // "scopes": [
  45678. // "https://www.googleapis.com/auth/cloud-platform",
  45679. // "https://www.googleapis.com/auth/compute",
  45680. // "https://www.googleapis.com/auth/compute.readonly"
  45681. // ]
  45682. // }
  45683. }
  45684. // method id "compute.globalOperations.list":
  45685. type GlobalOperationsListCall struct {
  45686. s *Service
  45687. project string
  45688. urlParams_ gensupport.URLParams
  45689. ifNoneMatch_ string
  45690. ctx_ context.Context
  45691. header_ http.Header
  45692. }
  45693. // List: Retrieves a list of Operation resources contained within the
  45694. // specified project.
  45695. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  45696. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  45697. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45698. c.project = project
  45699. return c
  45700. }
  45701. // Filter sets the optional parameter "filter": A filter expression that
  45702. // filters resources listed in the response. The expression must specify
  45703. // the field name, a comparison operator, and the value that you want to
  45704. // use for filtering. The value must be a string, a number, or a
  45705. // boolean. The comparison operator must be either =, !=, >, or <.
  45706. //
  45707. // For example, if you are filtering Compute Engine instances, you can
  45708. // exclude instances named example-instance by specifying name !=
  45709. // example-instance.
  45710. //
  45711. // You can also filter nested fields. For example, you could specify
  45712. // scheduling.automaticRestart = false to include instances only if they
  45713. // are not scheduled for automatic restarts. You can use filtering on
  45714. // nested fields to filter based on resource labels.
  45715. //
  45716. // To filter on multiple expressions, provide each separate expression
  45717. // within parentheses. For example, (scheduling.automaticRestart = true)
  45718. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45719. // AND expression. However, you can include AND and OR expressions
  45720. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45721. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45722. // true).
  45723. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  45724. c.urlParams_.Set("filter", filter)
  45725. return c
  45726. }
  45727. // MaxResults sets the optional parameter "maxResults": The maximum
  45728. // number of results per page that should be returned. If the number of
  45729. // available results is larger than maxResults, Compute Engine returns a
  45730. // nextPageToken that can be used to get the next page of results in
  45731. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45732. // (Default: 500)
  45733. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  45734. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45735. return c
  45736. }
  45737. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45738. // a certain order. By default, results are returned in alphanumerical
  45739. // order based on the resource name.
  45740. //
  45741. // You can also sort results in descending order based on the creation
  45742. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45743. // based on the creationTimestamp field in reverse chronological order
  45744. // (newest result first). Use this to sort resources like operations so
  45745. // that the newest operation is returned first.
  45746. //
  45747. // Currently, only sorting by name or creationTimestamp desc is
  45748. // supported.
  45749. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  45750. c.urlParams_.Set("orderBy", orderBy)
  45751. return c
  45752. }
  45753. // PageToken sets the optional parameter "pageToken": Specifies a page
  45754. // token to use. Set pageToken to the nextPageToken returned by a
  45755. // previous list request to get the next page of results.
  45756. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  45757. c.urlParams_.Set("pageToken", pageToken)
  45758. return c
  45759. }
  45760. // Fields allows partial responses to be retrieved. See
  45761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45762. // for more information.
  45763. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  45764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45765. return c
  45766. }
  45767. // IfNoneMatch sets the optional parameter which makes the operation
  45768. // fail if the object's ETag matches the given value. This is useful for
  45769. // getting updates only after the object has changed since the last
  45770. // request. Use googleapi.IsNotModified to check whether the response
  45771. // error from Do is the result of In-None-Match.
  45772. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  45773. c.ifNoneMatch_ = entityTag
  45774. return c
  45775. }
  45776. // Context sets the context to be used in this call's Do method. Any
  45777. // pending HTTP request will be aborted if the provided context is
  45778. // canceled.
  45779. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  45780. c.ctx_ = ctx
  45781. return c
  45782. }
  45783. // Header returns an http.Header that can be modified by the caller to
  45784. // add HTTP headers to the request.
  45785. func (c *GlobalOperationsListCall) Header() http.Header {
  45786. if c.header_ == nil {
  45787. c.header_ = make(http.Header)
  45788. }
  45789. return c.header_
  45790. }
  45791. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  45792. reqHeaders := make(http.Header)
  45793. for k, v := range c.header_ {
  45794. reqHeaders[k] = v
  45795. }
  45796. reqHeaders.Set("User-Agent", c.s.userAgent())
  45797. if c.ifNoneMatch_ != "" {
  45798. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45799. }
  45800. var body io.Reader = nil
  45801. c.urlParams_.Set("alt", alt)
  45802. c.urlParams_.Set("prettyPrint", "false")
  45803. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  45804. urls += "?" + c.urlParams_.Encode()
  45805. req, err := http.NewRequest("GET", urls, body)
  45806. if err != nil {
  45807. return nil, err
  45808. }
  45809. req.Header = reqHeaders
  45810. googleapi.Expand(req.URL, map[string]string{
  45811. "project": c.project,
  45812. })
  45813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45814. }
  45815. // Do executes the "compute.globalOperations.list" call.
  45816. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  45817. // status code is an error. Response headers are in either
  45818. // *OperationList.ServerResponse.Header or (if a response was returned
  45819. // at all) in error.(*googleapi.Error).Header. Use
  45820. // googleapi.IsNotModified to check whether the returned error was
  45821. // because http.StatusNotModified was returned.
  45822. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  45823. gensupport.SetOptions(c.urlParams_, opts...)
  45824. res, err := c.doRequest("json")
  45825. if res != nil && res.StatusCode == http.StatusNotModified {
  45826. if res.Body != nil {
  45827. res.Body.Close()
  45828. }
  45829. return nil, &googleapi.Error{
  45830. Code: res.StatusCode,
  45831. Header: res.Header,
  45832. }
  45833. }
  45834. if err != nil {
  45835. return nil, err
  45836. }
  45837. defer googleapi.CloseBody(res)
  45838. if err := googleapi.CheckResponse(res); err != nil {
  45839. return nil, err
  45840. }
  45841. ret := &OperationList{
  45842. ServerResponse: googleapi.ServerResponse{
  45843. Header: res.Header,
  45844. HTTPStatusCode: res.StatusCode,
  45845. },
  45846. }
  45847. target := &ret
  45848. if err := gensupport.DecodeResponse(target, res); err != nil {
  45849. return nil, err
  45850. }
  45851. return ret, nil
  45852. // {
  45853. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  45854. // "httpMethod": "GET",
  45855. // "id": "compute.globalOperations.list",
  45856. // "parameterOrder": [
  45857. // "project"
  45858. // ],
  45859. // "parameters": {
  45860. // "filter": {
  45861. // "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).",
  45862. // "location": "query",
  45863. // "type": "string"
  45864. // },
  45865. // "maxResults": {
  45866. // "default": "500",
  45867. // "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)",
  45868. // "format": "uint32",
  45869. // "location": "query",
  45870. // "minimum": "0",
  45871. // "type": "integer"
  45872. // },
  45873. // "orderBy": {
  45874. // "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.",
  45875. // "location": "query",
  45876. // "type": "string"
  45877. // },
  45878. // "pageToken": {
  45879. // "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.",
  45880. // "location": "query",
  45881. // "type": "string"
  45882. // },
  45883. // "project": {
  45884. // "description": "Project ID for this request.",
  45885. // "location": "path",
  45886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45887. // "required": true,
  45888. // "type": "string"
  45889. // }
  45890. // },
  45891. // "path": "{project}/global/operations",
  45892. // "response": {
  45893. // "$ref": "OperationList"
  45894. // },
  45895. // "scopes": [
  45896. // "https://www.googleapis.com/auth/cloud-platform",
  45897. // "https://www.googleapis.com/auth/compute",
  45898. // "https://www.googleapis.com/auth/compute.readonly"
  45899. // ]
  45900. // }
  45901. }
  45902. // Pages invokes f for each page of results.
  45903. // A non-nil error returned from f will halt the iteration.
  45904. // The provided context supersedes any context provided to the Context method.
  45905. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  45906. c.ctx_ = ctx
  45907. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45908. for {
  45909. x, err := c.Do()
  45910. if err != nil {
  45911. return err
  45912. }
  45913. if err := f(x); err != nil {
  45914. return err
  45915. }
  45916. if x.NextPageToken == "" {
  45917. return nil
  45918. }
  45919. c.PageToken(x.NextPageToken)
  45920. }
  45921. }
  45922. // method id "compute.healthChecks.delete":
  45923. type HealthChecksDeleteCall struct {
  45924. s *Service
  45925. project string
  45926. healthCheck string
  45927. urlParams_ gensupport.URLParams
  45928. ctx_ context.Context
  45929. header_ http.Header
  45930. }
  45931. // Delete: Deletes the specified HealthCheck resource.
  45932. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  45933. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45934. c.project = project
  45935. c.healthCheck = healthCheck
  45936. return c
  45937. }
  45938. // RequestId sets the optional parameter "requestId": An optional
  45939. // request ID to identify requests. Specify a unique request ID so that
  45940. // if you must retry your request, the server will know to ignore the
  45941. // request if it has already been completed.
  45942. //
  45943. // For example, consider a situation where you make an initial request
  45944. // and the request times out. If you make the request again with the
  45945. // same request ID, the server can check if original operation with the
  45946. // same request ID was received, and if so, will ignore the second
  45947. // request. This prevents clients from accidentally creating duplicate
  45948. // commitments.
  45949. //
  45950. // The request ID must be a valid UUID with the exception that zero UUID
  45951. // is not supported (00000000-0000-0000-0000-000000000000).
  45952. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  45953. c.urlParams_.Set("requestId", requestId)
  45954. return c
  45955. }
  45956. // Fields allows partial responses to be retrieved. See
  45957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45958. // for more information.
  45959. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  45960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45961. return c
  45962. }
  45963. // Context sets the context to be used in this call's Do method. Any
  45964. // pending HTTP request will be aborted if the provided context is
  45965. // canceled.
  45966. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  45967. c.ctx_ = ctx
  45968. return c
  45969. }
  45970. // Header returns an http.Header that can be modified by the caller to
  45971. // add HTTP headers to the request.
  45972. func (c *HealthChecksDeleteCall) Header() http.Header {
  45973. if c.header_ == nil {
  45974. c.header_ = make(http.Header)
  45975. }
  45976. return c.header_
  45977. }
  45978. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  45979. reqHeaders := make(http.Header)
  45980. for k, v := range c.header_ {
  45981. reqHeaders[k] = v
  45982. }
  45983. reqHeaders.Set("User-Agent", c.s.userAgent())
  45984. var body io.Reader = nil
  45985. c.urlParams_.Set("alt", alt)
  45986. c.urlParams_.Set("prettyPrint", "false")
  45987. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  45988. urls += "?" + c.urlParams_.Encode()
  45989. req, err := http.NewRequest("DELETE", urls, body)
  45990. if err != nil {
  45991. return nil, err
  45992. }
  45993. req.Header = reqHeaders
  45994. googleapi.Expand(req.URL, map[string]string{
  45995. "project": c.project,
  45996. "healthCheck": c.healthCheck,
  45997. })
  45998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45999. }
  46000. // Do executes the "compute.healthChecks.delete" call.
  46001. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46002. // status code is an error. Response headers are in either
  46003. // *Operation.ServerResponse.Header or (if a response was returned at
  46004. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46005. // to check whether the returned error was because
  46006. // http.StatusNotModified was returned.
  46007. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46008. gensupport.SetOptions(c.urlParams_, opts...)
  46009. res, err := c.doRequest("json")
  46010. if res != nil && res.StatusCode == http.StatusNotModified {
  46011. if res.Body != nil {
  46012. res.Body.Close()
  46013. }
  46014. return nil, &googleapi.Error{
  46015. Code: res.StatusCode,
  46016. Header: res.Header,
  46017. }
  46018. }
  46019. if err != nil {
  46020. return nil, err
  46021. }
  46022. defer googleapi.CloseBody(res)
  46023. if err := googleapi.CheckResponse(res); err != nil {
  46024. return nil, err
  46025. }
  46026. ret := &Operation{
  46027. ServerResponse: googleapi.ServerResponse{
  46028. Header: res.Header,
  46029. HTTPStatusCode: res.StatusCode,
  46030. },
  46031. }
  46032. target := &ret
  46033. if err := gensupport.DecodeResponse(target, res); err != nil {
  46034. return nil, err
  46035. }
  46036. return ret, nil
  46037. // {
  46038. // "description": "Deletes the specified HealthCheck resource.",
  46039. // "httpMethod": "DELETE",
  46040. // "id": "compute.healthChecks.delete",
  46041. // "parameterOrder": [
  46042. // "project",
  46043. // "healthCheck"
  46044. // ],
  46045. // "parameters": {
  46046. // "healthCheck": {
  46047. // "description": "Name of the HealthCheck resource to delete.",
  46048. // "location": "path",
  46049. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46050. // "required": true,
  46051. // "type": "string"
  46052. // },
  46053. // "project": {
  46054. // "description": "Project ID for this request.",
  46055. // "location": "path",
  46056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46057. // "required": true,
  46058. // "type": "string"
  46059. // },
  46060. // "requestId": {
  46061. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46062. // "location": "query",
  46063. // "type": "string"
  46064. // }
  46065. // },
  46066. // "path": "{project}/global/healthChecks/{healthCheck}",
  46067. // "response": {
  46068. // "$ref": "Operation"
  46069. // },
  46070. // "scopes": [
  46071. // "https://www.googleapis.com/auth/cloud-platform",
  46072. // "https://www.googleapis.com/auth/compute"
  46073. // ]
  46074. // }
  46075. }
  46076. // method id "compute.healthChecks.get":
  46077. type HealthChecksGetCall struct {
  46078. s *Service
  46079. project string
  46080. healthCheck string
  46081. urlParams_ gensupport.URLParams
  46082. ifNoneMatch_ string
  46083. ctx_ context.Context
  46084. header_ http.Header
  46085. }
  46086. // Get: Returns the specified HealthCheck resource. Gets a list of
  46087. // available health checks by making a list() request.
  46088. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  46089. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46090. c.project = project
  46091. c.healthCheck = healthCheck
  46092. return c
  46093. }
  46094. // Fields allows partial responses to be retrieved. See
  46095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46096. // for more information.
  46097. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  46098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46099. return c
  46100. }
  46101. // IfNoneMatch sets the optional parameter which makes the operation
  46102. // fail if the object's ETag matches the given value. This is useful for
  46103. // getting updates only after the object has changed since the last
  46104. // request. Use googleapi.IsNotModified to check whether the response
  46105. // error from Do is the result of In-None-Match.
  46106. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  46107. c.ifNoneMatch_ = entityTag
  46108. return c
  46109. }
  46110. // Context sets the context to be used in this call's Do method. Any
  46111. // pending HTTP request will be aborted if the provided context is
  46112. // canceled.
  46113. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  46114. c.ctx_ = ctx
  46115. return c
  46116. }
  46117. // Header returns an http.Header that can be modified by the caller to
  46118. // add HTTP headers to the request.
  46119. func (c *HealthChecksGetCall) Header() http.Header {
  46120. if c.header_ == nil {
  46121. c.header_ = make(http.Header)
  46122. }
  46123. return c.header_
  46124. }
  46125. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  46126. reqHeaders := make(http.Header)
  46127. for k, v := range c.header_ {
  46128. reqHeaders[k] = v
  46129. }
  46130. reqHeaders.Set("User-Agent", c.s.userAgent())
  46131. if c.ifNoneMatch_ != "" {
  46132. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46133. }
  46134. var body io.Reader = nil
  46135. c.urlParams_.Set("alt", alt)
  46136. c.urlParams_.Set("prettyPrint", "false")
  46137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  46138. urls += "?" + c.urlParams_.Encode()
  46139. req, err := http.NewRequest("GET", urls, body)
  46140. if err != nil {
  46141. return nil, err
  46142. }
  46143. req.Header = reqHeaders
  46144. googleapi.Expand(req.URL, map[string]string{
  46145. "project": c.project,
  46146. "healthCheck": c.healthCheck,
  46147. })
  46148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46149. }
  46150. // Do executes the "compute.healthChecks.get" call.
  46151. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  46152. // status code is an error. Response headers are in either
  46153. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  46154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46155. // to check whether the returned error was because
  46156. // http.StatusNotModified was returned.
  46157. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  46158. gensupport.SetOptions(c.urlParams_, opts...)
  46159. res, err := c.doRequest("json")
  46160. if res != nil && res.StatusCode == http.StatusNotModified {
  46161. if res.Body != nil {
  46162. res.Body.Close()
  46163. }
  46164. return nil, &googleapi.Error{
  46165. Code: res.StatusCode,
  46166. Header: res.Header,
  46167. }
  46168. }
  46169. if err != nil {
  46170. return nil, err
  46171. }
  46172. defer googleapi.CloseBody(res)
  46173. if err := googleapi.CheckResponse(res); err != nil {
  46174. return nil, err
  46175. }
  46176. ret := &HealthCheck{
  46177. ServerResponse: googleapi.ServerResponse{
  46178. Header: res.Header,
  46179. HTTPStatusCode: res.StatusCode,
  46180. },
  46181. }
  46182. target := &ret
  46183. if err := gensupport.DecodeResponse(target, res); err != nil {
  46184. return nil, err
  46185. }
  46186. return ret, nil
  46187. // {
  46188. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  46189. // "httpMethod": "GET",
  46190. // "id": "compute.healthChecks.get",
  46191. // "parameterOrder": [
  46192. // "project",
  46193. // "healthCheck"
  46194. // ],
  46195. // "parameters": {
  46196. // "healthCheck": {
  46197. // "description": "Name of the HealthCheck resource to return.",
  46198. // "location": "path",
  46199. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46200. // "required": true,
  46201. // "type": "string"
  46202. // },
  46203. // "project": {
  46204. // "description": "Project ID for this request.",
  46205. // "location": "path",
  46206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46207. // "required": true,
  46208. // "type": "string"
  46209. // }
  46210. // },
  46211. // "path": "{project}/global/healthChecks/{healthCheck}",
  46212. // "response": {
  46213. // "$ref": "HealthCheck"
  46214. // },
  46215. // "scopes": [
  46216. // "https://www.googleapis.com/auth/cloud-platform",
  46217. // "https://www.googleapis.com/auth/compute",
  46218. // "https://www.googleapis.com/auth/compute.readonly"
  46219. // ]
  46220. // }
  46221. }
  46222. // method id "compute.healthChecks.insert":
  46223. type HealthChecksInsertCall struct {
  46224. s *Service
  46225. project string
  46226. healthcheck *HealthCheck
  46227. urlParams_ gensupport.URLParams
  46228. ctx_ context.Context
  46229. header_ http.Header
  46230. }
  46231. // Insert: Creates a HealthCheck resource in the specified project using
  46232. // the data included in the request.
  46233. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  46234. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46235. c.project = project
  46236. c.healthcheck = healthcheck
  46237. return c
  46238. }
  46239. // RequestId sets the optional parameter "requestId": An optional
  46240. // request ID to identify requests. Specify a unique request ID so that
  46241. // if you must retry your request, the server will know to ignore the
  46242. // request if it has already been completed.
  46243. //
  46244. // For example, consider a situation where you make an initial request
  46245. // and the request times out. If you make the request again with the
  46246. // same request ID, the server can check if original operation with the
  46247. // same request ID was received, and if so, will ignore the second
  46248. // request. This prevents clients from accidentally creating duplicate
  46249. // commitments.
  46250. //
  46251. // The request ID must be a valid UUID with the exception that zero UUID
  46252. // is not supported (00000000-0000-0000-0000-000000000000).
  46253. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  46254. c.urlParams_.Set("requestId", requestId)
  46255. return c
  46256. }
  46257. // Fields allows partial responses to be retrieved. See
  46258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46259. // for more information.
  46260. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  46261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46262. return c
  46263. }
  46264. // Context sets the context to be used in this call's Do method. Any
  46265. // pending HTTP request will be aborted if the provided context is
  46266. // canceled.
  46267. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  46268. c.ctx_ = ctx
  46269. return c
  46270. }
  46271. // Header returns an http.Header that can be modified by the caller to
  46272. // add HTTP headers to the request.
  46273. func (c *HealthChecksInsertCall) Header() http.Header {
  46274. if c.header_ == nil {
  46275. c.header_ = make(http.Header)
  46276. }
  46277. return c.header_
  46278. }
  46279. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  46280. reqHeaders := make(http.Header)
  46281. for k, v := range c.header_ {
  46282. reqHeaders[k] = v
  46283. }
  46284. reqHeaders.Set("User-Agent", c.s.userAgent())
  46285. var body io.Reader = nil
  46286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  46287. if err != nil {
  46288. return nil, err
  46289. }
  46290. reqHeaders.Set("Content-Type", "application/json")
  46291. c.urlParams_.Set("alt", alt)
  46292. c.urlParams_.Set("prettyPrint", "false")
  46293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  46294. urls += "?" + c.urlParams_.Encode()
  46295. req, err := http.NewRequest("POST", urls, body)
  46296. if err != nil {
  46297. return nil, err
  46298. }
  46299. req.Header = reqHeaders
  46300. googleapi.Expand(req.URL, map[string]string{
  46301. "project": c.project,
  46302. })
  46303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46304. }
  46305. // Do executes the "compute.healthChecks.insert" call.
  46306. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46307. // status code is an error. Response headers are in either
  46308. // *Operation.ServerResponse.Header or (if a response was returned at
  46309. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46310. // to check whether the returned error was because
  46311. // http.StatusNotModified was returned.
  46312. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46313. gensupport.SetOptions(c.urlParams_, opts...)
  46314. res, err := c.doRequest("json")
  46315. if res != nil && res.StatusCode == http.StatusNotModified {
  46316. if res.Body != nil {
  46317. res.Body.Close()
  46318. }
  46319. return nil, &googleapi.Error{
  46320. Code: res.StatusCode,
  46321. Header: res.Header,
  46322. }
  46323. }
  46324. if err != nil {
  46325. return nil, err
  46326. }
  46327. defer googleapi.CloseBody(res)
  46328. if err := googleapi.CheckResponse(res); err != nil {
  46329. return nil, err
  46330. }
  46331. ret := &Operation{
  46332. ServerResponse: googleapi.ServerResponse{
  46333. Header: res.Header,
  46334. HTTPStatusCode: res.StatusCode,
  46335. },
  46336. }
  46337. target := &ret
  46338. if err := gensupport.DecodeResponse(target, res); err != nil {
  46339. return nil, err
  46340. }
  46341. return ret, nil
  46342. // {
  46343. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  46344. // "httpMethod": "POST",
  46345. // "id": "compute.healthChecks.insert",
  46346. // "parameterOrder": [
  46347. // "project"
  46348. // ],
  46349. // "parameters": {
  46350. // "project": {
  46351. // "description": "Project ID for this request.",
  46352. // "location": "path",
  46353. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46354. // "required": true,
  46355. // "type": "string"
  46356. // },
  46357. // "requestId": {
  46358. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46359. // "location": "query",
  46360. // "type": "string"
  46361. // }
  46362. // },
  46363. // "path": "{project}/global/healthChecks",
  46364. // "request": {
  46365. // "$ref": "HealthCheck"
  46366. // },
  46367. // "response": {
  46368. // "$ref": "Operation"
  46369. // },
  46370. // "scopes": [
  46371. // "https://www.googleapis.com/auth/cloud-platform",
  46372. // "https://www.googleapis.com/auth/compute"
  46373. // ]
  46374. // }
  46375. }
  46376. // method id "compute.healthChecks.list":
  46377. type HealthChecksListCall struct {
  46378. s *Service
  46379. project string
  46380. urlParams_ gensupport.URLParams
  46381. ifNoneMatch_ string
  46382. ctx_ context.Context
  46383. header_ http.Header
  46384. }
  46385. // List: Retrieves the list of HealthCheck resources available to the
  46386. // specified project.
  46387. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  46388. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46389. c.project = project
  46390. return c
  46391. }
  46392. // Filter sets the optional parameter "filter": A filter expression that
  46393. // filters resources listed in the response. The expression must specify
  46394. // the field name, a comparison operator, and the value that you want to
  46395. // use for filtering. The value must be a string, a number, or a
  46396. // boolean. The comparison operator must be either =, !=, >, or <.
  46397. //
  46398. // For example, if you are filtering Compute Engine instances, you can
  46399. // exclude instances named example-instance by specifying name !=
  46400. // example-instance.
  46401. //
  46402. // You can also filter nested fields. For example, you could specify
  46403. // scheduling.automaticRestart = false to include instances only if they
  46404. // are not scheduled for automatic restarts. You can use filtering on
  46405. // nested fields to filter based on resource labels.
  46406. //
  46407. // To filter on multiple expressions, provide each separate expression
  46408. // within parentheses. For example, (scheduling.automaticRestart = true)
  46409. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46410. // AND expression. However, you can include AND and OR expressions
  46411. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46412. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46413. // true).
  46414. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  46415. c.urlParams_.Set("filter", filter)
  46416. return c
  46417. }
  46418. // MaxResults sets the optional parameter "maxResults": The maximum
  46419. // number of results per page that should be returned. If the number of
  46420. // available results is larger than maxResults, Compute Engine returns a
  46421. // nextPageToken that can be used to get the next page of results in
  46422. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46423. // (Default: 500)
  46424. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  46425. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46426. return c
  46427. }
  46428. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46429. // a certain order. By default, results are returned in alphanumerical
  46430. // order based on the resource name.
  46431. //
  46432. // You can also sort results in descending order based on the creation
  46433. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46434. // based on the creationTimestamp field in reverse chronological order
  46435. // (newest result first). Use this to sort resources like operations so
  46436. // that the newest operation is returned first.
  46437. //
  46438. // Currently, only sorting by name or creationTimestamp desc is
  46439. // supported.
  46440. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  46441. c.urlParams_.Set("orderBy", orderBy)
  46442. return c
  46443. }
  46444. // PageToken sets the optional parameter "pageToken": Specifies a page
  46445. // token to use. Set pageToken to the nextPageToken returned by a
  46446. // previous list request to get the next page of results.
  46447. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  46448. c.urlParams_.Set("pageToken", pageToken)
  46449. return c
  46450. }
  46451. // Fields allows partial responses to be retrieved. See
  46452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46453. // for more information.
  46454. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  46455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46456. return c
  46457. }
  46458. // IfNoneMatch sets the optional parameter which makes the operation
  46459. // fail if the object's ETag matches the given value. This is useful for
  46460. // getting updates only after the object has changed since the last
  46461. // request. Use googleapi.IsNotModified to check whether the response
  46462. // error from Do is the result of In-None-Match.
  46463. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  46464. c.ifNoneMatch_ = entityTag
  46465. return c
  46466. }
  46467. // Context sets the context to be used in this call's Do method. Any
  46468. // pending HTTP request will be aborted if the provided context is
  46469. // canceled.
  46470. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  46471. c.ctx_ = ctx
  46472. return c
  46473. }
  46474. // Header returns an http.Header that can be modified by the caller to
  46475. // add HTTP headers to the request.
  46476. func (c *HealthChecksListCall) Header() http.Header {
  46477. if c.header_ == nil {
  46478. c.header_ = make(http.Header)
  46479. }
  46480. return c.header_
  46481. }
  46482. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  46483. reqHeaders := make(http.Header)
  46484. for k, v := range c.header_ {
  46485. reqHeaders[k] = v
  46486. }
  46487. reqHeaders.Set("User-Agent", c.s.userAgent())
  46488. if c.ifNoneMatch_ != "" {
  46489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46490. }
  46491. var body io.Reader = nil
  46492. c.urlParams_.Set("alt", alt)
  46493. c.urlParams_.Set("prettyPrint", "false")
  46494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  46495. urls += "?" + c.urlParams_.Encode()
  46496. req, err := http.NewRequest("GET", urls, body)
  46497. if err != nil {
  46498. return nil, err
  46499. }
  46500. req.Header = reqHeaders
  46501. googleapi.Expand(req.URL, map[string]string{
  46502. "project": c.project,
  46503. })
  46504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46505. }
  46506. // Do executes the "compute.healthChecks.list" call.
  46507. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  46508. // status code is an error. Response headers are in either
  46509. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  46510. // at all) in error.(*googleapi.Error).Header. Use
  46511. // googleapi.IsNotModified to check whether the returned error was
  46512. // because http.StatusNotModified was returned.
  46513. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  46514. gensupport.SetOptions(c.urlParams_, opts...)
  46515. res, err := c.doRequest("json")
  46516. if res != nil && res.StatusCode == http.StatusNotModified {
  46517. if res.Body != nil {
  46518. res.Body.Close()
  46519. }
  46520. return nil, &googleapi.Error{
  46521. Code: res.StatusCode,
  46522. Header: res.Header,
  46523. }
  46524. }
  46525. if err != nil {
  46526. return nil, err
  46527. }
  46528. defer googleapi.CloseBody(res)
  46529. if err := googleapi.CheckResponse(res); err != nil {
  46530. return nil, err
  46531. }
  46532. ret := &HealthCheckList{
  46533. ServerResponse: googleapi.ServerResponse{
  46534. Header: res.Header,
  46535. HTTPStatusCode: res.StatusCode,
  46536. },
  46537. }
  46538. target := &ret
  46539. if err := gensupport.DecodeResponse(target, res); err != nil {
  46540. return nil, err
  46541. }
  46542. return ret, nil
  46543. // {
  46544. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  46545. // "httpMethod": "GET",
  46546. // "id": "compute.healthChecks.list",
  46547. // "parameterOrder": [
  46548. // "project"
  46549. // ],
  46550. // "parameters": {
  46551. // "filter": {
  46552. // "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).",
  46553. // "location": "query",
  46554. // "type": "string"
  46555. // },
  46556. // "maxResults": {
  46557. // "default": "500",
  46558. // "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)",
  46559. // "format": "uint32",
  46560. // "location": "query",
  46561. // "minimum": "0",
  46562. // "type": "integer"
  46563. // },
  46564. // "orderBy": {
  46565. // "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.",
  46566. // "location": "query",
  46567. // "type": "string"
  46568. // },
  46569. // "pageToken": {
  46570. // "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.",
  46571. // "location": "query",
  46572. // "type": "string"
  46573. // },
  46574. // "project": {
  46575. // "description": "Project ID for this request.",
  46576. // "location": "path",
  46577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46578. // "required": true,
  46579. // "type": "string"
  46580. // }
  46581. // },
  46582. // "path": "{project}/global/healthChecks",
  46583. // "response": {
  46584. // "$ref": "HealthCheckList"
  46585. // },
  46586. // "scopes": [
  46587. // "https://www.googleapis.com/auth/cloud-platform",
  46588. // "https://www.googleapis.com/auth/compute",
  46589. // "https://www.googleapis.com/auth/compute.readonly"
  46590. // ]
  46591. // }
  46592. }
  46593. // Pages invokes f for each page of results.
  46594. // A non-nil error returned from f will halt the iteration.
  46595. // The provided context supersedes any context provided to the Context method.
  46596. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  46597. c.ctx_ = ctx
  46598. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46599. for {
  46600. x, err := c.Do()
  46601. if err != nil {
  46602. return err
  46603. }
  46604. if err := f(x); err != nil {
  46605. return err
  46606. }
  46607. if x.NextPageToken == "" {
  46608. return nil
  46609. }
  46610. c.PageToken(x.NextPageToken)
  46611. }
  46612. }
  46613. // method id "compute.healthChecks.patch":
  46614. type HealthChecksPatchCall struct {
  46615. s *Service
  46616. project string
  46617. healthCheck string
  46618. healthcheck *HealthCheck
  46619. urlParams_ gensupport.URLParams
  46620. ctx_ context.Context
  46621. header_ http.Header
  46622. }
  46623. // Patch: Updates a HealthCheck resource in the specified project using
  46624. // the data included in the request. This method supports PATCH
  46625. // semantics and uses the JSON merge patch format and processing rules.
  46626. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  46627. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46628. c.project = project
  46629. c.healthCheck = healthCheck
  46630. c.healthcheck = healthcheck
  46631. return c
  46632. }
  46633. // RequestId sets the optional parameter "requestId": An optional
  46634. // request ID to identify requests. Specify a unique request ID so that
  46635. // if you must retry your request, the server will know to ignore the
  46636. // request if it has already been completed.
  46637. //
  46638. // For example, consider a situation where you make an initial request
  46639. // and the request times out. If you make the request again with the
  46640. // same request ID, the server can check if original operation with the
  46641. // same request ID was received, and if so, will ignore the second
  46642. // request. This prevents clients from accidentally creating duplicate
  46643. // commitments.
  46644. //
  46645. // The request ID must be a valid UUID with the exception that zero UUID
  46646. // is not supported (00000000-0000-0000-0000-000000000000).
  46647. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  46648. c.urlParams_.Set("requestId", requestId)
  46649. return c
  46650. }
  46651. // Fields allows partial responses to be retrieved. See
  46652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46653. // for more information.
  46654. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  46655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46656. return c
  46657. }
  46658. // Context sets the context to be used in this call's Do method. Any
  46659. // pending HTTP request will be aborted if the provided context is
  46660. // canceled.
  46661. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  46662. c.ctx_ = ctx
  46663. return c
  46664. }
  46665. // Header returns an http.Header that can be modified by the caller to
  46666. // add HTTP headers to the request.
  46667. func (c *HealthChecksPatchCall) Header() http.Header {
  46668. if c.header_ == nil {
  46669. c.header_ = make(http.Header)
  46670. }
  46671. return c.header_
  46672. }
  46673. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  46674. reqHeaders := make(http.Header)
  46675. for k, v := range c.header_ {
  46676. reqHeaders[k] = v
  46677. }
  46678. reqHeaders.Set("User-Agent", c.s.userAgent())
  46679. var body io.Reader = nil
  46680. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  46681. if err != nil {
  46682. return nil, err
  46683. }
  46684. reqHeaders.Set("Content-Type", "application/json")
  46685. c.urlParams_.Set("alt", alt)
  46686. c.urlParams_.Set("prettyPrint", "false")
  46687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  46688. urls += "?" + c.urlParams_.Encode()
  46689. req, err := http.NewRequest("PATCH", urls, body)
  46690. if err != nil {
  46691. return nil, err
  46692. }
  46693. req.Header = reqHeaders
  46694. googleapi.Expand(req.URL, map[string]string{
  46695. "project": c.project,
  46696. "healthCheck": c.healthCheck,
  46697. })
  46698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46699. }
  46700. // Do executes the "compute.healthChecks.patch" call.
  46701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46702. // status code is an error. Response headers are in either
  46703. // *Operation.ServerResponse.Header or (if a response was returned at
  46704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46705. // to check whether the returned error was because
  46706. // http.StatusNotModified was returned.
  46707. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46708. gensupport.SetOptions(c.urlParams_, opts...)
  46709. res, err := c.doRequest("json")
  46710. if res != nil && res.StatusCode == http.StatusNotModified {
  46711. if res.Body != nil {
  46712. res.Body.Close()
  46713. }
  46714. return nil, &googleapi.Error{
  46715. Code: res.StatusCode,
  46716. Header: res.Header,
  46717. }
  46718. }
  46719. if err != nil {
  46720. return nil, err
  46721. }
  46722. defer googleapi.CloseBody(res)
  46723. if err := googleapi.CheckResponse(res); err != nil {
  46724. return nil, err
  46725. }
  46726. ret := &Operation{
  46727. ServerResponse: googleapi.ServerResponse{
  46728. Header: res.Header,
  46729. HTTPStatusCode: res.StatusCode,
  46730. },
  46731. }
  46732. target := &ret
  46733. if err := gensupport.DecodeResponse(target, res); err != nil {
  46734. return nil, err
  46735. }
  46736. return ret, nil
  46737. // {
  46738. // "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.",
  46739. // "httpMethod": "PATCH",
  46740. // "id": "compute.healthChecks.patch",
  46741. // "parameterOrder": [
  46742. // "project",
  46743. // "healthCheck"
  46744. // ],
  46745. // "parameters": {
  46746. // "healthCheck": {
  46747. // "description": "Name of the HealthCheck resource to patch.",
  46748. // "location": "path",
  46749. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46750. // "required": true,
  46751. // "type": "string"
  46752. // },
  46753. // "project": {
  46754. // "description": "Project ID for this request.",
  46755. // "location": "path",
  46756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46757. // "required": true,
  46758. // "type": "string"
  46759. // },
  46760. // "requestId": {
  46761. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46762. // "location": "query",
  46763. // "type": "string"
  46764. // }
  46765. // },
  46766. // "path": "{project}/global/healthChecks/{healthCheck}",
  46767. // "request": {
  46768. // "$ref": "HealthCheck"
  46769. // },
  46770. // "response": {
  46771. // "$ref": "Operation"
  46772. // },
  46773. // "scopes": [
  46774. // "https://www.googleapis.com/auth/cloud-platform",
  46775. // "https://www.googleapis.com/auth/compute"
  46776. // ]
  46777. // }
  46778. }
  46779. // method id "compute.healthChecks.testIamPermissions":
  46780. type HealthChecksTestIamPermissionsCall struct {
  46781. s *Service
  46782. project string
  46783. resource string
  46784. testpermissionsrequest *TestPermissionsRequest
  46785. urlParams_ gensupport.URLParams
  46786. ctx_ context.Context
  46787. header_ http.Header
  46788. }
  46789. // TestIamPermissions: Returns permissions that a caller has on the
  46790. // specified resource.
  46791. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  46792. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46793. c.project = project
  46794. c.resource = resource
  46795. c.testpermissionsrequest = testpermissionsrequest
  46796. return c
  46797. }
  46798. // Fields allows partial responses to be retrieved. See
  46799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46800. // for more information.
  46801. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  46802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46803. return c
  46804. }
  46805. // Context sets the context to be used in this call's Do method. Any
  46806. // pending HTTP request will be aborted if the provided context is
  46807. // canceled.
  46808. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  46809. c.ctx_ = ctx
  46810. return c
  46811. }
  46812. // Header returns an http.Header that can be modified by the caller to
  46813. // add HTTP headers to the request.
  46814. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  46815. if c.header_ == nil {
  46816. c.header_ = make(http.Header)
  46817. }
  46818. return c.header_
  46819. }
  46820. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  46821. reqHeaders := make(http.Header)
  46822. for k, v := range c.header_ {
  46823. reqHeaders[k] = v
  46824. }
  46825. reqHeaders.Set("User-Agent", c.s.userAgent())
  46826. var body io.Reader = nil
  46827. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  46828. if err != nil {
  46829. return nil, err
  46830. }
  46831. reqHeaders.Set("Content-Type", "application/json")
  46832. c.urlParams_.Set("alt", alt)
  46833. c.urlParams_.Set("prettyPrint", "false")
  46834. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  46835. urls += "?" + c.urlParams_.Encode()
  46836. req, err := http.NewRequest("POST", urls, body)
  46837. if err != nil {
  46838. return nil, err
  46839. }
  46840. req.Header = reqHeaders
  46841. googleapi.Expand(req.URL, map[string]string{
  46842. "project": c.project,
  46843. "resource": c.resource,
  46844. })
  46845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46846. }
  46847. // Do executes the "compute.healthChecks.testIamPermissions" call.
  46848. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  46849. // non-2xx status code is an error. Response headers are in either
  46850. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  46851. // returned at all) in error.(*googleapi.Error).Header. Use
  46852. // googleapi.IsNotModified to check whether the returned error was
  46853. // because http.StatusNotModified was returned.
  46854. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  46855. gensupport.SetOptions(c.urlParams_, opts...)
  46856. res, err := c.doRequest("json")
  46857. if res != nil && res.StatusCode == http.StatusNotModified {
  46858. if res.Body != nil {
  46859. res.Body.Close()
  46860. }
  46861. return nil, &googleapi.Error{
  46862. Code: res.StatusCode,
  46863. Header: res.Header,
  46864. }
  46865. }
  46866. if err != nil {
  46867. return nil, err
  46868. }
  46869. defer googleapi.CloseBody(res)
  46870. if err := googleapi.CheckResponse(res); err != nil {
  46871. return nil, err
  46872. }
  46873. ret := &TestPermissionsResponse{
  46874. ServerResponse: googleapi.ServerResponse{
  46875. Header: res.Header,
  46876. HTTPStatusCode: res.StatusCode,
  46877. },
  46878. }
  46879. target := &ret
  46880. if err := gensupport.DecodeResponse(target, res); err != nil {
  46881. return nil, err
  46882. }
  46883. return ret, nil
  46884. // {
  46885. // "description": "Returns permissions that a caller has on the specified resource.",
  46886. // "httpMethod": "POST",
  46887. // "id": "compute.healthChecks.testIamPermissions",
  46888. // "parameterOrder": [
  46889. // "project",
  46890. // "resource"
  46891. // ],
  46892. // "parameters": {
  46893. // "project": {
  46894. // "description": "Project ID for this request.",
  46895. // "location": "path",
  46896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46897. // "required": true,
  46898. // "type": "string"
  46899. // },
  46900. // "resource": {
  46901. // "description": "Name or id of the resource for this request.",
  46902. // "location": "path",
  46903. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46904. // "required": true,
  46905. // "type": "string"
  46906. // }
  46907. // },
  46908. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  46909. // "request": {
  46910. // "$ref": "TestPermissionsRequest"
  46911. // },
  46912. // "response": {
  46913. // "$ref": "TestPermissionsResponse"
  46914. // },
  46915. // "scopes": [
  46916. // "https://www.googleapis.com/auth/cloud-platform",
  46917. // "https://www.googleapis.com/auth/compute",
  46918. // "https://www.googleapis.com/auth/compute.readonly"
  46919. // ]
  46920. // }
  46921. }
  46922. // method id "compute.healthChecks.update":
  46923. type HealthChecksUpdateCall struct {
  46924. s *Service
  46925. project string
  46926. healthCheck string
  46927. healthcheck *HealthCheck
  46928. urlParams_ gensupport.URLParams
  46929. ctx_ context.Context
  46930. header_ http.Header
  46931. }
  46932. // Update: Updates a HealthCheck resource in the specified project using
  46933. // the data included in the request.
  46934. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  46935. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46936. c.project = project
  46937. c.healthCheck = healthCheck
  46938. c.healthcheck = healthcheck
  46939. return c
  46940. }
  46941. // RequestId sets the optional parameter "requestId": An optional
  46942. // request ID to identify requests. Specify a unique request ID so that
  46943. // if you must retry your request, the server will know to ignore the
  46944. // request if it has already been completed.
  46945. //
  46946. // For example, consider a situation where you make an initial request
  46947. // and the request times out. If you make the request again with the
  46948. // same request ID, the server can check if original operation with the
  46949. // same request ID was received, and if so, will ignore the second
  46950. // request. This prevents clients from accidentally creating duplicate
  46951. // commitments.
  46952. //
  46953. // The request ID must be a valid UUID with the exception that zero UUID
  46954. // is not supported (00000000-0000-0000-0000-000000000000).
  46955. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  46956. c.urlParams_.Set("requestId", requestId)
  46957. return c
  46958. }
  46959. // Fields allows partial responses to be retrieved. See
  46960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46961. // for more information.
  46962. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  46963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46964. return c
  46965. }
  46966. // Context sets the context to be used in this call's Do method. Any
  46967. // pending HTTP request will be aborted if the provided context is
  46968. // canceled.
  46969. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  46970. c.ctx_ = ctx
  46971. return c
  46972. }
  46973. // Header returns an http.Header that can be modified by the caller to
  46974. // add HTTP headers to the request.
  46975. func (c *HealthChecksUpdateCall) Header() http.Header {
  46976. if c.header_ == nil {
  46977. c.header_ = make(http.Header)
  46978. }
  46979. return c.header_
  46980. }
  46981. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  46982. reqHeaders := make(http.Header)
  46983. for k, v := range c.header_ {
  46984. reqHeaders[k] = v
  46985. }
  46986. reqHeaders.Set("User-Agent", c.s.userAgent())
  46987. var body io.Reader = nil
  46988. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  46989. if err != nil {
  46990. return nil, err
  46991. }
  46992. reqHeaders.Set("Content-Type", "application/json")
  46993. c.urlParams_.Set("alt", alt)
  46994. c.urlParams_.Set("prettyPrint", "false")
  46995. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  46996. urls += "?" + c.urlParams_.Encode()
  46997. req, err := http.NewRequest("PUT", urls, body)
  46998. if err != nil {
  46999. return nil, err
  47000. }
  47001. req.Header = reqHeaders
  47002. googleapi.Expand(req.URL, map[string]string{
  47003. "project": c.project,
  47004. "healthCheck": c.healthCheck,
  47005. })
  47006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47007. }
  47008. // Do executes the "compute.healthChecks.update" call.
  47009. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47010. // status code is an error. Response headers are in either
  47011. // *Operation.ServerResponse.Header or (if a response was returned at
  47012. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47013. // to check whether the returned error was because
  47014. // http.StatusNotModified was returned.
  47015. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47016. gensupport.SetOptions(c.urlParams_, opts...)
  47017. res, err := c.doRequest("json")
  47018. if res != nil && res.StatusCode == http.StatusNotModified {
  47019. if res.Body != nil {
  47020. res.Body.Close()
  47021. }
  47022. return nil, &googleapi.Error{
  47023. Code: res.StatusCode,
  47024. Header: res.Header,
  47025. }
  47026. }
  47027. if err != nil {
  47028. return nil, err
  47029. }
  47030. defer googleapi.CloseBody(res)
  47031. if err := googleapi.CheckResponse(res); err != nil {
  47032. return nil, err
  47033. }
  47034. ret := &Operation{
  47035. ServerResponse: googleapi.ServerResponse{
  47036. Header: res.Header,
  47037. HTTPStatusCode: res.StatusCode,
  47038. },
  47039. }
  47040. target := &ret
  47041. if err := gensupport.DecodeResponse(target, res); err != nil {
  47042. return nil, err
  47043. }
  47044. return ret, nil
  47045. // {
  47046. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  47047. // "httpMethod": "PUT",
  47048. // "id": "compute.healthChecks.update",
  47049. // "parameterOrder": [
  47050. // "project",
  47051. // "healthCheck"
  47052. // ],
  47053. // "parameters": {
  47054. // "healthCheck": {
  47055. // "description": "Name of the HealthCheck resource to update.",
  47056. // "location": "path",
  47057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47058. // "required": true,
  47059. // "type": "string"
  47060. // },
  47061. // "project": {
  47062. // "description": "Project ID for this request.",
  47063. // "location": "path",
  47064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47065. // "required": true,
  47066. // "type": "string"
  47067. // },
  47068. // "requestId": {
  47069. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47070. // "location": "query",
  47071. // "type": "string"
  47072. // }
  47073. // },
  47074. // "path": "{project}/global/healthChecks/{healthCheck}",
  47075. // "request": {
  47076. // "$ref": "HealthCheck"
  47077. // },
  47078. // "response": {
  47079. // "$ref": "Operation"
  47080. // },
  47081. // "scopes": [
  47082. // "https://www.googleapis.com/auth/cloud-platform",
  47083. // "https://www.googleapis.com/auth/compute"
  47084. // ]
  47085. // }
  47086. }
  47087. // method id "compute.httpHealthChecks.delete":
  47088. type HttpHealthChecksDeleteCall struct {
  47089. s *Service
  47090. project string
  47091. httpHealthCheck string
  47092. urlParams_ gensupport.URLParams
  47093. ctx_ context.Context
  47094. header_ http.Header
  47095. }
  47096. // Delete: Deletes the specified HttpHealthCheck resource.
  47097. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  47098. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  47099. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47100. c.project = project
  47101. c.httpHealthCheck = httpHealthCheck
  47102. return c
  47103. }
  47104. // RequestId sets the optional parameter "requestId": An optional
  47105. // request ID to identify requests. Specify a unique request ID so that
  47106. // if you must retry your request, the server will know to ignore the
  47107. // request if it has already been completed.
  47108. //
  47109. // For example, consider a situation where you make an initial request
  47110. // and the request times out. If you make the request again with the
  47111. // same request ID, the server can check if original operation with the
  47112. // same request ID was received, and if so, will ignore the second
  47113. // request. This prevents clients from accidentally creating duplicate
  47114. // commitments.
  47115. //
  47116. // The request ID must be a valid UUID with the exception that zero UUID
  47117. // is not supported (00000000-0000-0000-0000-000000000000).
  47118. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  47119. c.urlParams_.Set("requestId", requestId)
  47120. return c
  47121. }
  47122. // Fields allows partial responses to be retrieved. See
  47123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47124. // for more information.
  47125. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  47126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47127. return c
  47128. }
  47129. // Context sets the context to be used in this call's Do method. Any
  47130. // pending HTTP request will be aborted if the provided context is
  47131. // canceled.
  47132. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  47133. c.ctx_ = ctx
  47134. return c
  47135. }
  47136. // Header returns an http.Header that can be modified by the caller to
  47137. // add HTTP headers to the request.
  47138. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  47139. if c.header_ == nil {
  47140. c.header_ = make(http.Header)
  47141. }
  47142. return c.header_
  47143. }
  47144. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  47145. reqHeaders := make(http.Header)
  47146. for k, v := range c.header_ {
  47147. reqHeaders[k] = v
  47148. }
  47149. reqHeaders.Set("User-Agent", c.s.userAgent())
  47150. var body io.Reader = nil
  47151. c.urlParams_.Set("alt", alt)
  47152. c.urlParams_.Set("prettyPrint", "false")
  47153. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  47154. urls += "?" + c.urlParams_.Encode()
  47155. req, err := http.NewRequest("DELETE", urls, body)
  47156. if err != nil {
  47157. return nil, err
  47158. }
  47159. req.Header = reqHeaders
  47160. googleapi.Expand(req.URL, map[string]string{
  47161. "project": c.project,
  47162. "httpHealthCheck": c.httpHealthCheck,
  47163. })
  47164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47165. }
  47166. // Do executes the "compute.httpHealthChecks.delete" call.
  47167. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47168. // status code is an error. Response headers are in either
  47169. // *Operation.ServerResponse.Header or (if a response was returned at
  47170. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47171. // to check whether the returned error was because
  47172. // http.StatusNotModified was returned.
  47173. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47174. gensupport.SetOptions(c.urlParams_, opts...)
  47175. res, err := c.doRequest("json")
  47176. if res != nil && res.StatusCode == http.StatusNotModified {
  47177. if res.Body != nil {
  47178. res.Body.Close()
  47179. }
  47180. return nil, &googleapi.Error{
  47181. Code: res.StatusCode,
  47182. Header: res.Header,
  47183. }
  47184. }
  47185. if err != nil {
  47186. return nil, err
  47187. }
  47188. defer googleapi.CloseBody(res)
  47189. if err := googleapi.CheckResponse(res); err != nil {
  47190. return nil, err
  47191. }
  47192. ret := &Operation{
  47193. ServerResponse: googleapi.ServerResponse{
  47194. Header: res.Header,
  47195. HTTPStatusCode: res.StatusCode,
  47196. },
  47197. }
  47198. target := &ret
  47199. if err := gensupport.DecodeResponse(target, res); err != nil {
  47200. return nil, err
  47201. }
  47202. return ret, nil
  47203. // {
  47204. // "description": "Deletes the specified HttpHealthCheck resource.",
  47205. // "httpMethod": "DELETE",
  47206. // "id": "compute.httpHealthChecks.delete",
  47207. // "parameterOrder": [
  47208. // "project",
  47209. // "httpHealthCheck"
  47210. // ],
  47211. // "parameters": {
  47212. // "httpHealthCheck": {
  47213. // "description": "Name of the HttpHealthCheck resource to delete.",
  47214. // "location": "path",
  47215. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47216. // "required": true,
  47217. // "type": "string"
  47218. // },
  47219. // "project": {
  47220. // "description": "Project ID for this request.",
  47221. // "location": "path",
  47222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47223. // "required": true,
  47224. // "type": "string"
  47225. // },
  47226. // "requestId": {
  47227. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47228. // "location": "query",
  47229. // "type": "string"
  47230. // }
  47231. // },
  47232. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  47233. // "response": {
  47234. // "$ref": "Operation"
  47235. // },
  47236. // "scopes": [
  47237. // "https://www.googleapis.com/auth/cloud-platform",
  47238. // "https://www.googleapis.com/auth/compute"
  47239. // ]
  47240. // }
  47241. }
  47242. // method id "compute.httpHealthChecks.get":
  47243. type HttpHealthChecksGetCall struct {
  47244. s *Service
  47245. project string
  47246. httpHealthCheck string
  47247. urlParams_ gensupport.URLParams
  47248. ifNoneMatch_ string
  47249. ctx_ context.Context
  47250. header_ http.Header
  47251. }
  47252. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  47253. // available HTTP health checks by making a list() request.
  47254. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  47255. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  47256. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47257. c.project = project
  47258. c.httpHealthCheck = httpHealthCheck
  47259. return c
  47260. }
  47261. // Fields allows partial responses to be retrieved. See
  47262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47263. // for more information.
  47264. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  47265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47266. return c
  47267. }
  47268. // IfNoneMatch sets the optional parameter which makes the operation
  47269. // fail if the object's ETag matches the given value. This is useful for
  47270. // getting updates only after the object has changed since the last
  47271. // request. Use googleapi.IsNotModified to check whether the response
  47272. // error from Do is the result of In-None-Match.
  47273. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  47274. c.ifNoneMatch_ = entityTag
  47275. return c
  47276. }
  47277. // Context sets the context to be used in this call's Do method. Any
  47278. // pending HTTP request will be aborted if the provided context is
  47279. // canceled.
  47280. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  47281. c.ctx_ = ctx
  47282. return c
  47283. }
  47284. // Header returns an http.Header that can be modified by the caller to
  47285. // add HTTP headers to the request.
  47286. func (c *HttpHealthChecksGetCall) Header() http.Header {
  47287. if c.header_ == nil {
  47288. c.header_ = make(http.Header)
  47289. }
  47290. return c.header_
  47291. }
  47292. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  47293. reqHeaders := make(http.Header)
  47294. for k, v := range c.header_ {
  47295. reqHeaders[k] = v
  47296. }
  47297. reqHeaders.Set("User-Agent", c.s.userAgent())
  47298. if c.ifNoneMatch_ != "" {
  47299. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47300. }
  47301. var body io.Reader = nil
  47302. c.urlParams_.Set("alt", alt)
  47303. c.urlParams_.Set("prettyPrint", "false")
  47304. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  47305. urls += "?" + c.urlParams_.Encode()
  47306. req, err := http.NewRequest("GET", urls, body)
  47307. if err != nil {
  47308. return nil, err
  47309. }
  47310. req.Header = reqHeaders
  47311. googleapi.Expand(req.URL, map[string]string{
  47312. "project": c.project,
  47313. "httpHealthCheck": c.httpHealthCheck,
  47314. })
  47315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47316. }
  47317. // Do executes the "compute.httpHealthChecks.get" call.
  47318. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  47319. // status code is an error. Response headers are in either
  47320. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  47321. // at all) in error.(*googleapi.Error).Header. Use
  47322. // googleapi.IsNotModified to check whether the returned error was
  47323. // because http.StatusNotModified was returned.
  47324. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  47325. gensupport.SetOptions(c.urlParams_, opts...)
  47326. res, err := c.doRequest("json")
  47327. if res != nil && res.StatusCode == http.StatusNotModified {
  47328. if res.Body != nil {
  47329. res.Body.Close()
  47330. }
  47331. return nil, &googleapi.Error{
  47332. Code: res.StatusCode,
  47333. Header: res.Header,
  47334. }
  47335. }
  47336. if err != nil {
  47337. return nil, err
  47338. }
  47339. defer googleapi.CloseBody(res)
  47340. if err := googleapi.CheckResponse(res); err != nil {
  47341. return nil, err
  47342. }
  47343. ret := &HttpHealthCheck{
  47344. ServerResponse: googleapi.ServerResponse{
  47345. Header: res.Header,
  47346. HTTPStatusCode: res.StatusCode,
  47347. },
  47348. }
  47349. target := &ret
  47350. if err := gensupport.DecodeResponse(target, res); err != nil {
  47351. return nil, err
  47352. }
  47353. return ret, nil
  47354. // {
  47355. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  47356. // "httpMethod": "GET",
  47357. // "id": "compute.httpHealthChecks.get",
  47358. // "parameterOrder": [
  47359. // "project",
  47360. // "httpHealthCheck"
  47361. // ],
  47362. // "parameters": {
  47363. // "httpHealthCheck": {
  47364. // "description": "Name of the HttpHealthCheck resource to return.",
  47365. // "location": "path",
  47366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47367. // "required": true,
  47368. // "type": "string"
  47369. // },
  47370. // "project": {
  47371. // "description": "Project ID for this request.",
  47372. // "location": "path",
  47373. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47374. // "required": true,
  47375. // "type": "string"
  47376. // }
  47377. // },
  47378. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  47379. // "response": {
  47380. // "$ref": "HttpHealthCheck"
  47381. // },
  47382. // "scopes": [
  47383. // "https://www.googleapis.com/auth/cloud-platform",
  47384. // "https://www.googleapis.com/auth/compute",
  47385. // "https://www.googleapis.com/auth/compute.readonly"
  47386. // ]
  47387. // }
  47388. }
  47389. // method id "compute.httpHealthChecks.insert":
  47390. type HttpHealthChecksInsertCall struct {
  47391. s *Service
  47392. project string
  47393. httphealthcheck *HttpHealthCheck
  47394. urlParams_ gensupport.URLParams
  47395. ctx_ context.Context
  47396. header_ http.Header
  47397. }
  47398. // Insert: Creates a HttpHealthCheck resource in the specified project
  47399. // using the data included in the request.
  47400. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  47401. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  47402. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47403. c.project = project
  47404. c.httphealthcheck = httphealthcheck
  47405. return c
  47406. }
  47407. // RequestId sets the optional parameter "requestId": An optional
  47408. // request ID to identify requests. Specify a unique request ID so that
  47409. // if you must retry your request, the server will know to ignore the
  47410. // request if it has already been completed.
  47411. //
  47412. // For example, consider a situation where you make an initial request
  47413. // and the request times out. If you make the request again with the
  47414. // same request ID, the server can check if original operation with the
  47415. // same request ID was received, and if so, will ignore the second
  47416. // request. This prevents clients from accidentally creating duplicate
  47417. // commitments.
  47418. //
  47419. // The request ID must be a valid UUID with the exception that zero UUID
  47420. // is not supported (00000000-0000-0000-0000-000000000000).
  47421. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  47422. c.urlParams_.Set("requestId", requestId)
  47423. return c
  47424. }
  47425. // Fields allows partial responses to be retrieved. See
  47426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47427. // for more information.
  47428. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  47429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47430. return c
  47431. }
  47432. // Context sets the context to be used in this call's Do method. Any
  47433. // pending HTTP request will be aborted if the provided context is
  47434. // canceled.
  47435. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  47436. c.ctx_ = ctx
  47437. return c
  47438. }
  47439. // Header returns an http.Header that can be modified by the caller to
  47440. // add HTTP headers to the request.
  47441. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  47442. if c.header_ == nil {
  47443. c.header_ = make(http.Header)
  47444. }
  47445. return c.header_
  47446. }
  47447. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  47448. reqHeaders := make(http.Header)
  47449. for k, v := range c.header_ {
  47450. reqHeaders[k] = v
  47451. }
  47452. reqHeaders.Set("User-Agent", c.s.userAgent())
  47453. var body io.Reader = nil
  47454. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  47455. if err != nil {
  47456. return nil, err
  47457. }
  47458. reqHeaders.Set("Content-Type", "application/json")
  47459. c.urlParams_.Set("alt", alt)
  47460. c.urlParams_.Set("prettyPrint", "false")
  47461. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  47462. urls += "?" + c.urlParams_.Encode()
  47463. req, err := http.NewRequest("POST", urls, body)
  47464. if err != nil {
  47465. return nil, err
  47466. }
  47467. req.Header = reqHeaders
  47468. googleapi.Expand(req.URL, map[string]string{
  47469. "project": c.project,
  47470. })
  47471. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47472. }
  47473. // Do executes the "compute.httpHealthChecks.insert" call.
  47474. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47475. // status code is an error. Response headers are in either
  47476. // *Operation.ServerResponse.Header or (if a response was returned at
  47477. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47478. // to check whether the returned error was because
  47479. // http.StatusNotModified was returned.
  47480. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47481. gensupport.SetOptions(c.urlParams_, opts...)
  47482. res, err := c.doRequest("json")
  47483. if res != nil && res.StatusCode == http.StatusNotModified {
  47484. if res.Body != nil {
  47485. res.Body.Close()
  47486. }
  47487. return nil, &googleapi.Error{
  47488. Code: res.StatusCode,
  47489. Header: res.Header,
  47490. }
  47491. }
  47492. if err != nil {
  47493. return nil, err
  47494. }
  47495. defer googleapi.CloseBody(res)
  47496. if err := googleapi.CheckResponse(res); err != nil {
  47497. return nil, err
  47498. }
  47499. ret := &Operation{
  47500. ServerResponse: googleapi.ServerResponse{
  47501. Header: res.Header,
  47502. HTTPStatusCode: res.StatusCode,
  47503. },
  47504. }
  47505. target := &ret
  47506. if err := gensupport.DecodeResponse(target, res); err != nil {
  47507. return nil, err
  47508. }
  47509. return ret, nil
  47510. // {
  47511. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  47512. // "httpMethod": "POST",
  47513. // "id": "compute.httpHealthChecks.insert",
  47514. // "parameterOrder": [
  47515. // "project"
  47516. // ],
  47517. // "parameters": {
  47518. // "project": {
  47519. // "description": "Project ID for this request.",
  47520. // "location": "path",
  47521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47522. // "required": true,
  47523. // "type": "string"
  47524. // },
  47525. // "requestId": {
  47526. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47527. // "location": "query",
  47528. // "type": "string"
  47529. // }
  47530. // },
  47531. // "path": "{project}/global/httpHealthChecks",
  47532. // "request": {
  47533. // "$ref": "HttpHealthCheck"
  47534. // },
  47535. // "response": {
  47536. // "$ref": "Operation"
  47537. // },
  47538. // "scopes": [
  47539. // "https://www.googleapis.com/auth/cloud-platform",
  47540. // "https://www.googleapis.com/auth/compute"
  47541. // ]
  47542. // }
  47543. }
  47544. // method id "compute.httpHealthChecks.list":
  47545. type HttpHealthChecksListCall struct {
  47546. s *Service
  47547. project string
  47548. urlParams_ gensupport.URLParams
  47549. ifNoneMatch_ string
  47550. ctx_ context.Context
  47551. header_ http.Header
  47552. }
  47553. // List: Retrieves the list of HttpHealthCheck resources available to
  47554. // the specified project.
  47555. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  47556. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  47557. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47558. c.project = project
  47559. return c
  47560. }
  47561. // Filter sets the optional parameter "filter": A filter expression that
  47562. // filters resources listed in the response. The expression must specify
  47563. // the field name, a comparison operator, and the value that you want to
  47564. // use for filtering. The value must be a string, a number, or a
  47565. // boolean. The comparison operator must be either =, !=, >, or <.
  47566. //
  47567. // For example, if you are filtering Compute Engine instances, you can
  47568. // exclude instances named example-instance by specifying name !=
  47569. // example-instance.
  47570. //
  47571. // You can also filter nested fields. For example, you could specify
  47572. // scheduling.automaticRestart = false to include instances only if they
  47573. // are not scheduled for automatic restarts. You can use filtering on
  47574. // nested fields to filter based on resource labels.
  47575. //
  47576. // To filter on multiple expressions, provide each separate expression
  47577. // within parentheses. For example, (scheduling.automaticRestart = true)
  47578. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47579. // AND expression. However, you can include AND and OR expressions
  47580. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47581. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47582. // true).
  47583. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  47584. c.urlParams_.Set("filter", filter)
  47585. return c
  47586. }
  47587. // MaxResults sets the optional parameter "maxResults": The maximum
  47588. // number of results per page that should be returned. If the number of
  47589. // available results is larger than maxResults, Compute Engine returns a
  47590. // nextPageToken that can be used to get the next page of results in
  47591. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47592. // (Default: 500)
  47593. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  47594. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47595. return c
  47596. }
  47597. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47598. // a certain order. By default, results are returned in alphanumerical
  47599. // order based on the resource name.
  47600. //
  47601. // You can also sort results in descending order based on the creation
  47602. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47603. // based on the creationTimestamp field in reverse chronological order
  47604. // (newest result first). Use this to sort resources like operations so
  47605. // that the newest operation is returned first.
  47606. //
  47607. // Currently, only sorting by name or creationTimestamp desc is
  47608. // supported.
  47609. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  47610. c.urlParams_.Set("orderBy", orderBy)
  47611. return c
  47612. }
  47613. // PageToken sets the optional parameter "pageToken": Specifies a page
  47614. // token to use. Set pageToken to the nextPageToken returned by a
  47615. // previous list request to get the next page of results.
  47616. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  47617. c.urlParams_.Set("pageToken", pageToken)
  47618. return c
  47619. }
  47620. // Fields allows partial responses to be retrieved. See
  47621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47622. // for more information.
  47623. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  47624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47625. return c
  47626. }
  47627. // IfNoneMatch sets the optional parameter which makes the operation
  47628. // fail if the object's ETag matches the given value. This is useful for
  47629. // getting updates only after the object has changed since the last
  47630. // request. Use googleapi.IsNotModified to check whether the response
  47631. // error from Do is the result of In-None-Match.
  47632. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  47633. c.ifNoneMatch_ = entityTag
  47634. return c
  47635. }
  47636. // Context sets the context to be used in this call's Do method. Any
  47637. // pending HTTP request will be aborted if the provided context is
  47638. // canceled.
  47639. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  47640. c.ctx_ = ctx
  47641. return c
  47642. }
  47643. // Header returns an http.Header that can be modified by the caller to
  47644. // add HTTP headers to the request.
  47645. func (c *HttpHealthChecksListCall) Header() http.Header {
  47646. if c.header_ == nil {
  47647. c.header_ = make(http.Header)
  47648. }
  47649. return c.header_
  47650. }
  47651. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  47652. reqHeaders := make(http.Header)
  47653. for k, v := range c.header_ {
  47654. reqHeaders[k] = v
  47655. }
  47656. reqHeaders.Set("User-Agent", c.s.userAgent())
  47657. if c.ifNoneMatch_ != "" {
  47658. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47659. }
  47660. var body io.Reader = nil
  47661. c.urlParams_.Set("alt", alt)
  47662. c.urlParams_.Set("prettyPrint", "false")
  47663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  47664. urls += "?" + c.urlParams_.Encode()
  47665. req, err := http.NewRequest("GET", urls, body)
  47666. if err != nil {
  47667. return nil, err
  47668. }
  47669. req.Header = reqHeaders
  47670. googleapi.Expand(req.URL, map[string]string{
  47671. "project": c.project,
  47672. })
  47673. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47674. }
  47675. // Do executes the "compute.httpHealthChecks.list" call.
  47676. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  47677. // non-2xx status code is an error. Response headers are in either
  47678. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  47679. // returned at all) in error.(*googleapi.Error).Header. Use
  47680. // googleapi.IsNotModified to check whether the returned error was
  47681. // because http.StatusNotModified was returned.
  47682. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  47683. gensupport.SetOptions(c.urlParams_, opts...)
  47684. res, err := c.doRequest("json")
  47685. if res != nil && res.StatusCode == http.StatusNotModified {
  47686. if res.Body != nil {
  47687. res.Body.Close()
  47688. }
  47689. return nil, &googleapi.Error{
  47690. Code: res.StatusCode,
  47691. Header: res.Header,
  47692. }
  47693. }
  47694. if err != nil {
  47695. return nil, err
  47696. }
  47697. defer googleapi.CloseBody(res)
  47698. if err := googleapi.CheckResponse(res); err != nil {
  47699. return nil, err
  47700. }
  47701. ret := &HttpHealthCheckList{
  47702. ServerResponse: googleapi.ServerResponse{
  47703. Header: res.Header,
  47704. HTTPStatusCode: res.StatusCode,
  47705. },
  47706. }
  47707. target := &ret
  47708. if err := gensupport.DecodeResponse(target, res); err != nil {
  47709. return nil, err
  47710. }
  47711. return ret, nil
  47712. // {
  47713. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  47714. // "httpMethod": "GET",
  47715. // "id": "compute.httpHealthChecks.list",
  47716. // "parameterOrder": [
  47717. // "project"
  47718. // ],
  47719. // "parameters": {
  47720. // "filter": {
  47721. // "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).",
  47722. // "location": "query",
  47723. // "type": "string"
  47724. // },
  47725. // "maxResults": {
  47726. // "default": "500",
  47727. // "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)",
  47728. // "format": "uint32",
  47729. // "location": "query",
  47730. // "minimum": "0",
  47731. // "type": "integer"
  47732. // },
  47733. // "orderBy": {
  47734. // "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.",
  47735. // "location": "query",
  47736. // "type": "string"
  47737. // },
  47738. // "pageToken": {
  47739. // "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.",
  47740. // "location": "query",
  47741. // "type": "string"
  47742. // },
  47743. // "project": {
  47744. // "description": "Project ID for this request.",
  47745. // "location": "path",
  47746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47747. // "required": true,
  47748. // "type": "string"
  47749. // }
  47750. // },
  47751. // "path": "{project}/global/httpHealthChecks",
  47752. // "response": {
  47753. // "$ref": "HttpHealthCheckList"
  47754. // },
  47755. // "scopes": [
  47756. // "https://www.googleapis.com/auth/cloud-platform",
  47757. // "https://www.googleapis.com/auth/compute",
  47758. // "https://www.googleapis.com/auth/compute.readonly"
  47759. // ]
  47760. // }
  47761. }
  47762. // Pages invokes f for each page of results.
  47763. // A non-nil error returned from f will halt the iteration.
  47764. // The provided context supersedes any context provided to the Context method.
  47765. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  47766. c.ctx_ = ctx
  47767. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47768. for {
  47769. x, err := c.Do()
  47770. if err != nil {
  47771. return err
  47772. }
  47773. if err := f(x); err != nil {
  47774. return err
  47775. }
  47776. if x.NextPageToken == "" {
  47777. return nil
  47778. }
  47779. c.PageToken(x.NextPageToken)
  47780. }
  47781. }
  47782. // method id "compute.httpHealthChecks.patch":
  47783. type HttpHealthChecksPatchCall struct {
  47784. s *Service
  47785. project string
  47786. httpHealthCheck string
  47787. httphealthcheck *HttpHealthCheck
  47788. urlParams_ gensupport.URLParams
  47789. ctx_ context.Context
  47790. header_ http.Header
  47791. }
  47792. // Patch: Updates a HttpHealthCheck resource in the specified project
  47793. // using the data included in the request. This method supports PATCH
  47794. // semantics and uses the JSON merge patch format and processing rules.
  47795. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  47796. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  47797. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47798. c.project = project
  47799. c.httpHealthCheck = httpHealthCheck
  47800. c.httphealthcheck = httphealthcheck
  47801. return c
  47802. }
  47803. // RequestId sets the optional parameter "requestId": An optional
  47804. // request ID to identify requests. Specify a unique request ID so that
  47805. // if you must retry your request, the server will know to ignore the
  47806. // request if it has already been completed.
  47807. //
  47808. // For example, consider a situation where you make an initial request
  47809. // and the request times out. If you make the request again with the
  47810. // same request ID, the server can check if original operation with the
  47811. // same request ID was received, and if so, will ignore the second
  47812. // request. This prevents clients from accidentally creating duplicate
  47813. // commitments.
  47814. //
  47815. // The request ID must be a valid UUID with the exception that zero UUID
  47816. // is not supported (00000000-0000-0000-0000-000000000000).
  47817. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  47818. c.urlParams_.Set("requestId", requestId)
  47819. return c
  47820. }
  47821. // Fields allows partial responses to be retrieved. See
  47822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47823. // for more information.
  47824. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  47825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47826. return c
  47827. }
  47828. // Context sets the context to be used in this call's Do method. Any
  47829. // pending HTTP request will be aborted if the provided context is
  47830. // canceled.
  47831. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  47832. c.ctx_ = ctx
  47833. return c
  47834. }
  47835. // Header returns an http.Header that can be modified by the caller to
  47836. // add HTTP headers to the request.
  47837. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  47838. if c.header_ == nil {
  47839. c.header_ = make(http.Header)
  47840. }
  47841. return c.header_
  47842. }
  47843. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  47844. reqHeaders := make(http.Header)
  47845. for k, v := range c.header_ {
  47846. reqHeaders[k] = v
  47847. }
  47848. reqHeaders.Set("User-Agent", c.s.userAgent())
  47849. var body io.Reader = nil
  47850. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  47851. if err != nil {
  47852. return nil, err
  47853. }
  47854. reqHeaders.Set("Content-Type", "application/json")
  47855. c.urlParams_.Set("alt", alt)
  47856. c.urlParams_.Set("prettyPrint", "false")
  47857. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  47858. urls += "?" + c.urlParams_.Encode()
  47859. req, err := http.NewRequest("PATCH", urls, body)
  47860. if err != nil {
  47861. return nil, err
  47862. }
  47863. req.Header = reqHeaders
  47864. googleapi.Expand(req.URL, map[string]string{
  47865. "project": c.project,
  47866. "httpHealthCheck": c.httpHealthCheck,
  47867. })
  47868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47869. }
  47870. // Do executes the "compute.httpHealthChecks.patch" call.
  47871. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47872. // status code is an error. Response headers are in either
  47873. // *Operation.ServerResponse.Header or (if a response was returned at
  47874. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47875. // to check whether the returned error was because
  47876. // http.StatusNotModified was returned.
  47877. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47878. gensupport.SetOptions(c.urlParams_, opts...)
  47879. res, err := c.doRequest("json")
  47880. if res != nil && res.StatusCode == http.StatusNotModified {
  47881. if res.Body != nil {
  47882. res.Body.Close()
  47883. }
  47884. return nil, &googleapi.Error{
  47885. Code: res.StatusCode,
  47886. Header: res.Header,
  47887. }
  47888. }
  47889. if err != nil {
  47890. return nil, err
  47891. }
  47892. defer googleapi.CloseBody(res)
  47893. if err := googleapi.CheckResponse(res); err != nil {
  47894. return nil, err
  47895. }
  47896. ret := &Operation{
  47897. ServerResponse: googleapi.ServerResponse{
  47898. Header: res.Header,
  47899. HTTPStatusCode: res.StatusCode,
  47900. },
  47901. }
  47902. target := &ret
  47903. if err := gensupport.DecodeResponse(target, res); err != nil {
  47904. return nil, err
  47905. }
  47906. return ret, nil
  47907. // {
  47908. // "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.",
  47909. // "httpMethod": "PATCH",
  47910. // "id": "compute.httpHealthChecks.patch",
  47911. // "parameterOrder": [
  47912. // "project",
  47913. // "httpHealthCheck"
  47914. // ],
  47915. // "parameters": {
  47916. // "httpHealthCheck": {
  47917. // "description": "Name of the HttpHealthCheck resource to patch.",
  47918. // "location": "path",
  47919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47920. // "required": true,
  47921. // "type": "string"
  47922. // },
  47923. // "project": {
  47924. // "description": "Project ID for this request.",
  47925. // "location": "path",
  47926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47927. // "required": true,
  47928. // "type": "string"
  47929. // },
  47930. // "requestId": {
  47931. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47932. // "location": "query",
  47933. // "type": "string"
  47934. // }
  47935. // },
  47936. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  47937. // "request": {
  47938. // "$ref": "HttpHealthCheck"
  47939. // },
  47940. // "response": {
  47941. // "$ref": "Operation"
  47942. // },
  47943. // "scopes": [
  47944. // "https://www.googleapis.com/auth/cloud-platform",
  47945. // "https://www.googleapis.com/auth/compute"
  47946. // ]
  47947. // }
  47948. }
  47949. // method id "compute.httpHealthChecks.testIamPermissions":
  47950. type HttpHealthChecksTestIamPermissionsCall struct {
  47951. s *Service
  47952. project string
  47953. resource string
  47954. testpermissionsrequest *TestPermissionsRequest
  47955. urlParams_ gensupport.URLParams
  47956. ctx_ context.Context
  47957. header_ http.Header
  47958. }
  47959. // TestIamPermissions: Returns permissions that a caller has on the
  47960. // specified resource.
  47961. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  47962. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47963. c.project = project
  47964. c.resource = resource
  47965. c.testpermissionsrequest = testpermissionsrequest
  47966. return c
  47967. }
  47968. // Fields allows partial responses to be retrieved. See
  47969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47970. // for more information.
  47971. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  47972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47973. return c
  47974. }
  47975. // Context sets the context to be used in this call's Do method. Any
  47976. // pending HTTP request will be aborted if the provided context is
  47977. // canceled.
  47978. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  47979. c.ctx_ = ctx
  47980. return c
  47981. }
  47982. // Header returns an http.Header that can be modified by the caller to
  47983. // add HTTP headers to the request.
  47984. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  47985. if c.header_ == nil {
  47986. c.header_ = make(http.Header)
  47987. }
  47988. return c.header_
  47989. }
  47990. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  47991. reqHeaders := make(http.Header)
  47992. for k, v := range c.header_ {
  47993. reqHeaders[k] = v
  47994. }
  47995. reqHeaders.Set("User-Agent", c.s.userAgent())
  47996. var body io.Reader = nil
  47997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  47998. if err != nil {
  47999. return nil, err
  48000. }
  48001. reqHeaders.Set("Content-Type", "application/json")
  48002. c.urlParams_.Set("alt", alt)
  48003. c.urlParams_.Set("prettyPrint", "false")
  48004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  48005. urls += "?" + c.urlParams_.Encode()
  48006. req, err := http.NewRequest("POST", urls, body)
  48007. if err != nil {
  48008. return nil, err
  48009. }
  48010. req.Header = reqHeaders
  48011. googleapi.Expand(req.URL, map[string]string{
  48012. "project": c.project,
  48013. "resource": c.resource,
  48014. })
  48015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48016. }
  48017. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  48018. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  48019. // non-2xx status code is an error. Response headers are in either
  48020. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  48021. // returned at all) in error.(*googleapi.Error).Header. Use
  48022. // googleapi.IsNotModified to check whether the returned error was
  48023. // because http.StatusNotModified was returned.
  48024. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  48025. gensupport.SetOptions(c.urlParams_, opts...)
  48026. res, err := c.doRequest("json")
  48027. if res != nil && res.StatusCode == http.StatusNotModified {
  48028. if res.Body != nil {
  48029. res.Body.Close()
  48030. }
  48031. return nil, &googleapi.Error{
  48032. Code: res.StatusCode,
  48033. Header: res.Header,
  48034. }
  48035. }
  48036. if err != nil {
  48037. return nil, err
  48038. }
  48039. defer googleapi.CloseBody(res)
  48040. if err := googleapi.CheckResponse(res); err != nil {
  48041. return nil, err
  48042. }
  48043. ret := &TestPermissionsResponse{
  48044. ServerResponse: googleapi.ServerResponse{
  48045. Header: res.Header,
  48046. HTTPStatusCode: res.StatusCode,
  48047. },
  48048. }
  48049. target := &ret
  48050. if err := gensupport.DecodeResponse(target, res); err != nil {
  48051. return nil, err
  48052. }
  48053. return ret, nil
  48054. // {
  48055. // "description": "Returns permissions that a caller has on the specified resource.",
  48056. // "httpMethod": "POST",
  48057. // "id": "compute.httpHealthChecks.testIamPermissions",
  48058. // "parameterOrder": [
  48059. // "project",
  48060. // "resource"
  48061. // ],
  48062. // "parameters": {
  48063. // "project": {
  48064. // "description": "Project ID for this request.",
  48065. // "location": "path",
  48066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48067. // "required": true,
  48068. // "type": "string"
  48069. // },
  48070. // "resource": {
  48071. // "description": "Name or id of the resource for this request.",
  48072. // "location": "path",
  48073. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48074. // "required": true,
  48075. // "type": "string"
  48076. // }
  48077. // },
  48078. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  48079. // "request": {
  48080. // "$ref": "TestPermissionsRequest"
  48081. // },
  48082. // "response": {
  48083. // "$ref": "TestPermissionsResponse"
  48084. // },
  48085. // "scopes": [
  48086. // "https://www.googleapis.com/auth/cloud-platform",
  48087. // "https://www.googleapis.com/auth/compute",
  48088. // "https://www.googleapis.com/auth/compute.readonly"
  48089. // ]
  48090. // }
  48091. }
  48092. // method id "compute.httpHealthChecks.update":
  48093. type HttpHealthChecksUpdateCall struct {
  48094. s *Service
  48095. project string
  48096. httpHealthCheck string
  48097. httphealthcheck *HttpHealthCheck
  48098. urlParams_ gensupport.URLParams
  48099. ctx_ context.Context
  48100. header_ http.Header
  48101. }
  48102. // Update: Updates a HttpHealthCheck resource in the specified project
  48103. // using the data included in the request.
  48104. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  48105. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  48106. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48107. c.project = project
  48108. c.httpHealthCheck = httpHealthCheck
  48109. c.httphealthcheck = httphealthcheck
  48110. return c
  48111. }
  48112. // RequestId sets the optional parameter "requestId": An optional
  48113. // request ID to identify requests. Specify a unique request ID so that
  48114. // if you must retry your request, the server will know to ignore the
  48115. // request if it has already been completed.
  48116. //
  48117. // For example, consider a situation where you make an initial request
  48118. // and the request times out. If you make the request again with the
  48119. // same request ID, the server can check if original operation with the
  48120. // same request ID was received, and if so, will ignore the second
  48121. // request. This prevents clients from accidentally creating duplicate
  48122. // commitments.
  48123. //
  48124. // The request ID must be a valid UUID with the exception that zero UUID
  48125. // is not supported (00000000-0000-0000-0000-000000000000).
  48126. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  48127. c.urlParams_.Set("requestId", requestId)
  48128. return c
  48129. }
  48130. // Fields allows partial responses to be retrieved. See
  48131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48132. // for more information.
  48133. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  48134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48135. return c
  48136. }
  48137. // Context sets the context to be used in this call's Do method. Any
  48138. // pending HTTP request will be aborted if the provided context is
  48139. // canceled.
  48140. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  48141. c.ctx_ = ctx
  48142. return c
  48143. }
  48144. // Header returns an http.Header that can be modified by the caller to
  48145. // add HTTP headers to the request.
  48146. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  48147. if c.header_ == nil {
  48148. c.header_ = make(http.Header)
  48149. }
  48150. return c.header_
  48151. }
  48152. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  48153. reqHeaders := make(http.Header)
  48154. for k, v := range c.header_ {
  48155. reqHeaders[k] = v
  48156. }
  48157. reqHeaders.Set("User-Agent", c.s.userAgent())
  48158. var body io.Reader = nil
  48159. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  48160. if err != nil {
  48161. return nil, err
  48162. }
  48163. reqHeaders.Set("Content-Type", "application/json")
  48164. c.urlParams_.Set("alt", alt)
  48165. c.urlParams_.Set("prettyPrint", "false")
  48166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  48167. urls += "?" + c.urlParams_.Encode()
  48168. req, err := http.NewRequest("PUT", urls, body)
  48169. if err != nil {
  48170. return nil, err
  48171. }
  48172. req.Header = reqHeaders
  48173. googleapi.Expand(req.URL, map[string]string{
  48174. "project": c.project,
  48175. "httpHealthCheck": c.httpHealthCheck,
  48176. })
  48177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48178. }
  48179. // Do executes the "compute.httpHealthChecks.update" call.
  48180. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48181. // status code is an error. Response headers are in either
  48182. // *Operation.ServerResponse.Header or (if a response was returned at
  48183. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48184. // to check whether the returned error was because
  48185. // http.StatusNotModified was returned.
  48186. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48187. gensupport.SetOptions(c.urlParams_, opts...)
  48188. res, err := c.doRequest("json")
  48189. if res != nil && res.StatusCode == http.StatusNotModified {
  48190. if res.Body != nil {
  48191. res.Body.Close()
  48192. }
  48193. return nil, &googleapi.Error{
  48194. Code: res.StatusCode,
  48195. Header: res.Header,
  48196. }
  48197. }
  48198. if err != nil {
  48199. return nil, err
  48200. }
  48201. defer googleapi.CloseBody(res)
  48202. if err := googleapi.CheckResponse(res); err != nil {
  48203. return nil, err
  48204. }
  48205. ret := &Operation{
  48206. ServerResponse: googleapi.ServerResponse{
  48207. Header: res.Header,
  48208. HTTPStatusCode: res.StatusCode,
  48209. },
  48210. }
  48211. target := &ret
  48212. if err := gensupport.DecodeResponse(target, res); err != nil {
  48213. return nil, err
  48214. }
  48215. return ret, nil
  48216. // {
  48217. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  48218. // "httpMethod": "PUT",
  48219. // "id": "compute.httpHealthChecks.update",
  48220. // "parameterOrder": [
  48221. // "project",
  48222. // "httpHealthCheck"
  48223. // ],
  48224. // "parameters": {
  48225. // "httpHealthCheck": {
  48226. // "description": "Name of the HttpHealthCheck resource to update.",
  48227. // "location": "path",
  48228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48229. // "required": true,
  48230. // "type": "string"
  48231. // },
  48232. // "project": {
  48233. // "description": "Project ID for this request.",
  48234. // "location": "path",
  48235. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48236. // "required": true,
  48237. // "type": "string"
  48238. // },
  48239. // "requestId": {
  48240. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48241. // "location": "query",
  48242. // "type": "string"
  48243. // }
  48244. // },
  48245. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  48246. // "request": {
  48247. // "$ref": "HttpHealthCheck"
  48248. // },
  48249. // "response": {
  48250. // "$ref": "Operation"
  48251. // },
  48252. // "scopes": [
  48253. // "https://www.googleapis.com/auth/cloud-platform",
  48254. // "https://www.googleapis.com/auth/compute"
  48255. // ]
  48256. // }
  48257. }
  48258. // method id "compute.httpsHealthChecks.delete":
  48259. type HttpsHealthChecksDeleteCall struct {
  48260. s *Service
  48261. project string
  48262. httpsHealthCheck string
  48263. urlParams_ gensupport.URLParams
  48264. ctx_ context.Context
  48265. header_ http.Header
  48266. }
  48267. // Delete: Deletes the specified HttpsHealthCheck resource.
  48268. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  48269. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48270. c.project = project
  48271. c.httpsHealthCheck = httpsHealthCheck
  48272. return c
  48273. }
  48274. // RequestId sets the optional parameter "requestId": An optional
  48275. // request ID to identify requests. Specify a unique request ID so that
  48276. // if you must retry your request, the server will know to ignore the
  48277. // request if it has already been completed.
  48278. //
  48279. // For example, consider a situation where you make an initial request
  48280. // and the request times out. If you make the request again with the
  48281. // same request ID, the server can check if original operation with the
  48282. // same request ID was received, and if so, will ignore the second
  48283. // request. This prevents clients from accidentally creating duplicate
  48284. // commitments.
  48285. //
  48286. // The request ID must be a valid UUID with the exception that zero UUID
  48287. // is not supported (00000000-0000-0000-0000-000000000000).
  48288. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  48289. c.urlParams_.Set("requestId", requestId)
  48290. return c
  48291. }
  48292. // Fields allows partial responses to be retrieved. See
  48293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48294. // for more information.
  48295. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  48296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48297. return c
  48298. }
  48299. // Context sets the context to be used in this call's Do method. Any
  48300. // pending HTTP request will be aborted if the provided context is
  48301. // canceled.
  48302. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  48303. c.ctx_ = ctx
  48304. return c
  48305. }
  48306. // Header returns an http.Header that can be modified by the caller to
  48307. // add HTTP headers to the request.
  48308. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  48309. if c.header_ == nil {
  48310. c.header_ = make(http.Header)
  48311. }
  48312. return c.header_
  48313. }
  48314. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  48315. reqHeaders := make(http.Header)
  48316. for k, v := range c.header_ {
  48317. reqHeaders[k] = v
  48318. }
  48319. reqHeaders.Set("User-Agent", c.s.userAgent())
  48320. var body io.Reader = nil
  48321. c.urlParams_.Set("alt", alt)
  48322. c.urlParams_.Set("prettyPrint", "false")
  48323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  48324. urls += "?" + c.urlParams_.Encode()
  48325. req, err := http.NewRequest("DELETE", urls, body)
  48326. if err != nil {
  48327. return nil, err
  48328. }
  48329. req.Header = reqHeaders
  48330. googleapi.Expand(req.URL, map[string]string{
  48331. "project": c.project,
  48332. "httpsHealthCheck": c.httpsHealthCheck,
  48333. })
  48334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48335. }
  48336. // Do executes the "compute.httpsHealthChecks.delete" call.
  48337. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48338. // status code is an error. Response headers are in either
  48339. // *Operation.ServerResponse.Header or (if a response was returned at
  48340. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48341. // to check whether the returned error was because
  48342. // http.StatusNotModified was returned.
  48343. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48344. gensupport.SetOptions(c.urlParams_, opts...)
  48345. res, err := c.doRequest("json")
  48346. if res != nil && res.StatusCode == http.StatusNotModified {
  48347. if res.Body != nil {
  48348. res.Body.Close()
  48349. }
  48350. return nil, &googleapi.Error{
  48351. Code: res.StatusCode,
  48352. Header: res.Header,
  48353. }
  48354. }
  48355. if err != nil {
  48356. return nil, err
  48357. }
  48358. defer googleapi.CloseBody(res)
  48359. if err := googleapi.CheckResponse(res); err != nil {
  48360. return nil, err
  48361. }
  48362. ret := &Operation{
  48363. ServerResponse: googleapi.ServerResponse{
  48364. Header: res.Header,
  48365. HTTPStatusCode: res.StatusCode,
  48366. },
  48367. }
  48368. target := &ret
  48369. if err := gensupport.DecodeResponse(target, res); err != nil {
  48370. return nil, err
  48371. }
  48372. return ret, nil
  48373. // {
  48374. // "description": "Deletes the specified HttpsHealthCheck resource.",
  48375. // "httpMethod": "DELETE",
  48376. // "id": "compute.httpsHealthChecks.delete",
  48377. // "parameterOrder": [
  48378. // "project",
  48379. // "httpsHealthCheck"
  48380. // ],
  48381. // "parameters": {
  48382. // "httpsHealthCheck": {
  48383. // "description": "Name of the HttpsHealthCheck resource to delete.",
  48384. // "location": "path",
  48385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48386. // "required": true,
  48387. // "type": "string"
  48388. // },
  48389. // "project": {
  48390. // "description": "Project ID for this request.",
  48391. // "location": "path",
  48392. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48393. // "required": true,
  48394. // "type": "string"
  48395. // },
  48396. // "requestId": {
  48397. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48398. // "location": "query",
  48399. // "type": "string"
  48400. // }
  48401. // },
  48402. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  48403. // "response": {
  48404. // "$ref": "Operation"
  48405. // },
  48406. // "scopes": [
  48407. // "https://www.googleapis.com/auth/cloud-platform",
  48408. // "https://www.googleapis.com/auth/compute"
  48409. // ]
  48410. // }
  48411. }
  48412. // method id "compute.httpsHealthChecks.get":
  48413. type HttpsHealthChecksGetCall struct {
  48414. s *Service
  48415. project string
  48416. httpsHealthCheck string
  48417. urlParams_ gensupport.URLParams
  48418. ifNoneMatch_ string
  48419. ctx_ context.Context
  48420. header_ http.Header
  48421. }
  48422. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  48423. // available HTTPS health checks by making a list() request.
  48424. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  48425. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48426. c.project = project
  48427. c.httpsHealthCheck = httpsHealthCheck
  48428. return c
  48429. }
  48430. // Fields allows partial responses to be retrieved. See
  48431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48432. // for more information.
  48433. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  48434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48435. return c
  48436. }
  48437. // IfNoneMatch sets the optional parameter which makes the operation
  48438. // fail if the object's ETag matches the given value. This is useful for
  48439. // getting updates only after the object has changed since the last
  48440. // request. Use googleapi.IsNotModified to check whether the response
  48441. // error from Do is the result of In-None-Match.
  48442. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  48443. c.ifNoneMatch_ = entityTag
  48444. return c
  48445. }
  48446. // Context sets the context to be used in this call's Do method. Any
  48447. // pending HTTP request will be aborted if the provided context is
  48448. // canceled.
  48449. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  48450. c.ctx_ = ctx
  48451. return c
  48452. }
  48453. // Header returns an http.Header that can be modified by the caller to
  48454. // add HTTP headers to the request.
  48455. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  48456. if c.header_ == nil {
  48457. c.header_ = make(http.Header)
  48458. }
  48459. return c.header_
  48460. }
  48461. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  48462. reqHeaders := make(http.Header)
  48463. for k, v := range c.header_ {
  48464. reqHeaders[k] = v
  48465. }
  48466. reqHeaders.Set("User-Agent", c.s.userAgent())
  48467. if c.ifNoneMatch_ != "" {
  48468. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48469. }
  48470. var body io.Reader = nil
  48471. c.urlParams_.Set("alt", alt)
  48472. c.urlParams_.Set("prettyPrint", "false")
  48473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  48474. urls += "?" + c.urlParams_.Encode()
  48475. req, err := http.NewRequest("GET", urls, body)
  48476. if err != nil {
  48477. return nil, err
  48478. }
  48479. req.Header = reqHeaders
  48480. googleapi.Expand(req.URL, map[string]string{
  48481. "project": c.project,
  48482. "httpsHealthCheck": c.httpsHealthCheck,
  48483. })
  48484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48485. }
  48486. // Do executes the "compute.httpsHealthChecks.get" call.
  48487. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  48488. // non-2xx status code is an error. Response headers are in either
  48489. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  48490. // returned at all) in error.(*googleapi.Error).Header. Use
  48491. // googleapi.IsNotModified to check whether the returned error was
  48492. // because http.StatusNotModified was returned.
  48493. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  48494. gensupport.SetOptions(c.urlParams_, opts...)
  48495. res, err := c.doRequest("json")
  48496. if res != nil && res.StatusCode == http.StatusNotModified {
  48497. if res.Body != nil {
  48498. res.Body.Close()
  48499. }
  48500. return nil, &googleapi.Error{
  48501. Code: res.StatusCode,
  48502. Header: res.Header,
  48503. }
  48504. }
  48505. if err != nil {
  48506. return nil, err
  48507. }
  48508. defer googleapi.CloseBody(res)
  48509. if err := googleapi.CheckResponse(res); err != nil {
  48510. return nil, err
  48511. }
  48512. ret := &HttpsHealthCheck{
  48513. ServerResponse: googleapi.ServerResponse{
  48514. Header: res.Header,
  48515. HTTPStatusCode: res.StatusCode,
  48516. },
  48517. }
  48518. target := &ret
  48519. if err := gensupport.DecodeResponse(target, res); err != nil {
  48520. return nil, err
  48521. }
  48522. return ret, nil
  48523. // {
  48524. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  48525. // "httpMethod": "GET",
  48526. // "id": "compute.httpsHealthChecks.get",
  48527. // "parameterOrder": [
  48528. // "project",
  48529. // "httpsHealthCheck"
  48530. // ],
  48531. // "parameters": {
  48532. // "httpsHealthCheck": {
  48533. // "description": "Name of the HttpsHealthCheck resource to return.",
  48534. // "location": "path",
  48535. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48536. // "required": true,
  48537. // "type": "string"
  48538. // },
  48539. // "project": {
  48540. // "description": "Project ID for this request.",
  48541. // "location": "path",
  48542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48543. // "required": true,
  48544. // "type": "string"
  48545. // }
  48546. // },
  48547. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  48548. // "response": {
  48549. // "$ref": "HttpsHealthCheck"
  48550. // },
  48551. // "scopes": [
  48552. // "https://www.googleapis.com/auth/cloud-platform",
  48553. // "https://www.googleapis.com/auth/compute",
  48554. // "https://www.googleapis.com/auth/compute.readonly"
  48555. // ]
  48556. // }
  48557. }
  48558. // method id "compute.httpsHealthChecks.insert":
  48559. type HttpsHealthChecksInsertCall struct {
  48560. s *Service
  48561. project string
  48562. httpshealthcheck *HttpsHealthCheck
  48563. urlParams_ gensupport.URLParams
  48564. ctx_ context.Context
  48565. header_ http.Header
  48566. }
  48567. // Insert: Creates a HttpsHealthCheck resource in the specified project
  48568. // using the data included in the request.
  48569. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  48570. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48571. c.project = project
  48572. c.httpshealthcheck = httpshealthcheck
  48573. return c
  48574. }
  48575. // RequestId sets the optional parameter "requestId": An optional
  48576. // request ID to identify requests. Specify a unique request ID so that
  48577. // if you must retry your request, the server will know to ignore the
  48578. // request if it has already been completed.
  48579. //
  48580. // For example, consider a situation where you make an initial request
  48581. // and the request times out. If you make the request again with the
  48582. // same request ID, the server can check if original operation with the
  48583. // same request ID was received, and if so, will ignore the second
  48584. // request. This prevents clients from accidentally creating duplicate
  48585. // commitments.
  48586. //
  48587. // The request ID must be a valid UUID with the exception that zero UUID
  48588. // is not supported (00000000-0000-0000-0000-000000000000).
  48589. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  48590. c.urlParams_.Set("requestId", requestId)
  48591. return c
  48592. }
  48593. // Fields allows partial responses to be retrieved. See
  48594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48595. // for more information.
  48596. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  48597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48598. return c
  48599. }
  48600. // Context sets the context to be used in this call's Do method. Any
  48601. // pending HTTP request will be aborted if the provided context is
  48602. // canceled.
  48603. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  48604. c.ctx_ = ctx
  48605. return c
  48606. }
  48607. // Header returns an http.Header that can be modified by the caller to
  48608. // add HTTP headers to the request.
  48609. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  48610. if c.header_ == nil {
  48611. c.header_ = make(http.Header)
  48612. }
  48613. return c.header_
  48614. }
  48615. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  48616. reqHeaders := make(http.Header)
  48617. for k, v := range c.header_ {
  48618. reqHeaders[k] = v
  48619. }
  48620. reqHeaders.Set("User-Agent", c.s.userAgent())
  48621. var body io.Reader = nil
  48622. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  48623. if err != nil {
  48624. return nil, err
  48625. }
  48626. reqHeaders.Set("Content-Type", "application/json")
  48627. c.urlParams_.Set("alt", alt)
  48628. c.urlParams_.Set("prettyPrint", "false")
  48629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  48630. urls += "?" + c.urlParams_.Encode()
  48631. req, err := http.NewRequest("POST", urls, body)
  48632. if err != nil {
  48633. return nil, err
  48634. }
  48635. req.Header = reqHeaders
  48636. googleapi.Expand(req.URL, map[string]string{
  48637. "project": c.project,
  48638. })
  48639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48640. }
  48641. // Do executes the "compute.httpsHealthChecks.insert" call.
  48642. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48643. // status code is an error. Response headers are in either
  48644. // *Operation.ServerResponse.Header or (if a response was returned at
  48645. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48646. // to check whether the returned error was because
  48647. // http.StatusNotModified was returned.
  48648. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48649. gensupport.SetOptions(c.urlParams_, opts...)
  48650. res, err := c.doRequest("json")
  48651. if res != nil && res.StatusCode == http.StatusNotModified {
  48652. if res.Body != nil {
  48653. res.Body.Close()
  48654. }
  48655. return nil, &googleapi.Error{
  48656. Code: res.StatusCode,
  48657. Header: res.Header,
  48658. }
  48659. }
  48660. if err != nil {
  48661. return nil, err
  48662. }
  48663. defer googleapi.CloseBody(res)
  48664. if err := googleapi.CheckResponse(res); err != nil {
  48665. return nil, err
  48666. }
  48667. ret := &Operation{
  48668. ServerResponse: googleapi.ServerResponse{
  48669. Header: res.Header,
  48670. HTTPStatusCode: res.StatusCode,
  48671. },
  48672. }
  48673. target := &ret
  48674. if err := gensupport.DecodeResponse(target, res); err != nil {
  48675. return nil, err
  48676. }
  48677. return ret, nil
  48678. // {
  48679. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  48680. // "httpMethod": "POST",
  48681. // "id": "compute.httpsHealthChecks.insert",
  48682. // "parameterOrder": [
  48683. // "project"
  48684. // ],
  48685. // "parameters": {
  48686. // "project": {
  48687. // "description": "Project ID for this request.",
  48688. // "location": "path",
  48689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48690. // "required": true,
  48691. // "type": "string"
  48692. // },
  48693. // "requestId": {
  48694. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48695. // "location": "query",
  48696. // "type": "string"
  48697. // }
  48698. // },
  48699. // "path": "{project}/global/httpsHealthChecks",
  48700. // "request": {
  48701. // "$ref": "HttpsHealthCheck"
  48702. // },
  48703. // "response": {
  48704. // "$ref": "Operation"
  48705. // },
  48706. // "scopes": [
  48707. // "https://www.googleapis.com/auth/cloud-platform",
  48708. // "https://www.googleapis.com/auth/compute"
  48709. // ]
  48710. // }
  48711. }
  48712. // method id "compute.httpsHealthChecks.list":
  48713. type HttpsHealthChecksListCall struct {
  48714. s *Service
  48715. project string
  48716. urlParams_ gensupport.URLParams
  48717. ifNoneMatch_ string
  48718. ctx_ context.Context
  48719. header_ http.Header
  48720. }
  48721. // List: Retrieves the list of HttpsHealthCheck resources available to
  48722. // the specified project.
  48723. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  48724. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48725. c.project = project
  48726. return c
  48727. }
  48728. // Filter sets the optional parameter "filter": A filter expression that
  48729. // filters resources listed in the response. The expression must specify
  48730. // the field name, a comparison operator, and the value that you want to
  48731. // use for filtering. The value must be a string, a number, or a
  48732. // boolean. The comparison operator must be either =, !=, >, or <.
  48733. //
  48734. // For example, if you are filtering Compute Engine instances, you can
  48735. // exclude instances named example-instance by specifying name !=
  48736. // example-instance.
  48737. //
  48738. // You can also filter nested fields. For example, you could specify
  48739. // scheduling.automaticRestart = false to include instances only if they
  48740. // are not scheduled for automatic restarts. You can use filtering on
  48741. // nested fields to filter based on resource labels.
  48742. //
  48743. // To filter on multiple expressions, provide each separate expression
  48744. // within parentheses. For example, (scheduling.automaticRestart = true)
  48745. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48746. // AND expression. However, you can include AND and OR expressions
  48747. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48748. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48749. // true).
  48750. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  48751. c.urlParams_.Set("filter", filter)
  48752. return c
  48753. }
  48754. // MaxResults sets the optional parameter "maxResults": The maximum
  48755. // number of results per page that should be returned. If the number of
  48756. // available results is larger than maxResults, Compute Engine returns a
  48757. // nextPageToken that can be used to get the next page of results in
  48758. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48759. // (Default: 500)
  48760. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  48761. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48762. return c
  48763. }
  48764. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48765. // a certain order. By default, results are returned in alphanumerical
  48766. // order based on the resource name.
  48767. //
  48768. // You can also sort results in descending order based on the creation
  48769. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48770. // based on the creationTimestamp field in reverse chronological order
  48771. // (newest result first). Use this to sort resources like operations so
  48772. // that the newest operation is returned first.
  48773. //
  48774. // Currently, only sorting by name or creationTimestamp desc is
  48775. // supported.
  48776. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  48777. c.urlParams_.Set("orderBy", orderBy)
  48778. return c
  48779. }
  48780. // PageToken sets the optional parameter "pageToken": Specifies a page
  48781. // token to use. Set pageToken to the nextPageToken returned by a
  48782. // previous list request to get the next page of results.
  48783. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  48784. c.urlParams_.Set("pageToken", pageToken)
  48785. return c
  48786. }
  48787. // Fields allows partial responses to be retrieved. See
  48788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48789. // for more information.
  48790. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  48791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48792. return c
  48793. }
  48794. // IfNoneMatch sets the optional parameter which makes the operation
  48795. // fail if the object's ETag matches the given value. This is useful for
  48796. // getting updates only after the object has changed since the last
  48797. // request. Use googleapi.IsNotModified to check whether the response
  48798. // error from Do is the result of In-None-Match.
  48799. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  48800. c.ifNoneMatch_ = entityTag
  48801. return c
  48802. }
  48803. // Context sets the context to be used in this call's Do method. Any
  48804. // pending HTTP request will be aborted if the provided context is
  48805. // canceled.
  48806. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  48807. c.ctx_ = ctx
  48808. return c
  48809. }
  48810. // Header returns an http.Header that can be modified by the caller to
  48811. // add HTTP headers to the request.
  48812. func (c *HttpsHealthChecksListCall) Header() http.Header {
  48813. if c.header_ == nil {
  48814. c.header_ = make(http.Header)
  48815. }
  48816. return c.header_
  48817. }
  48818. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  48819. reqHeaders := make(http.Header)
  48820. for k, v := range c.header_ {
  48821. reqHeaders[k] = v
  48822. }
  48823. reqHeaders.Set("User-Agent", c.s.userAgent())
  48824. if c.ifNoneMatch_ != "" {
  48825. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48826. }
  48827. var body io.Reader = nil
  48828. c.urlParams_.Set("alt", alt)
  48829. c.urlParams_.Set("prettyPrint", "false")
  48830. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  48831. urls += "?" + c.urlParams_.Encode()
  48832. req, err := http.NewRequest("GET", urls, body)
  48833. if err != nil {
  48834. return nil, err
  48835. }
  48836. req.Header = reqHeaders
  48837. googleapi.Expand(req.URL, map[string]string{
  48838. "project": c.project,
  48839. })
  48840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48841. }
  48842. // Do executes the "compute.httpsHealthChecks.list" call.
  48843. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  48844. // non-2xx status code is an error. Response headers are in either
  48845. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  48846. // returned at all) in error.(*googleapi.Error).Header. Use
  48847. // googleapi.IsNotModified to check whether the returned error was
  48848. // because http.StatusNotModified was returned.
  48849. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  48850. gensupport.SetOptions(c.urlParams_, opts...)
  48851. res, err := c.doRequest("json")
  48852. if res != nil && res.StatusCode == http.StatusNotModified {
  48853. if res.Body != nil {
  48854. res.Body.Close()
  48855. }
  48856. return nil, &googleapi.Error{
  48857. Code: res.StatusCode,
  48858. Header: res.Header,
  48859. }
  48860. }
  48861. if err != nil {
  48862. return nil, err
  48863. }
  48864. defer googleapi.CloseBody(res)
  48865. if err := googleapi.CheckResponse(res); err != nil {
  48866. return nil, err
  48867. }
  48868. ret := &HttpsHealthCheckList{
  48869. ServerResponse: googleapi.ServerResponse{
  48870. Header: res.Header,
  48871. HTTPStatusCode: res.StatusCode,
  48872. },
  48873. }
  48874. target := &ret
  48875. if err := gensupport.DecodeResponse(target, res); err != nil {
  48876. return nil, err
  48877. }
  48878. return ret, nil
  48879. // {
  48880. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  48881. // "httpMethod": "GET",
  48882. // "id": "compute.httpsHealthChecks.list",
  48883. // "parameterOrder": [
  48884. // "project"
  48885. // ],
  48886. // "parameters": {
  48887. // "filter": {
  48888. // "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).",
  48889. // "location": "query",
  48890. // "type": "string"
  48891. // },
  48892. // "maxResults": {
  48893. // "default": "500",
  48894. // "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)",
  48895. // "format": "uint32",
  48896. // "location": "query",
  48897. // "minimum": "0",
  48898. // "type": "integer"
  48899. // },
  48900. // "orderBy": {
  48901. // "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.",
  48902. // "location": "query",
  48903. // "type": "string"
  48904. // },
  48905. // "pageToken": {
  48906. // "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.",
  48907. // "location": "query",
  48908. // "type": "string"
  48909. // },
  48910. // "project": {
  48911. // "description": "Project ID for this request.",
  48912. // "location": "path",
  48913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48914. // "required": true,
  48915. // "type": "string"
  48916. // }
  48917. // },
  48918. // "path": "{project}/global/httpsHealthChecks",
  48919. // "response": {
  48920. // "$ref": "HttpsHealthCheckList"
  48921. // },
  48922. // "scopes": [
  48923. // "https://www.googleapis.com/auth/cloud-platform",
  48924. // "https://www.googleapis.com/auth/compute",
  48925. // "https://www.googleapis.com/auth/compute.readonly"
  48926. // ]
  48927. // }
  48928. }
  48929. // Pages invokes f for each page of results.
  48930. // A non-nil error returned from f will halt the iteration.
  48931. // The provided context supersedes any context provided to the Context method.
  48932. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  48933. c.ctx_ = ctx
  48934. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48935. for {
  48936. x, err := c.Do()
  48937. if err != nil {
  48938. return err
  48939. }
  48940. if err := f(x); err != nil {
  48941. return err
  48942. }
  48943. if x.NextPageToken == "" {
  48944. return nil
  48945. }
  48946. c.PageToken(x.NextPageToken)
  48947. }
  48948. }
  48949. // method id "compute.httpsHealthChecks.patch":
  48950. type HttpsHealthChecksPatchCall struct {
  48951. s *Service
  48952. project string
  48953. httpsHealthCheck string
  48954. httpshealthcheck *HttpsHealthCheck
  48955. urlParams_ gensupport.URLParams
  48956. ctx_ context.Context
  48957. header_ http.Header
  48958. }
  48959. // Patch: Updates a HttpsHealthCheck resource in the specified project
  48960. // using the data included in the request. This method supports PATCH
  48961. // semantics and uses the JSON merge patch format and processing rules.
  48962. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  48963. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48964. c.project = project
  48965. c.httpsHealthCheck = httpsHealthCheck
  48966. c.httpshealthcheck = httpshealthcheck
  48967. return c
  48968. }
  48969. // RequestId sets the optional parameter "requestId": An optional
  48970. // request ID to identify requests. Specify a unique request ID so that
  48971. // if you must retry your request, the server will know to ignore the
  48972. // request if it has already been completed.
  48973. //
  48974. // For example, consider a situation where you make an initial request
  48975. // and the request times out. If you make the request again with the
  48976. // same request ID, the server can check if original operation with the
  48977. // same request ID was received, and if so, will ignore the second
  48978. // request. This prevents clients from accidentally creating duplicate
  48979. // commitments.
  48980. //
  48981. // The request ID must be a valid UUID with the exception that zero UUID
  48982. // is not supported (00000000-0000-0000-0000-000000000000).
  48983. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  48984. c.urlParams_.Set("requestId", requestId)
  48985. return c
  48986. }
  48987. // Fields allows partial responses to be retrieved. See
  48988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48989. // for more information.
  48990. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  48991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48992. return c
  48993. }
  48994. // Context sets the context to be used in this call's Do method. Any
  48995. // pending HTTP request will be aborted if the provided context is
  48996. // canceled.
  48997. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  48998. c.ctx_ = ctx
  48999. return c
  49000. }
  49001. // Header returns an http.Header that can be modified by the caller to
  49002. // add HTTP headers to the request.
  49003. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  49004. if c.header_ == nil {
  49005. c.header_ = make(http.Header)
  49006. }
  49007. return c.header_
  49008. }
  49009. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  49010. reqHeaders := make(http.Header)
  49011. for k, v := range c.header_ {
  49012. reqHeaders[k] = v
  49013. }
  49014. reqHeaders.Set("User-Agent", c.s.userAgent())
  49015. var body io.Reader = nil
  49016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  49017. if err != nil {
  49018. return nil, err
  49019. }
  49020. reqHeaders.Set("Content-Type", "application/json")
  49021. c.urlParams_.Set("alt", alt)
  49022. c.urlParams_.Set("prettyPrint", "false")
  49023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  49024. urls += "?" + c.urlParams_.Encode()
  49025. req, err := http.NewRequest("PATCH", urls, body)
  49026. if err != nil {
  49027. return nil, err
  49028. }
  49029. req.Header = reqHeaders
  49030. googleapi.Expand(req.URL, map[string]string{
  49031. "project": c.project,
  49032. "httpsHealthCheck": c.httpsHealthCheck,
  49033. })
  49034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49035. }
  49036. // Do executes the "compute.httpsHealthChecks.patch" call.
  49037. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49038. // status code is an error. Response headers are in either
  49039. // *Operation.ServerResponse.Header or (if a response was returned at
  49040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49041. // to check whether the returned error was because
  49042. // http.StatusNotModified was returned.
  49043. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49044. gensupport.SetOptions(c.urlParams_, opts...)
  49045. res, err := c.doRequest("json")
  49046. if res != nil && res.StatusCode == http.StatusNotModified {
  49047. if res.Body != nil {
  49048. res.Body.Close()
  49049. }
  49050. return nil, &googleapi.Error{
  49051. Code: res.StatusCode,
  49052. Header: res.Header,
  49053. }
  49054. }
  49055. if err != nil {
  49056. return nil, err
  49057. }
  49058. defer googleapi.CloseBody(res)
  49059. if err := googleapi.CheckResponse(res); err != nil {
  49060. return nil, err
  49061. }
  49062. ret := &Operation{
  49063. ServerResponse: googleapi.ServerResponse{
  49064. Header: res.Header,
  49065. HTTPStatusCode: res.StatusCode,
  49066. },
  49067. }
  49068. target := &ret
  49069. if err := gensupport.DecodeResponse(target, res); err != nil {
  49070. return nil, err
  49071. }
  49072. return ret, nil
  49073. // {
  49074. // "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.",
  49075. // "httpMethod": "PATCH",
  49076. // "id": "compute.httpsHealthChecks.patch",
  49077. // "parameterOrder": [
  49078. // "project",
  49079. // "httpsHealthCheck"
  49080. // ],
  49081. // "parameters": {
  49082. // "httpsHealthCheck": {
  49083. // "description": "Name of the HttpsHealthCheck resource to patch.",
  49084. // "location": "path",
  49085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49086. // "required": true,
  49087. // "type": "string"
  49088. // },
  49089. // "project": {
  49090. // "description": "Project ID for this request.",
  49091. // "location": "path",
  49092. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49093. // "required": true,
  49094. // "type": "string"
  49095. // },
  49096. // "requestId": {
  49097. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49098. // "location": "query",
  49099. // "type": "string"
  49100. // }
  49101. // },
  49102. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  49103. // "request": {
  49104. // "$ref": "HttpsHealthCheck"
  49105. // },
  49106. // "response": {
  49107. // "$ref": "Operation"
  49108. // },
  49109. // "scopes": [
  49110. // "https://www.googleapis.com/auth/cloud-platform",
  49111. // "https://www.googleapis.com/auth/compute"
  49112. // ]
  49113. // }
  49114. }
  49115. // method id "compute.httpsHealthChecks.testIamPermissions":
  49116. type HttpsHealthChecksTestIamPermissionsCall struct {
  49117. s *Service
  49118. project string
  49119. resource string
  49120. testpermissionsrequest *TestPermissionsRequest
  49121. urlParams_ gensupport.URLParams
  49122. ctx_ context.Context
  49123. header_ http.Header
  49124. }
  49125. // TestIamPermissions: Returns permissions that a caller has on the
  49126. // specified resource.
  49127. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  49128. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49129. c.project = project
  49130. c.resource = resource
  49131. c.testpermissionsrequest = testpermissionsrequest
  49132. return c
  49133. }
  49134. // Fields allows partial responses to be retrieved. See
  49135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49136. // for more information.
  49137. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  49138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49139. return c
  49140. }
  49141. // Context sets the context to be used in this call's Do method. Any
  49142. // pending HTTP request will be aborted if the provided context is
  49143. // canceled.
  49144. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  49145. c.ctx_ = ctx
  49146. return c
  49147. }
  49148. // Header returns an http.Header that can be modified by the caller to
  49149. // add HTTP headers to the request.
  49150. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  49151. if c.header_ == nil {
  49152. c.header_ = make(http.Header)
  49153. }
  49154. return c.header_
  49155. }
  49156. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49157. reqHeaders := make(http.Header)
  49158. for k, v := range c.header_ {
  49159. reqHeaders[k] = v
  49160. }
  49161. reqHeaders.Set("User-Agent", c.s.userAgent())
  49162. var body io.Reader = nil
  49163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49164. if err != nil {
  49165. return nil, err
  49166. }
  49167. reqHeaders.Set("Content-Type", "application/json")
  49168. c.urlParams_.Set("alt", alt)
  49169. c.urlParams_.Set("prettyPrint", "false")
  49170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  49171. urls += "?" + c.urlParams_.Encode()
  49172. req, err := http.NewRequest("POST", urls, body)
  49173. if err != nil {
  49174. return nil, err
  49175. }
  49176. req.Header = reqHeaders
  49177. googleapi.Expand(req.URL, map[string]string{
  49178. "project": c.project,
  49179. "resource": c.resource,
  49180. })
  49181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49182. }
  49183. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  49184. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49185. // non-2xx status code is an error. Response headers are in either
  49186. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49187. // returned at all) in error.(*googleapi.Error).Header. Use
  49188. // googleapi.IsNotModified to check whether the returned error was
  49189. // because http.StatusNotModified was returned.
  49190. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49191. gensupport.SetOptions(c.urlParams_, opts...)
  49192. res, err := c.doRequest("json")
  49193. if res != nil && res.StatusCode == http.StatusNotModified {
  49194. if res.Body != nil {
  49195. res.Body.Close()
  49196. }
  49197. return nil, &googleapi.Error{
  49198. Code: res.StatusCode,
  49199. Header: res.Header,
  49200. }
  49201. }
  49202. if err != nil {
  49203. return nil, err
  49204. }
  49205. defer googleapi.CloseBody(res)
  49206. if err := googleapi.CheckResponse(res); err != nil {
  49207. return nil, err
  49208. }
  49209. ret := &TestPermissionsResponse{
  49210. ServerResponse: googleapi.ServerResponse{
  49211. Header: res.Header,
  49212. HTTPStatusCode: res.StatusCode,
  49213. },
  49214. }
  49215. target := &ret
  49216. if err := gensupport.DecodeResponse(target, res); err != nil {
  49217. return nil, err
  49218. }
  49219. return ret, nil
  49220. // {
  49221. // "description": "Returns permissions that a caller has on the specified resource.",
  49222. // "httpMethod": "POST",
  49223. // "id": "compute.httpsHealthChecks.testIamPermissions",
  49224. // "parameterOrder": [
  49225. // "project",
  49226. // "resource"
  49227. // ],
  49228. // "parameters": {
  49229. // "project": {
  49230. // "description": "Project ID for this request.",
  49231. // "location": "path",
  49232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49233. // "required": true,
  49234. // "type": "string"
  49235. // },
  49236. // "resource": {
  49237. // "description": "Name or id of the resource for this request.",
  49238. // "location": "path",
  49239. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49240. // "required": true,
  49241. // "type": "string"
  49242. // }
  49243. // },
  49244. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  49245. // "request": {
  49246. // "$ref": "TestPermissionsRequest"
  49247. // },
  49248. // "response": {
  49249. // "$ref": "TestPermissionsResponse"
  49250. // },
  49251. // "scopes": [
  49252. // "https://www.googleapis.com/auth/cloud-platform",
  49253. // "https://www.googleapis.com/auth/compute",
  49254. // "https://www.googleapis.com/auth/compute.readonly"
  49255. // ]
  49256. // }
  49257. }
  49258. // method id "compute.httpsHealthChecks.update":
  49259. type HttpsHealthChecksUpdateCall struct {
  49260. s *Service
  49261. project string
  49262. httpsHealthCheck string
  49263. httpshealthcheck *HttpsHealthCheck
  49264. urlParams_ gensupport.URLParams
  49265. ctx_ context.Context
  49266. header_ http.Header
  49267. }
  49268. // Update: Updates a HttpsHealthCheck resource in the specified project
  49269. // using the data included in the request.
  49270. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  49271. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49272. c.project = project
  49273. c.httpsHealthCheck = httpsHealthCheck
  49274. c.httpshealthcheck = httpshealthcheck
  49275. return c
  49276. }
  49277. // RequestId sets the optional parameter "requestId": An optional
  49278. // request ID to identify requests. Specify a unique request ID so that
  49279. // if you must retry your request, the server will know to ignore the
  49280. // request if it has already been completed.
  49281. //
  49282. // For example, consider a situation where you make an initial request
  49283. // and the request times out. If you make the request again with the
  49284. // same request ID, the server can check if original operation with the
  49285. // same request ID was received, and if so, will ignore the second
  49286. // request. This prevents clients from accidentally creating duplicate
  49287. // commitments.
  49288. //
  49289. // The request ID must be a valid UUID with the exception that zero UUID
  49290. // is not supported (00000000-0000-0000-0000-000000000000).
  49291. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  49292. c.urlParams_.Set("requestId", requestId)
  49293. return c
  49294. }
  49295. // Fields allows partial responses to be retrieved. See
  49296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49297. // for more information.
  49298. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  49299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49300. return c
  49301. }
  49302. // Context sets the context to be used in this call's Do method. Any
  49303. // pending HTTP request will be aborted if the provided context is
  49304. // canceled.
  49305. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  49306. c.ctx_ = ctx
  49307. return c
  49308. }
  49309. // Header returns an http.Header that can be modified by the caller to
  49310. // add HTTP headers to the request.
  49311. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  49312. if c.header_ == nil {
  49313. c.header_ = make(http.Header)
  49314. }
  49315. return c.header_
  49316. }
  49317. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  49318. reqHeaders := make(http.Header)
  49319. for k, v := range c.header_ {
  49320. reqHeaders[k] = v
  49321. }
  49322. reqHeaders.Set("User-Agent", c.s.userAgent())
  49323. var body io.Reader = nil
  49324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  49325. if err != nil {
  49326. return nil, err
  49327. }
  49328. reqHeaders.Set("Content-Type", "application/json")
  49329. c.urlParams_.Set("alt", alt)
  49330. c.urlParams_.Set("prettyPrint", "false")
  49331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  49332. urls += "?" + c.urlParams_.Encode()
  49333. req, err := http.NewRequest("PUT", urls, body)
  49334. if err != nil {
  49335. return nil, err
  49336. }
  49337. req.Header = reqHeaders
  49338. googleapi.Expand(req.URL, map[string]string{
  49339. "project": c.project,
  49340. "httpsHealthCheck": c.httpsHealthCheck,
  49341. })
  49342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49343. }
  49344. // Do executes the "compute.httpsHealthChecks.update" call.
  49345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49346. // status code is an error. Response headers are in either
  49347. // *Operation.ServerResponse.Header or (if a response was returned at
  49348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49349. // to check whether the returned error was because
  49350. // http.StatusNotModified was returned.
  49351. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49352. gensupport.SetOptions(c.urlParams_, opts...)
  49353. res, err := c.doRequest("json")
  49354. if res != nil && res.StatusCode == http.StatusNotModified {
  49355. if res.Body != nil {
  49356. res.Body.Close()
  49357. }
  49358. return nil, &googleapi.Error{
  49359. Code: res.StatusCode,
  49360. Header: res.Header,
  49361. }
  49362. }
  49363. if err != nil {
  49364. return nil, err
  49365. }
  49366. defer googleapi.CloseBody(res)
  49367. if err := googleapi.CheckResponse(res); err != nil {
  49368. return nil, err
  49369. }
  49370. ret := &Operation{
  49371. ServerResponse: googleapi.ServerResponse{
  49372. Header: res.Header,
  49373. HTTPStatusCode: res.StatusCode,
  49374. },
  49375. }
  49376. target := &ret
  49377. if err := gensupport.DecodeResponse(target, res); err != nil {
  49378. return nil, err
  49379. }
  49380. return ret, nil
  49381. // {
  49382. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  49383. // "httpMethod": "PUT",
  49384. // "id": "compute.httpsHealthChecks.update",
  49385. // "parameterOrder": [
  49386. // "project",
  49387. // "httpsHealthCheck"
  49388. // ],
  49389. // "parameters": {
  49390. // "httpsHealthCheck": {
  49391. // "description": "Name of the HttpsHealthCheck resource to update.",
  49392. // "location": "path",
  49393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49394. // "required": true,
  49395. // "type": "string"
  49396. // },
  49397. // "project": {
  49398. // "description": "Project ID for this request.",
  49399. // "location": "path",
  49400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49401. // "required": true,
  49402. // "type": "string"
  49403. // },
  49404. // "requestId": {
  49405. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49406. // "location": "query",
  49407. // "type": "string"
  49408. // }
  49409. // },
  49410. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  49411. // "request": {
  49412. // "$ref": "HttpsHealthCheck"
  49413. // },
  49414. // "response": {
  49415. // "$ref": "Operation"
  49416. // },
  49417. // "scopes": [
  49418. // "https://www.googleapis.com/auth/cloud-platform",
  49419. // "https://www.googleapis.com/auth/compute"
  49420. // ]
  49421. // }
  49422. }
  49423. // method id "compute.images.delete":
  49424. type ImagesDeleteCall struct {
  49425. s *Service
  49426. project string
  49427. image string
  49428. urlParams_ gensupport.URLParams
  49429. ctx_ context.Context
  49430. header_ http.Header
  49431. }
  49432. // Delete: Deletes the specified image.
  49433. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  49434. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  49435. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49436. c.project = project
  49437. c.image = image
  49438. return c
  49439. }
  49440. // RequestId sets the optional parameter "requestId": An optional
  49441. // request ID to identify requests. Specify a unique request ID so that
  49442. // if you must retry your request, the server will know to ignore the
  49443. // request if it has already been completed.
  49444. //
  49445. // For example, consider a situation where you make an initial request
  49446. // and the request times out. If you make the request again with the
  49447. // same request ID, the server can check if original operation with the
  49448. // same request ID was received, and if so, will ignore the second
  49449. // request. This prevents clients from accidentally creating duplicate
  49450. // commitments.
  49451. //
  49452. // The request ID must be a valid UUID with the exception that zero UUID
  49453. // is not supported (00000000-0000-0000-0000-000000000000).
  49454. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  49455. c.urlParams_.Set("requestId", requestId)
  49456. return c
  49457. }
  49458. // Fields allows partial responses to be retrieved. See
  49459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49460. // for more information.
  49461. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  49462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49463. return c
  49464. }
  49465. // Context sets the context to be used in this call's Do method. Any
  49466. // pending HTTP request will be aborted if the provided context is
  49467. // canceled.
  49468. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  49469. c.ctx_ = ctx
  49470. return c
  49471. }
  49472. // Header returns an http.Header that can be modified by the caller to
  49473. // add HTTP headers to the request.
  49474. func (c *ImagesDeleteCall) Header() http.Header {
  49475. if c.header_ == nil {
  49476. c.header_ = make(http.Header)
  49477. }
  49478. return c.header_
  49479. }
  49480. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49481. reqHeaders := make(http.Header)
  49482. for k, v := range c.header_ {
  49483. reqHeaders[k] = v
  49484. }
  49485. reqHeaders.Set("User-Agent", c.s.userAgent())
  49486. var body io.Reader = nil
  49487. c.urlParams_.Set("alt", alt)
  49488. c.urlParams_.Set("prettyPrint", "false")
  49489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  49490. urls += "?" + c.urlParams_.Encode()
  49491. req, err := http.NewRequest("DELETE", urls, body)
  49492. if err != nil {
  49493. return nil, err
  49494. }
  49495. req.Header = reqHeaders
  49496. googleapi.Expand(req.URL, map[string]string{
  49497. "project": c.project,
  49498. "image": c.image,
  49499. })
  49500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49501. }
  49502. // Do executes the "compute.images.delete" call.
  49503. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49504. // status code is an error. Response headers are in either
  49505. // *Operation.ServerResponse.Header or (if a response was returned at
  49506. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49507. // to check whether the returned error was because
  49508. // http.StatusNotModified was returned.
  49509. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49510. gensupport.SetOptions(c.urlParams_, opts...)
  49511. res, err := c.doRequest("json")
  49512. if res != nil && res.StatusCode == http.StatusNotModified {
  49513. if res.Body != nil {
  49514. res.Body.Close()
  49515. }
  49516. return nil, &googleapi.Error{
  49517. Code: res.StatusCode,
  49518. Header: res.Header,
  49519. }
  49520. }
  49521. if err != nil {
  49522. return nil, err
  49523. }
  49524. defer googleapi.CloseBody(res)
  49525. if err := googleapi.CheckResponse(res); err != nil {
  49526. return nil, err
  49527. }
  49528. ret := &Operation{
  49529. ServerResponse: googleapi.ServerResponse{
  49530. Header: res.Header,
  49531. HTTPStatusCode: res.StatusCode,
  49532. },
  49533. }
  49534. target := &ret
  49535. if err := gensupport.DecodeResponse(target, res); err != nil {
  49536. return nil, err
  49537. }
  49538. return ret, nil
  49539. // {
  49540. // "description": "Deletes the specified image.",
  49541. // "httpMethod": "DELETE",
  49542. // "id": "compute.images.delete",
  49543. // "parameterOrder": [
  49544. // "project",
  49545. // "image"
  49546. // ],
  49547. // "parameters": {
  49548. // "image": {
  49549. // "description": "Name of the image resource to delete.",
  49550. // "location": "path",
  49551. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49552. // "required": true,
  49553. // "type": "string"
  49554. // },
  49555. // "project": {
  49556. // "description": "Project ID for this request.",
  49557. // "location": "path",
  49558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49559. // "required": true,
  49560. // "type": "string"
  49561. // },
  49562. // "requestId": {
  49563. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49564. // "location": "query",
  49565. // "type": "string"
  49566. // }
  49567. // },
  49568. // "path": "{project}/global/images/{image}",
  49569. // "response": {
  49570. // "$ref": "Operation"
  49571. // },
  49572. // "scopes": [
  49573. // "https://www.googleapis.com/auth/cloud-platform",
  49574. // "https://www.googleapis.com/auth/compute"
  49575. // ]
  49576. // }
  49577. }
  49578. // method id "compute.images.deprecate":
  49579. type ImagesDeprecateCall struct {
  49580. s *Service
  49581. project string
  49582. image string
  49583. deprecationstatus *DeprecationStatus
  49584. urlParams_ gensupport.URLParams
  49585. ctx_ context.Context
  49586. header_ http.Header
  49587. }
  49588. // Deprecate: Sets the deprecation status of an image.
  49589. //
  49590. // If an empty request body is given, clears the deprecation status
  49591. // instead.
  49592. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  49593. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  49594. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49595. c.project = project
  49596. c.image = image
  49597. c.deprecationstatus = deprecationstatus
  49598. return c
  49599. }
  49600. // RequestId sets the optional parameter "requestId": An optional
  49601. // request ID to identify requests. Specify a unique request ID so that
  49602. // if you must retry your request, the server will know to ignore the
  49603. // request if it has already been completed.
  49604. //
  49605. // For example, consider a situation where you make an initial request
  49606. // and the request times out. If you make the request again with the
  49607. // same request ID, the server can check if original operation with the
  49608. // same request ID was received, and if so, will ignore the second
  49609. // request. This prevents clients from accidentally creating duplicate
  49610. // commitments.
  49611. //
  49612. // The request ID must be a valid UUID with the exception that zero UUID
  49613. // is not supported (00000000-0000-0000-0000-000000000000).
  49614. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  49615. c.urlParams_.Set("requestId", requestId)
  49616. return c
  49617. }
  49618. // Fields allows partial responses to be retrieved. See
  49619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49620. // for more information.
  49621. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  49622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49623. return c
  49624. }
  49625. // Context sets the context to be used in this call's Do method. Any
  49626. // pending HTTP request will be aborted if the provided context is
  49627. // canceled.
  49628. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  49629. c.ctx_ = ctx
  49630. return c
  49631. }
  49632. // Header returns an http.Header that can be modified by the caller to
  49633. // add HTTP headers to the request.
  49634. func (c *ImagesDeprecateCall) Header() http.Header {
  49635. if c.header_ == nil {
  49636. c.header_ = make(http.Header)
  49637. }
  49638. return c.header_
  49639. }
  49640. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  49641. reqHeaders := make(http.Header)
  49642. for k, v := range c.header_ {
  49643. reqHeaders[k] = v
  49644. }
  49645. reqHeaders.Set("User-Agent", c.s.userAgent())
  49646. var body io.Reader = nil
  49647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  49648. if err != nil {
  49649. return nil, err
  49650. }
  49651. reqHeaders.Set("Content-Type", "application/json")
  49652. c.urlParams_.Set("alt", alt)
  49653. c.urlParams_.Set("prettyPrint", "false")
  49654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  49655. urls += "?" + c.urlParams_.Encode()
  49656. req, err := http.NewRequest("POST", urls, body)
  49657. if err != nil {
  49658. return nil, err
  49659. }
  49660. req.Header = reqHeaders
  49661. googleapi.Expand(req.URL, map[string]string{
  49662. "project": c.project,
  49663. "image": c.image,
  49664. })
  49665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49666. }
  49667. // Do executes the "compute.images.deprecate" call.
  49668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49669. // status code is an error. Response headers are in either
  49670. // *Operation.ServerResponse.Header or (if a response was returned at
  49671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49672. // to check whether the returned error was because
  49673. // http.StatusNotModified was returned.
  49674. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49675. gensupport.SetOptions(c.urlParams_, opts...)
  49676. res, err := c.doRequest("json")
  49677. if res != nil && res.StatusCode == http.StatusNotModified {
  49678. if res.Body != nil {
  49679. res.Body.Close()
  49680. }
  49681. return nil, &googleapi.Error{
  49682. Code: res.StatusCode,
  49683. Header: res.Header,
  49684. }
  49685. }
  49686. if err != nil {
  49687. return nil, err
  49688. }
  49689. defer googleapi.CloseBody(res)
  49690. if err := googleapi.CheckResponse(res); err != nil {
  49691. return nil, err
  49692. }
  49693. ret := &Operation{
  49694. ServerResponse: googleapi.ServerResponse{
  49695. Header: res.Header,
  49696. HTTPStatusCode: res.StatusCode,
  49697. },
  49698. }
  49699. target := &ret
  49700. if err := gensupport.DecodeResponse(target, res); err != nil {
  49701. return nil, err
  49702. }
  49703. return ret, nil
  49704. // {
  49705. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  49706. // "httpMethod": "POST",
  49707. // "id": "compute.images.deprecate",
  49708. // "parameterOrder": [
  49709. // "project",
  49710. // "image"
  49711. // ],
  49712. // "parameters": {
  49713. // "image": {
  49714. // "description": "Image name.",
  49715. // "location": "path",
  49716. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49717. // "required": true,
  49718. // "type": "string"
  49719. // },
  49720. // "project": {
  49721. // "description": "Project ID for this request.",
  49722. // "location": "path",
  49723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49724. // "required": true,
  49725. // "type": "string"
  49726. // },
  49727. // "requestId": {
  49728. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49729. // "location": "query",
  49730. // "type": "string"
  49731. // }
  49732. // },
  49733. // "path": "{project}/global/images/{image}/deprecate",
  49734. // "request": {
  49735. // "$ref": "DeprecationStatus"
  49736. // },
  49737. // "response": {
  49738. // "$ref": "Operation"
  49739. // },
  49740. // "scopes": [
  49741. // "https://www.googleapis.com/auth/cloud-platform",
  49742. // "https://www.googleapis.com/auth/compute"
  49743. // ]
  49744. // }
  49745. }
  49746. // method id "compute.images.get":
  49747. type ImagesGetCall struct {
  49748. s *Service
  49749. project string
  49750. image string
  49751. urlParams_ gensupport.URLParams
  49752. ifNoneMatch_ string
  49753. ctx_ context.Context
  49754. header_ http.Header
  49755. }
  49756. // Get: Returns the specified image. Gets a list of available images by
  49757. // making a list() request.
  49758. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  49759. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  49760. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49761. c.project = project
  49762. c.image = image
  49763. return c
  49764. }
  49765. // Fields allows partial responses to be retrieved. See
  49766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49767. // for more information.
  49768. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  49769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49770. return c
  49771. }
  49772. // IfNoneMatch sets the optional parameter which makes the operation
  49773. // fail if the object's ETag matches the given value. This is useful for
  49774. // getting updates only after the object has changed since the last
  49775. // request. Use googleapi.IsNotModified to check whether the response
  49776. // error from Do is the result of In-None-Match.
  49777. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  49778. c.ifNoneMatch_ = entityTag
  49779. return c
  49780. }
  49781. // Context sets the context to be used in this call's Do method. Any
  49782. // pending HTTP request will be aborted if the provided context is
  49783. // canceled.
  49784. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  49785. c.ctx_ = ctx
  49786. return c
  49787. }
  49788. // Header returns an http.Header that can be modified by the caller to
  49789. // add HTTP headers to the request.
  49790. func (c *ImagesGetCall) Header() http.Header {
  49791. if c.header_ == nil {
  49792. c.header_ = make(http.Header)
  49793. }
  49794. return c.header_
  49795. }
  49796. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  49797. reqHeaders := make(http.Header)
  49798. for k, v := range c.header_ {
  49799. reqHeaders[k] = v
  49800. }
  49801. reqHeaders.Set("User-Agent", c.s.userAgent())
  49802. if c.ifNoneMatch_ != "" {
  49803. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49804. }
  49805. var body io.Reader = nil
  49806. c.urlParams_.Set("alt", alt)
  49807. c.urlParams_.Set("prettyPrint", "false")
  49808. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  49809. urls += "?" + c.urlParams_.Encode()
  49810. req, err := http.NewRequest("GET", urls, body)
  49811. if err != nil {
  49812. return nil, err
  49813. }
  49814. req.Header = reqHeaders
  49815. googleapi.Expand(req.URL, map[string]string{
  49816. "project": c.project,
  49817. "image": c.image,
  49818. })
  49819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49820. }
  49821. // Do executes the "compute.images.get" call.
  49822. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  49823. // code is an error. Response headers are in either
  49824. // *Image.ServerResponse.Header or (if a response was returned at all)
  49825. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  49826. // check whether the returned error was because http.StatusNotModified
  49827. // was returned.
  49828. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  49829. gensupport.SetOptions(c.urlParams_, opts...)
  49830. res, err := c.doRequest("json")
  49831. if res != nil && res.StatusCode == http.StatusNotModified {
  49832. if res.Body != nil {
  49833. res.Body.Close()
  49834. }
  49835. return nil, &googleapi.Error{
  49836. Code: res.StatusCode,
  49837. Header: res.Header,
  49838. }
  49839. }
  49840. if err != nil {
  49841. return nil, err
  49842. }
  49843. defer googleapi.CloseBody(res)
  49844. if err := googleapi.CheckResponse(res); err != nil {
  49845. return nil, err
  49846. }
  49847. ret := &Image{
  49848. ServerResponse: googleapi.ServerResponse{
  49849. Header: res.Header,
  49850. HTTPStatusCode: res.StatusCode,
  49851. },
  49852. }
  49853. target := &ret
  49854. if err := gensupport.DecodeResponse(target, res); err != nil {
  49855. return nil, err
  49856. }
  49857. return ret, nil
  49858. // {
  49859. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  49860. // "httpMethod": "GET",
  49861. // "id": "compute.images.get",
  49862. // "parameterOrder": [
  49863. // "project",
  49864. // "image"
  49865. // ],
  49866. // "parameters": {
  49867. // "image": {
  49868. // "description": "Name of the image resource to return.",
  49869. // "location": "path",
  49870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49871. // "required": true,
  49872. // "type": "string"
  49873. // },
  49874. // "project": {
  49875. // "description": "Project ID for this request.",
  49876. // "location": "path",
  49877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49878. // "required": true,
  49879. // "type": "string"
  49880. // }
  49881. // },
  49882. // "path": "{project}/global/images/{image}",
  49883. // "response": {
  49884. // "$ref": "Image"
  49885. // },
  49886. // "scopes": [
  49887. // "https://www.googleapis.com/auth/cloud-platform",
  49888. // "https://www.googleapis.com/auth/compute",
  49889. // "https://www.googleapis.com/auth/compute.readonly"
  49890. // ]
  49891. // }
  49892. }
  49893. // method id "compute.images.getFromFamily":
  49894. type ImagesGetFromFamilyCall struct {
  49895. s *Service
  49896. project string
  49897. family string
  49898. urlParams_ gensupport.URLParams
  49899. ifNoneMatch_ string
  49900. ctx_ context.Context
  49901. header_ http.Header
  49902. }
  49903. // GetFromFamily: Returns the latest image that is part of an image
  49904. // family and is not deprecated.
  49905. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  49906. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49907. c.project = project
  49908. c.family = family
  49909. return c
  49910. }
  49911. // Fields allows partial responses to be retrieved. See
  49912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49913. // for more information.
  49914. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  49915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49916. return c
  49917. }
  49918. // IfNoneMatch sets the optional parameter which makes the operation
  49919. // fail if the object's ETag matches the given value. This is useful for
  49920. // getting updates only after the object has changed since the last
  49921. // request. Use googleapi.IsNotModified to check whether the response
  49922. // error from Do is the result of In-None-Match.
  49923. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  49924. c.ifNoneMatch_ = entityTag
  49925. return c
  49926. }
  49927. // Context sets the context to be used in this call's Do method. Any
  49928. // pending HTTP request will be aborted if the provided context is
  49929. // canceled.
  49930. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  49931. c.ctx_ = ctx
  49932. return c
  49933. }
  49934. // Header returns an http.Header that can be modified by the caller to
  49935. // add HTTP headers to the request.
  49936. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  49937. if c.header_ == nil {
  49938. c.header_ = make(http.Header)
  49939. }
  49940. return c.header_
  49941. }
  49942. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  49943. reqHeaders := make(http.Header)
  49944. for k, v := range c.header_ {
  49945. reqHeaders[k] = v
  49946. }
  49947. reqHeaders.Set("User-Agent", c.s.userAgent())
  49948. if c.ifNoneMatch_ != "" {
  49949. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49950. }
  49951. var body io.Reader = nil
  49952. c.urlParams_.Set("alt", alt)
  49953. c.urlParams_.Set("prettyPrint", "false")
  49954. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  49955. urls += "?" + c.urlParams_.Encode()
  49956. req, err := http.NewRequest("GET", urls, body)
  49957. if err != nil {
  49958. return nil, err
  49959. }
  49960. req.Header = reqHeaders
  49961. googleapi.Expand(req.URL, map[string]string{
  49962. "project": c.project,
  49963. "family": c.family,
  49964. })
  49965. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49966. }
  49967. // Do executes the "compute.images.getFromFamily" call.
  49968. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  49969. // code is an error. Response headers are in either
  49970. // *Image.ServerResponse.Header or (if a response was returned at all)
  49971. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  49972. // check whether the returned error was because http.StatusNotModified
  49973. // was returned.
  49974. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  49975. gensupport.SetOptions(c.urlParams_, opts...)
  49976. res, err := c.doRequest("json")
  49977. if res != nil && res.StatusCode == http.StatusNotModified {
  49978. if res.Body != nil {
  49979. res.Body.Close()
  49980. }
  49981. return nil, &googleapi.Error{
  49982. Code: res.StatusCode,
  49983. Header: res.Header,
  49984. }
  49985. }
  49986. if err != nil {
  49987. return nil, err
  49988. }
  49989. defer googleapi.CloseBody(res)
  49990. if err := googleapi.CheckResponse(res); err != nil {
  49991. return nil, err
  49992. }
  49993. ret := &Image{
  49994. ServerResponse: googleapi.ServerResponse{
  49995. Header: res.Header,
  49996. HTTPStatusCode: res.StatusCode,
  49997. },
  49998. }
  49999. target := &ret
  50000. if err := gensupport.DecodeResponse(target, res); err != nil {
  50001. return nil, err
  50002. }
  50003. return ret, nil
  50004. // {
  50005. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  50006. // "httpMethod": "GET",
  50007. // "id": "compute.images.getFromFamily",
  50008. // "parameterOrder": [
  50009. // "project",
  50010. // "family"
  50011. // ],
  50012. // "parameters": {
  50013. // "family": {
  50014. // "description": "Name of the image family to search for.",
  50015. // "location": "path",
  50016. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50017. // "required": true,
  50018. // "type": "string"
  50019. // },
  50020. // "project": {
  50021. // "description": "Project ID for this request.",
  50022. // "location": "path",
  50023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50024. // "required": true,
  50025. // "type": "string"
  50026. // }
  50027. // },
  50028. // "path": "{project}/global/images/family/{family}",
  50029. // "response": {
  50030. // "$ref": "Image"
  50031. // },
  50032. // "scopes": [
  50033. // "https://www.googleapis.com/auth/cloud-platform",
  50034. // "https://www.googleapis.com/auth/compute",
  50035. // "https://www.googleapis.com/auth/compute.readonly"
  50036. // ]
  50037. // }
  50038. }
  50039. // method id "compute.images.getIamPolicy":
  50040. type ImagesGetIamPolicyCall struct {
  50041. s *Service
  50042. project string
  50043. resource string
  50044. urlParams_ gensupport.URLParams
  50045. ifNoneMatch_ string
  50046. ctx_ context.Context
  50047. header_ http.Header
  50048. }
  50049. // GetIamPolicy: Gets the access control policy for a resource. May be
  50050. // empty if no such policy or resource exists.
  50051. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  50052. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50053. c.project = project
  50054. c.resource = resource
  50055. return c
  50056. }
  50057. // Fields allows partial responses to be retrieved. See
  50058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50059. // for more information.
  50060. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  50061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50062. return c
  50063. }
  50064. // IfNoneMatch sets the optional parameter which makes the operation
  50065. // fail if the object's ETag matches the given value. This is useful for
  50066. // getting updates only after the object has changed since the last
  50067. // request. Use googleapi.IsNotModified to check whether the response
  50068. // error from Do is the result of In-None-Match.
  50069. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  50070. c.ifNoneMatch_ = entityTag
  50071. return c
  50072. }
  50073. // Context sets the context to be used in this call's Do method. Any
  50074. // pending HTTP request will be aborted if the provided context is
  50075. // canceled.
  50076. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  50077. c.ctx_ = ctx
  50078. return c
  50079. }
  50080. // Header returns an http.Header that can be modified by the caller to
  50081. // add HTTP headers to the request.
  50082. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  50083. if c.header_ == nil {
  50084. c.header_ = make(http.Header)
  50085. }
  50086. return c.header_
  50087. }
  50088. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  50089. reqHeaders := make(http.Header)
  50090. for k, v := range c.header_ {
  50091. reqHeaders[k] = v
  50092. }
  50093. reqHeaders.Set("User-Agent", c.s.userAgent())
  50094. if c.ifNoneMatch_ != "" {
  50095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50096. }
  50097. var body io.Reader = nil
  50098. c.urlParams_.Set("alt", alt)
  50099. c.urlParams_.Set("prettyPrint", "false")
  50100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  50101. urls += "?" + c.urlParams_.Encode()
  50102. req, err := http.NewRequest("GET", urls, body)
  50103. if err != nil {
  50104. return nil, err
  50105. }
  50106. req.Header = reqHeaders
  50107. googleapi.Expand(req.URL, map[string]string{
  50108. "project": c.project,
  50109. "resource": c.resource,
  50110. })
  50111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50112. }
  50113. // Do executes the "compute.images.getIamPolicy" call.
  50114. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50115. // code is an error. Response headers are in either
  50116. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50117. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50118. // check whether the returned error was because http.StatusNotModified
  50119. // was returned.
  50120. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50121. gensupport.SetOptions(c.urlParams_, opts...)
  50122. res, err := c.doRequest("json")
  50123. if res != nil && res.StatusCode == http.StatusNotModified {
  50124. if res.Body != nil {
  50125. res.Body.Close()
  50126. }
  50127. return nil, &googleapi.Error{
  50128. Code: res.StatusCode,
  50129. Header: res.Header,
  50130. }
  50131. }
  50132. if err != nil {
  50133. return nil, err
  50134. }
  50135. defer googleapi.CloseBody(res)
  50136. if err := googleapi.CheckResponse(res); err != nil {
  50137. return nil, err
  50138. }
  50139. ret := &Policy{
  50140. ServerResponse: googleapi.ServerResponse{
  50141. Header: res.Header,
  50142. HTTPStatusCode: res.StatusCode,
  50143. },
  50144. }
  50145. target := &ret
  50146. if err := gensupport.DecodeResponse(target, res); err != nil {
  50147. return nil, err
  50148. }
  50149. return ret, nil
  50150. // {
  50151. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  50152. // "httpMethod": "GET",
  50153. // "id": "compute.images.getIamPolicy",
  50154. // "parameterOrder": [
  50155. // "project",
  50156. // "resource"
  50157. // ],
  50158. // "parameters": {
  50159. // "project": {
  50160. // "description": "Project ID for this request.",
  50161. // "location": "path",
  50162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50163. // "required": true,
  50164. // "type": "string"
  50165. // },
  50166. // "resource": {
  50167. // "description": "Name or id of the resource for this request.",
  50168. // "location": "path",
  50169. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50170. // "required": true,
  50171. // "type": "string"
  50172. // }
  50173. // },
  50174. // "path": "{project}/global/images/{resource}/getIamPolicy",
  50175. // "response": {
  50176. // "$ref": "Policy"
  50177. // },
  50178. // "scopes": [
  50179. // "https://www.googleapis.com/auth/cloud-platform",
  50180. // "https://www.googleapis.com/auth/compute",
  50181. // "https://www.googleapis.com/auth/compute.readonly"
  50182. // ]
  50183. // }
  50184. }
  50185. // method id "compute.images.insert":
  50186. type ImagesInsertCall struct {
  50187. s *Service
  50188. project string
  50189. image *Image
  50190. urlParams_ gensupport.URLParams
  50191. ctx_ context.Context
  50192. header_ http.Header
  50193. }
  50194. // Insert: Creates an image in the specified project using the data
  50195. // included in the request.
  50196. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  50197. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  50198. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50199. c.project = project
  50200. c.image = image
  50201. return c
  50202. }
  50203. // ForceCreate sets the optional parameter "forceCreate": Force image
  50204. // creation if true.
  50205. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  50206. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  50207. return c
  50208. }
  50209. // RequestId sets the optional parameter "requestId": An optional
  50210. // request ID to identify requests. Specify a unique request ID so that
  50211. // if you must retry your request, the server will know to ignore the
  50212. // request if it has already been completed.
  50213. //
  50214. // For example, consider a situation where you make an initial request
  50215. // and the request times out. If you make the request again with the
  50216. // same request ID, the server can check if original operation with the
  50217. // same request ID was received, and if so, will ignore the second
  50218. // request. This prevents clients from accidentally creating duplicate
  50219. // commitments.
  50220. //
  50221. // The request ID must be a valid UUID with the exception that zero UUID
  50222. // is not supported (00000000-0000-0000-0000-000000000000).
  50223. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  50224. c.urlParams_.Set("requestId", requestId)
  50225. return c
  50226. }
  50227. // Fields allows partial responses to be retrieved. See
  50228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50229. // for more information.
  50230. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  50231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50232. return c
  50233. }
  50234. // Context sets the context to be used in this call's Do method. Any
  50235. // pending HTTP request will be aborted if the provided context is
  50236. // canceled.
  50237. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  50238. c.ctx_ = ctx
  50239. return c
  50240. }
  50241. // Header returns an http.Header that can be modified by the caller to
  50242. // add HTTP headers to the request.
  50243. func (c *ImagesInsertCall) Header() http.Header {
  50244. if c.header_ == nil {
  50245. c.header_ = make(http.Header)
  50246. }
  50247. return c.header_
  50248. }
  50249. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  50250. reqHeaders := make(http.Header)
  50251. for k, v := range c.header_ {
  50252. reqHeaders[k] = v
  50253. }
  50254. reqHeaders.Set("User-Agent", c.s.userAgent())
  50255. var body io.Reader = nil
  50256. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  50257. if err != nil {
  50258. return nil, err
  50259. }
  50260. reqHeaders.Set("Content-Type", "application/json")
  50261. c.urlParams_.Set("alt", alt)
  50262. c.urlParams_.Set("prettyPrint", "false")
  50263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  50264. urls += "?" + c.urlParams_.Encode()
  50265. req, err := http.NewRequest("POST", urls, body)
  50266. if err != nil {
  50267. return nil, err
  50268. }
  50269. req.Header = reqHeaders
  50270. googleapi.Expand(req.URL, map[string]string{
  50271. "project": c.project,
  50272. })
  50273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50274. }
  50275. // Do executes the "compute.images.insert" call.
  50276. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50277. // status code is an error. Response headers are in either
  50278. // *Operation.ServerResponse.Header or (if a response was returned at
  50279. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50280. // to check whether the returned error was because
  50281. // http.StatusNotModified was returned.
  50282. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50283. gensupport.SetOptions(c.urlParams_, opts...)
  50284. res, err := c.doRequest("json")
  50285. if res != nil && res.StatusCode == http.StatusNotModified {
  50286. if res.Body != nil {
  50287. res.Body.Close()
  50288. }
  50289. return nil, &googleapi.Error{
  50290. Code: res.StatusCode,
  50291. Header: res.Header,
  50292. }
  50293. }
  50294. if err != nil {
  50295. return nil, err
  50296. }
  50297. defer googleapi.CloseBody(res)
  50298. if err := googleapi.CheckResponse(res); err != nil {
  50299. return nil, err
  50300. }
  50301. ret := &Operation{
  50302. ServerResponse: googleapi.ServerResponse{
  50303. Header: res.Header,
  50304. HTTPStatusCode: res.StatusCode,
  50305. },
  50306. }
  50307. target := &ret
  50308. if err := gensupport.DecodeResponse(target, res); err != nil {
  50309. return nil, err
  50310. }
  50311. return ret, nil
  50312. // {
  50313. // "description": "Creates an image in the specified project using the data included in the request.",
  50314. // "httpMethod": "POST",
  50315. // "id": "compute.images.insert",
  50316. // "parameterOrder": [
  50317. // "project"
  50318. // ],
  50319. // "parameters": {
  50320. // "forceCreate": {
  50321. // "description": "Force image creation if true.",
  50322. // "location": "query",
  50323. // "type": "boolean"
  50324. // },
  50325. // "project": {
  50326. // "description": "Project ID for this request.",
  50327. // "location": "path",
  50328. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50329. // "required": true,
  50330. // "type": "string"
  50331. // },
  50332. // "requestId": {
  50333. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50334. // "location": "query",
  50335. // "type": "string"
  50336. // }
  50337. // },
  50338. // "path": "{project}/global/images",
  50339. // "request": {
  50340. // "$ref": "Image"
  50341. // },
  50342. // "response": {
  50343. // "$ref": "Operation"
  50344. // },
  50345. // "scopes": [
  50346. // "https://www.googleapis.com/auth/cloud-platform",
  50347. // "https://www.googleapis.com/auth/compute",
  50348. // "https://www.googleapis.com/auth/devstorage.full_control",
  50349. // "https://www.googleapis.com/auth/devstorage.read_only",
  50350. // "https://www.googleapis.com/auth/devstorage.read_write"
  50351. // ]
  50352. // }
  50353. }
  50354. // method id "compute.images.list":
  50355. type ImagesListCall struct {
  50356. s *Service
  50357. project string
  50358. urlParams_ gensupport.URLParams
  50359. ifNoneMatch_ string
  50360. ctx_ context.Context
  50361. header_ http.Header
  50362. }
  50363. // List: Retrieves the list of custom images available to the specified
  50364. // project. Custom images are images you create that belong to your
  50365. // project. This method does not get any images that belong to other
  50366. // projects, including publicly-available images, like Debian 8. If you
  50367. // want to get a list of publicly-available images, use this method to
  50368. // make a request to the respective image project, such as debian-cloud
  50369. // or windows-cloud.
  50370. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  50371. func (r *ImagesService) List(project string) *ImagesListCall {
  50372. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50373. c.project = project
  50374. return c
  50375. }
  50376. // Filter sets the optional parameter "filter": A filter expression that
  50377. // filters resources listed in the response. The expression must specify
  50378. // the field name, a comparison operator, and the value that you want to
  50379. // use for filtering. The value must be a string, a number, or a
  50380. // boolean. The comparison operator must be either =, !=, >, or <.
  50381. //
  50382. // For example, if you are filtering Compute Engine instances, you can
  50383. // exclude instances named example-instance by specifying name !=
  50384. // example-instance.
  50385. //
  50386. // You can also filter nested fields. For example, you could specify
  50387. // scheduling.automaticRestart = false to include instances only if they
  50388. // are not scheduled for automatic restarts. You can use filtering on
  50389. // nested fields to filter based on resource labels.
  50390. //
  50391. // To filter on multiple expressions, provide each separate expression
  50392. // within parentheses. For example, (scheduling.automaticRestart = true)
  50393. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50394. // AND expression. However, you can include AND and OR expressions
  50395. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50396. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50397. // true).
  50398. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  50399. c.urlParams_.Set("filter", filter)
  50400. return c
  50401. }
  50402. // MaxResults sets the optional parameter "maxResults": The maximum
  50403. // number of results per page that should be returned. If the number of
  50404. // available results is larger than maxResults, Compute Engine returns a
  50405. // nextPageToken that can be used to get the next page of results in
  50406. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50407. // (Default: 500)
  50408. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  50409. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50410. return c
  50411. }
  50412. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50413. // a certain order. By default, results are returned in alphanumerical
  50414. // order based on the resource name.
  50415. //
  50416. // You can also sort results in descending order based on the creation
  50417. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50418. // based on the creationTimestamp field in reverse chronological order
  50419. // (newest result first). Use this to sort resources like operations so
  50420. // that the newest operation is returned first.
  50421. //
  50422. // Currently, only sorting by name or creationTimestamp desc is
  50423. // supported.
  50424. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  50425. c.urlParams_.Set("orderBy", orderBy)
  50426. return c
  50427. }
  50428. // PageToken sets the optional parameter "pageToken": Specifies a page
  50429. // token to use. Set pageToken to the nextPageToken returned by a
  50430. // previous list request to get the next page of results.
  50431. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  50432. c.urlParams_.Set("pageToken", pageToken)
  50433. return c
  50434. }
  50435. // Fields allows partial responses to be retrieved. See
  50436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50437. // for more information.
  50438. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  50439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50440. return c
  50441. }
  50442. // IfNoneMatch sets the optional parameter which makes the operation
  50443. // fail if the object's ETag matches the given value. This is useful for
  50444. // getting updates only after the object has changed since the last
  50445. // request. Use googleapi.IsNotModified to check whether the response
  50446. // error from Do is the result of In-None-Match.
  50447. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  50448. c.ifNoneMatch_ = entityTag
  50449. return c
  50450. }
  50451. // Context sets the context to be used in this call's Do method. Any
  50452. // pending HTTP request will be aborted if the provided context is
  50453. // canceled.
  50454. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  50455. c.ctx_ = ctx
  50456. return c
  50457. }
  50458. // Header returns an http.Header that can be modified by the caller to
  50459. // add HTTP headers to the request.
  50460. func (c *ImagesListCall) Header() http.Header {
  50461. if c.header_ == nil {
  50462. c.header_ = make(http.Header)
  50463. }
  50464. return c.header_
  50465. }
  50466. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  50467. reqHeaders := make(http.Header)
  50468. for k, v := range c.header_ {
  50469. reqHeaders[k] = v
  50470. }
  50471. reqHeaders.Set("User-Agent", c.s.userAgent())
  50472. if c.ifNoneMatch_ != "" {
  50473. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50474. }
  50475. var body io.Reader = nil
  50476. c.urlParams_.Set("alt", alt)
  50477. c.urlParams_.Set("prettyPrint", "false")
  50478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  50479. urls += "?" + c.urlParams_.Encode()
  50480. req, err := http.NewRequest("GET", urls, body)
  50481. if err != nil {
  50482. return nil, err
  50483. }
  50484. req.Header = reqHeaders
  50485. googleapi.Expand(req.URL, map[string]string{
  50486. "project": c.project,
  50487. })
  50488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50489. }
  50490. // Do executes the "compute.images.list" call.
  50491. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  50492. // status code is an error. Response headers are in either
  50493. // *ImageList.ServerResponse.Header or (if a response was returned at
  50494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50495. // to check whether the returned error was because
  50496. // http.StatusNotModified was returned.
  50497. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  50498. gensupport.SetOptions(c.urlParams_, opts...)
  50499. res, err := c.doRequest("json")
  50500. if res != nil && res.StatusCode == http.StatusNotModified {
  50501. if res.Body != nil {
  50502. res.Body.Close()
  50503. }
  50504. return nil, &googleapi.Error{
  50505. Code: res.StatusCode,
  50506. Header: res.Header,
  50507. }
  50508. }
  50509. if err != nil {
  50510. return nil, err
  50511. }
  50512. defer googleapi.CloseBody(res)
  50513. if err := googleapi.CheckResponse(res); err != nil {
  50514. return nil, err
  50515. }
  50516. ret := &ImageList{
  50517. ServerResponse: googleapi.ServerResponse{
  50518. Header: res.Header,
  50519. HTTPStatusCode: res.StatusCode,
  50520. },
  50521. }
  50522. target := &ret
  50523. if err := gensupport.DecodeResponse(target, res); err != nil {
  50524. return nil, err
  50525. }
  50526. return ret, nil
  50527. // {
  50528. // "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.",
  50529. // "httpMethod": "GET",
  50530. // "id": "compute.images.list",
  50531. // "parameterOrder": [
  50532. // "project"
  50533. // ],
  50534. // "parameters": {
  50535. // "filter": {
  50536. // "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).",
  50537. // "location": "query",
  50538. // "type": "string"
  50539. // },
  50540. // "maxResults": {
  50541. // "default": "500",
  50542. // "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)",
  50543. // "format": "uint32",
  50544. // "location": "query",
  50545. // "minimum": "0",
  50546. // "type": "integer"
  50547. // },
  50548. // "orderBy": {
  50549. // "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.",
  50550. // "location": "query",
  50551. // "type": "string"
  50552. // },
  50553. // "pageToken": {
  50554. // "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.",
  50555. // "location": "query",
  50556. // "type": "string"
  50557. // },
  50558. // "project": {
  50559. // "description": "Project ID for this request.",
  50560. // "location": "path",
  50561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50562. // "required": true,
  50563. // "type": "string"
  50564. // }
  50565. // },
  50566. // "path": "{project}/global/images",
  50567. // "response": {
  50568. // "$ref": "ImageList"
  50569. // },
  50570. // "scopes": [
  50571. // "https://www.googleapis.com/auth/cloud-platform",
  50572. // "https://www.googleapis.com/auth/compute",
  50573. // "https://www.googleapis.com/auth/compute.readonly"
  50574. // ]
  50575. // }
  50576. }
  50577. // Pages invokes f for each page of results.
  50578. // A non-nil error returned from f will halt the iteration.
  50579. // The provided context supersedes any context provided to the Context method.
  50580. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  50581. c.ctx_ = ctx
  50582. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50583. for {
  50584. x, err := c.Do()
  50585. if err != nil {
  50586. return err
  50587. }
  50588. if err := f(x); err != nil {
  50589. return err
  50590. }
  50591. if x.NextPageToken == "" {
  50592. return nil
  50593. }
  50594. c.PageToken(x.NextPageToken)
  50595. }
  50596. }
  50597. // method id "compute.images.setIamPolicy":
  50598. type ImagesSetIamPolicyCall struct {
  50599. s *Service
  50600. project string
  50601. resource string
  50602. globalsetpolicyrequest *GlobalSetPolicyRequest
  50603. urlParams_ gensupport.URLParams
  50604. ctx_ context.Context
  50605. header_ http.Header
  50606. }
  50607. // SetIamPolicy: Sets the access control policy on the specified
  50608. // resource. Replaces any existing policy.
  50609. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  50610. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50611. c.project = project
  50612. c.resource = resource
  50613. c.globalsetpolicyrequest = globalsetpolicyrequest
  50614. return c
  50615. }
  50616. // Fields allows partial responses to be retrieved. See
  50617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50618. // for more information.
  50619. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  50620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50621. return c
  50622. }
  50623. // Context sets the context to be used in this call's Do method. Any
  50624. // pending HTTP request will be aborted if the provided context is
  50625. // canceled.
  50626. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  50627. c.ctx_ = ctx
  50628. return c
  50629. }
  50630. // Header returns an http.Header that can be modified by the caller to
  50631. // add HTTP headers to the request.
  50632. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  50633. if c.header_ == nil {
  50634. c.header_ = make(http.Header)
  50635. }
  50636. return c.header_
  50637. }
  50638. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  50639. reqHeaders := make(http.Header)
  50640. for k, v := range c.header_ {
  50641. reqHeaders[k] = v
  50642. }
  50643. reqHeaders.Set("User-Agent", c.s.userAgent())
  50644. var body io.Reader = nil
  50645. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  50646. if err != nil {
  50647. return nil, err
  50648. }
  50649. reqHeaders.Set("Content-Type", "application/json")
  50650. c.urlParams_.Set("alt", alt)
  50651. c.urlParams_.Set("prettyPrint", "false")
  50652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  50653. urls += "?" + c.urlParams_.Encode()
  50654. req, err := http.NewRequest("POST", urls, body)
  50655. if err != nil {
  50656. return nil, err
  50657. }
  50658. req.Header = reqHeaders
  50659. googleapi.Expand(req.URL, map[string]string{
  50660. "project": c.project,
  50661. "resource": c.resource,
  50662. })
  50663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50664. }
  50665. // Do executes the "compute.images.setIamPolicy" call.
  50666. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50667. // code is an error. Response headers are in either
  50668. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50669. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50670. // check whether the returned error was because http.StatusNotModified
  50671. // was returned.
  50672. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50673. gensupport.SetOptions(c.urlParams_, opts...)
  50674. res, err := c.doRequest("json")
  50675. if res != nil && res.StatusCode == http.StatusNotModified {
  50676. if res.Body != nil {
  50677. res.Body.Close()
  50678. }
  50679. return nil, &googleapi.Error{
  50680. Code: res.StatusCode,
  50681. Header: res.Header,
  50682. }
  50683. }
  50684. if err != nil {
  50685. return nil, err
  50686. }
  50687. defer googleapi.CloseBody(res)
  50688. if err := googleapi.CheckResponse(res); err != nil {
  50689. return nil, err
  50690. }
  50691. ret := &Policy{
  50692. ServerResponse: googleapi.ServerResponse{
  50693. Header: res.Header,
  50694. HTTPStatusCode: res.StatusCode,
  50695. },
  50696. }
  50697. target := &ret
  50698. if err := gensupport.DecodeResponse(target, res); err != nil {
  50699. return nil, err
  50700. }
  50701. return ret, nil
  50702. // {
  50703. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  50704. // "httpMethod": "POST",
  50705. // "id": "compute.images.setIamPolicy",
  50706. // "parameterOrder": [
  50707. // "project",
  50708. // "resource"
  50709. // ],
  50710. // "parameters": {
  50711. // "project": {
  50712. // "description": "Project ID for this request.",
  50713. // "location": "path",
  50714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50715. // "required": true,
  50716. // "type": "string"
  50717. // },
  50718. // "resource": {
  50719. // "description": "Name or id of the resource for this request.",
  50720. // "location": "path",
  50721. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50722. // "required": true,
  50723. // "type": "string"
  50724. // }
  50725. // },
  50726. // "path": "{project}/global/images/{resource}/setIamPolicy",
  50727. // "request": {
  50728. // "$ref": "GlobalSetPolicyRequest"
  50729. // },
  50730. // "response": {
  50731. // "$ref": "Policy"
  50732. // },
  50733. // "scopes": [
  50734. // "https://www.googleapis.com/auth/cloud-platform",
  50735. // "https://www.googleapis.com/auth/compute"
  50736. // ]
  50737. // }
  50738. }
  50739. // method id "compute.images.setLabels":
  50740. type ImagesSetLabelsCall struct {
  50741. s *Service
  50742. project string
  50743. resource string
  50744. globalsetlabelsrequest *GlobalSetLabelsRequest
  50745. urlParams_ gensupport.URLParams
  50746. ctx_ context.Context
  50747. header_ http.Header
  50748. }
  50749. // SetLabels: Sets the labels on an image. To learn more about labels,
  50750. // read the Labeling Resources documentation.
  50751. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  50752. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50753. c.project = project
  50754. c.resource = resource
  50755. c.globalsetlabelsrequest = globalsetlabelsrequest
  50756. return c
  50757. }
  50758. // Fields allows partial responses to be retrieved. See
  50759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50760. // for more information.
  50761. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  50762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50763. return c
  50764. }
  50765. // Context sets the context to be used in this call's Do method. Any
  50766. // pending HTTP request will be aborted if the provided context is
  50767. // canceled.
  50768. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  50769. c.ctx_ = ctx
  50770. return c
  50771. }
  50772. // Header returns an http.Header that can be modified by the caller to
  50773. // add HTTP headers to the request.
  50774. func (c *ImagesSetLabelsCall) Header() http.Header {
  50775. if c.header_ == nil {
  50776. c.header_ = make(http.Header)
  50777. }
  50778. return c.header_
  50779. }
  50780. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  50781. reqHeaders := make(http.Header)
  50782. for k, v := range c.header_ {
  50783. reqHeaders[k] = v
  50784. }
  50785. reqHeaders.Set("User-Agent", c.s.userAgent())
  50786. var body io.Reader = nil
  50787. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  50788. if err != nil {
  50789. return nil, err
  50790. }
  50791. reqHeaders.Set("Content-Type", "application/json")
  50792. c.urlParams_.Set("alt", alt)
  50793. c.urlParams_.Set("prettyPrint", "false")
  50794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  50795. urls += "?" + c.urlParams_.Encode()
  50796. req, err := http.NewRequest("POST", urls, body)
  50797. if err != nil {
  50798. return nil, err
  50799. }
  50800. req.Header = reqHeaders
  50801. googleapi.Expand(req.URL, map[string]string{
  50802. "project": c.project,
  50803. "resource": c.resource,
  50804. })
  50805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50806. }
  50807. // Do executes the "compute.images.setLabels" call.
  50808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50809. // status code is an error. Response headers are in either
  50810. // *Operation.ServerResponse.Header or (if a response was returned at
  50811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50812. // to check whether the returned error was because
  50813. // http.StatusNotModified was returned.
  50814. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50815. gensupport.SetOptions(c.urlParams_, opts...)
  50816. res, err := c.doRequest("json")
  50817. if res != nil && res.StatusCode == http.StatusNotModified {
  50818. if res.Body != nil {
  50819. res.Body.Close()
  50820. }
  50821. return nil, &googleapi.Error{
  50822. Code: res.StatusCode,
  50823. Header: res.Header,
  50824. }
  50825. }
  50826. if err != nil {
  50827. return nil, err
  50828. }
  50829. defer googleapi.CloseBody(res)
  50830. if err := googleapi.CheckResponse(res); err != nil {
  50831. return nil, err
  50832. }
  50833. ret := &Operation{
  50834. ServerResponse: googleapi.ServerResponse{
  50835. Header: res.Header,
  50836. HTTPStatusCode: res.StatusCode,
  50837. },
  50838. }
  50839. target := &ret
  50840. if err := gensupport.DecodeResponse(target, res); err != nil {
  50841. return nil, err
  50842. }
  50843. return ret, nil
  50844. // {
  50845. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  50846. // "httpMethod": "POST",
  50847. // "id": "compute.images.setLabels",
  50848. // "parameterOrder": [
  50849. // "project",
  50850. // "resource"
  50851. // ],
  50852. // "parameters": {
  50853. // "project": {
  50854. // "description": "Project ID for this request.",
  50855. // "location": "path",
  50856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50857. // "required": true,
  50858. // "type": "string"
  50859. // },
  50860. // "resource": {
  50861. // "description": "Name or id of the resource for this request.",
  50862. // "location": "path",
  50863. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50864. // "required": true,
  50865. // "type": "string"
  50866. // }
  50867. // },
  50868. // "path": "{project}/global/images/{resource}/setLabels",
  50869. // "request": {
  50870. // "$ref": "GlobalSetLabelsRequest"
  50871. // },
  50872. // "response": {
  50873. // "$ref": "Operation"
  50874. // },
  50875. // "scopes": [
  50876. // "https://www.googleapis.com/auth/cloud-platform",
  50877. // "https://www.googleapis.com/auth/compute"
  50878. // ]
  50879. // }
  50880. }
  50881. // method id "compute.images.testIamPermissions":
  50882. type ImagesTestIamPermissionsCall struct {
  50883. s *Service
  50884. project string
  50885. resource string
  50886. testpermissionsrequest *TestPermissionsRequest
  50887. urlParams_ gensupport.URLParams
  50888. ctx_ context.Context
  50889. header_ http.Header
  50890. }
  50891. // TestIamPermissions: Returns permissions that a caller has on the
  50892. // specified resource.
  50893. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  50894. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50895. c.project = project
  50896. c.resource = resource
  50897. c.testpermissionsrequest = testpermissionsrequest
  50898. return c
  50899. }
  50900. // Fields allows partial responses to be retrieved. See
  50901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50902. // for more information.
  50903. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  50904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50905. return c
  50906. }
  50907. // Context sets the context to be used in this call's Do method. Any
  50908. // pending HTTP request will be aborted if the provided context is
  50909. // canceled.
  50910. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  50911. c.ctx_ = ctx
  50912. return c
  50913. }
  50914. // Header returns an http.Header that can be modified by the caller to
  50915. // add HTTP headers to the request.
  50916. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  50917. if c.header_ == nil {
  50918. c.header_ = make(http.Header)
  50919. }
  50920. return c.header_
  50921. }
  50922. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50923. reqHeaders := make(http.Header)
  50924. for k, v := range c.header_ {
  50925. reqHeaders[k] = v
  50926. }
  50927. reqHeaders.Set("User-Agent", c.s.userAgent())
  50928. var body io.Reader = nil
  50929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50930. if err != nil {
  50931. return nil, err
  50932. }
  50933. reqHeaders.Set("Content-Type", "application/json")
  50934. c.urlParams_.Set("alt", alt)
  50935. c.urlParams_.Set("prettyPrint", "false")
  50936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  50937. urls += "?" + c.urlParams_.Encode()
  50938. req, err := http.NewRequest("POST", urls, body)
  50939. if err != nil {
  50940. return nil, err
  50941. }
  50942. req.Header = reqHeaders
  50943. googleapi.Expand(req.URL, map[string]string{
  50944. "project": c.project,
  50945. "resource": c.resource,
  50946. })
  50947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50948. }
  50949. // Do executes the "compute.images.testIamPermissions" call.
  50950. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50951. // non-2xx status code is an error. Response headers are in either
  50952. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50953. // returned at all) in error.(*googleapi.Error).Header. Use
  50954. // googleapi.IsNotModified to check whether the returned error was
  50955. // because http.StatusNotModified was returned.
  50956. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50957. gensupport.SetOptions(c.urlParams_, opts...)
  50958. res, err := c.doRequest("json")
  50959. if res != nil && res.StatusCode == http.StatusNotModified {
  50960. if res.Body != nil {
  50961. res.Body.Close()
  50962. }
  50963. return nil, &googleapi.Error{
  50964. Code: res.StatusCode,
  50965. Header: res.Header,
  50966. }
  50967. }
  50968. if err != nil {
  50969. return nil, err
  50970. }
  50971. defer googleapi.CloseBody(res)
  50972. if err := googleapi.CheckResponse(res); err != nil {
  50973. return nil, err
  50974. }
  50975. ret := &TestPermissionsResponse{
  50976. ServerResponse: googleapi.ServerResponse{
  50977. Header: res.Header,
  50978. HTTPStatusCode: res.StatusCode,
  50979. },
  50980. }
  50981. target := &ret
  50982. if err := gensupport.DecodeResponse(target, res); err != nil {
  50983. return nil, err
  50984. }
  50985. return ret, nil
  50986. // {
  50987. // "description": "Returns permissions that a caller has on the specified resource.",
  50988. // "httpMethod": "POST",
  50989. // "id": "compute.images.testIamPermissions",
  50990. // "parameterOrder": [
  50991. // "project",
  50992. // "resource"
  50993. // ],
  50994. // "parameters": {
  50995. // "project": {
  50996. // "description": "Project ID for this request.",
  50997. // "location": "path",
  50998. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50999. // "required": true,
  51000. // "type": "string"
  51001. // },
  51002. // "resource": {
  51003. // "description": "Name or id of the resource for this request.",
  51004. // "location": "path",
  51005. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51006. // "required": true,
  51007. // "type": "string"
  51008. // }
  51009. // },
  51010. // "path": "{project}/global/images/{resource}/testIamPermissions",
  51011. // "request": {
  51012. // "$ref": "TestPermissionsRequest"
  51013. // },
  51014. // "response": {
  51015. // "$ref": "TestPermissionsResponse"
  51016. // },
  51017. // "scopes": [
  51018. // "https://www.googleapis.com/auth/cloud-platform",
  51019. // "https://www.googleapis.com/auth/compute",
  51020. // "https://www.googleapis.com/auth/compute.readonly"
  51021. // ]
  51022. // }
  51023. }
  51024. // method id "compute.instanceGroupManagers.abandonInstances":
  51025. type InstanceGroupManagersAbandonInstancesCall struct {
  51026. s *Service
  51027. project string
  51028. zone string
  51029. instanceGroupManager string
  51030. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  51031. urlParams_ gensupport.URLParams
  51032. ctx_ context.Context
  51033. header_ http.Header
  51034. }
  51035. // AbandonInstances: Flags the specified instances to be removed from
  51036. // the managed instance group. Abandoning an instance does not delete
  51037. // the instance, but it does remove the instance from any target pools
  51038. // that are applied by the managed instance group. This method reduces
  51039. // the targetSize of the managed instance group by the number of
  51040. // instances that you abandon. This operation is marked as DONE when the
  51041. // action is scheduled even if the instances have not yet been removed
  51042. // from the group. You must separately verify the status of the
  51043. // abandoning action with the listmanagedinstances method.
  51044. //
  51045. // If the group is part of a backend service that has enabled connection
  51046. // draining, it can take up to 60 seconds after the connection draining
  51047. // duration has elapsed before the VM instance is removed or
  51048. // deleted.
  51049. //
  51050. // You can specify a maximum of 1000 instances with this method per
  51051. // request.
  51052. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  51053. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51054. c.project = project
  51055. c.zone = zone
  51056. c.instanceGroupManager = instanceGroupManager
  51057. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  51058. return c
  51059. }
  51060. // RequestId sets the optional parameter "requestId": An optional
  51061. // request ID to identify requests. Specify a unique request ID so that
  51062. // if you must retry your request, the server will know to ignore the
  51063. // request if it has already been completed.
  51064. //
  51065. // For example, consider a situation where you make an initial request
  51066. // and the request times out. If you make the request again with the
  51067. // same request ID, the server can check if original operation with the
  51068. // same request ID was received, and if so, will ignore the second
  51069. // request. This prevents clients from accidentally creating duplicate
  51070. // commitments.
  51071. //
  51072. // The request ID must be a valid UUID with the exception that zero UUID
  51073. // is not supported (00000000-0000-0000-0000-000000000000).
  51074. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  51075. c.urlParams_.Set("requestId", requestId)
  51076. return c
  51077. }
  51078. // Fields allows partial responses to be retrieved. See
  51079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51080. // for more information.
  51081. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  51082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51083. return c
  51084. }
  51085. // Context sets the context to be used in this call's Do method. Any
  51086. // pending HTTP request will be aborted if the provided context is
  51087. // canceled.
  51088. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  51089. c.ctx_ = ctx
  51090. return c
  51091. }
  51092. // Header returns an http.Header that can be modified by the caller to
  51093. // add HTTP headers to the request.
  51094. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  51095. if c.header_ == nil {
  51096. c.header_ = make(http.Header)
  51097. }
  51098. return c.header_
  51099. }
  51100. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  51101. reqHeaders := make(http.Header)
  51102. for k, v := range c.header_ {
  51103. reqHeaders[k] = v
  51104. }
  51105. reqHeaders.Set("User-Agent", c.s.userAgent())
  51106. var body io.Reader = nil
  51107. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  51108. if err != nil {
  51109. return nil, err
  51110. }
  51111. reqHeaders.Set("Content-Type", "application/json")
  51112. c.urlParams_.Set("alt", alt)
  51113. c.urlParams_.Set("prettyPrint", "false")
  51114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  51115. urls += "?" + c.urlParams_.Encode()
  51116. req, err := http.NewRequest("POST", urls, body)
  51117. if err != nil {
  51118. return nil, err
  51119. }
  51120. req.Header = reqHeaders
  51121. googleapi.Expand(req.URL, map[string]string{
  51122. "project": c.project,
  51123. "zone": c.zone,
  51124. "instanceGroupManager": c.instanceGroupManager,
  51125. })
  51126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51127. }
  51128. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  51129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51130. // status code is an error. Response headers are in either
  51131. // *Operation.ServerResponse.Header or (if a response was returned at
  51132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51133. // to check whether the returned error was because
  51134. // http.StatusNotModified was returned.
  51135. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51136. gensupport.SetOptions(c.urlParams_, opts...)
  51137. res, err := c.doRequest("json")
  51138. if res != nil && res.StatusCode == http.StatusNotModified {
  51139. if res.Body != nil {
  51140. res.Body.Close()
  51141. }
  51142. return nil, &googleapi.Error{
  51143. Code: res.StatusCode,
  51144. Header: res.Header,
  51145. }
  51146. }
  51147. if err != nil {
  51148. return nil, err
  51149. }
  51150. defer googleapi.CloseBody(res)
  51151. if err := googleapi.CheckResponse(res); err != nil {
  51152. return nil, err
  51153. }
  51154. ret := &Operation{
  51155. ServerResponse: googleapi.ServerResponse{
  51156. Header: res.Header,
  51157. HTTPStatusCode: res.StatusCode,
  51158. },
  51159. }
  51160. target := &ret
  51161. if err := gensupport.DecodeResponse(target, res); err != nil {
  51162. return nil, err
  51163. }
  51164. return ret, nil
  51165. // {
  51166. // "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.",
  51167. // "httpMethod": "POST",
  51168. // "id": "compute.instanceGroupManagers.abandonInstances",
  51169. // "parameterOrder": [
  51170. // "project",
  51171. // "zone",
  51172. // "instanceGroupManager"
  51173. // ],
  51174. // "parameters": {
  51175. // "instanceGroupManager": {
  51176. // "description": "The name of the managed instance group.",
  51177. // "location": "path",
  51178. // "required": true,
  51179. // "type": "string"
  51180. // },
  51181. // "project": {
  51182. // "description": "Project ID for this request.",
  51183. // "location": "path",
  51184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51185. // "required": true,
  51186. // "type": "string"
  51187. // },
  51188. // "requestId": {
  51189. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51190. // "location": "query",
  51191. // "type": "string"
  51192. // },
  51193. // "zone": {
  51194. // "description": "The name of the zone where the managed instance group is located.",
  51195. // "location": "path",
  51196. // "required": true,
  51197. // "type": "string"
  51198. // }
  51199. // },
  51200. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  51201. // "request": {
  51202. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  51203. // },
  51204. // "response": {
  51205. // "$ref": "Operation"
  51206. // },
  51207. // "scopes": [
  51208. // "https://www.googleapis.com/auth/cloud-platform",
  51209. // "https://www.googleapis.com/auth/compute"
  51210. // ]
  51211. // }
  51212. }
  51213. // method id "compute.instanceGroupManagers.aggregatedList":
  51214. type InstanceGroupManagersAggregatedListCall struct {
  51215. s *Service
  51216. project string
  51217. urlParams_ gensupport.URLParams
  51218. ifNoneMatch_ string
  51219. ctx_ context.Context
  51220. header_ http.Header
  51221. }
  51222. // AggregatedList: Retrieves the list of managed instance groups and
  51223. // groups them by zone.
  51224. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  51225. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51226. c.project = project
  51227. return c
  51228. }
  51229. // Filter sets the optional parameter "filter": A filter expression that
  51230. // filters resources listed in the response. The expression must specify
  51231. // the field name, a comparison operator, and the value that you want to
  51232. // use for filtering. The value must be a string, a number, or a
  51233. // boolean. The comparison operator must be either =, !=, >, or <.
  51234. //
  51235. // For example, if you are filtering Compute Engine instances, you can
  51236. // exclude instances named example-instance by specifying name !=
  51237. // example-instance.
  51238. //
  51239. // You can also filter nested fields. For example, you could specify
  51240. // scheduling.automaticRestart = false to include instances only if they
  51241. // are not scheduled for automatic restarts. You can use filtering on
  51242. // nested fields to filter based on resource labels.
  51243. //
  51244. // To filter on multiple expressions, provide each separate expression
  51245. // within parentheses. For example, (scheduling.automaticRestart = true)
  51246. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51247. // AND expression. However, you can include AND and OR expressions
  51248. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51249. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51250. // true).
  51251. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  51252. c.urlParams_.Set("filter", filter)
  51253. return c
  51254. }
  51255. // MaxResults sets the optional parameter "maxResults": The maximum
  51256. // number of results per page that should be returned. If the number of
  51257. // available results is larger than maxResults, Compute Engine returns a
  51258. // nextPageToken that can be used to get the next page of results in
  51259. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51260. // (Default: 500)
  51261. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  51262. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51263. return c
  51264. }
  51265. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51266. // a certain order. By default, results are returned in alphanumerical
  51267. // order based on the resource name.
  51268. //
  51269. // You can also sort results in descending order based on the creation
  51270. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51271. // based on the creationTimestamp field in reverse chronological order
  51272. // (newest result first). Use this to sort resources like operations so
  51273. // that the newest operation is returned first.
  51274. //
  51275. // Currently, only sorting by name or creationTimestamp desc is
  51276. // supported.
  51277. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  51278. c.urlParams_.Set("orderBy", orderBy)
  51279. return c
  51280. }
  51281. // PageToken sets the optional parameter "pageToken": Specifies a page
  51282. // token to use. Set pageToken to the nextPageToken returned by a
  51283. // previous list request to get the next page of results.
  51284. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  51285. c.urlParams_.Set("pageToken", pageToken)
  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 *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  51292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51293. return c
  51294. }
  51295. // IfNoneMatch sets the optional parameter which makes the operation
  51296. // fail if the object's ETag matches the given value. This is useful for
  51297. // getting updates only after the object has changed since the last
  51298. // request. Use googleapi.IsNotModified to check whether the response
  51299. // error from Do is the result of In-None-Match.
  51300. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  51301. c.ifNoneMatch_ = entityTag
  51302. return c
  51303. }
  51304. // Context sets the context to be used in this call's Do method. Any
  51305. // pending HTTP request will be aborted if the provided context is
  51306. // canceled.
  51307. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  51308. c.ctx_ = ctx
  51309. return c
  51310. }
  51311. // Header returns an http.Header that can be modified by the caller to
  51312. // add HTTP headers to the request.
  51313. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  51314. if c.header_ == nil {
  51315. c.header_ = make(http.Header)
  51316. }
  51317. return c.header_
  51318. }
  51319. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  51320. reqHeaders := make(http.Header)
  51321. for k, v := range c.header_ {
  51322. reqHeaders[k] = v
  51323. }
  51324. reqHeaders.Set("User-Agent", c.s.userAgent())
  51325. if c.ifNoneMatch_ != "" {
  51326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51327. }
  51328. var body io.Reader = nil
  51329. c.urlParams_.Set("alt", alt)
  51330. c.urlParams_.Set("prettyPrint", "false")
  51331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  51332. urls += "?" + c.urlParams_.Encode()
  51333. req, err := http.NewRequest("GET", urls, body)
  51334. if err != nil {
  51335. return nil, err
  51336. }
  51337. req.Header = reqHeaders
  51338. googleapi.Expand(req.URL, map[string]string{
  51339. "project": c.project,
  51340. })
  51341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51342. }
  51343. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  51344. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  51345. // non-nil. Any non-2xx status code is an error. Response headers are in
  51346. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  51347. // (if a response was returned at all) in
  51348. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  51349. // whether the returned error was because http.StatusNotModified was
  51350. // returned.
  51351. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  51352. gensupport.SetOptions(c.urlParams_, opts...)
  51353. res, err := c.doRequest("json")
  51354. if res != nil && res.StatusCode == http.StatusNotModified {
  51355. if res.Body != nil {
  51356. res.Body.Close()
  51357. }
  51358. return nil, &googleapi.Error{
  51359. Code: res.StatusCode,
  51360. Header: res.Header,
  51361. }
  51362. }
  51363. if err != nil {
  51364. return nil, err
  51365. }
  51366. defer googleapi.CloseBody(res)
  51367. if err := googleapi.CheckResponse(res); err != nil {
  51368. return nil, err
  51369. }
  51370. ret := &InstanceGroupManagerAggregatedList{
  51371. ServerResponse: googleapi.ServerResponse{
  51372. Header: res.Header,
  51373. HTTPStatusCode: res.StatusCode,
  51374. },
  51375. }
  51376. target := &ret
  51377. if err := gensupport.DecodeResponse(target, res); err != nil {
  51378. return nil, err
  51379. }
  51380. return ret, nil
  51381. // {
  51382. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  51383. // "httpMethod": "GET",
  51384. // "id": "compute.instanceGroupManagers.aggregatedList",
  51385. // "parameterOrder": [
  51386. // "project"
  51387. // ],
  51388. // "parameters": {
  51389. // "filter": {
  51390. // "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).",
  51391. // "location": "query",
  51392. // "type": "string"
  51393. // },
  51394. // "maxResults": {
  51395. // "default": "500",
  51396. // "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)",
  51397. // "format": "uint32",
  51398. // "location": "query",
  51399. // "minimum": "0",
  51400. // "type": "integer"
  51401. // },
  51402. // "orderBy": {
  51403. // "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.",
  51404. // "location": "query",
  51405. // "type": "string"
  51406. // },
  51407. // "pageToken": {
  51408. // "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.",
  51409. // "location": "query",
  51410. // "type": "string"
  51411. // },
  51412. // "project": {
  51413. // "description": "Project ID for this request.",
  51414. // "location": "path",
  51415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51416. // "required": true,
  51417. // "type": "string"
  51418. // }
  51419. // },
  51420. // "path": "{project}/aggregated/instanceGroupManagers",
  51421. // "response": {
  51422. // "$ref": "InstanceGroupManagerAggregatedList"
  51423. // },
  51424. // "scopes": [
  51425. // "https://www.googleapis.com/auth/cloud-platform",
  51426. // "https://www.googleapis.com/auth/compute",
  51427. // "https://www.googleapis.com/auth/compute.readonly"
  51428. // ]
  51429. // }
  51430. }
  51431. // Pages invokes f for each page of results.
  51432. // A non-nil error returned from f will halt the iteration.
  51433. // The provided context supersedes any context provided to the Context method.
  51434. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  51435. c.ctx_ = ctx
  51436. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51437. for {
  51438. x, err := c.Do()
  51439. if err != nil {
  51440. return err
  51441. }
  51442. if err := f(x); err != nil {
  51443. return err
  51444. }
  51445. if x.NextPageToken == "" {
  51446. return nil
  51447. }
  51448. c.PageToken(x.NextPageToken)
  51449. }
  51450. }
  51451. // method id "compute.instanceGroupManagers.delete":
  51452. type InstanceGroupManagersDeleteCall struct {
  51453. s *Service
  51454. project string
  51455. zone string
  51456. instanceGroupManager string
  51457. urlParams_ gensupport.URLParams
  51458. ctx_ context.Context
  51459. header_ http.Header
  51460. }
  51461. // Delete: Deletes the specified managed instance group and all of the
  51462. // instances in that group. Note that the instance group must not belong
  51463. // to a backend service. Read Deleting an instance group for more
  51464. // information.
  51465. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  51466. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51467. c.project = project
  51468. c.zone = zone
  51469. c.instanceGroupManager = instanceGroupManager
  51470. return c
  51471. }
  51472. // RequestId sets the optional parameter "requestId": An optional
  51473. // request ID to identify requests. Specify a unique request ID so that
  51474. // if you must retry your request, the server will know to ignore the
  51475. // request if it has already been completed.
  51476. //
  51477. // For example, consider a situation where you make an initial request
  51478. // and the request times out. If you make the request again with the
  51479. // same request ID, the server can check if original operation with the
  51480. // same request ID was received, and if so, will ignore the second
  51481. // request. This prevents clients from accidentally creating duplicate
  51482. // commitments.
  51483. //
  51484. // The request ID must be a valid UUID with the exception that zero UUID
  51485. // is not supported (00000000-0000-0000-0000-000000000000).
  51486. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  51487. c.urlParams_.Set("requestId", requestId)
  51488. return c
  51489. }
  51490. // Fields allows partial responses to be retrieved. See
  51491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51492. // for more information.
  51493. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  51494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51495. return c
  51496. }
  51497. // Context sets the context to be used in this call's Do method. Any
  51498. // pending HTTP request will be aborted if the provided context is
  51499. // canceled.
  51500. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  51501. c.ctx_ = ctx
  51502. return c
  51503. }
  51504. // Header returns an http.Header that can be modified by the caller to
  51505. // add HTTP headers to the request.
  51506. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  51507. if c.header_ == nil {
  51508. c.header_ = make(http.Header)
  51509. }
  51510. return c.header_
  51511. }
  51512. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  51513. reqHeaders := make(http.Header)
  51514. for k, v := range c.header_ {
  51515. reqHeaders[k] = v
  51516. }
  51517. reqHeaders.Set("User-Agent", c.s.userAgent())
  51518. var body io.Reader = nil
  51519. c.urlParams_.Set("alt", alt)
  51520. c.urlParams_.Set("prettyPrint", "false")
  51521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  51522. urls += "?" + c.urlParams_.Encode()
  51523. req, err := http.NewRequest("DELETE", urls, body)
  51524. if err != nil {
  51525. return nil, err
  51526. }
  51527. req.Header = reqHeaders
  51528. googleapi.Expand(req.URL, map[string]string{
  51529. "project": c.project,
  51530. "zone": c.zone,
  51531. "instanceGroupManager": c.instanceGroupManager,
  51532. })
  51533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51534. }
  51535. // Do executes the "compute.instanceGroupManagers.delete" call.
  51536. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51537. // status code is an error. Response headers are in either
  51538. // *Operation.ServerResponse.Header or (if a response was returned at
  51539. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51540. // to check whether the returned error was because
  51541. // http.StatusNotModified was returned.
  51542. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51543. gensupport.SetOptions(c.urlParams_, opts...)
  51544. res, err := c.doRequest("json")
  51545. if res != nil && res.StatusCode == http.StatusNotModified {
  51546. if res.Body != nil {
  51547. res.Body.Close()
  51548. }
  51549. return nil, &googleapi.Error{
  51550. Code: res.StatusCode,
  51551. Header: res.Header,
  51552. }
  51553. }
  51554. if err != nil {
  51555. return nil, err
  51556. }
  51557. defer googleapi.CloseBody(res)
  51558. if err := googleapi.CheckResponse(res); err != nil {
  51559. return nil, err
  51560. }
  51561. ret := &Operation{
  51562. ServerResponse: googleapi.ServerResponse{
  51563. Header: res.Header,
  51564. HTTPStatusCode: res.StatusCode,
  51565. },
  51566. }
  51567. target := &ret
  51568. if err := gensupport.DecodeResponse(target, res); err != nil {
  51569. return nil, err
  51570. }
  51571. return ret, nil
  51572. // {
  51573. // "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.",
  51574. // "httpMethod": "DELETE",
  51575. // "id": "compute.instanceGroupManagers.delete",
  51576. // "parameterOrder": [
  51577. // "project",
  51578. // "zone",
  51579. // "instanceGroupManager"
  51580. // ],
  51581. // "parameters": {
  51582. // "instanceGroupManager": {
  51583. // "description": "The name of the managed instance group to delete.",
  51584. // "location": "path",
  51585. // "required": true,
  51586. // "type": "string"
  51587. // },
  51588. // "project": {
  51589. // "description": "Project ID for this request.",
  51590. // "location": "path",
  51591. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51592. // "required": true,
  51593. // "type": "string"
  51594. // },
  51595. // "requestId": {
  51596. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51597. // "location": "query",
  51598. // "type": "string"
  51599. // },
  51600. // "zone": {
  51601. // "description": "The name of the zone where the managed instance group is located.",
  51602. // "location": "path",
  51603. // "required": true,
  51604. // "type": "string"
  51605. // }
  51606. // },
  51607. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  51608. // "response": {
  51609. // "$ref": "Operation"
  51610. // },
  51611. // "scopes": [
  51612. // "https://www.googleapis.com/auth/cloud-platform",
  51613. // "https://www.googleapis.com/auth/compute"
  51614. // ]
  51615. // }
  51616. }
  51617. // method id "compute.instanceGroupManagers.deleteInstances":
  51618. type InstanceGroupManagersDeleteInstancesCall struct {
  51619. s *Service
  51620. project string
  51621. zone string
  51622. instanceGroupManager string
  51623. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  51624. urlParams_ gensupport.URLParams
  51625. ctx_ context.Context
  51626. header_ http.Header
  51627. }
  51628. // DeleteInstances: Flags the specified instances in the managed
  51629. // instance group for immediate deletion. The instances are also removed
  51630. // from any target pools of which they were a member. This method
  51631. // reduces the targetSize of the managed instance group by the number of
  51632. // instances that you delete. This operation is marked as DONE when the
  51633. // action is scheduled even if the instances are still being deleted.
  51634. // You must separately verify the status of the deleting action with the
  51635. // listmanagedinstances method.
  51636. //
  51637. // If the group is part of a backend service that has enabled connection
  51638. // draining, it can take up to 60 seconds after the connection draining
  51639. // duration has elapsed before the VM instance is removed or
  51640. // deleted.
  51641. //
  51642. // You can specify a maximum of 1000 instances with this method per
  51643. // request.
  51644. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  51645. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51646. c.project = project
  51647. c.zone = zone
  51648. c.instanceGroupManager = instanceGroupManager
  51649. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  51650. return c
  51651. }
  51652. // RequestId sets the optional parameter "requestId": An optional
  51653. // request ID to identify requests. Specify a unique request ID so that
  51654. // if you must retry your request, the server will know to ignore the
  51655. // request if it has already been completed.
  51656. //
  51657. // For example, consider a situation where you make an initial request
  51658. // and the request times out. If you make the request again with the
  51659. // same request ID, the server can check if original operation with the
  51660. // same request ID was received, and if so, will ignore the second
  51661. // request. This prevents clients from accidentally creating duplicate
  51662. // commitments.
  51663. //
  51664. // The request ID must be a valid UUID with the exception that zero UUID
  51665. // is not supported (00000000-0000-0000-0000-000000000000).
  51666. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  51667. c.urlParams_.Set("requestId", requestId)
  51668. return c
  51669. }
  51670. // Fields allows partial responses to be retrieved. See
  51671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51672. // for more information.
  51673. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  51674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51675. return c
  51676. }
  51677. // Context sets the context to be used in this call's Do method. Any
  51678. // pending HTTP request will be aborted if the provided context is
  51679. // canceled.
  51680. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  51681. c.ctx_ = ctx
  51682. return c
  51683. }
  51684. // Header returns an http.Header that can be modified by the caller to
  51685. // add HTTP headers to the request.
  51686. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  51687. if c.header_ == nil {
  51688. c.header_ = make(http.Header)
  51689. }
  51690. return c.header_
  51691. }
  51692. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  51693. reqHeaders := make(http.Header)
  51694. for k, v := range c.header_ {
  51695. reqHeaders[k] = v
  51696. }
  51697. reqHeaders.Set("User-Agent", c.s.userAgent())
  51698. var body io.Reader = nil
  51699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  51700. if err != nil {
  51701. return nil, err
  51702. }
  51703. reqHeaders.Set("Content-Type", "application/json")
  51704. c.urlParams_.Set("alt", alt)
  51705. c.urlParams_.Set("prettyPrint", "false")
  51706. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  51707. urls += "?" + c.urlParams_.Encode()
  51708. req, err := http.NewRequest("POST", urls, body)
  51709. if err != nil {
  51710. return nil, err
  51711. }
  51712. req.Header = reqHeaders
  51713. googleapi.Expand(req.URL, map[string]string{
  51714. "project": c.project,
  51715. "zone": c.zone,
  51716. "instanceGroupManager": c.instanceGroupManager,
  51717. })
  51718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51719. }
  51720. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  51721. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51722. // status code is an error. Response headers are in either
  51723. // *Operation.ServerResponse.Header or (if a response was returned at
  51724. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51725. // to check whether the returned error was because
  51726. // http.StatusNotModified was returned.
  51727. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51728. gensupport.SetOptions(c.urlParams_, opts...)
  51729. res, err := c.doRequest("json")
  51730. if res != nil && res.StatusCode == http.StatusNotModified {
  51731. if res.Body != nil {
  51732. res.Body.Close()
  51733. }
  51734. return nil, &googleapi.Error{
  51735. Code: res.StatusCode,
  51736. Header: res.Header,
  51737. }
  51738. }
  51739. if err != nil {
  51740. return nil, err
  51741. }
  51742. defer googleapi.CloseBody(res)
  51743. if err := googleapi.CheckResponse(res); err != nil {
  51744. return nil, err
  51745. }
  51746. ret := &Operation{
  51747. ServerResponse: googleapi.ServerResponse{
  51748. Header: res.Header,
  51749. HTTPStatusCode: res.StatusCode,
  51750. },
  51751. }
  51752. target := &ret
  51753. if err := gensupport.DecodeResponse(target, res); err != nil {
  51754. return nil, err
  51755. }
  51756. return ret, nil
  51757. // {
  51758. // "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.",
  51759. // "httpMethod": "POST",
  51760. // "id": "compute.instanceGroupManagers.deleteInstances",
  51761. // "parameterOrder": [
  51762. // "project",
  51763. // "zone",
  51764. // "instanceGroupManager"
  51765. // ],
  51766. // "parameters": {
  51767. // "instanceGroupManager": {
  51768. // "description": "The name of the managed instance group.",
  51769. // "location": "path",
  51770. // "required": true,
  51771. // "type": "string"
  51772. // },
  51773. // "project": {
  51774. // "description": "Project ID for this request.",
  51775. // "location": "path",
  51776. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51777. // "required": true,
  51778. // "type": "string"
  51779. // },
  51780. // "requestId": {
  51781. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51782. // "location": "query",
  51783. // "type": "string"
  51784. // },
  51785. // "zone": {
  51786. // "description": "The name of the zone where the managed instance group is located.",
  51787. // "location": "path",
  51788. // "required": true,
  51789. // "type": "string"
  51790. // }
  51791. // },
  51792. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  51793. // "request": {
  51794. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  51795. // },
  51796. // "response": {
  51797. // "$ref": "Operation"
  51798. // },
  51799. // "scopes": [
  51800. // "https://www.googleapis.com/auth/cloud-platform",
  51801. // "https://www.googleapis.com/auth/compute"
  51802. // ]
  51803. // }
  51804. }
  51805. // method id "compute.instanceGroupManagers.get":
  51806. type InstanceGroupManagersGetCall struct {
  51807. s *Service
  51808. project string
  51809. zone string
  51810. instanceGroupManager string
  51811. urlParams_ gensupport.URLParams
  51812. ifNoneMatch_ string
  51813. ctx_ context.Context
  51814. header_ http.Header
  51815. }
  51816. // Get: Returns all of the details about the specified managed instance
  51817. // group. Gets a list of available managed instance groups by making a
  51818. // list() request.
  51819. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  51820. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51821. c.project = project
  51822. c.zone = zone
  51823. c.instanceGroupManager = instanceGroupManager
  51824. return c
  51825. }
  51826. // Fields allows partial responses to be retrieved. See
  51827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51828. // for more information.
  51829. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  51830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51831. return c
  51832. }
  51833. // IfNoneMatch sets the optional parameter which makes the operation
  51834. // fail if the object's ETag matches the given value. This is useful for
  51835. // getting updates only after the object has changed since the last
  51836. // request. Use googleapi.IsNotModified to check whether the response
  51837. // error from Do is the result of In-None-Match.
  51838. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  51839. c.ifNoneMatch_ = entityTag
  51840. return c
  51841. }
  51842. // Context sets the context to be used in this call's Do method. Any
  51843. // pending HTTP request will be aborted if the provided context is
  51844. // canceled.
  51845. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  51846. c.ctx_ = ctx
  51847. return c
  51848. }
  51849. // Header returns an http.Header that can be modified by the caller to
  51850. // add HTTP headers to the request.
  51851. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  51852. if c.header_ == nil {
  51853. c.header_ = make(http.Header)
  51854. }
  51855. return c.header_
  51856. }
  51857. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  51858. reqHeaders := make(http.Header)
  51859. for k, v := range c.header_ {
  51860. reqHeaders[k] = v
  51861. }
  51862. reqHeaders.Set("User-Agent", c.s.userAgent())
  51863. if c.ifNoneMatch_ != "" {
  51864. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51865. }
  51866. var body io.Reader = nil
  51867. c.urlParams_.Set("alt", alt)
  51868. c.urlParams_.Set("prettyPrint", "false")
  51869. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  51870. urls += "?" + c.urlParams_.Encode()
  51871. req, err := http.NewRequest("GET", urls, body)
  51872. if err != nil {
  51873. return nil, err
  51874. }
  51875. req.Header = reqHeaders
  51876. googleapi.Expand(req.URL, map[string]string{
  51877. "project": c.project,
  51878. "zone": c.zone,
  51879. "instanceGroupManager": c.instanceGroupManager,
  51880. })
  51881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51882. }
  51883. // Do executes the "compute.instanceGroupManagers.get" call.
  51884. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  51885. // non-2xx status code is an error. Response headers are in either
  51886. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  51887. // returned at all) in error.(*googleapi.Error).Header. Use
  51888. // googleapi.IsNotModified to check whether the returned error was
  51889. // because http.StatusNotModified was returned.
  51890. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  51891. gensupport.SetOptions(c.urlParams_, opts...)
  51892. res, err := c.doRequest("json")
  51893. if res != nil && res.StatusCode == http.StatusNotModified {
  51894. if res.Body != nil {
  51895. res.Body.Close()
  51896. }
  51897. return nil, &googleapi.Error{
  51898. Code: res.StatusCode,
  51899. Header: res.Header,
  51900. }
  51901. }
  51902. if err != nil {
  51903. return nil, err
  51904. }
  51905. defer googleapi.CloseBody(res)
  51906. if err := googleapi.CheckResponse(res); err != nil {
  51907. return nil, err
  51908. }
  51909. ret := &InstanceGroupManager{
  51910. ServerResponse: googleapi.ServerResponse{
  51911. Header: res.Header,
  51912. HTTPStatusCode: res.StatusCode,
  51913. },
  51914. }
  51915. target := &ret
  51916. if err := gensupport.DecodeResponse(target, res); err != nil {
  51917. return nil, err
  51918. }
  51919. return ret, nil
  51920. // {
  51921. // "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.",
  51922. // "httpMethod": "GET",
  51923. // "id": "compute.instanceGroupManagers.get",
  51924. // "parameterOrder": [
  51925. // "project",
  51926. // "zone",
  51927. // "instanceGroupManager"
  51928. // ],
  51929. // "parameters": {
  51930. // "instanceGroupManager": {
  51931. // "description": "The name of the managed instance group.",
  51932. // "location": "path",
  51933. // "required": true,
  51934. // "type": "string"
  51935. // },
  51936. // "project": {
  51937. // "description": "Project ID for this request.",
  51938. // "location": "path",
  51939. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51940. // "required": true,
  51941. // "type": "string"
  51942. // },
  51943. // "zone": {
  51944. // "description": "The name of the zone where the managed instance group is located.",
  51945. // "location": "path",
  51946. // "required": true,
  51947. // "type": "string"
  51948. // }
  51949. // },
  51950. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  51951. // "response": {
  51952. // "$ref": "InstanceGroupManager"
  51953. // },
  51954. // "scopes": [
  51955. // "https://www.googleapis.com/auth/cloud-platform",
  51956. // "https://www.googleapis.com/auth/compute",
  51957. // "https://www.googleapis.com/auth/compute.readonly"
  51958. // ]
  51959. // }
  51960. }
  51961. // method id "compute.instanceGroupManagers.insert":
  51962. type InstanceGroupManagersInsertCall struct {
  51963. s *Service
  51964. project string
  51965. zone string
  51966. instancegroupmanager *InstanceGroupManager
  51967. urlParams_ gensupport.URLParams
  51968. ctx_ context.Context
  51969. header_ http.Header
  51970. }
  51971. // Insert: Creates a managed instance group using the information that
  51972. // you specify in the request. After the group is created, instances in
  51973. // the group are created using the specified instance template. This
  51974. // operation is marked as DONE when the group is created even if the
  51975. // instances in the group have not yet been created. You must separately
  51976. // verify the status of the individual instances with the
  51977. // listmanagedinstances method.
  51978. //
  51979. // A managed instance group can have up to 1000 VM instances per group.
  51980. // Please contact Cloud Support if you need an increase in this limit.
  51981. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  51982. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51983. c.project = project
  51984. c.zone = zone
  51985. c.instancegroupmanager = instancegroupmanager
  51986. return c
  51987. }
  51988. // RequestId sets the optional parameter "requestId": An optional
  51989. // request ID to identify requests. Specify a unique request ID so that
  51990. // if you must retry your request, the server will know to ignore the
  51991. // request if it has already been completed.
  51992. //
  51993. // For example, consider a situation where you make an initial request
  51994. // and the request times out. If you make the request again with the
  51995. // same request ID, the server can check if original operation with the
  51996. // same request ID was received, and if so, will ignore the second
  51997. // request. This prevents clients from accidentally creating duplicate
  51998. // commitments.
  51999. //
  52000. // The request ID must be a valid UUID with the exception that zero UUID
  52001. // is not supported (00000000-0000-0000-0000-000000000000).
  52002. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  52003. c.urlParams_.Set("requestId", requestId)
  52004. return c
  52005. }
  52006. // Fields allows partial responses to be retrieved. See
  52007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52008. // for more information.
  52009. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  52010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52011. return c
  52012. }
  52013. // Context sets the context to be used in this call's Do method. Any
  52014. // pending HTTP request will be aborted if the provided context is
  52015. // canceled.
  52016. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  52017. c.ctx_ = ctx
  52018. return c
  52019. }
  52020. // Header returns an http.Header that can be modified by the caller to
  52021. // add HTTP headers to the request.
  52022. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  52023. if c.header_ == nil {
  52024. c.header_ = make(http.Header)
  52025. }
  52026. return c.header_
  52027. }
  52028. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  52029. reqHeaders := make(http.Header)
  52030. for k, v := range c.header_ {
  52031. reqHeaders[k] = v
  52032. }
  52033. reqHeaders.Set("User-Agent", c.s.userAgent())
  52034. var body io.Reader = nil
  52035. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  52036. if err != nil {
  52037. return nil, err
  52038. }
  52039. reqHeaders.Set("Content-Type", "application/json")
  52040. c.urlParams_.Set("alt", alt)
  52041. c.urlParams_.Set("prettyPrint", "false")
  52042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  52043. urls += "?" + c.urlParams_.Encode()
  52044. req, err := http.NewRequest("POST", urls, body)
  52045. if err != nil {
  52046. return nil, err
  52047. }
  52048. req.Header = reqHeaders
  52049. googleapi.Expand(req.URL, map[string]string{
  52050. "project": c.project,
  52051. "zone": c.zone,
  52052. })
  52053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52054. }
  52055. // Do executes the "compute.instanceGroupManagers.insert" call.
  52056. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52057. // status code is an error. Response headers are in either
  52058. // *Operation.ServerResponse.Header or (if a response was returned at
  52059. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52060. // to check whether the returned error was because
  52061. // http.StatusNotModified was returned.
  52062. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52063. gensupport.SetOptions(c.urlParams_, opts...)
  52064. res, err := c.doRequest("json")
  52065. if res != nil && res.StatusCode == http.StatusNotModified {
  52066. if res.Body != nil {
  52067. res.Body.Close()
  52068. }
  52069. return nil, &googleapi.Error{
  52070. Code: res.StatusCode,
  52071. Header: res.Header,
  52072. }
  52073. }
  52074. if err != nil {
  52075. return nil, err
  52076. }
  52077. defer googleapi.CloseBody(res)
  52078. if err := googleapi.CheckResponse(res); err != nil {
  52079. return nil, err
  52080. }
  52081. ret := &Operation{
  52082. ServerResponse: googleapi.ServerResponse{
  52083. Header: res.Header,
  52084. HTTPStatusCode: res.StatusCode,
  52085. },
  52086. }
  52087. target := &ret
  52088. if err := gensupport.DecodeResponse(target, res); err != nil {
  52089. return nil, err
  52090. }
  52091. return ret, nil
  52092. // {
  52093. // "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.",
  52094. // "httpMethod": "POST",
  52095. // "id": "compute.instanceGroupManagers.insert",
  52096. // "parameterOrder": [
  52097. // "project",
  52098. // "zone"
  52099. // ],
  52100. // "parameters": {
  52101. // "project": {
  52102. // "description": "Project ID for this request.",
  52103. // "location": "path",
  52104. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52105. // "required": true,
  52106. // "type": "string"
  52107. // },
  52108. // "requestId": {
  52109. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52110. // "location": "query",
  52111. // "type": "string"
  52112. // },
  52113. // "zone": {
  52114. // "description": "The name of the zone where you want to create the managed instance group.",
  52115. // "location": "path",
  52116. // "required": true,
  52117. // "type": "string"
  52118. // }
  52119. // },
  52120. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  52121. // "request": {
  52122. // "$ref": "InstanceGroupManager"
  52123. // },
  52124. // "response": {
  52125. // "$ref": "Operation"
  52126. // },
  52127. // "scopes": [
  52128. // "https://www.googleapis.com/auth/cloud-platform",
  52129. // "https://www.googleapis.com/auth/compute"
  52130. // ]
  52131. // }
  52132. }
  52133. // method id "compute.instanceGroupManagers.list":
  52134. type InstanceGroupManagersListCall struct {
  52135. s *Service
  52136. project string
  52137. zone string
  52138. urlParams_ gensupport.URLParams
  52139. ifNoneMatch_ string
  52140. ctx_ context.Context
  52141. header_ http.Header
  52142. }
  52143. // List: Retrieves a list of managed instance groups that are contained
  52144. // within the specified project and zone.
  52145. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  52146. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52147. c.project = project
  52148. c.zone = zone
  52149. return c
  52150. }
  52151. // Filter sets the optional parameter "filter": A filter expression that
  52152. // filters resources listed in the response. The expression must specify
  52153. // the field name, a comparison operator, and the value that you want to
  52154. // use for filtering. The value must be a string, a number, or a
  52155. // boolean. The comparison operator must be either =, !=, >, or <.
  52156. //
  52157. // For example, if you are filtering Compute Engine instances, you can
  52158. // exclude instances named example-instance by specifying name !=
  52159. // example-instance.
  52160. //
  52161. // You can also filter nested fields. For example, you could specify
  52162. // scheduling.automaticRestart = false to include instances only if they
  52163. // are not scheduled for automatic restarts. You can use filtering on
  52164. // nested fields to filter based on resource labels.
  52165. //
  52166. // To filter on multiple expressions, provide each separate expression
  52167. // within parentheses. For example, (scheduling.automaticRestart = true)
  52168. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52169. // AND expression. However, you can include AND and OR expressions
  52170. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52171. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52172. // true).
  52173. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  52174. c.urlParams_.Set("filter", filter)
  52175. return c
  52176. }
  52177. // MaxResults sets the optional parameter "maxResults": The maximum
  52178. // number of results per page that should be returned. If the number of
  52179. // available results is larger than maxResults, Compute Engine returns a
  52180. // nextPageToken that can be used to get the next page of results in
  52181. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52182. // (Default: 500)
  52183. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  52184. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52185. return c
  52186. }
  52187. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52188. // a certain order. By default, results are returned in alphanumerical
  52189. // order based on the resource name.
  52190. //
  52191. // You can also sort results in descending order based on the creation
  52192. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52193. // based on the creationTimestamp field in reverse chronological order
  52194. // (newest result first). Use this to sort resources like operations so
  52195. // that the newest operation is returned first.
  52196. //
  52197. // Currently, only sorting by name or creationTimestamp desc is
  52198. // supported.
  52199. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  52200. c.urlParams_.Set("orderBy", orderBy)
  52201. return c
  52202. }
  52203. // PageToken sets the optional parameter "pageToken": Specifies a page
  52204. // token to use. Set pageToken to the nextPageToken returned by a
  52205. // previous list request to get the next page of results.
  52206. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  52207. c.urlParams_.Set("pageToken", pageToken)
  52208. return c
  52209. }
  52210. // Fields allows partial responses to be retrieved. See
  52211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52212. // for more information.
  52213. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  52214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52215. return c
  52216. }
  52217. // IfNoneMatch sets the optional parameter which makes the operation
  52218. // fail if the object's ETag matches the given value. This is useful for
  52219. // getting updates only after the object has changed since the last
  52220. // request. Use googleapi.IsNotModified to check whether the response
  52221. // error from Do is the result of In-None-Match.
  52222. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  52223. c.ifNoneMatch_ = entityTag
  52224. return c
  52225. }
  52226. // Context sets the context to be used in this call's Do method. Any
  52227. // pending HTTP request will be aborted if the provided context is
  52228. // canceled.
  52229. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  52230. c.ctx_ = ctx
  52231. return c
  52232. }
  52233. // Header returns an http.Header that can be modified by the caller to
  52234. // add HTTP headers to the request.
  52235. func (c *InstanceGroupManagersListCall) Header() http.Header {
  52236. if c.header_ == nil {
  52237. c.header_ = make(http.Header)
  52238. }
  52239. return c.header_
  52240. }
  52241. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  52242. reqHeaders := make(http.Header)
  52243. for k, v := range c.header_ {
  52244. reqHeaders[k] = v
  52245. }
  52246. reqHeaders.Set("User-Agent", c.s.userAgent())
  52247. if c.ifNoneMatch_ != "" {
  52248. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52249. }
  52250. var body io.Reader = nil
  52251. c.urlParams_.Set("alt", alt)
  52252. c.urlParams_.Set("prettyPrint", "false")
  52253. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  52254. urls += "?" + c.urlParams_.Encode()
  52255. req, err := http.NewRequest("GET", urls, body)
  52256. if err != nil {
  52257. return nil, err
  52258. }
  52259. req.Header = reqHeaders
  52260. googleapi.Expand(req.URL, map[string]string{
  52261. "project": c.project,
  52262. "zone": c.zone,
  52263. })
  52264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52265. }
  52266. // Do executes the "compute.instanceGroupManagers.list" call.
  52267. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  52268. // Any non-2xx status code is an error. Response headers are in either
  52269. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  52270. // returned at all) in error.(*googleapi.Error).Header. Use
  52271. // googleapi.IsNotModified to check whether the returned error was
  52272. // because http.StatusNotModified was returned.
  52273. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  52274. gensupport.SetOptions(c.urlParams_, opts...)
  52275. res, err := c.doRequest("json")
  52276. if res != nil && res.StatusCode == http.StatusNotModified {
  52277. if res.Body != nil {
  52278. res.Body.Close()
  52279. }
  52280. return nil, &googleapi.Error{
  52281. Code: res.StatusCode,
  52282. Header: res.Header,
  52283. }
  52284. }
  52285. if err != nil {
  52286. return nil, err
  52287. }
  52288. defer googleapi.CloseBody(res)
  52289. if err := googleapi.CheckResponse(res); err != nil {
  52290. return nil, err
  52291. }
  52292. ret := &InstanceGroupManagerList{
  52293. ServerResponse: googleapi.ServerResponse{
  52294. Header: res.Header,
  52295. HTTPStatusCode: res.StatusCode,
  52296. },
  52297. }
  52298. target := &ret
  52299. if err := gensupport.DecodeResponse(target, res); err != nil {
  52300. return nil, err
  52301. }
  52302. return ret, nil
  52303. // {
  52304. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  52305. // "httpMethod": "GET",
  52306. // "id": "compute.instanceGroupManagers.list",
  52307. // "parameterOrder": [
  52308. // "project",
  52309. // "zone"
  52310. // ],
  52311. // "parameters": {
  52312. // "filter": {
  52313. // "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).",
  52314. // "location": "query",
  52315. // "type": "string"
  52316. // },
  52317. // "maxResults": {
  52318. // "default": "500",
  52319. // "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)",
  52320. // "format": "uint32",
  52321. // "location": "query",
  52322. // "minimum": "0",
  52323. // "type": "integer"
  52324. // },
  52325. // "orderBy": {
  52326. // "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.",
  52327. // "location": "query",
  52328. // "type": "string"
  52329. // },
  52330. // "pageToken": {
  52331. // "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.",
  52332. // "location": "query",
  52333. // "type": "string"
  52334. // },
  52335. // "project": {
  52336. // "description": "Project ID for this request.",
  52337. // "location": "path",
  52338. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52339. // "required": true,
  52340. // "type": "string"
  52341. // },
  52342. // "zone": {
  52343. // "description": "The name of the zone where the managed instance group is located.",
  52344. // "location": "path",
  52345. // "required": true,
  52346. // "type": "string"
  52347. // }
  52348. // },
  52349. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  52350. // "response": {
  52351. // "$ref": "InstanceGroupManagerList"
  52352. // },
  52353. // "scopes": [
  52354. // "https://www.googleapis.com/auth/cloud-platform",
  52355. // "https://www.googleapis.com/auth/compute",
  52356. // "https://www.googleapis.com/auth/compute.readonly"
  52357. // ]
  52358. // }
  52359. }
  52360. // Pages invokes f for each page of results.
  52361. // A non-nil error returned from f will halt the iteration.
  52362. // The provided context supersedes any context provided to the Context method.
  52363. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  52364. c.ctx_ = ctx
  52365. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52366. for {
  52367. x, err := c.Do()
  52368. if err != nil {
  52369. return err
  52370. }
  52371. if err := f(x); err != nil {
  52372. return err
  52373. }
  52374. if x.NextPageToken == "" {
  52375. return nil
  52376. }
  52377. c.PageToken(x.NextPageToken)
  52378. }
  52379. }
  52380. // method id "compute.instanceGroupManagers.listManagedInstances":
  52381. type InstanceGroupManagersListManagedInstancesCall struct {
  52382. s *Service
  52383. project string
  52384. zone string
  52385. instanceGroupManager string
  52386. urlParams_ gensupport.URLParams
  52387. ctx_ context.Context
  52388. header_ http.Header
  52389. }
  52390. // ListManagedInstances: Lists all of the instances in the managed
  52391. // instance group. Each instance in the list has a currentAction, which
  52392. // indicates the action that the managed instance group is performing on
  52393. // the instance. For example, if the group is still creating an
  52394. // instance, the currentAction is CREATING. If a previous action failed,
  52395. // the list displays the errors for that failed action.
  52396. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  52397. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52398. c.project = project
  52399. c.zone = zone
  52400. c.instanceGroupManager = instanceGroupManager
  52401. return c
  52402. }
  52403. // Filter sets the optional parameter "filter": A filter expression that
  52404. // filters resources listed in the response. The expression must specify
  52405. // the field name, a comparison operator, and the value that you want to
  52406. // use for filtering. The value must be a string, a number, or a
  52407. // boolean. The comparison operator must be either =, !=, >, or <.
  52408. //
  52409. // For example, if you are filtering Compute Engine instances, you can
  52410. // exclude instances named example-instance by specifying name !=
  52411. // example-instance.
  52412. //
  52413. // You can also filter nested fields. For example, you could specify
  52414. // scheduling.automaticRestart = false to include instances only if they
  52415. // are not scheduled for automatic restarts. You can use filtering on
  52416. // nested fields to filter based on resource labels.
  52417. //
  52418. // To filter on multiple expressions, provide each separate expression
  52419. // within parentheses. For example, (scheduling.automaticRestart = true)
  52420. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52421. // AND expression. However, you can include AND and OR expressions
  52422. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52423. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52424. // true).
  52425. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  52426. c.urlParams_.Set("filter", filter)
  52427. return c
  52428. }
  52429. // MaxResults sets the optional parameter "maxResults": The maximum
  52430. // number of results per page that should be returned. If the number of
  52431. // available results is larger than maxResults, Compute Engine returns a
  52432. // nextPageToken that can be used to get the next page of results in
  52433. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52434. // (Default: 500)
  52435. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  52436. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52437. return c
  52438. }
  52439. // OrderBy sets the optional parameter "order_by": Sorts list results by
  52440. // a certain order. By default, results are returned in alphanumerical
  52441. // order based on the resource name.
  52442. //
  52443. // You can also sort results in descending order based on the creation
  52444. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52445. // based on the creationTimestamp field in reverse chronological order
  52446. // (newest result first). Use this to sort resources like operations so
  52447. // that the newest operation is returned first.
  52448. //
  52449. // Currently, only sorting by name or creationTimestamp desc is
  52450. // supported.
  52451. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  52452. c.urlParams_.Set("order_by", orderBy)
  52453. return c
  52454. }
  52455. // PageToken sets the optional parameter "pageToken": Specifies a page
  52456. // token to use. Set pageToken to the nextPageToken returned by a
  52457. // previous list request to get the next page of results.
  52458. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  52459. c.urlParams_.Set("pageToken", pageToken)
  52460. return c
  52461. }
  52462. // Fields allows partial responses to be retrieved. See
  52463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52464. // for more information.
  52465. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  52466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52467. return c
  52468. }
  52469. // Context sets the context to be used in this call's Do method. Any
  52470. // pending HTTP request will be aborted if the provided context is
  52471. // canceled.
  52472. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  52473. c.ctx_ = ctx
  52474. return c
  52475. }
  52476. // Header returns an http.Header that can be modified by the caller to
  52477. // add HTTP headers to the request.
  52478. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  52479. if c.header_ == nil {
  52480. c.header_ = make(http.Header)
  52481. }
  52482. return c.header_
  52483. }
  52484. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  52485. reqHeaders := make(http.Header)
  52486. for k, v := range c.header_ {
  52487. reqHeaders[k] = v
  52488. }
  52489. reqHeaders.Set("User-Agent", c.s.userAgent())
  52490. var body io.Reader = nil
  52491. c.urlParams_.Set("alt", alt)
  52492. c.urlParams_.Set("prettyPrint", "false")
  52493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  52494. urls += "?" + c.urlParams_.Encode()
  52495. req, err := http.NewRequest("POST", urls, body)
  52496. if err != nil {
  52497. return nil, err
  52498. }
  52499. req.Header = reqHeaders
  52500. googleapi.Expand(req.URL, map[string]string{
  52501. "project": c.project,
  52502. "zone": c.zone,
  52503. "instanceGroupManager": c.instanceGroupManager,
  52504. })
  52505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52506. }
  52507. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  52508. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  52509. // error will be non-nil. Any non-2xx status code is an error. Response
  52510. // headers are in either
  52511. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  52512. // er or (if a response was returned at all) in
  52513. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  52514. // whether the returned error was because http.StatusNotModified was
  52515. // returned.
  52516. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  52517. gensupport.SetOptions(c.urlParams_, opts...)
  52518. res, err := c.doRequest("json")
  52519. if res != nil && res.StatusCode == http.StatusNotModified {
  52520. if res.Body != nil {
  52521. res.Body.Close()
  52522. }
  52523. return nil, &googleapi.Error{
  52524. Code: res.StatusCode,
  52525. Header: res.Header,
  52526. }
  52527. }
  52528. if err != nil {
  52529. return nil, err
  52530. }
  52531. defer googleapi.CloseBody(res)
  52532. if err := googleapi.CheckResponse(res); err != nil {
  52533. return nil, err
  52534. }
  52535. ret := &InstanceGroupManagersListManagedInstancesResponse{
  52536. ServerResponse: googleapi.ServerResponse{
  52537. Header: res.Header,
  52538. HTTPStatusCode: res.StatusCode,
  52539. },
  52540. }
  52541. target := &ret
  52542. if err := gensupport.DecodeResponse(target, res); err != nil {
  52543. return nil, err
  52544. }
  52545. return ret, nil
  52546. // {
  52547. // "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.",
  52548. // "httpMethod": "POST",
  52549. // "id": "compute.instanceGroupManagers.listManagedInstances",
  52550. // "parameterOrder": [
  52551. // "project",
  52552. // "zone",
  52553. // "instanceGroupManager"
  52554. // ],
  52555. // "parameters": {
  52556. // "filter": {
  52557. // "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).",
  52558. // "location": "query",
  52559. // "type": "string"
  52560. // },
  52561. // "instanceGroupManager": {
  52562. // "description": "The name of the managed instance group.",
  52563. // "location": "path",
  52564. // "required": true,
  52565. // "type": "string"
  52566. // },
  52567. // "maxResults": {
  52568. // "default": "500",
  52569. // "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)",
  52570. // "format": "uint32",
  52571. // "location": "query",
  52572. // "minimum": "0",
  52573. // "type": "integer"
  52574. // },
  52575. // "order_by": {
  52576. // "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.",
  52577. // "location": "query",
  52578. // "type": "string"
  52579. // },
  52580. // "pageToken": {
  52581. // "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.",
  52582. // "location": "query",
  52583. // "type": "string"
  52584. // },
  52585. // "project": {
  52586. // "description": "Project ID for this request.",
  52587. // "location": "path",
  52588. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52589. // "required": true,
  52590. // "type": "string"
  52591. // },
  52592. // "zone": {
  52593. // "description": "The name of the zone where the managed instance group is located.",
  52594. // "location": "path",
  52595. // "required": true,
  52596. // "type": "string"
  52597. // }
  52598. // },
  52599. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  52600. // "response": {
  52601. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  52602. // },
  52603. // "scopes": [
  52604. // "https://www.googleapis.com/auth/cloud-platform",
  52605. // "https://www.googleapis.com/auth/compute",
  52606. // "https://www.googleapis.com/auth/compute.readonly"
  52607. // ]
  52608. // }
  52609. }
  52610. // Pages invokes f for each page of results.
  52611. // A non-nil error returned from f will halt the iteration.
  52612. // The provided context supersedes any context provided to the Context method.
  52613. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  52614. c.ctx_ = ctx
  52615. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52616. for {
  52617. x, err := c.Do()
  52618. if err != nil {
  52619. return err
  52620. }
  52621. if err := f(x); err != nil {
  52622. return err
  52623. }
  52624. if x.NextPageToken == "" {
  52625. return nil
  52626. }
  52627. c.PageToken(x.NextPageToken)
  52628. }
  52629. }
  52630. // method id "compute.instanceGroupManagers.patch":
  52631. type InstanceGroupManagersPatchCall struct {
  52632. s *Service
  52633. project string
  52634. zone string
  52635. instanceGroupManager string
  52636. instancegroupmanager *InstanceGroupManager
  52637. urlParams_ gensupport.URLParams
  52638. ctx_ context.Context
  52639. header_ http.Header
  52640. }
  52641. // Patch: Updates a managed instance group using the information that
  52642. // you specify in the request. This operation is marked as DONE when the
  52643. // group is patched even if the instances in the group are still in the
  52644. // process of being patched. You must separately verify the status of
  52645. // the individual instances with the listManagedInstances method. This
  52646. // method supports PATCH semantics and uses the JSON merge patch format
  52647. // and processing rules.
  52648. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  52649. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52650. c.project = project
  52651. c.zone = zone
  52652. c.instanceGroupManager = instanceGroupManager
  52653. c.instancegroupmanager = instancegroupmanager
  52654. return c
  52655. }
  52656. // RequestId sets the optional parameter "requestId": An optional
  52657. // request ID to identify requests. Specify a unique request ID so that
  52658. // if you must retry your request, the server will know to ignore the
  52659. // request if it has already been completed.
  52660. //
  52661. // For example, consider a situation where you make an initial request
  52662. // and the request times out. If you make the request again with the
  52663. // same request ID, the server can check if original operation with the
  52664. // same request ID was received, and if so, will ignore the second
  52665. // request. This prevents clients from accidentally creating duplicate
  52666. // commitments.
  52667. //
  52668. // The request ID must be a valid UUID with the exception that zero UUID
  52669. // is not supported (00000000-0000-0000-0000-000000000000).
  52670. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  52671. c.urlParams_.Set("requestId", requestId)
  52672. return c
  52673. }
  52674. // Fields allows partial responses to be retrieved. See
  52675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52676. // for more information.
  52677. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  52678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52679. return c
  52680. }
  52681. // Context sets the context to be used in this call's Do method. Any
  52682. // pending HTTP request will be aborted if the provided context is
  52683. // canceled.
  52684. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  52685. c.ctx_ = ctx
  52686. return c
  52687. }
  52688. // Header returns an http.Header that can be modified by the caller to
  52689. // add HTTP headers to the request.
  52690. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  52691. if c.header_ == nil {
  52692. c.header_ = make(http.Header)
  52693. }
  52694. return c.header_
  52695. }
  52696. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  52697. reqHeaders := make(http.Header)
  52698. for k, v := range c.header_ {
  52699. reqHeaders[k] = v
  52700. }
  52701. reqHeaders.Set("User-Agent", c.s.userAgent())
  52702. var body io.Reader = nil
  52703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  52704. if err != nil {
  52705. return nil, err
  52706. }
  52707. reqHeaders.Set("Content-Type", "application/json")
  52708. c.urlParams_.Set("alt", alt)
  52709. c.urlParams_.Set("prettyPrint", "false")
  52710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  52711. urls += "?" + c.urlParams_.Encode()
  52712. req, err := http.NewRequest("PATCH", urls, body)
  52713. if err != nil {
  52714. return nil, err
  52715. }
  52716. req.Header = reqHeaders
  52717. googleapi.Expand(req.URL, map[string]string{
  52718. "project": c.project,
  52719. "zone": c.zone,
  52720. "instanceGroupManager": c.instanceGroupManager,
  52721. })
  52722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52723. }
  52724. // Do executes the "compute.instanceGroupManagers.patch" call.
  52725. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52726. // status code is an error. Response headers are in either
  52727. // *Operation.ServerResponse.Header or (if a response was returned at
  52728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52729. // to check whether the returned error was because
  52730. // http.StatusNotModified was returned.
  52731. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52732. gensupport.SetOptions(c.urlParams_, opts...)
  52733. res, err := c.doRequest("json")
  52734. if res != nil && res.StatusCode == http.StatusNotModified {
  52735. if res.Body != nil {
  52736. res.Body.Close()
  52737. }
  52738. return nil, &googleapi.Error{
  52739. Code: res.StatusCode,
  52740. Header: res.Header,
  52741. }
  52742. }
  52743. if err != nil {
  52744. return nil, err
  52745. }
  52746. defer googleapi.CloseBody(res)
  52747. if err := googleapi.CheckResponse(res); err != nil {
  52748. return nil, err
  52749. }
  52750. ret := &Operation{
  52751. ServerResponse: googleapi.ServerResponse{
  52752. Header: res.Header,
  52753. HTTPStatusCode: res.StatusCode,
  52754. },
  52755. }
  52756. target := &ret
  52757. if err := gensupport.DecodeResponse(target, res); err != nil {
  52758. return nil, err
  52759. }
  52760. return ret, nil
  52761. // {
  52762. // "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.",
  52763. // "httpMethod": "PATCH",
  52764. // "id": "compute.instanceGroupManagers.patch",
  52765. // "parameterOrder": [
  52766. // "project",
  52767. // "zone",
  52768. // "instanceGroupManager"
  52769. // ],
  52770. // "parameters": {
  52771. // "instanceGroupManager": {
  52772. // "description": "The name of the instance group manager.",
  52773. // "location": "path",
  52774. // "required": true,
  52775. // "type": "string"
  52776. // },
  52777. // "project": {
  52778. // "description": "Project ID for this request.",
  52779. // "location": "path",
  52780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52781. // "required": true,
  52782. // "type": "string"
  52783. // },
  52784. // "requestId": {
  52785. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52786. // "location": "query",
  52787. // "type": "string"
  52788. // },
  52789. // "zone": {
  52790. // "description": "The name of the zone where you want to create the managed instance group.",
  52791. // "location": "path",
  52792. // "required": true,
  52793. // "type": "string"
  52794. // }
  52795. // },
  52796. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  52797. // "request": {
  52798. // "$ref": "InstanceGroupManager"
  52799. // },
  52800. // "response": {
  52801. // "$ref": "Operation"
  52802. // },
  52803. // "scopes": [
  52804. // "https://www.googleapis.com/auth/cloud-platform",
  52805. // "https://www.googleapis.com/auth/compute"
  52806. // ]
  52807. // }
  52808. }
  52809. // method id "compute.instanceGroupManagers.recreateInstances":
  52810. type InstanceGroupManagersRecreateInstancesCall struct {
  52811. s *Service
  52812. project string
  52813. zone string
  52814. instanceGroupManager string
  52815. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  52816. urlParams_ gensupport.URLParams
  52817. ctx_ context.Context
  52818. header_ http.Header
  52819. }
  52820. // RecreateInstances: Flags the specified instances in the managed
  52821. // instance group to be immediately recreated. The instances are deleted
  52822. // and recreated using the current instance template for the managed
  52823. // instance group. This operation is marked as DONE when the flag is set
  52824. // even if the instances have not yet been recreated. You must
  52825. // separately verify the status of the recreating action with the
  52826. // listmanagedinstances method.
  52827. //
  52828. // If the group is part of a backend service that has enabled connection
  52829. // draining, it can take up to 60 seconds after the connection draining
  52830. // duration has elapsed before the VM instance is removed or
  52831. // deleted.
  52832. //
  52833. // You can specify a maximum of 1000 instances with this method per
  52834. // request.
  52835. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  52836. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52837. c.project = project
  52838. c.zone = zone
  52839. c.instanceGroupManager = instanceGroupManager
  52840. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  52841. return c
  52842. }
  52843. // RequestId sets the optional parameter "requestId": An optional
  52844. // request ID to identify requests. Specify a unique request ID so that
  52845. // if you must retry your request, the server will know to ignore the
  52846. // request if it has already been completed.
  52847. //
  52848. // For example, consider a situation where you make an initial request
  52849. // and the request times out. If you make the request again with the
  52850. // same request ID, the server can check if original operation with the
  52851. // same request ID was received, and if so, will ignore the second
  52852. // request. This prevents clients from accidentally creating duplicate
  52853. // commitments.
  52854. //
  52855. // The request ID must be a valid UUID with the exception that zero UUID
  52856. // is not supported (00000000-0000-0000-0000-000000000000).
  52857. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  52858. c.urlParams_.Set("requestId", requestId)
  52859. return c
  52860. }
  52861. // Fields allows partial responses to be retrieved. See
  52862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52863. // for more information.
  52864. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  52865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52866. return c
  52867. }
  52868. // Context sets the context to be used in this call's Do method. Any
  52869. // pending HTTP request will be aborted if the provided context is
  52870. // canceled.
  52871. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  52872. c.ctx_ = ctx
  52873. return c
  52874. }
  52875. // Header returns an http.Header that can be modified by the caller to
  52876. // add HTTP headers to the request.
  52877. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  52878. if c.header_ == nil {
  52879. c.header_ = make(http.Header)
  52880. }
  52881. return c.header_
  52882. }
  52883. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  52884. reqHeaders := make(http.Header)
  52885. for k, v := range c.header_ {
  52886. reqHeaders[k] = v
  52887. }
  52888. reqHeaders.Set("User-Agent", c.s.userAgent())
  52889. var body io.Reader = nil
  52890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  52891. if err != nil {
  52892. return nil, err
  52893. }
  52894. reqHeaders.Set("Content-Type", "application/json")
  52895. c.urlParams_.Set("alt", alt)
  52896. c.urlParams_.Set("prettyPrint", "false")
  52897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  52898. urls += "?" + c.urlParams_.Encode()
  52899. req, err := http.NewRequest("POST", urls, body)
  52900. if err != nil {
  52901. return nil, err
  52902. }
  52903. req.Header = reqHeaders
  52904. googleapi.Expand(req.URL, map[string]string{
  52905. "project": c.project,
  52906. "zone": c.zone,
  52907. "instanceGroupManager": c.instanceGroupManager,
  52908. })
  52909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52910. }
  52911. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  52912. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52913. // status code is an error. Response headers are in either
  52914. // *Operation.ServerResponse.Header or (if a response was returned at
  52915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52916. // to check whether the returned error was because
  52917. // http.StatusNotModified was returned.
  52918. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52919. gensupport.SetOptions(c.urlParams_, opts...)
  52920. res, err := c.doRequest("json")
  52921. if res != nil && res.StatusCode == http.StatusNotModified {
  52922. if res.Body != nil {
  52923. res.Body.Close()
  52924. }
  52925. return nil, &googleapi.Error{
  52926. Code: res.StatusCode,
  52927. Header: res.Header,
  52928. }
  52929. }
  52930. if err != nil {
  52931. return nil, err
  52932. }
  52933. defer googleapi.CloseBody(res)
  52934. if err := googleapi.CheckResponse(res); err != nil {
  52935. return nil, err
  52936. }
  52937. ret := &Operation{
  52938. ServerResponse: googleapi.ServerResponse{
  52939. Header: res.Header,
  52940. HTTPStatusCode: res.StatusCode,
  52941. },
  52942. }
  52943. target := &ret
  52944. if err := gensupport.DecodeResponse(target, res); err != nil {
  52945. return nil, err
  52946. }
  52947. return ret, nil
  52948. // {
  52949. // "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.",
  52950. // "httpMethod": "POST",
  52951. // "id": "compute.instanceGroupManagers.recreateInstances",
  52952. // "parameterOrder": [
  52953. // "project",
  52954. // "zone",
  52955. // "instanceGroupManager"
  52956. // ],
  52957. // "parameters": {
  52958. // "instanceGroupManager": {
  52959. // "description": "The name of the managed instance group.",
  52960. // "location": "path",
  52961. // "required": true,
  52962. // "type": "string"
  52963. // },
  52964. // "project": {
  52965. // "description": "Project ID for this request.",
  52966. // "location": "path",
  52967. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52968. // "required": true,
  52969. // "type": "string"
  52970. // },
  52971. // "requestId": {
  52972. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52973. // "location": "query",
  52974. // "type": "string"
  52975. // },
  52976. // "zone": {
  52977. // "description": "The name of the zone where the managed instance group is located.",
  52978. // "location": "path",
  52979. // "required": true,
  52980. // "type": "string"
  52981. // }
  52982. // },
  52983. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  52984. // "request": {
  52985. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  52986. // },
  52987. // "response": {
  52988. // "$ref": "Operation"
  52989. // },
  52990. // "scopes": [
  52991. // "https://www.googleapis.com/auth/cloud-platform",
  52992. // "https://www.googleapis.com/auth/compute"
  52993. // ]
  52994. // }
  52995. }
  52996. // method id "compute.instanceGroupManagers.resize":
  52997. type InstanceGroupManagersResizeCall struct {
  52998. s *Service
  52999. project string
  53000. zone string
  53001. instanceGroupManager string
  53002. urlParams_ gensupport.URLParams
  53003. ctx_ context.Context
  53004. header_ http.Header
  53005. }
  53006. // Resize: Resizes the managed instance group. If you increase the size,
  53007. // the group creates new instances using the current instance template.
  53008. // If you decrease the size, the group deletes instances. The resize
  53009. // operation is marked DONE when the resize actions are scheduled even
  53010. // if the group has not yet added or deleted any instances. You must
  53011. // separately verify the status of the creating or deleting actions with
  53012. // the listmanagedinstances method.
  53013. //
  53014. // When resizing down, the instance group arbitrarily chooses the order
  53015. // in which VMs are deleted. The group takes into account some VM
  53016. // attributes when making the selection including:
  53017. //
  53018. // + The status of the VM instance. + The health of the VM instance. +
  53019. // The instance template version the VM is based on. + For regional
  53020. // managed instance groups, the location of the VM instance.
  53021. //
  53022. // This list is subject to change.
  53023. //
  53024. // If the group is part of a backend service that has enabled connection
  53025. // draining, it can take up to 60 seconds after the connection draining
  53026. // duration has elapsed before the VM instance is removed or deleted.
  53027. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  53028. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53029. c.project = project
  53030. c.zone = zone
  53031. c.instanceGroupManager = instanceGroupManager
  53032. c.urlParams_.Set("size", fmt.Sprint(size))
  53033. return c
  53034. }
  53035. // RequestId sets the optional parameter "requestId": An optional
  53036. // request ID to identify requests. Specify a unique request ID so that
  53037. // if you must retry your request, the server will know to ignore the
  53038. // request if it has already been completed.
  53039. //
  53040. // For example, consider a situation where you make an initial request
  53041. // and the request times out. If you make the request again with the
  53042. // same request ID, the server can check if original operation with the
  53043. // same request ID was received, and if so, will ignore the second
  53044. // request. This prevents clients from accidentally creating duplicate
  53045. // commitments.
  53046. //
  53047. // The request ID must be a valid UUID with the exception that zero UUID
  53048. // is not supported (00000000-0000-0000-0000-000000000000).
  53049. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  53050. c.urlParams_.Set("requestId", requestId)
  53051. return c
  53052. }
  53053. // Fields allows partial responses to be retrieved. See
  53054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53055. // for more information.
  53056. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  53057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53058. return c
  53059. }
  53060. // Context sets the context to be used in this call's Do method. Any
  53061. // pending HTTP request will be aborted if the provided context is
  53062. // canceled.
  53063. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  53064. c.ctx_ = ctx
  53065. return c
  53066. }
  53067. // Header returns an http.Header that can be modified by the caller to
  53068. // add HTTP headers to the request.
  53069. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  53070. if c.header_ == nil {
  53071. c.header_ = make(http.Header)
  53072. }
  53073. return c.header_
  53074. }
  53075. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  53076. reqHeaders := make(http.Header)
  53077. for k, v := range c.header_ {
  53078. reqHeaders[k] = v
  53079. }
  53080. reqHeaders.Set("User-Agent", c.s.userAgent())
  53081. var body io.Reader = nil
  53082. c.urlParams_.Set("alt", alt)
  53083. c.urlParams_.Set("prettyPrint", "false")
  53084. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  53085. urls += "?" + c.urlParams_.Encode()
  53086. req, err := http.NewRequest("POST", urls, body)
  53087. if err != nil {
  53088. return nil, err
  53089. }
  53090. req.Header = reqHeaders
  53091. googleapi.Expand(req.URL, map[string]string{
  53092. "project": c.project,
  53093. "zone": c.zone,
  53094. "instanceGroupManager": c.instanceGroupManager,
  53095. })
  53096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53097. }
  53098. // Do executes the "compute.instanceGroupManagers.resize" call.
  53099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53100. // status code is an error. Response headers are in either
  53101. // *Operation.ServerResponse.Header or (if a response was returned at
  53102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53103. // to check whether the returned error was because
  53104. // http.StatusNotModified was returned.
  53105. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53106. gensupport.SetOptions(c.urlParams_, opts...)
  53107. res, err := c.doRequest("json")
  53108. if res != nil && res.StatusCode == http.StatusNotModified {
  53109. if res.Body != nil {
  53110. res.Body.Close()
  53111. }
  53112. return nil, &googleapi.Error{
  53113. Code: res.StatusCode,
  53114. Header: res.Header,
  53115. }
  53116. }
  53117. if err != nil {
  53118. return nil, err
  53119. }
  53120. defer googleapi.CloseBody(res)
  53121. if err := googleapi.CheckResponse(res); err != nil {
  53122. return nil, err
  53123. }
  53124. ret := &Operation{
  53125. ServerResponse: googleapi.ServerResponse{
  53126. Header: res.Header,
  53127. HTTPStatusCode: res.StatusCode,
  53128. },
  53129. }
  53130. target := &ret
  53131. if err := gensupport.DecodeResponse(target, res); err != nil {
  53132. return nil, err
  53133. }
  53134. return ret, nil
  53135. // {
  53136. // "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.",
  53137. // "httpMethod": "POST",
  53138. // "id": "compute.instanceGroupManagers.resize",
  53139. // "parameterOrder": [
  53140. // "project",
  53141. // "zone",
  53142. // "instanceGroupManager",
  53143. // "size"
  53144. // ],
  53145. // "parameters": {
  53146. // "instanceGroupManager": {
  53147. // "description": "The name of the managed instance group.",
  53148. // "location": "path",
  53149. // "required": true,
  53150. // "type": "string"
  53151. // },
  53152. // "project": {
  53153. // "description": "Project ID for this request.",
  53154. // "location": "path",
  53155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53156. // "required": true,
  53157. // "type": "string"
  53158. // },
  53159. // "requestId": {
  53160. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53161. // "location": "query",
  53162. // "type": "string"
  53163. // },
  53164. // "size": {
  53165. // "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.",
  53166. // "format": "int32",
  53167. // "location": "query",
  53168. // "required": true,
  53169. // "type": "integer"
  53170. // },
  53171. // "zone": {
  53172. // "description": "The name of the zone where the managed instance group is located.",
  53173. // "location": "path",
  53174. // "required": true,
  53175. // "type": "string"
  53176. // }
  53177. // },
  53178. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  53179. // "response": {
  53180. // "$ref": "Operation"
  53181. // },
  53182. // "scopes": [
  53183. // "https://www.googleapis.com/auth/cloud-platform",
  53184. // "https://www.googleapis.com/auth/compute"
  53185. // ]
  53186. // }
  53187. }
  53188. // method id "compute.instanceGroupManagers.resizeAdvanced":
  53189. type InstanceGroupManagersResizeAdvancedCall struct {
  53190. s *Service
  53191. project string
  53192. zone string
  53193. instanceGroupManager string
  53194. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  53195. urlParams_ gensupport.URLParams
  53196. ctx_ context.Context
  53197. header_ http.Header
  53198. }
  53199. // ResizeAdvanced: Resizes the managed instance group with advanced
  53200. // configuration options like disabling creation retries. This is an
  53201. // extended version of the resize method.
  53202. //
  53203. // If you increase the size of the instance group, the group creates new
  53204. // instances using the current instance template. If you decrease the
  53205. // size, the group deletes instances. The resize operation is marked
  53206. // DONE when the resize actions are scheduled even if the group has not
  53207. // yet added or deleted any instances. You must separately verify the
  53208. // status of the creating, creatingWithoutRetries, or deleting actions
  53209. // with the get or listmanagedinstances method.
  53210. //
  53211. // If the group is part of a backend service that has enabled connection
  53212. // draining, it can take up to 60 seconds after the connection draining
  53213. // duration has elapsed before the VM instance is removed or deleted.
  53214. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  53215. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53216. c.project = project
  53217. c.zone = zone
  53218. c.instanceGroupManager = instanceGroupManager
  53219. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  53220. return c
  53221. }
  53222. // RequestId sets the optional parameter "requestId": An optional
  53223. // request ID to identify requests. Specify a unique request ID so that
  53224. // if you must retry your request, the server will know to ignore the
  53225. // request if it has already been completed.
  53226. //
  53227. // For example, consider a situation where you make an initial request
  53228. // and the request times out. If you make the request again with the
  53229. // same request ID, the server can check if original operation with the
  53230. // same request ID was received, and if so, will ignore the second
  53231. // request. This prevents clients from accidentally creating duplicate
  53232. // commitments.
  53233. //
  53234. // The request ID must be a valid UUID with the exception that zero UUID
  53235. // is not supported (00000000-0000-0000-0000-000000000000).
  53236. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  53237. c.urlParams_.Set("requestId", requestId)
  53238. return c
  53239. }
  53240. // Fields allows partial responses to be retrieved. See
  53241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53242. // for more information.
  53243. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  53244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53245. return c
  53246. }
  53247. // Context sets the context to be used in this call's Do method. Any
  53248. // pending HTTP request will be aborted if the provided context is
  53249. // canceled.
  53250. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  53251. c.ctx_ = ctx
  53252. return c
  53253. }
  53254. // Header returns an http.Header that can be modified by the caller to
  53255. // add HTTP headers to the request.
  53256. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  53257. if c.header_ == nil {
  53258. c.header_ = make(http.Header)
  53259. }
  53260. return c.header_
  53261. }
  53262. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  53263. reqHeaders := make(http.Header)
  53264. for k, v := range c.header_ {
  53265. reqHeaders[k] = v
  53266. }
  53267. reqHeaders.Set("User-Agent", c.s.userAgent())
  53268. var body io.Reader = nil
  53269. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  53270. if err != nil {
  53271. return nil, err
  53272. }
  53273. reqHeaders.Set("Content-Type", "application/json")
  53274. c.urlParams_.Set("alt", alt)
  53275. c.urlParams_.Set("prettyPrint", "false")
  53276. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  53277. urls += "?" + c.urlParams_.Encode()
  53278. req, err := http.NewRequest("POST", urls, body)
  53279. if err != nil {
  53280. return nil, err
  53281. }
  53282. req.Header = reqHeaders
  53283. googleapi.Expand(req.URL, map[string]string{
  53284. "project": c.project,
  53285. "zone": c.zone,
  53286. "instanceGroupManager": c.instanceGroupManager,
  53287. })
  53288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53289. }
  53290. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  53291. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53292. // status code is an error. Response headers are in either
  53293. // *Operation.ServerResponse.Header or (if a response was returned at
  53294. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53295. // to check whether the returned error was because
  53296. // http.StatusNotModified was returned.
  53297. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53298. gensupport.SetOptions(c.urlParams_, opts...)
  53299. res, err := c.doRequest("json")
  53300. if res != nil && res.StatusCode == http.StatusNotModified {
  53301. if res.Body != nil {
  53302. res.Body.Close()
  53303. }
  53304. return nil, &googleapi.Error{
  53305. Code: res.StatusCode,
  53306. Header: res.Header,
  53307. }
  53308. }
  53309. if err != nil {
  53310. return nil, err
  53311. }
  53312. defer googleapi.CloseBody(res)
  53313. if err := googleapi.CheckResponse(res); err != nil {
  53314. return nil, err
  53315. }
  53316. ret := &Operation{
  53317. ServerResponse: googleapi.ServerResponse{
  53318. Header: res.Header,
  53319. HTTPStatusCode: res.StatusCode,
  53320. },
  53321. }
  53322. target := &ret
  53323. if err := gensupport.DecodeResponse(target, res); err != nil {
  53324. return nil, err
  53325. }
  53326. return ret, nil
  53327. // {
  53328. // "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, 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, creatingWithoutRetries, or deleting actions with the get or 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.",
  53329. // "httpMethod": "POST",
  53330. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  53331. // "parameterOrder": [
  53332. // "project",
  53333. // "zone",
  53334. // "instanceGroupManager"
  53335. // ],
  53336. // "parameters": {
  53337. // "instanceGroupManager": {
  53338. // "description": "The name of the managed instance group.",
  53339. // "location": "path",
  53340. // "required": true,
  53341. // "type": "string"
  53342. // },
  53343. // "project": {
  53344. // "description": "Project ID for this request.",
  53345. // "location": "path",
  53346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53347. // "required": true,
  53348. // "type": "string"
  53349. // },
  53350. // "requestId": {
  53351. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53352. // "location": "query",
  53353. // "type": "string"
  53354. // },
  53355. // "zone": {
  53356. // "description": "The name of the zone where the managed instance group is located.",
  53357. // "location": "path",
  53358. // "required": true,
  53359. // "type": "string"
  53360. // }
  53361. // },
  53362. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  53363. // "request": {
  53364. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  53365. // },
  53366. // "response": {
  53367. // "$ref": "Operation"
  53368. // },
  53369. // "scopes": [
  53370. // "https://www.googleapis.com/auth/cloud-platform",
  53371. // "https://www.googleapis.com/auth/compute"
  53372. // ]
  53373. // }
  53374. }
  53375. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  53376. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  53377. s *Service
  53378. project string
  53379. zone string
  53380. instanceGroupManager string
  53381. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  53382. urlParams_ gensupport.URLParams
  53383. ctx_ context.Context
  53384. header_ http.Header
  53385. }
  53386. // SetAutoHealingPolicies: Modifies the autohealing policies.
  53387. // [Deprecated] This method is deprecated. Please use Patch instead.
  53388. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  53389. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53390. c.project = project
  53391. c.zone = zone
  53392. c.instanceGroupManager = instanceGroupManager
  53393. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  53394. return c
  53395. }
  53396. // RequestId sets the optional parameter "requestId": An optional
  53397. // request ID to identify requests. Specify a unique request ID so that
  53398. // if you must retry your request, the server will know to ignore the
  53399. // request if it has already been completed.
  53400. //
  53401. // For example, consider a situation where you make an initial request
  53402. // and the request times out. If you make the request again with the
  53403. // same request ID, the server can check if original operation with the
  53404. // same request ID was received, and if so, will ignore the second
  53405. // request. This prevents clients from accidentally creating duplicate
  53406. // commitments.
  53407. //
  53408. // The request ID must be a valid UUID with the exception that zero UUID
  53409. // is not supported (00000000-0000-0000-0000-000000000000).
  53410. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  53411. c.urlParams_.Set("requestId", requestId)
  53412. return c
  53413. }
  53414. // Fields allows partial responses to be retrieved. See
  53415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53416. // for more information.
  53417. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  53418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53419. return c
  53420. }
  53421. // Context sets the context to be used in this call's Do method. Any
  53422. // pending HTTP request will be aborted if the provided context is
  53423. // canceled.
  53424. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  53425. c.ctx_ = ctx
  53426. return c
  53427. }
  53428. // Header returns an http.Header that can be modified by the caller to
  53429. // add HTTP headers to the request.
  53430. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  53431. if c.header_ == nil {
  53432. c.header_ = make(http.Header)
  53433. }
  53434. return c.header_
  53435. }
  53436. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  53437. reqHeaders := make(http.Header)
  53438. for k, v := range c.header_ {
  53439. reqHeaders[k] = v
  53440. }
  53441. reqHeaders.Set("User-Agent", c.s.userAgent())
  53442. var body io.Reader = nil
  53443. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  53444. if err != nil {
  53445. return nil, err
  53446. }
  53447. reqHeaders.Set("Content-Type", "application/json")
  53448. c.urlParams_.Set("alt", alt)
  53449. c.urlParams_.Set("prettyPrint", "false")
  53450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  53451. urls += "?" + c.urlParams_.Encode()
  53452. req, err := http.NewRequest("POST", urls, body)
  53453. if err != nil {
  53454. return nil, err
  53455. }
  53456. req.Header = reqHeaders
  53457. googleapi.Expand(req.URL, map[string]string{
  53458. "project": c.project,
  53459. "zone": c.zone,
  53460. "instanceGroupManager": c.instanceGroupManager,
  53461. })
  53462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53463. }
  53464. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  53465. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53466. // status code is an error. Response headers are in either
  53467. // *Operation.ServerResponse.Header or (if a response was returned at
  53468. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53469. // to check whether the returned error was because
  53470. // http.StatusNotModified was returned.
  53471. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53472. gensupport.SetOptions(c.urlParams_, opts...)
  53473. res, err := c.doRequest("json")
  53474. if res != nil && res.StatusCode == http.StatusNotModified {
  53475. if res.Body != nil {
  53476. res.Body.Close()
  53477. }
  53478. return nil, &googleapi.Error{
  53479. Code: res.StatusCode,
  53480. Header: res.Header,
  53481. }
  53482. }
  53483. if err != nil {
  53484. return nil, err
  53485. }
  53486. defer googleapi.CloseBody(res)
  53487. if err := googleapi.CheckResponse(res); err != nil {
  53488. return nil, err
  53489. }
  53490. ret := &Operation{
  53491. ServerResponse: googleapi.ServerResponse{
  53492. Header: res.Header,
  53493. HTTPStatusCode: res.StatusCode,
  53494. },
  53495. }
  53496. target := &ret
  53497. if err := gensupport.DecodeResponse(target, res); err != nil {
  53498. return nil, err
  53499. }
  53500. return ret, nil
  53501. // {
  53502. // "description": "Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.",
  53503. // "httpMethod": "POST",
  53504. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  53505. // "parameterOrder": [
  53506. // "project",
  53507. // "zone",
  53508. // "instanceGroupManager"
  53509. // ],
  53510. // "parameters": {
  53511. // "instanceGroupManager": {
  53512. // "description": "The name of the instance group manager.",
  53513. // "location": "path",
  53514. // "required": true,
  53515. // "type": "string"
  53516. // },
  53517. // "project": {
  53518. // "description": "Project ID for this request.",
  53519. // "location": "path",
  53520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53521. // "required": true,
  53522. // "type": "string"
  53523. // },
  53524. // "requestId": {
  53525. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53526. // "location": "query",
  53527. // "type": "string"
  53528. // },
  53529. // "zone": {
  53530. // "description": "The name of the zone where the managed instance group is located.",
  53531. // "location": "path",
  53532. // "required": true,
  53533. // "type": "string"
  53534. // }
  53535. // },
  53536. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  53537. // "request": {
  53538. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  53539. // },
  53540. // "response": {
  53541. // "$ref": "Operation"
  53542. // },
  53543. // "scopes": [
  53544. // "https://www.googleapis.com/auth/cloud-platform",
  53545. // "https://www.googleapis.com/auth/compute"
  53546. // ]
  53547. // }
  53548. }
  53549. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  53550. type InstanceGroupManagersSetInstanceTemplateCall struct {
  53551. s *Service
  53552. project string
  53553. zone string
  53554. instanceGroupManager string
  53555. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  53556. urlParams_ gensupport.URLParams
  53557. ctx_ context.Context
  53558. header_ http.Header
  53559. }
  53560. // SetInstanceTemplate: Specifies the instance template to use when
  53561. // creating new instances in this group. The templates for existing
  53562. // instances in the group do not change unless you recreate them.
  53563. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  53564. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53565. c.project = project
  53566. c.zone = zone
  53567. c.instanceGroupManager = instanceGroupManager
  53568. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  53569. return c
  53570. }
  53571. // RequestId sets the optional parameter "requestId": An optional
  53572. // request ID to identify requests. Specify a unique request ID so that
  53573. // if you must retry your request, the server will know to ignore the
  53574. // request if it has already been completed.
  53575. //
  53576. // For example, consider a situation where you make an initial request
  53577. // and the request times out. If you make the request again with the
  53578. // same request ID, the server can check if original operation with the
  53579. // same request ID was received, and if so, will ignore the second
  53580. // request. This prevents clients from accidentally creating duplicate
  53581. // commitments.
  53582. //
  53583. // The request ID must be a valid UUID with the exception that zero UUID
  53584. // is not supported (00000000-0000-0000-0000-000000000000).
  53585. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  53586. c.urlParams_.Set("requestId", requestId)
  53587. return c
  53588. }
  53589. // Fields allows partial responses to be retrieved. See
  53590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53591. // for more information.
  53592. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  53593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53594. return c
  53595. }
  53596. // Context sets the context to be used in this call's Do method. Any
  53597. // pending HTTP request will be aborted if the provided context is
  53598. // canceled.
  53599. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  53600. c.ctx_ = ctx
  53601. return c
  53602. }
  53603. // Header returns an http.Header that can be modified by the caller to
  53604. // add HTTP headers to the request.
  53605. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  53606. if c.header_ == nil {
  53607. c.header_ = make(http.Header)
  53608. }
  53609. return c.header_
  53610. }
  53611. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  53612. reqHeaders := make(http.Header)
  53613. for k, v := range c.header_ {
  53614. reqHeaders[k] = v
  53615. }
  53616. reqHeaders.Set("User-Agent", c.s.userAgent())
  53617. var body io.Reader = nil
  53618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  53619. if err != nil {
  53620. return nil, err
  53621. }
  53622. reqHeaders.Set("Content-Type", "application/json")
  53623. c.urlParams_.Set("alt", alt)
  53624. c.urlParams_.Set("prettyPrint", "false")
  53625. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  53626. urls += "?" + c.urlParams_.Encode()
  53627. req, err := http.NewRequest("POST", urls, body)
  53628. if err != nil {
  53629. return nil, err
  53630. }
  53631. req.Header = reqHeaders
  53632. googleapi.Expand(req.URL, map[string]string{
  53633. "project": c.project,
  53634. "zone": c.zone,
  53635. "instanceGroupManager": c.instanceGroupManager,
  53636. })
  53637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53638. }
  53639. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  53640. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53641. // status code is an error. Response headers are in either
  53642. // *Operation.ServerResponse.Header or (if a response was returned at
  53643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53644. // to check whether the returned error was because
  53645. // http.StatusNotModified was returned.
  53646. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53647. gensupport.SetOptions(c.urlParams_, opts...)
  53648. res, err := c.doRequest("json")
  53649. if res != nil && res.StatusCode == http.StatusNotModified {
  53650. if res.Body != nil {
  53651. res.Body.Close()
  53652. }
  53653. return nil, &googleapi.Error{
  53654. Code: res.StatusCode,
  53655. Header: res.Header,
  53656. }
  53657. }
  53658. if err != nil {
  53659. return nil, err
  53660. }
  53661. defer googleapi.CloseBody(res)
  53662. if err := googleapi.CheckResponse(res); err != nil {
  53663. return nil, err
  53664. }
  53665. ret := &Operation{
  53666. ServerResponse: googleapi.ServerResponse{
  53667. Header: res.Header,
  53668. HTTPStatusCode: res.StatusCode,
  53669. },
  53670. }
  53671. target := &ret
  53672. if err := gensupport.DecodeResponse(target, res); err != nil {
  53673. return nil, err
  53674. }
  53675. return ret, nil
  53676. // {
  53677. // "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.",
  53678. // "httpMethod": "POST",
  53679. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  53680. // "parameterOrder": [
  53681. // "project",
  53682. // "zone",
  53683. // "instanceGroupManager"
  53684. // ],
  53685. // "parameters": {
  53686. // "instanceGroupManager": {
  53687. // "description": "The name of the managed instance group.",
  53688. // "location": "path",
  53689. // "required": true,
  53690. // "type": "string"
  53691. // },
  53692. // "project": {
  53693. // "description": "Project ID for this request.",
  53694. // "location": "path",
  53695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53696. // "required": true,
  53697. // "type": "string"
  53698. // },
  53699. // "requestId": {
  53700. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53701. // "location": "query",
  53702. // "type": "string"
  53703. // },
  53704. // "zone": {
  53705. // "description": "The name of the zone where the managed instance group is located.",
  53706. // "location": "path",
  53707. // "required": true,
  53708. // "type": "string"
  53709. // }
  53710. // },
  53711. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  53712. // "request": {
  53713. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  53714. // },
  53715. // "response": {
  53716. // "$ref": "Operation"
  53717. // },
  53718. // "scopes": [
  53719. // "https://www.googleapis.com/auth/cloud-platform",
  53720. // "https://www.googleapis.com/auth/compute"
  53721. // ]
  53722. // }
  53723. }
  53724. // method id "compute.instanceGroupManagers.setTargetPools":
  53725. type InstanceGroupManagersSetTargetPoolsCall struct {
  53726. s *Service
  53727. project string
  53728. zone string
  53729. instanceGroupManager string
  53730. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  53731. urlParams_ gensupport.URLParams
  53732. ctx_ context.Context
  53733. header_ http.Header
  53734. }
  53735. // SetTargetPools: Modifies the target pools to which all instances in
  53736. // this managed instance group are assigned. The target pools
  53737. // automatically apply to all of the instances in the managed instance
  53738. // group. This operation is marked DONE when you make the request even
  53739. // if the instances have not yet been added to their target pools. The
  53740. // change might take some time to apply to all of the instances in the
  53741. // group depending on the size of the group.
  53742. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  53743. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53744. c.project = project
  53745. c.zone = zone
  53746. c.instanceGroupManager = instanceGroupManager
  53747. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  53748. return c
  53749. }
  53750. // RequestId sets the optional parameter "requestId": An optional
  53751. // request ID to identify requests. Specify a unique request ID so that
  53752. // if you must retry your request, the server will know to ignore the
  53753. // request if it has already been completed.
  53754. //
  53755. // For example, consider a situation where you make an initial request
  53756. // and the request times out. If you make the request again with the
  53757. // same request ID, the server can check if original operation with the
  53758. // same request ID was received, and if so, will ignore the second
  53759. // request. This prevents clients from accidentally creating duplicate
  53760. // commitments.
  53761. //
  53762. // The request ID must be a valid UUID with the exception that zero UUID
  53763. // is not supported (00000000-0000-0000-0000-000000000000).
  53764. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  53765. c.urlParams_.Set("requestId", requestId)
  53766. return c
  53767. }
  53768. // Fields allows partial responses to be retrieved. See
  53769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53770. // for more information.
  53771. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  53772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53773. return c
  53774. }
  53775. // Context sets the context to be used in this call's Do method. Any
  53776. // pending HTTP request will be aborted if the provided context is
  53777. // canceled.
  53778. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  53779. c.ctx_ = ctx
  53780. return c
  53781. }
  53782. // Header returns an http.Header that can be modified by the caller to
  53783. // add HTTP headers to the request.
  53784. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  53785. if c.header_ == nil {
  53786. c.header_ = make(http.Header)
  53787. }
  53788. return c.header_
  53789. }
  53790. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  53791. reqHeaders := make(http.Header)
  53792. for k, v := range c.header_ {
  53793. reqHeaders[k] = v
  53794. }
  53795. reqHeaders.Set("User-Agent", c.s.userAgent())
  53796. var body io.Reader = nil
  53797. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  53798. if err != nil {
  53799. return nil, err
  53800. }
  53801. reqHeaders.Set("Content-Type", "application/json")
  53802. c.urlParams_.Set("alt", alt)
  53803. c.urlParams_.Set("prettyPrint", "false")
  53804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  53805. urls += "?" + c.urlParams_.Encode()
  53806. req, err := http.NewRequest("POST", urls, body)
  53807. if err != nil {
  53808. return nil, err
  53809. }
  53810. req.Header = reqHeaders
  53811. googleapi.Expand(req.URL, map[string]string{
  53812. "project": c.project,
  53813. "zone": c.zone,
  53814. "instanceGroupManager": c.instanceGroupManager,
  53815. })
  53816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53817. }
  53818. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  53819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53820. // status code is an error. Response headers are in either
  53821. // *Operation.ServerResponse.Header or (if a response was returned at
  53822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53823. // to check whether the returned error was because
  53824. // http.StatusNotModified was returned.
  53825. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53826. gensupport.SetOptions(c.urlParams_, opts...)
  53827. res, err := c.doRequest("json")
  53828. if res != nil && res.StatusCode == http.StatusNotModified {
  53829. if res.Body != nil {
  53830. res.Body.Close()
  53831. }
  53832. return nil, &googleapi.Error{
  53833. Code: res.StatusCode,
  53834. Header: res.Header,
  53835. }
  53836. }
  53837. if err != nil {
  53838. return nil, err
  53839. }
  53840. defer googleapi.CloseBody(res)
  53841. if err := googleapi.CheckResponse(res); err != nil {
  53842. return nil, err
  53843. }
  53844. ret := &Operation{
  53845. ServerResponse: googleapi.ServerResponse{
  53846. Header: res.Header,
  53847. HTTPStatusCode: res.StatusCode,
  53848. },
  53849. }
  53850. target := &ret
  53851. if err := gensupport.DecodeResponse(target, res); err != nil {
  53852. return nil, err
  53853. }
  53854. return ret, nil
  53855. // {
  53856. // "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.",
  53857. // "httpMethod": "POST",
  53858. // "id": "compute.instanceGroupManagers.setTargetPools",
  53859. // "parameterOrder": [
  53860. // "project",
  53861. // "zone",
  53862. // "instanceGroupManager"
  53863. // ],
  53864. // "parameters": {
  53865. // "instanceGroupManager": {
  53866. // "description": "The name of the managed instance group.",
  53867. // "location": "path",
  53868. // "required": true,
  53869. // "type": "string"
  53870. // },
  53871. // "project": {
  53872. // "description": "Project ID for this request.",
  53873. // "location": "path",
  53874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53875. // "required": true,
  53876. // "type": "string"
  53877. // },
  53878. // "requestId": {
  53879. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53880. // "location": "query",
  53881. // "type": "string"
  53882. // },
  53883. // "zone": {
  53884. // "description": "The name of the zone where the managed instance group is located.",
  53885. // "location": "path",
  53886. // "required": true,
  53887. // "type": "string"
  53888. // }
  53889. // },
  53890. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  53891. // "request": {
  53892. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  53893. // },
  53894. // "response": {
  53895. // "$ref": "Operation"
  53896. // },
  53897. // "scopes": [
  53898. // "https://www.googleapis.com/auth/cloud-platform",
  53899. // "https://www.googleapis.com/auth/compute"
  53900. // ]
  53901. // }
  53902. }
  53903. // method id "compute.instanceGroupManagers.testIamPermissions":
  53904. type InstanceGroupManagersTestIamPermissionsCall struct {
  53905. s *Service
  53906. project string
  53907. zone string
  53908. resource string
  53909. testpermissionsrequest *TestPermissionsRequest
  53910. urlParams_ gensupport.URLParams
  53911. ctx_ context.Context
  53912. header_ http.Header
  53913. }
  53914. // TestIamPermissions: Returns permissions that a caller has on the
  53915. // specified resource.
  53916. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  53917. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53918. c.project = project
  53919. c.zone = zone
  53920. c.resource = resource
  53921. c.testpermissionsrequest = testpermissionsrequest
  53922. return c
  53923. }
  53924. // Fields allows partial responses to be retrieved. See
  53925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53926. // for more information.
  53927. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  53928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53929. return c
  53930. }
  53931. // Context sets the context to be used in this call's Do method. Any
  53932. // pending HTTP request will be aborted if the provided context is
  53933. // canceled.
  53934. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  53935. c.ctx_ = ctx
  53936. return c
  53937. }
  53938. // Header returns an http.Header that can be modified by the caller to
  53939. // add HTTP headers to the request.
  53940. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  53941. if c.header_ == nil {
  53942. c.header_ = make(http.Header)
  53943. }
  53944. return c.header_
  53945. }
  53946. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53947. reqHeaders := make(http.Header)
  53948. for k, v := range c.header_ {
  53949. reqHeaders[k] = v
  53950. }
  53951. reqHeaders.Set("User-Agent", c.s.userAgent())
  53952. var body io.Reader = nil
  53953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53954. if err != nil {
  53955. return nil, err
  53956. }
  53957. reqHeaders.Set("Content-Type", "application/json")
  53958. c.urlParams_.Set("alt", alt)
  53959. c.urlParams_.Set("prettyPrint", "false")
  53960. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  53961. urls += "?" + c.urlParams_.Encode()
  53962. req, err := http.NewRequest("POST", urls, body)
  53963. if err != nil {
  53964. return nil, err
  53965. }
  53966. req.Header = reqHeaders
  53967. googleapi.Expand(req.URL, map[string]string{
  53968. "project": c.project,
  53969. "zone": c.zone,
  53970. "resource": c.resource,
  53971. })
  53972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53973. }
  53974. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  53975. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53976. // non-2xx status code is an error. Response headers are in either
  53977. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53978. // returned at all) in error.(*googleapi.Error).Header. Use
  53979. // googleapi.IsNotModified to check whether the returned error was
  53980. // because http.StatusNotModified was returned.
  53981. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53982. gensupport.SetOptions(c.urlParams_, opts...)
  53983. res, err := c.doRequest("json")
  53984. if res != nil && res.StatusCode == http.StatusNotModified {
  53985. if res.Body != nil {
  53986. res.Body.Close()
  53987. }
  53988. return nil, &googleapi.Error{
  53989. Code: res.StatusCode,
  53990. Header: res.Header,
  53991. }
  53992. }
  53993. if err != nil {
  53994. return nil, err
  53995. }
  53996. defer googleapi.CloseBody(res)
  53997. if err := googleapi.CheckResponse(res); err != nil {
  53998. return nil, err
  53999. }
  54000. ret := &TestPermissionsResponse{
  54001. ServerResponse: googleapi.ServerResponse{
  54002. Header: res.Header,
  54003. HTTPStatusCode: res.StatusCode,
  54004. },
  54005. }
  54006. target := &ret
  54007. if err := gensupport.DecodeResponse(target, res); err != nil {
  54008. return nil, err
  54009. }
  54010. return ret, nil
  54011. // {
  54012. // "description": "Returns permissions that a caller has on the specified resource.",
  54013. // "httpMethod": "POST",
  54014. // "id": "compute.instanceGroupManagers.testIamPermissions",
  54015. // "parameterOrder": [
  54016. // "project",
  54017. // "zone",
  54018. // "resource"
  54019. // ],
  54020. // "parameters": {
  54021. // "project": {
  54022. // "description": "Project ID for this request.",
  54023. // "location": "path",
  54024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54025. // "required": true,
  54026. // "type": "string"
  54027. // },
  54028. // "resource": {
  54029. // "description": "Name or id of the resource for this request.",
  54030. // "location": "path",
  54031. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54032. // "required": true,
  54033. // "type": "string"
  54034. // },
  54035. // "zone": {
  54036. // "description": "The name of the zone for this request.",
  54037. // "location": "path",
  54038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54039. // "required": true,
  54040. // "type": "string"
  54041. // }
  54042. // },
  54043. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  54044. // "request": {
  54045. // "$ref": "TestPermissionsRequest"
  54046. // },
  54047. // "response": {
  54048. // "$ref": "TestPermissionsResponse"
  54049. // },
  54050. // "scopes": [
  54051. // "https://www.googleapis.com/auth/cloud-platform",
  54052. // "https://www.googleapis.com/auth/compute",
  54053. // "https://www.googleapis.com/auth/compute.readonly"
  54054. // ]
  54055. // }
  54056. }
  54057. // method id "compute.instanceGroupManagers.update":
  54058. type InstanceGroupManagersUpdateCall struct {
  54059. s *Service
  54060. project string
  54061. zone string
  54062. instanceGroupManager string
  54063. instancegroupmanager *InstanceGroupManager
  54064. urlParams_ gensupport.URLParams
  54065. ctx_ context.Context
  54066. header_ http.Header
  54067. }
  54068. // Update: Updates a managed instance group using the information that
  54069. // you specify in the request. This operation is marked as DONE when the
  54070. // group is updated even if the instances in the group have not yet been
  54071. // updated. You must separately verify the status of the individual
  54072. // instances with the listManagedInstances method.
  54073. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  54074. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54075. c.project = project
  54076. c.zone = zone
  54077. c.instanceGroupManager = instanceGroupManager
  54078. c.instancegroupmanager = instancegroupmanager
  54079. return c
  54080. }
  54081. // RequestId sets the optional parameter "requestId": An optional
  54082. // request ID to identify requests. Specify a unique request ID so that
  54083. // if you must retry your request, the server will know to ignore the
  54084. // request if it has already been completed.
  54085. //
  54086. // For example, consider a situation where you make an initial request
  54087. // and the request times out. If you make the request again with the
  54088. // same request ID, the server can check if original operation with the
  54089. // same request ID was received, and if so, will ignore the second
  54090. // request. This prevents clients from accidentally creating duplicate
  54091. // commitments.
  54092. //
  54093. // The request ID must be a valid UUID with the exception that zero UUID
  54094. // is not supported (00000000-0000-0000-0000-000000000000).
  54095. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  54096. c.urlParams_.Set("requestId", requestId)
  54097. return c
  54098. }
  54099. // Fields allows partial responses to be retrieved. See
  54100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54101. // for more information.
  54102. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  54103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54104. return c
  54105. }
  54106. // Context sets the context to be used in this call's Do method. Any
  54107. // pending HTTP request will be aborted if the provided context is
  54108. // canceled.
  54109. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  54110. c.ctx_ = ctx
  54111. return c
  54112. }
  54113. // Header returns an http.Header that can be modified by the caller to
  54114. // add HTTP headers to the request.
  54115. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  54116. if c.header_ == nil {
  54117. c.header_ = make(http.Header)
  54118. }
  54119. return c.header_
  54120. }
  54121. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  54122. reqHeaders := make(http.Header)
  54123. for k, v := range c.header_ {
  54124. reqHeaders[k] = v
  54125. }
  54126. reqHeaders.Set("User-Agent", c.s.userAgent())
  54127. var body io.Reader = nil
  54128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  54129. if err != nil {
  54130. return nil, err
  54131. }
  54132. reqHeaders.Set("Content-Type", "application/json")
  54133. c.urlParams_.Set("alt", alt)
  54134. c.urlParams_.Set("prettyPrint", "false")
  54135. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  54136. urls += "?" + c.urlParams_.Encode()
  54137. req, err := http.NewRequest("PUT", urls, body)
  54138. if err != nil {
  54139. return nil, err
  54140. }
  54141. req.Header = reqHeaders
  54142. googleapi.Expand(req.URL, map[string]string{
  54143. "project": c.project,
  54144. "zone": c.zone,
  54145. "instanceGroupManager": c.instanceGroupManager,
  54146. })
  54147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54148. }
  54149. // Do executes the "compute.instanceGroupManagers.update" call.
  54150. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54151. // status code is an error. Response headers are in either
  54152. // *Operation.ServerResponse.Header or (if a response was returned at
  54153. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54154. // to check whether the returned error was because
  54155. // http.StatusNotModified was returned.
  54156. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54157. gensupport.SetOptions(c.urlParams_, opts...)
  54158. res, err := c.doRequest("json")
  54159. if res != nil && res.StatusCode == http.StatusNotModified {
  54160. if res.Body != nil {
  54161. res.Body.Close()
  54162. }
  54163. return nil, &googleapi.Error{
  54164. Code: res.StatusCode,
  54165. Header: res.Header,
  54166. }
  54167. }
  54168. if err != nil {
  54169. return nil, err
  54170. }
  54171. defer googleapi.CloseBody(res)
  54172. if err := googleapi.CheckResponse(res); err != nil {
  54173. return nil, err
  54174. }
  54175. ret := &Operation{
  54176. ServerResponse: googleapi.ServerResponse{
  54177. Header: res.Header,
  54178. HTTPStatusCode: res.StatusCode,
  54179. },
  54180. }
  54181. target := &ret
  54182. if err := gensupport.DecodeResponse(target, res); err != nil {
  54183. return nil, err
  54184. }
  54185. return ret, nil
  54186. // {
  54187. // "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 updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method.",
  54188. // "httpMethod": "PUT",
  54189. // "id": "compute.instanceGroupManagers.update",
  54190. // "parameterOrder": [
  54191. // "project",
  54192. // "zone",
  54193. // "instanceGroupManager"
  54194. // ],
  54195. // "parameters": {
  54196. // "instanceGroupManager": {
  54197. // "description": "The name of the instance group manager.",
  54198. // "location": "path",
  54199. // "required": true,
  54200. // "type": "string"
  54201. // },
  54202. // "project": {
  54203. // "description": "Project ID for this request.",
  54204. // "location": "path",
  54205. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54206. // "required": true,
  54207. // "type": "string"
  54208. // },
  54209. // "requestId": {
  54210. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54211. // "location": "query",
  54212. // "type": "string"
  54213. // },
  54214. // "zone": {
  54215. // "description": "The name of the zone where you want to create the managed instance group.",
  54216. // "location": "path",
  54217. // "required": true,
  54218. // "type": "string"
  54219. // }
  54220. // },
  54221. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  54222. // "request": {
  54223. // "$ref": "InstanceGroupManager"
  54224. // },
  54225. // "response": {
  54226. // "$ref": "Operation"
  54227. // },
  54228. // "scopes": [
  54229. // "https://www.googleapis.com/auth/cloud-platform",
  54230. // "https://www.googleapis.com/auth/compute"
  54231. // ]
  54232. // }
  54233. }
  54234. // method id "compute.instanceGroups.addInstances":
  54235. type InstanceGroupsAddInstancesCall struct {
  54236. s *Service
  54237. project string
  54238. zone string
  54239. instanceGroup string
  54240. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  54241. urlParams_ gensupport.URLParams
  54242. ctx_ context.Context
  54243. header_ http.Header
  54244. }
  54245. // AddInstances: Adds a list of instances to the specified instance
  54246. // group. All of the instances in the instance group must be in the same
  54247. // network/subnetwork. Read Adding instances for more information.
  54248. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  54249. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54250. c.project = project
  54251. c.zone = zone
  54252. c.instanceGroup = instanceGroup
  54253. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  54254. return c
  54255. }
  54256. // RequestId sets the optional parameter "requestId": An optional
  54257. // request ID to identify requests. Specify a unique request ID so that
  54258. // if you must retry your request, the server will know to ignore the
  54259. // request if it has already been completed.
  54260. //
  54261. // For example, consider a situation where you make an initial request
  54262. // and the request times out. If you make the request again with the
  54263. // same request ID, the server can check if original operation with the
  54264. // same request ID was received, and if so, will ignore the second
  54265. // request. This prevents clients from accidentally creating duplicate
  54266. // commitments.
  54267. //
  54268. // The request ID must be a valid UUID with the exception that zero UUID
  54269. // is not supported (00000000-0000-0000-0000-000000000000).
  54270. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  54271. c.urlParams_.Set("requestId", requestId)
  54272. return c
  54273. }
  54274. // Fields allows partial responses to be retrieved. See
  54275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54276. // for more information.
  54277. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  54278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54279. return c
  54280. }
  54281. // Context sets the context to be used in this call's Do method. Any
  54282. // pending HTTP request will be aborted if the provided context is
  54283. // canceled.
  54284. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  54285. c.ctx_ = ctx
  54286. return c
  54287. }
  54288. // Header returns an http.Header that can be modified by the caller to
  54289. // add HTTP headers to the request.
  54290. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  54291. if c.header_ == nil {
  54292. c.header_ = make(http.Header)
  54293. }
  54294. return c.header_
  54295. }
  54296. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  54297. reqHeaders := make(http.Header)
  54298. for k, v := range c.header_ {
  54299. reqHeaders[k] = v
  54300. }
  54301. reqHeaders.Set("User-Agent", c.s.userAgent())
  54302. var body io.Reader = nil
  54303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  54304. if err != nil {
  54305. return nil, err
  54306. }
  54307. reqHeaders.Set("Content-Type", "application/json")
  54308. c.urlParams_.Set("alt", alt)
  54309. c.urlParams_.Set("prettyPrint", "false")
  54310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  54311. urls += "?" + c.urlParams_.Encode()
  54312. req, err := http.NewRequest("POST", urls, body)
  54313. if err != nil {
  54314. return nil, err
  54315. }
  54316. req.Header = reqHeaders
  54317. googleapi.Expand(req.URL, map[string]string{
  54318. "project": c.project,
  54319. "zone": c.zone,
  54320. "instanceGroup": c.instanceGroup,
  54321. })
  54322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54323. }
  54324. // Do executes the "compute.instanceGroups.addInstances" call.
  54325. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54326. // status code is an error. Response headers are in either
  54327. // *Operation.ServerResponse.Header or (if a response was returned at
  54328. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54329. // to check whether the returned error was because
  54330. // http.StatusNotModified was returned.
  54331. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54332. gensupport.SetOptions(c.urlParams_, opts...)
  54333. res, err := c.doRequest("json")
  54334. if res != nil && res.StatusCode == http.StatusNotModified {
  54335. if res.Body != nil {
  54336. res.Body.Close()
  54337. }
  54338. return nil, &googleapi.Error{
  54339. Code: res.StatusCode,
  54340. Header: res.Header,
  54341. }
  54342. }
  54343. if err != nil {
  54344. return nil, err
  54345. }
  54346. defer googleapi.CloseBody(res)
  54347. if err := googleapi.CheckResponse(res); err != nil {
  54348. return nil, err
  54349. }
  54350. ret := &Operation{
  54351. ServerResponse: googleapi.ServerResponse{
  54352. Header: res.Header,
  54353. HTTPStatusCode: res.StatusCode,
  54354. },
  54355. }
  54356. target := &ret
  54357. if err := gensupport.DecodeResponse(target, res); err != nil {
  54358. return nil, err
  54359. }
  54360. return ret, nil
  54361. // {
  54362. // "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.",
  54363. // "httpMethod": "POST",
  54364. // "id": "compute.instanceGroups.addInstances",
  54365. // "parameterOrder": [
  54366. // "project",
  54367. // "zone",
  54368. // "instanceGroup"
  54369. // ],
  54370. // "parameters": {
  54371. // "instanceGroup": {
  54372. // "description": "The name of the instance group where you are adding instances.",
  54373. // "location": "path",
  54374. // "required": true,
  54375. // "type": "string"
  54376. // },
  54377. // "project": {
  54378. // "description": "Project ID for this request.",
  54379. // "location": "path",
  54380. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54381. // "required": true,
  54382. // "type": "string"
  54383. // },
  54384. // "requestId": {
  54385. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54386. // "location": "query",
  54387. // "type": "string"
  54388. // },
  54389. // "zone": {
  54390. // "description": "The name of the zone where the instance group is located.",
  54391. // "location": "path",
  54392. // "required": true,
  54393. // "type": "string"
  54394. // }
  54395. // },
  54396. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  54397. // "request": {
  54398. // "$ref": "InstanceGroupsAddInstancesRequest"
  54399. // },
  54400. // "response": {
  54401. // "$ref": "Operation"
  54402. // },
  54403. // "scopes": [
  54404. // "https://www.googleapis.com/auth/cloud-platform",
  54405. // "https://www.googleapis.com/auth/compute"
  54406. // ]
  54407. // }
  54408. }
  54409. // method id "compute.instanceGroups.aggregatedList":
  54410. type InstanceGroupsAggregatedListCall struct {
  54411. s *Service
  54412. project string
  54413. urlParams_ gensupport.URLParams
  54414. ifNoneMatch_ string
  54415. ctx_ context.Context
  54416. header_ http.Header
  54417. }
  54418. // AggregatedList: Retrieves the list of instance groups and sorts them
  54419. // by zone.
  54420. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  54421. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54422. c.project = project
  54423. return c
  54424. }
  54425. // Filter sets the optional parameter "filter": A filter expression that
  54426. // filters resources listed in the response. The expression must specify
  54427. // the field name, a comparison operator, and the value that you want to
  54428. // use for filtering. The value must be a string, a number, or a
  54429. // boolean. The comparison operator must be either =, !=, >, or <.
  54430. //
  54431. // For example, if you are filtering Compute Engine instances, you can
  54432. // exclude instances named example-instance by specifying name !=
  54433. // example-instance.
  54434. //
  54435. // You can also filter nested fields. For example, you could specify
  54436. // scheduling.automaticRestart = false to include instances only if they
  54437. // are not scheduled for automatic restarts. You can use filtering on
  54438. // nested fields to filter based on resource labels.
  54439. //
  54440. // To filter on multiple expressions, provide each separate expression
  54441. // within parentheses. For example, (scheduling.automaticRestart = true)
  54442. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54443. // AND expression. However, you can include AND and OR expressions
  54444. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54445. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54446. // true).
  54447. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  54448. c.urlParams_.Set("filter", filter)
  54449. return c
  54450. }
  54451. // MaxResults sets the optional parameter "maxResults": The maximum
  54452. // number of results per page that should be returned. If the number of
  54453. // available results is larger than maxResults, Compute Engine returns a
  54454. // nextPageToken that can be used to get the next page of results in
  54455. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54456. // (Default: 500)
  54457. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  54458. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54459. return c
  54460. }
  54461. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54462. // a certain order. By default, results are returned in alphanumerical
  54463. // order based on the resource name.
  54464. //
  54465. // You can also sort results in descending order based on the creation
  54466. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54467. // based on the creationTimestamp field in reverse chronological order
  54468. // (newest result first). Use this to sort resources like operations so
  54469. // that the newest operation is returned first.
  54470. //
  54471. // Currently, only sorting by name or creationTimestamp desc is
  54472. // supported.
  54473. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  54474. c.urlParams_.Set("orderBy", orderBy)
  54475. return c
  54476. }
  54477. // PageToken sets the optional parameter "pageToken": Specifies a page
  54478. // token to use. Set pageToken to the nextPageToken returned by a
  54479. // previous list request to get the next page of results.
  54480. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  54481. c.urlParams_.Set("pageToken", pageToken)
  54482. return c
  54483. }
  54484. // Fields allows partial responses to be retrieved. See
  54485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54486. // for more information.
  54487. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  54488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54489. return c
  54490. }
  54491. // IfNoneMatch sets the optional parameter which makes the operation
  54492. // fail if the object's ETag matches the given value. This is useful for
  54493. // getting updates only after the object has changed since the last
  54494. // request. Use googleapi.IsNotModified to check whether the response
  54495. // error from Do is the result of In-None-Match.
  54496. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  54497. c.ifNoneMatch_ = entityTag
  54498. return c
  54499. }
  54500. // Context sets the context to be used in this call's Do method. Any
  54501. // pending HTTP request will be aborted if the provided context is
  54502. // canceled.
  54503. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  54504. c.ctx_ = ctx
  54505. return c
  54506. }
  54507. // Header returns an http.Header that can be modified by the caller to
  54508. // add HTTP headers to the request.
  54509. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  54510. if c.header_ == nil {
  54511. c.header_ = make(http.Header)
  54512. }
  54513. return c.header_
  54514. }
  54515. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54516. reqHeaders := make(http.Header)
  54517. for k, v := range c.header_ {
  54518. reqHeaders[k] = v
  54519. }
  54520. reqHeaders.Set("User-Agent", c.s.userAgent())
  54521. if c.ifNoneMatch_ != "" {
  54522. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54523. }
  54524. var body io.Reader = nil
  54525. c.urlParams_.Set("alt", alt)
  54526. c.urlParams_.Set("prettyPrint", "false")
  54527. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  54528. urls += "?" + c.urlParams_.Encode()
  54529. req, err := http.NewRequest("GET", urls, body)
  54530. if err != nil {
  54531. return nil, err
  54532. }
  54533. req.Header = reqHeaders
  54534. googleapi.Expand(req.URL, map[string]string{
  54535. "project": c.project,
  54536. })
  54537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54538. }
  54539. // Do executes the "compute.instanceGroups.aggregatedList" call.
  54540. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  54541. // Any non-2xx status code is an error. Response headers are in either
  54542. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  54543. // was returned at all) in error.(*googleapi.Error).Header. Use
  54544. // googleapi.IsNotModified to check whether the returned error was
  54545. // because http.StatusNotModified was returned.
  54546. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  54547. gensupport.SetOptions(c.urlParams_, opts...)
  54548. res, err := c.doRequest("json")
  54549. if res != nil && res.StatusCode == http.StatusNotModified {
  54550. if res.Body != nil {
  54551. res.Body.Close()
  54552. }
  54553. return nil, &googleapi.Error{
  54554. Code: res.StatusCode,
  54555. Header: res.Header,
  54556. }
  54557. }
  54558. if err != nil {
  54559. return nil, err
  54560. }
  54561. defer googleapi.CloseBody(res)
  54562. if err := googleapi.CheckResponse(res); err != nil {
  54563. return nil, err
  54564. }
  54565. ret := &InstanceGroupAggregatedList{
  54566. ServerResponse: googleapi.ServerResponse{
  54567. Header: res.Header,
  54568. HTTPStatusCode: res.StatusCode,
  54569. },
  54570. }
  54571. target := &ret
  54572. if err := gensupport.DecodeResponse(target, res); err != nil {
  54573. return nil, err
  54574. }
  54575. return ret, nil
  54576. // {
  54577. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  54578. // "httpMethod": "GET",
  54579. // "id": "compute.instanceGroups.aggregatedList",
  54580. // "parameterOrder": [
  54581. // "project"
  54582. // ],
  54583. // "parameters": {
  54584. // "filter": {
  54585. // "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).",
  54586. // "location": "query",
  54587. // "type": "string"
  54588. // },
  54589. // "maxResults": {
  54590. // "default": "500",
  54591. // "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)",
  54592. // "format": "uint32",
  54593. // "location": "query",
  54594. // "minimum": "0",
  54595. // "type": "integer"
  54596. // },
  54597. // "orderBy": {
  54598. // "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.",
  54599. // "location": "query",
  54600. // "type": "string"
  54601. // },
  54602. // "pageToken": {
  54603. // "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.",
  54604. // "location": "query",
  54605. // "type": "string"
  54606. // },
  54607. // "project": {
  54608. // "description": "Project ID for this request.",
  54609. // "location": "path",
  54610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54611. // "required": true,
  54612. // "type": "string"
  54613. // }
  54614. // },
  54615. // "path": "{project}/aggregated/instanceGroups",
  54616. // "response": {
  54617. // "$ref": "InstanceGroupAggregatedList"
  54618. // },
  54619. // "scopes": [
  54620. // "https://www.googleapis.com/auth/cloud-platform",
  54621. // "https://www.googleapis.com/auth/compute",
  54622. // "https://www.googleapis.com/auth/compute.readonly"
  54623. // ]
  54624. // }
  54625. }
  54626. // Pages invokes f for each page of results.
  54627. // A non-nil error returned from f will halt the iteration.
  54628. // The provided context supersedes any context provided to the Context method.
  54629. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  54630. c.ctx_ = ctx
  54631. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54632. for {
  54633. x, err := c.Do()
  54634. if err != nil {
  54635. return err
  54636. }
  54637. if err := f(x); err != nil {
  54638. return err
  54639. }
  54640. if x.NextPageToken == "" {
  54641. return nil
  54642. }
  54643. c.PageToken(x.NextPageToken)
  54644. }
  54645. }
  54646. // method id "compute.instanceGroups.delete":
  54647. type InstanceGroupsDeleteCall struct {
  54648. s *Service
  54649. project string
  54650. zone string
  54651. instanceGroup string
  54652. urlParams_ gensupport.URLParams
  54653. ctx_ context.Context
  54654. header_ http.Header
  54655. }
  54656. // Delete: Deletes the specified instance group. The instances in the
  54657. // group are not deleted. Note that instance group must not belong to a
  54658. // backend service. Read Deleting an instance group for more
  54659. // information.
  54660. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  54661. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54662. c.project = project
  54663. c.zone = zone
  54664. c.instanceGroup = instanceGroup
  54665. return c
  54666. }
  54667. // RequestId sets the optional parameter "requestId": An optional
  54668. // request ID to identify requests. Specify a unique request ID so that
  54669. // if you must retry your request, the server will know to ignore the
  54670. // request if it has already been completed.
  54671. //
  54672. // For example, consider a situation where you make an initial request
  54673. // and the request times out. If you make the request again with the
  54674. // same request ID, the server can check if original operation with the
  54675. // same request ID was received, and if so, will ignore the second
  54676. // request. This prevents clients from accidentally creating duplicate
  54677. // commitments.
  54678. //
  54679. // The request ID must be a valid UUID with the exception that zero UUID
  54680. // is not supported (00000000-0000-0000-0000-000000000000).
  54681. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  54682. c.urlParams_.Set("requestId", requestId)
  54683. return c
  54684. }
  54685. // Fields allows partial responses to be retrieved. See
  54686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54687. // for more information.
  54688. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  54689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54690. return c
  54691. }
  54692. // Context sets the context to be used in this call's Do method. Any
  54693. // pending HTTP request will be aborted if the provided context is
  54694. // canceled.
  54695. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  54696. c.ctx_ = ctx
  54697. return c
  54698. }
  54699. // Header returns an http.Header that can be modified by the caller to
  54700. // add HTTP headers to the request.
  54701. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  54702. if c.header_ == nil {
  54703. c.header_ = make(http.Header)
  54704. }
  54705. return c.header_
  54706. }
  54707. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  54708. reqHeaders := make(http.Header)
  54709. for k, v := range c.header_ {
  54710. reqHeaders[k] = v
  54711. }
  54712. reqHeaders.Set("User-Agent", c.s.userAgent())
  54713. var body io.Reader = nil
  54714. c.urlParams_.Set("alt", alt)
  54715. c.urlParams_.Set("prettyPrint", "false")
  54716. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  54717. urls += "?" + c.urlParams_.Encode()
  54718. req, err := http.NewRequest("DELETE", urls, body)
  54719. if err != nil {
  54720. return nil, err
  54721. }
  54722. req.Header = reqHeaders
  54723. googleapi.Expand(req.URL, map[string]string{
  54724. "project": c.project,
  54725. "zone": c.zone,
  54726. "instanceGroup": c.instanceGroup,
  54727. })
  54728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54729. }
  54730. // Do executes the "compute.instanceGroups.delete" call.
  54731. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54732. // status code is an error. Response headers are in either
  54733. // *Operation.ServerResponse.Header or (if a response was returned at
  54734. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54735. // to check whether the returned error was because
  54736. // http.StatusNotModified was returned.
  54737. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54738. gensupport.SetOptions(c.urlParams_, opts...)
  54739. res, err := c.doRequest("json")
  54740. if res != nil && res.StatusCode == http.StatusNotModified {
  54741. if res.Body != nil {
  54742. res.Body.Close()
  54743. }
  54744. return nil, &googleapi.Error{
  54745. Code: res.StatusCode,
  54746. Header: res.Header,
  54747. }
  54748. }
  54749. if err != nil {
  54750. return nil, err
  54751. }
  54752. defer googleapi.CloseBody(res)
  54753. if err := googleapi.CheckResponse(res); err != nil {
  54754. return nil, err
  54755. }
  54756. ret := &Operation{
  54757. ServerResponse: googleapi.ServerResponse{
  54758. Header: res.Header,
  54759. HTTPStatusCode: res.StatusCode,
  54760. },
  54761. }
  54762. target := &ret
  54763. if err := gensupport.DecodeResponse(target, res); err != nil {
  54764. return nil, err
  54765. }
  54766. return ret, nil
  54767. // {
  54768. // "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.",
  54769. // "httpMethod": "DELETE",
  54770. // "id": "compute.instanceGroups.delete",
  54771. // "parameterOrder": [
  54772. // "project",
  54773. // "zone",
  54774. // "instanceGroup"
  54775. // ],
  54776. // "parameters": {
  54777. // "instanceGroup": {
  54778. // "description": "The name of the instance group to delete.",
  54779. // "location": "path",
  54780. // "required": true,
  54781. // "type": "string"
  54782. // },
  54783. // "project": {
  54784. // "description": "Project ID for this request.",
  54785. // "location": "path",
  54786. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54787. // "required": true,
  54788. // "type": "string"
  54789. // },
  54790. // "requestId": {
  54791. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54792. // "location": "query",
  54793. // "type": "string"
  54794. // },
  54795. // "zone": {
  54796. // "description": "The name of the zone where the instance group is located.",
  54797. // "location": "path",
  54798. // "required": true,
  54799. // "type": "string"
  54800. // }
  54801. // },
  54802. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  54803. // "response": {
  54804. // "$ref": "Operation"
  54805. // },
  54806. // "scopes": [
  54807. // "https://www.googleapis.com/auth/cloud-platform",
  54808. // "https://www.googleapis.com/auth/compute"
  54809. // ]
  54810. // }
  54811. }
  54812. // method id "compute.instanceGroups.get":
  54813. type InstanceGroupsGetCall struct {
  54814. s *Service
  54815. project string
  54816. zone string
  54817. instanceGroup string
  54818. urlParams_ gensupport.URLParams
  54819. ifNoneMatch_ string
  54820. ctx_ context.Context
  54821. header_ http.Header
  54822. }
  54823. // Get: Returns the specified instance group. Gets a list of available
  54824. // instance groups by making a list() request.
  54825. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  54826. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54827. c.project = project
  54828. c.zone = zone
  54829. c.instanceGroup = instanceGroup
  54830. return c
  54831. }
  54832. // Fields allows partial responses to be retrieved. See
  54833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54834. // for more information.
  54835. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  54836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54837. return c
  54838. }
  54839. // IfNoneMatch sets the optional parameter which makes the operation
  54840. // fail if the object's ETag matches the given value. This is useful for
  54841. // getting updates only after the object has changed since the last
  54842. // request. Use googleapi.IsNotModified to check whether the response
  54843. // error from Do is the result of In-None-Match.
  54844. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  54845. c.ifNoneMatch_ = entityTag
  54846. return c
  54847. }
  54848. // Context sets the context to be used in this call's Do method. Any
  54849. // pending HTTP request will be aborted if the provided context is
  54850. // canceled.
  54851. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  54852. c.ctx_ = ctx
  54853. return c
  54854. }
  54855. // Header returns an http.Header that can be modified by the caller to
  54856. // add HTTP headers to the request.
  54857. func (c *InstanceGroupsGetCall) Header() http.Header {
  54858. if c.header_ == nil {
  54859. c.header_ = make(http.Header)
  54860. }
  54861. return c.header_
  54862. }
  54863. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  54864. reqHeaders := make(http.Header)
  54865. for k, v := range c.header_ {
  54866. reqHeaders[k] = v
  54867. }
  54868. reqHeaders.Set("User-Agent", c.s.userAgent())
  54869. if c.ifNoneMatch_ != "" {
  54870. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54871. }
  54872. var body io.Reader = nil
  54873. c.urlParams_.Set("alt", alt)
  54874. c.urlParams_.Set("prettyPrint", "false")
  54875. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  54876. urls += "?" + c.urlParams_.Encode()
  54877. req, err := http.NewRequest("GET", urls, body)
  54878. if err != nil {
  54879. return nil, err
  54880. }
  54881. req.Header = reqHeaders
  54882. googleapi.Expand(req.URL, map[string]string{
  54883. "project": c.project,
  54884. "zone": c.zone,
  54885. "instanceGroup": c.instanceGroup,
  54886. })
  54887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54888. }
  54889. // Do executes the "compute.instanceGroups.get" call.
  54890. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  54891. // status code is an error. Response headers are in either
  54892. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  54893. // at all) in error.(*googleapi.Error).Header. Use
  54894. // googleapi.IsNotModified to check whether the returned error was
  54895. // because http.StatusNotModified was returned.
  54896. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  54897. gensupport.SetOptions(c.urlParams_, opts...)
  54898. res, err := c.doRequest("json")
  54899. if res != nil && res.StatusCode == http.StatusNotModified {
  54900. if res.Body != nil {
  54901. res.Body.Close()
  54902. }
  54903. return nil, &googleapi.Error{
  54904. Code: res.StatusCode,
  54905. Header: res.Header,
  54906. }
  54907. }
  54908. if err != nil {
  54909. return nil, err
  54910. }
  54911. defer googleapi.CloseBody(res)
  54912. if err := googleapi.CheckResponse(res); err != nil {
  54913. return nil, err
  54914. }
  54915. ret := &InstanceGroup{
  54916. ServerResponse: googleapi.ServerResponse{
  54917. Header: res.Header,
  54918. HTTPStatusCode: res.StatusCode,
  54919. },
  54920. }
  54921. target := &ret
  54922. if err := gensupport.DecodeResponse(target, res); err != nil {
  54923. return nil, err
  54924. }
  54925. return ret, nil
  54926. // {
  54927. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  54928. // "httpMethod": "GET",
  54929. // "id": "compute.instanceGroups.get",
  54930. // "parameterOrder": [
  54931. // "project",
  54932. // "zone",
  54933. // "instanceGroup"
  54934. // ],
  54935. // "parameters": {
  54936. // "instanceGroup": {
  54937. // "description": "The name of the instance group.",
  54938. // "location": "path",
  54939. // "required": true,
  54940. // "type": "string"
  54941. // },
  54942. // "project": {
  54943. // "description": "Project ID for this request.",
  54944. // "location": "path",
  54945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54946. // "required": true,
  54947. // "type": "string"
  54948. // },
  54949. // "zone": {
  54950. // "description": "The name of the zone where the instance group is located.",
  54951. // "location": "path",
  54952. // "required": true,
  54953. // "type": "string"
  54954. // }
  54955. // },
  54956. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  54957. // "response": {
  54958. // "$ref": "InstanceGroup"
  54959. // },
  54960. // "scopes": [
  54961. // "https://www.googleapis.com/auth/cloud-platform",
  54962. // "https://www.googleapis.com/auth/compute",
  54963. // "https://www.googleapis.com/auth/compute.readonly"
  54964. // ]
  54965. // }
  54966. }
  54967. // method id "compute.instanceGroups.insert":
  54968. type InstanceGroupsInsertCall struct {
  54969. s *Service
  54970. project string
  54971. zone string
  54972. instancegroup *InstanceGroup
  54973. urlParams_ gensupport.URLParams
  54974. ctx_ context.Context
  54975. header_ http.Header
  54976. }
  54977. // Insert: Creates an instance group in the specified project using the
  54978. // parameters that are included in the request.
  54979. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  54980. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54981. c.project = project
  54982. c.zone = zone
  54983. c.instancegroup = instancegroup
  54984. return c
  54985. }
  54986. // RequestId sets the optional parameter "requestId": An optional
  54987. // request ID to identify requests. Specify a unique request ID so that
  54988. // if you must retry your request, the server will know to ignore the
  54989. // request if it has already been completed.
  54990. //
  54991. // For example, consider a situation where you make an initial request
  54992. // and the request times out. If you make the request again with the
  54993. // same request ID, the server can check if original operation with the
  54994. // same request ID was received, and if so, will ignore the second
  54995. // request. This prevents clients from accidentally creating duplicate
  54996. // commitments.
  54997. //
  54998. // The request ID must be a valid UUID with the exception that zero UUID
  54999. // is not supported (00000000-0000-0000-0000-000000000000).
  55000. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  55001. c.urlParams_.Set("requestId", requestId)
  55002. return c
  55003. }
  55004. // Fields allows partial responses to be retrieved. See
  55005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55006. // for more information.
  55007. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  55008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55009. return c
  55010. }
  55011. // Context sets the context to be used in this call's Do method. Any
  55012. // pending HTTP request will be aborted if the provided context is
  55013. // canceled.
  55014. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  55015. c.ctx_ = ctx
  55016. return c
  55017. }
  55018. // Header returns an http.Header that can be modified by the caller to
  55019. // add HTTP headers to the request.
  55020. func (c *InstanceGroupsInsertCall) Header() http.Header {
  55021. if c.header_ == nil {
  55022. c.header_ = make(http.Header)
  55023. }
  55024. return c.header_
  55025. }
  55026. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  55027. reqHeaders := make(http.Header)
  55028. for k, v := range c.header_ {
  55029. reqHeaders[k] = v
  55030. }
  55031. reqHeaders.Set("User-Agent", c.s.userAgent())
  55032. var body io.Reader = nil
  55033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  55034. if err != nil {
  55035. return nil, err
  55036. }
  55037. reqHeaders.Set("Content-Type", "application/json")
  55038. c.urlParams_.Set("alt", alt)
  55039. c.urlParams_.Set("prettyPrint", "false")
  55040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  55041. urls += "?" + c.urlParams_.Encode()
  55042. req, err := http.NewRequest("POST", urls, body)
  55043. if err != nil {
  55044. return nil, err
  55045. }
  55046. req.Header = reqHeaders
  55047. googleapi.Expand(req.URL, map[string]string{
  55048. "project": c.project,
  55049. "zone": c.zone,
  55050. })
  55051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55052. }
  55053. // Do executes the "compute.instanceGroups.insert" call.
  55054. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55055. // status code is an error. Response headers are in either
  55056. // *Operation.ServerResponse.Header or (if a response was returned at
  55057. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55058. // to check whether the returned error was because
  55059. // http.StatusNotModified was returned.
  55060. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55061. gensupport.SetOptions(c.urlParams_, opts...)
  55062. res, err := c.doRequest("json")
  55063. if res != nil && res.StatusCode == http.StatusNotModified {
  55064. if res.Body != nil {
  55065. res.Body.Close()
  55066. }
  55067. return nil, &googleapi.Error{
  55068. Code: res.StatusCode,
  55069. Header: res.Header,
  55070. }
  55071. }
  55072. if err != nil {
  55073. return nil, err
  55074. }
  55075. defer googleapi.CloseBody(res)
  55076. if err := googleapi.CheckResponse(res); err != nil {
  55077. return nil, err
  55078. }
  55079. ret := &Operation{
  55080. ServerResponse: googleapi.ServerResponse{
  55081. Header: res.Header,
  55082. HTTPStatusCode: res.StatusCode,
  55083. },
  55084. }
  55085. target := &ret
  55086. if err := gensupport.DecodeResponse(target, res); err != nil {
  55087. return nil, err
  55088. }
  55089. return ret, nil
  55090. // {
  55091. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  55092. // "httpMethod": "POST",
  55093. // "id": "compute.instanceGroups.insert",
  55094. // "parameterOrder": [
  55095. // "project",
  55096. // "zone"
  55097. // ],
  55098. // "parameters": {
  55099. // "project": {
  55100. // "description": "Project ID for this request.",
  55101. // "location": "path",
  55102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55103. // "required": true,
  55104. // "type": "string"
  55105. // },
  55106. // "requestId": {
  55107. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55108. // "location": "query",
  55109. // "type": "string"
  55110. // },
  55111. // "zone": {
  55112. // "description": "The name of the zone where you want to create the instance group.",
  55113. // "location": "path",
  55114. // "required": true,
  55115. // "type": "string"
  55116. // }
  55117. // },
  55118. // "path": "{project}/zones/{zone}/instanceGroups",
  55119. // "request": {
  55120. // "$ref": "InstanceGroup"
  55121. // },
  55122. // "response": {
  55123. // "$ref": "Operation"
  55124. // },
  55125. // "scopes": [
  55126. // "https://www.googleapis.com/auth/cloud-platform",
  55127. // "https://www.googleapis.com/auth/compute"
  55128. // ]
  55129. // }
  55130. }
  55131. // method id "compute.instanceGroups.list":
  55132. type InstanceGroupsListCall struct {
  55133. s *Service
  55134. project string
  55135. zone string
  55136. urlParams_ gensupport.URLParams
  55137. ifNoneMatch_ string
  55138. ctx_ context.Context
  55139. header_ http.Header
  55140. }
  55141. // List: Retrieves the list of instance groups that are located in the
  55142. // specified project and zone.
  55143. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  55144. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55145. c.project = project
  55146. c.zone = zone
  55147. return c
  55148. }
  55149. // Filter sets the optional parameter "filter": A filter expression that
  55150. // filters resources listed in the response. The expression must specify
  55151. // the field name, a comparison operator, and the value that you want to
  55152. // use for filtering. The value must be a string, a number, or a
  55153. // boolean. The comparison operator must be either =, !=, >, or <.
  55154. //
  55155. // For example, if you are filtering Compute Engine instances, you can
  55156. // exclude instances named example-instance by specifying name !=
  55157. // example-instance.
  55158. //
  55159. // You can also filter nested fields. For example, you could specify
  55160. // scheduling.automaticRestart = false to include instances only if they
  55161. // are not scheduled for automatic restarts. You can use filtering on
  55162. // nested fields to filter based on resource labels.
  55163. //
  55164. // To filter on multiple expressions, provide each separate expression
  55165. // within parentheses. For example, (scheduling.automaticRestart = true)
  55166. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55167. // AND expression. However, you can include AND and OR expressions
  55168. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55169. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55170. // true).
  55171. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  55172. c.urlParams_.Set("filter", filter)
  55173. return c
  55174. }
  55175. // MaxResults sets the optional parameter "maxResults": The maximum
  55176. // number of results per page that should be returned. If the number of
  55177. // available results is larger than maxResults, Compute Engine returns a
  55178. // nextPageToken that can be used to get the next page of results in
  55179. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55180. // (Default: 500)
  55181. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  55182. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55183. return c
  55184. }
  55185. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55186. // a certain order. By default, results are returned in alphanumerical
  55187. // order based on the resource name.
  55188. //
  55189. // You can also sort results in descending order based on the creation
  55190. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55191. // based on the creationTimestamp field in reverse chronological order
  55192. // (newest result first). Use this to sort resources like operations so
  55193. // that the newest operation is returned first.
  55194. //
  55195. // Currently, only sorting by name or creationTimestamp desc is
  55196. // supported.
  55197. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  55198. c.urlParams_.Set("orderBy", orderBy)
  55199. return c
  55200. }
  55201. // PageToken sets the optional parameter "pageToken": Specifies a page
  55202. // token to use. Set pageToken to the nextPageToken returned by a
  55203. // previous list request to get the next page of results.
  55204. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  55205. c.urlParams_.Set("pageToken", pageToken)
  55206. return c
  55207. }
  55208. // Fields allows partial responses to be retrieved. See
  55209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55210. // for more information.
  55211. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  55212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55213. return c
  55214. }
  55215. // IfNoneMatch sets the optional parameter which makes the operation
  55216. // fail if the object's ETag matches the given value. This is useful for
  55217. // getting updates only after the object has changed since the last
  55218. // request. Use googleapi.IsNotModified to check whether the response
  55219. // error from Do is the result of In-None-Match.
  55220. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  55221. c.ifNoneMatch_ = entityTag
  55222. return c
  55223. }
  55224. // Context sets the context to be used in this call's Do method. Any
  55225. // pending HTTP request will be aborted if the provided context is
  55226. // canceled.
  55227. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  55228. c.ctx_ = ctx
  55229. return c
  55230. }
  55231. // Header returns an http.Header that can be modified by the caller to
  55232. // add HTTP headers to the request.
  55233. func (c *InstanceGroupsListCall) Header() http.Header {
  55234. if c.header_ == nil {
  55235. c.header_ = make(http.Header)
  55236. }
  55237. return c.header_
  55238. }
  55239. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  55240. reqHeaders := make(http.Header)
  55241. for k, v := range c.header_ {
  55242. reqHeaders[k] = v
  55243. }
  55244. reqHeaders.Set("User-Agent", c.s.userAgent())
  55245. if c.ifNoneMatch_ != "" {
  55246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55247. }
  55248. var body io.Reader = nil
  55249. c.urlParams_.Set("alt", alt)
  55250. c.urlParams_.Set("prettyPrint", "false")
  55251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  55252. urls += "?" + c.urlParams_.Encode()
  55253. req, err := http.NewRequest("GET", urls, body)
  55254. if err != nil {
  55255. return nil, err
  55256. }
  55257. req.Header = reqHeaders
  55258. googleapi.Expand(req.URL, map[string]string{
  55259. "project": c.project,
  55260. "zone": c.zone,
  55261. })
  55262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55263. }
  55264. // Do executes the "compute.instanceGroups.list" call.
  55265. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  55266. // non-2xx status code is an error. Response headers are in either
  55267. // *InstanceGroupList.ServerResponse.Header or (if a response was
  55268. // returned at all) in error.(*googleapi.Error).Header. Use
  55269. // googleapi.IsNotModified to check whether the returned error was
  55270. // because http.StatusNotModified was returned.
  55271. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  55272. gensupport.SetOptions(c.urlParams_, opts...)
  55273. res, err := c.doRequest("json")
  55274. if res != nil && res.StatusCode == http.StatusNotModified {
  55275. if res.Body != nil {
  55276. res.Body.Close()
  55277. }
  55278. return nil, &googleapi.Error{
  55279. Code: res.StatusCode,
  55280. Header: res.Header,
  55281. }
  55282. }
  55283. if err != nil {
  55284. return nil, err
  55285. }
  55286. defer googleapi.CloseBody(res)
  55287. if err := googleapi.CheckResponse(res); err != nil {
  55288. return nil, err
  55289. }
  55290. ret := &InstanceGroupList{
  55291. ServerResponse: googleapi.ServerResponse{
  55292. Header: res.Header,
  55293. HTTPStatusCode: res.StatusCode,
  55294. },
  55295. }
  55296. target := &ret
  55297. if err := gensupport.DecodeResponse(target, res); err != nil {
  55298. return nil, err
  55299. }
  55300. return ret, nil
  55301. // {
  55302. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  55303. // "httpMethod": "GET",
  55304. // "id": "compute.instanceGroups.list",
  55305. // "parameterOrder": [
  55306. // "project",
  55307. // "zone"
  55308. // ],
  55309. // "parameters": {
  55310. // "filter": {
  55311. // "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).",
  55312. // "location": "query",
  55313. // "type": "string"
  55314. // },
  55315. // "maxResults": {
  55316. // "default": "500",
  55317. // "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)",
  55318. // "format": "uint32",
  55319. // "location": "query",
  55320. // "minimum": "0",
  55321. // "type": "integer"
  55322. // },
  55323. // "orderBy": {
  55324. // "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.",
  55325. // "location": "query",
  55326. // "type": "string"
  55327. // },
  55328. // "pageToken": {
  55329. // "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.",
  55330. // "location": "query",
  55331. // "type": "string"
  55332. // },
  55333. // "project": {
  55334. // "description": "Project ID for this request.",
  55335. // "location": "path",
  55336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55337. // "required": true,
  55338. // "type": "string"
  55339. // },
  55340. // "zone": {
  55341. // "description": "The name of the zone where the instance group is located.",
  55342. // "location": "path",
  55343. // "required": true,
  55344. // "type": "string"
  55345. // }
  55346. // },
  55347. // "path": "{project}/zones/{zone}/instanceGroups",
  55348. // "response": {
  55349. // "$ref": "InstanceGroupList"
  55350. // },
  55351. // "scopes": [
  55352. // "https://www.googleapis.com/auth/cloud-platform",
  55353. // "https://www.googleapis.com/auth/compute",
  55354. // "https://www.googleapis.com/auth/compute.readonly"
  55355. // ]
  55356. // }
  55357. }
  55358. // Pages invokes f for each page of results.
  55359. // A non-nil error returned from f will halt the iteration.
  55360. // The provided context supersedes any context provided to the Context method.
  55361. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  55362. c.ctx_ = ctx
  55363. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55364. for {
  55365. x, err := c.Do()
  55366. if err != nil {
  55367. return err
  55368. }
  55369. if err := f(x); err != nil {
  55370. return err
  55371. }
  55372. if x.NextPageToken == "" {
  55373. return nil
  55374. }
  55375. c.PageToken(x.NextPageToken)
  55376. }
  55377. }
  55378. // method id "compute.instanceGroups.listInstances":
  55379. type InstanceGroupsListInstancesCall struct {
  55380. s *Service
  55381. project string
  55382. zone string
  55383. instanceGroup string
  55384. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  55385. urlParams_ gensupport.URLParams
  55386. ctx_ context.Context
  55387. header_ http.Header
  55388. }
  55389. // ListInstances: Lists the instances in the specified instance group.
  55390. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  55391. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55392. c.project = project
  55393. c.zone = zone
  55394. c.instanceGroup = instanceGroup
  55395. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  55396. return c
  55397. }
  55398. // Filter sets the optional parameter "filter": A filter expression that
  55399. // filters resources listed in the response. The expression must specify
  55400. // the field name, a comparison operator, and the value that you want to
  55401. // use for filtering. The value must be a string, a number, or a
  55402. // boolean. The comparison operator must be either =, !=, >, or <.
  55403. //
  55404. // For example, if you are filtering Compute Engine instances, you can
  55405. // exclude instances named example-instance by specifying name !=
  55406. // example-instance.
  55407. //
  55408. // You can also filter nested fields. For example, you could specify
  55409. // scheduling.automaticRestart = false to include instances only if they
  55410. // are not scheduled for automatic restarts. You can use filtering on
  55411. // nested fields to filter based on resource labels.
  55412. //
  55413. // To filter on multiple expressions, provide each separate expression
  55414. // within parentheses. For example, (scheduling.automaticRestart = true)
  55415. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55416. // AND expression. However, you can include AND and OR expressions
  55417. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55418. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55419. // true).
  55420. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  55421. c.urlParams_.Set("filter", filter)
  55422. return c
  55423. }
  55424. // MaxResults sets the optional parameter "maxResults": The maximum
  55425. // number of results per page that should be returned. If the number of
  55426. // available results is larger than maxResults, Compute Engine returns a
  55427. // nextPageToken that can be used to get the next page of results in
  55428. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55429. // (Default: 500)
  55430. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  55431. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55432. return c
  55433. }
  55434. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55435. // a certain order. By default, results are returned in alphanumerical
  55436. // order based on the resource name.
  55437. //
  55438. // You can also sort results in descending order based on the creation
  55439. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55440. // based on the creationTimestamp field in reverse chronological order
  55441. // (newest result first). Use this to sort resources like operations so
  55442. // that the newest operation is returned first.
  55443. //
  55444. // Currently, only sorting by name or creationTimestamp desc is
  55445. // supported.
  55446. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  55447. c.urlParams_.Set("orderBy", orderBy)
  55448. return c
  55449. }
  55450. // PageToken sets the optional parameter "pageToken": Specifies a page
  55451. // token to use. Set pageToken to the nextPageToken returned by a
  55452. // previous list request to get the next page of results.
  55453. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  55454. c.urlParams_.Set("pageToken", pageToken)
  55455. return c
  55456. }
  55457. // Fields allows partial responses to be retrieved. See
  55458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55459. // for more information.
  55460. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  55461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55462. return c
  55463. }
  55464. // Context sets the context to be used in this call's Do method. Any
  55465. // pending HTTP request will be aborted if the provided context is
  55466. // canceled.
  55467. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  55468. c.ctx_ = ctx
  55469. return c
  55470. }
  55471. // Header returns an http.Header that can be modified by the caller to
  55472. // add HTTP headers to the request.
  55473. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  55474. if c.header_ == nil {
  55475. c.header_ = make(http.Header)
  55476. }
  55477. return c.header_
  55478. }
  55479. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  55480. reqHeaders := make(http.Header)
  55481. for k, v := range c.header_ {
  55482. reqHeaders[k] = v
  55483. }
  55484. reqHeaders.Set("User-Agent", c.s.userAgent())
  55485. var body io.Reader = nil
  55486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  55487. if err != nil {
  55488. return nil, err
  55489. }
  55490. reqHeaders.Set("Content-Type", "application/json")
  55491. c.urlParams_.Set("alt", alt)
  55492. c.urlParams_.Set("prettyPrint", "false")
  55493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  55494. urls += "?" + c.urlParams_.Encode()
  55495. req, err := http.NewRequest("POST", urls, body)
  55496. if err != nil {
  55497. return nil, err
  55498. }
  55499. req.Header = reqHeaders
  55500. googleapi.Expand(req.URL, map[string]string{
  55501. "project": c.project,
  55502. "zone": c.zone,
  55503. "instanceGroup": c.instanceGroup,
  55504. })
  55505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55506. }
  55507. // Do executes the "compute.instanceGroups.listInstances" call.
  55508. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  55509. // Any non-2xx status code is an error. Response headers are in either
  55510. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  55511. // was returned at all) in error.(*googleapi.Error).Header. Use
  55512. // googleapi.IsNotModified to check whether the returned error was
  55513. // because http.StatusNotModified was returned.
  55514. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  55515. gensupport.SetOptions(c.urlParams_, opts...)
  55516. res, err := c.doRequest("json")
  55517. if res != nil && res.StatusCode == http.StatusNotModified {
  55518. if res.Body != nil {
  55519. res.Body.Close()
  55520. }
  55521. return nil, &googleapi.Error{
  55522. Code: res.StatusCode,
  55523. Header: res.Header,
  55524. }
  55525. }
  55526. if err != nil {
  55527. return nil, err
  55528. }
  55529. defer googleapi.CloseBody(res)
  55530. if err := googleapi.CheckResponse(res); err != nil {
  55531. return nil, err
  55532. }
  55533. ret := &InstanceGroupsListInstances{
  55534. ServerResponse: googleapi.ServerResponse{
  55535. Header: res.Header,
  55536. HTTPStatusCode: res.StatusCode,
  55537. },
  55538. }
  55539. target := &ret
  55540. if err := gensupport.DecodeResponse(target, res); err != nil {
  55541. return nil, err
  55542. }
  55543. return ret, nil
  55544. // {
  55545. // "description": "Lists the instances in the specified instance group.",
  55546. // "httpMethod": "POST",
  55547. // "id": "compute.instanceGroups.listInstances",
  55548. // "parameterOrder": [
  55549. // "project",
  55550. // "zone",
  55551. // "instanceGroup"
  55552. // ],
  55553. // "parameters": {
  55554. // "filter": {
  55555. // "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).",
  55556. // "location": "query",
  55557. // "type": "string"
  55558. // },
  55559. // "instanceGroup": {
  55560. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  55561. // "location": "path",
  55562. // "required": true,
  55563. // "type": "string"
  55564. // },
  55565. // "maxResults": {
  55566. // "default": "500",
  55567. // "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)",
  55568. // "format": "uint32",
  55569. // "location": "query",
  55570. // "minimum": "0",
  55571. // "type": "integer"
  55572. // },
  55573. // "orderBy": {
  55574. // "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.",
  55575. // "location": "query",
  55576. // "type": "string"
  55577. // },
  55578. // "pageToken": {
  55579. // "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.",
  55580. // "location": "query",
  55581. // "type": "string"
  55582. // },
  55583. // "project": {
  55584. // "description": "Project ID for this request.",
  55585. // "location": "path",
  55586. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55587. // "required": true,
  55588. // "type": "string"
  55589. // },
  55590. // "zone": {
  55591. // "description": "The name of the zone where the instance group is located.",
  55592. // "location": "path",
  55593. // "required": true,
  55594. // "type": "string"
  55595. // }
  55596. // },
  55597. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  55598. // "request": {
  55599. // "$ref": "InstanceGroupsListInstancesRequest"
  55600. // },
  55601. // "response": {
  55602. // "$ref": "InstanceGroupsListInstances"
  55603. // },
  55604. // "scopes": [
  55605. // "https://www.googleapis.com/auth/cloud-platform",
  55606. // "https://www.googleapis.com/auth/compute",
  55607. // "https://www.googleapis.com/auth/compute.readonly"
  55608. // ]
  55609. // }
  55610. }
  55611. // Pages invokes f for each page of results.
  55612. // A non-nil error returned from f will halt the iteration.
  55613. // The provided context supersedes any context provided to the Context method.
  55614. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  55615. c.ctx_ = ctx
  55616. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55617. for {
  55618. x, err := c.Do()
  55619. if err != nil {
  55620. return err
  55621. }
  55622. if err := f(x); err != nil {
  55623. return err
  55624. }
  55625. if x.NextPageToken == "" {
  55626. return nil
  55627. }
  55628. c.PageToken(x.NextPageToken)
  55629. }
  55630. }
  55631. // method id "compute.instanceGroups.removeInstances":
  55632. type InstanceGroupsRemoveInstancesCall struct {
  55633. s *Service
  55634. project string
  55635. zone string
  55636. instanceGroup string
  55637. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  55638. urlParams_ gensupport.URLParams
  55639. ctx_ context.Context
  55640. header_ http.Header
  55641. }
  55642. // RemoveInstances: Removes one or more instances from the specified
  55643. // instance group, but does not delete those instances.
  55644. //
  55645. // If the group is part of a backend service that has enabled connection
  55646. // draining, it can take up to 60 seconds after the connection draining
  55647. // duration before the VM instance is removed or deleted.
  55648. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  55649. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55650. c.project = project
  55651. c.zone = zone
  55652. c.instanceGroup = instanceGroup
  55653. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  55654. return c
  55655. }
  55656. // RequestId sets the optional parameter "requestId": An optional
  55657. // request ID to identify requests. Specify a unique request ID so that
  55658. // if you must retry your request, the server will know to ignore the
  55659. // request if it has already been completed.
  55660. //
  55661. // For example, consider a situation where you make an initial request
  55662. // and the request times out. If you make the request again with the
  55663. // same request ID, the server can check if original operation with the
  55664. // same request ID was received, and if so, will ignore the second
  55665. // request. This prevents clients from accidentally creating duplicate
  55666. // commitments.
  55667. //
  55668. // The request ID must be a valid UUID with the exception that zero UUID
  55669. // is not supported (00000000-0000-0000-0000-000000000000).
  55670. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  55671. c.urlParams_.Set("requestId", requestId)
  55672. return c
  55673. }
  55674. // Fields allows partial responses to be retrieved. See
  55675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55676. // for more information.
  55677. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  55678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55679. return c
  55680. }
  55681. // Context sets the context to be used in this call's Do method. Any
  55682. // pending HTTP request will be aborted if the provided context is
  55683. // canceled.
  55684. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  55685. c.ctx_ = ctx
  55686. return c
  55687. }
  55688. // Header returns an http.Header that can be modified by the caller to
  55689. // add HTTP headers to the request.
  55690. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  55691. if c.header_ == nil {
  55692. c.header_ = make(http.Header)
  55693. }
  55694. return c.header_
  55695. }
  55696. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  55697. reqHeaders := make(http.Header)
  55698. for k, v := range c.header_ {
  55699. reqHeaders[k] = v
  55700. }
  55701. reqHeaders.Set("User-Agent", c.s.userAgent())
  55702. var body io.Reader = nil
  55703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  55704. if err != nil {
  55705. return nil, err
  55706. }
  55707. reqHeaders.Set("Content-Type", "application/json")
  55708. c.urlParams_.Set("alt", alt)
  55709. c.urlParams_.Set("prettyPrint", "false")
  55710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  55711. urls += "?" + c.urlParams_.Encode()
  55712. req, err := http.NewRequest("POST", urls, body)
  55713. if err != nil {
  55714. return nil, err
  55715. }
  55716. req.Header = reqHeaders
  55717. googleapi.Expand(req.URL, map[string]string{
  55718. "project": c.project,
  55719. "zone": c.zone,
  55720. "instanceGroup": c.instanceGroup,
  55721. })
  55722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55723. }
  55724. // Do executes the "compute.instanceGroups.removeInstances" call.
  55725. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55726. // status code is an error. Response headers are in either
  55727. // *Operation.ServerResponse.Header or (if a response was returned at
  55728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55729. // to check whether the returned error was because
  55730. // http.StatusNotModified was returned.
  55731. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55732. gensupport.SetOptions(c.urlParams_, opts...)
  55733. res, err := c.doRequest("json")
  55734. if res != nil && res.StatusCode == http.StatusNotModified {
  55735. if res.Body != nil {
  55736. res.Body.Close()
  55737. }
  55738. return nil, &googleapi.Error{
  55739. Code: res.StatusCode,
  55740. Header: res.Header,
  55741. }
  55742. }
  55743. if err != nil {
  55744. return nil, err
  55745. }
  55746. defer googleapi.CloseBody(res)
  55747. if err := googleapi.CheckResponse(res); err != nil {
  55748. return nil, err
  55749. }
  55750. ret := &Operation{
  55751. ServerResponse: googleapi.ServerResponse{
  55752. Header: res.Header,
  55753. HTTPStatusCode: res.StatusCode,
  55754. },
  55755. }
  55756. target := &ret
  55757. if err := gensupport.DecodeResponse(target, res); err != nil {
  55758. return nil, err
  55759. }
  55760. return ret, nil
  55761. // {
  55762. // "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.",
  55763. // "httpMethod": "POST",
  55764. // "id": "compute.instanceGroups.removeInstances",
  55765. // "parameterOrder": [
  55766. // "project",
  55767. // "zone",
  55768. // "instanceGroup"
  55769. // ],
  55770. // "parameters": {
  55771. // "instanceGroup": {
  55772. // "description": "The name of the instance group where the specified instances will be removed.",
  55773. // "location": "path",
  55774. // "required": true,
  55775. // "type": "string"
  55776. // },
  55777. // "project": {
  55778. // "description": "Project ID for this request.",
  55779. // "location": "path",
  55780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55781. // "required": true,
  55782. // "type": "string"
  55783. // },
  55784. // "requestId": {
  55785. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55786. // "location": "query",
  55787. // "type": "string"
  55788. // },
  55789. // "zone": {
  55790. // "description": "The name of the zone where the instance group is located.",
  55791. // "location": "path",
  55792. // "required": true,
  55793. // "type": "string"
  55794. // }
  55795. // },
  55796. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  55797. // "request": {
  55798. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  55799. // },
  55800. // "response": {
  55801. // "$ref": "Operation"
  55802. // },
  55803. // "scopes": [
  55804. // "https://www.googleapis.com/auth/cloud-platform",
  55805. // "https://www.googleapis.com/auth/compute"
  55806. // ]
  55807. // }
  55808. }
  55809. // method id "compute.instanceGroups.setNamedPorts":
  55810. type InstanceGroupsSetNamedPortsCall struct {
  55811. s *Service
  55812. project string
  55813. zone string
  55814. instanceGroup string
  55815. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  55816. urlParams_ gensupport.URLParams
  55817. ctx_ context.Context
  55818. header_ http.Header
  55819. }
  55820. // SetNamedPorts: Sets the named ports for the specified instance group.
  55821. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  55822. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55823. c.project = project
  55824. c.zone = zone
  55825. c.instanceGroup = instanceGroup
  55826. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  55827. return c
  55828. }
  55829. // RequestId sets the optional parameter "requestId": An optional
  55830. // request ID to identify requests. Specify a unique request ID so that
  55831. // if you must retry your request, the server will know to ignore the
  55832. // request if it has already been completed.
  55833. //
  55834. // For example, consider a situation where you make an initial request
  55835. // and the request times out. If you make the request again with the
  55836. // same request ID, the server can check if original operation with the
  55837. // same request ID was received, and if so, will ignore the second
  55838. // request. This prevents clients from accidentally creating duplicate
  55839. // commitments.
  55840. //
  55841. // The request ID must be a valid UUID with the exception that zero UUID
  55842. // is not supported (00000000-0000-0000-0000-000000000000).
  55843. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  55844. c.urlParams_.Set("requestId", requestId)
  55845. return c
  55846. }
  55847. // Fields allows partial responses to be retrieved. See
  55848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55849. // for more information.
  55850. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  55851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55852. return c
  55853. }
  55854. // Context sets the context to be used in this call's Do method. Any
  55855. // pending HTTP request will be aborted if the provided context is
  55856. // canceled.
  55857. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  55858. c.ctx_ = ctx
  55859. return c
  55860. }
  55861. // Header returns an http.Header that can be modified by the caller to
  55862. // add HTTP headers to the request.
  55863. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  55864. if c.header_ == nil {
  55865. c.header_ = make(http.Header)
  55866. }
  55867. return c.header_
  55868. }
  55869. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  55870. reqHeaders := make(http.Header)
  55871. for k, v := range c.header_ {
  55872. reqHeaders[k] = v
  55873. }
  55874. reqHeaders.Set("User-Agent", c.s.userAgent())
  55875. var body io.Reader = nil
  55876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  55877. if err != nil {
  55878. return nil, err
  55879. }
  55880. reqHeaders.Set("Content-Type", "application/json")
  55881. c.urlParams_.Set("alt", alt)
  55882. c.urlParams_.Set("prettyPrint", "false")
  55883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  55884. urls += "?" + c.urlParams_.Encode()
  55885. req, err := http.NewRequest("POST", urls, body)
  55886. if err != nil {
  55887. return nil, err
  55888. }
  55889. req.Header = reqHeaders
  55890. googleapi.Expand(req.URL, map[string]string{
  55891. "project": c.project,
  55892. "zone": c.zone,
  55893. "instanceGroup": c.instanceGroup,
  55894. })
  55895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55896. }
  55897. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  55898. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55899. // status code is an error. Response headers are in either
  55900. // *Operation.ServerResponse.Header or (if a response was returned at
  55901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55902. // to check whether the returned error was because
  55903. // http.StatusNotModified was returned.
  55904. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55905. gensupport.SetOptions(c.urlParams_, opts...)
  55906. res, err := c.doRequest("json")
  55907. if res != nil && res.StatusCode == http.StatusNotModified {
  55908. if res.Body != nil {
  55909. res.Body.Close()
  55910. }
  55911. return nil, &googleapi.Error{
  55912. Code: res.StatusCode,
  55913. Header: res.Header,
  55914. }
  55915. }
  55916. if err != nil {
  55917. return nil, err
  55918. }
  55919. defer googleapi.CloseBody(res)
  55920. if err := googleapi.CheckResponse(res); err != nil {
  55921. return nil, err
  55922. }
  55923. ret := &Operation{
  55924. ServerResponse: googleapi.ServerResponse{
  55925. Header: res.Header,
  55926. HTTPStatusCode: res.StatusCode,
  55927. },
  55928. }
  55929. target := &ret
  55930. if err := gensupport.DecodeResponse(target, res); err != nil {
  55931. return nil, err
  55932. }
  55933. return ret, nil
  55934. // {
  55935. // "description": "Sets the named ports for the specified instance group.",
  55936. // "httpMethod": "POST",
  55937. // "id": "compute.instanceGroups.setNamedPorts",
  55938. // "parameterOrder": [
  55939. // "project",
  55940. // "zone",
  55941. // "instanceGroup"
  55942. // ],
  55943. // "parameters": {
  55944. // "instanceGroup": {
  55945. // "description": "The name of the instance group where the named ports are updated.",
  55946. // "location": "path",
  55947. // "required": true,
  55948. // "type": "string"
  55949. // },
  55950. // "project": {
  55951. // "description": "Project ID for this request.",
  55952. // "location": "path",
  55953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55954. // "required": true,
  55955. // "type": "string"
  55956. // },
  55957. // "requestId": {
  55958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55959. // "location": "query",
  55960. // "type": "string"
  55961. // },
  55962. // "zone": {
  55963. // "description": "The name of the zone where the instance group is located.",
  55964. // "location": "path",
  55965. // "required": true,
  55966. // "type": "string"
  55967. // }
  55968. // },
  55969. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  55970. // "request": {
  55971. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  55972. // },
  55973. // "response": {
  55974. // "$ref": "Operation"
  55975. // },
  55976. // "scopes": [
  55977. // "https://www.googleapis.com/auth/cloud-platform",
  55978. // "https://www.googleapis.com/auth/compute"
  55979. // ]
  55980. // }
  55981. }
  55982. // method id "compute.instanceGroups.testIamPermissions":
  55983. type InstanceGroupsTestIamPermissionsCall struct {
  55984. s *Service
  55985. project string
  55986. zone string
  55987. resource string
  55988. testpermissionsrequest *TestPermissionsRequest
  55989. urlParams_ gensupport.URLParams
  55990. ctx_ context.Context
  55991. header_ http.Header
  55992. }
  55993. // TestIamPermissions: Returns permissions that a caller has on the
  55994. // specified resource.
  55995. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  55996. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55997. c.project = project
  55998. c.zone = zone
  55999. c.resource = resource
  56000. c.testpermissionsrequest = testpermissionsrequest
  56001. return c
  56002. }
  56003. // Fields allows partial responses to be retrieved. See
  56004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56005. // for more information.
  56006. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  56007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56008. return c
  56009. }
  56010. // Context sets the context to be used in this call's Do method. Any
  56011. // pending HTTP request will be aborted if the provided context is
  56012. // canceled.
  56013. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  56014. c.ctx_ = ctx
  56015. return c
  56016. }
  56017. // Header returns an http.Header that can be modified by the caller to
  56018. // add HTTP headers to the request.
  56019. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  56020. if c.header_ == nil {
  56021. c.header_ = make(http.Header)
  56022. }
  56023. return c.header_
  56024. }
  56025. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  56026. reqHeaders := make(http.Header)
  56027. for k, v := range c.header_ {
  56028. reqHeaders[k] = v
  56029. }
  56030. reqHeaders.Set("User-Agent", c.s.userAgent())
  56031. var body io.Reader = nil
  56032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  56033. if err != nil {
  56034. return nil, err
  56035. }
  56036. reqHeaders.Set("Content-Type", "application/json")
  56037. c.urlParams_.Set("alt", alt)
  56038. c.urlParams_.Set("prettyPrint", "false")
  56039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  56040. urls += "?" + c.urlParams_.Encode()
  56041. req, err := http.NewRequest("POST", urls, body)
  56042. if err != nil {
  56043. return nil, err
  56044. }
  56045. req.Header = reqHeaders
  56046. googleapi.Expand(req.URL, map[string]string{
  56047. "project": c.project,
  56048. "zone": c.zone,
  56049. "resource": c.resource,
  56050. })
  56051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56052. }
  56053. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  56054. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  56055. // non-2xx status code is an error. Response headers are in either
  56056. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  56057. // returned at all) in error.(*googleapi.Error).Header. Use
  56058. // googleapi.IsNotModified to check whether the returned error was
  56059. // because http.StatusNotModified was returned.
  56060. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  56061. gensupport.SetOptions(c.urlParams_, opts...)
  56062. res, err := c.doRequest("json")
  56063. if res != nil && res.StatusCode == http.StatusNotModified {
  56064. if res.Body != nil {
  56065. res.Body.Close()
  56066. }
  56067. return nil, &googleapi.Error{
  56068. Code: res.StatusCode,
  56069. Header: res.Header,
  56070. }
  56071. }
  56072. if err != nil {
  56073. return nil, err
  56074. }
  56075. defer googleapi.CloseBody(res)
  56076. if err := googleapi.CheckResponse(res); err != nil {
  56077. return nil, err
  56078. }
  56079. ret := &TestPermissionsResponse{
  56080. ServerResponse: googleapi.ServerResponse{
  56081. Header: res.Header,
  56082. HTTPStatusCode: res.StatusCode,
  56083. },
  56084. }
  56085. target := &ret
  56086. if err := gensupport.DecodeResponse(target, res); err != nil {
  56087. return nil, err
  56088. }
  56089. return ret, nil
  56090. // {
  56091. // "description": "Returns permissions that a caller has on the specified resource.",
  56092. // "httpMethod": "POST",
  56093. // "id": "compute.instanceGroups.testIamPermissions",
  56094. // "parameterOrder": [
  56095. // "project",
  56096. // "zone",
  56097. // "resource"
  56098. // ],
  56099. // "parameters": {
  56100. // "project": {
  56101. // "description": "Project ID for this request.",
  56102. // "location": "path",
  56103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56104. // "required": true,
  56105. // "type": "string"
  56106. // },
  56107. // "resource": {
  56108. // "description": "Name or id of the resource for this request.",
  56109. // "location": "path",
  56110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56111. // "required": true,
  56112. // "type": "string"
  56113. // },
  56114. // "zone": {
  56115. // "description": "The name of the zone for this request.",
  56116. // "location": "path",
  56117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56118. // "required": true,
  56119. // "type": "string"
  56120. // }
  56121. // },
  56122. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  56123. // "request": {
  56124. // "$ref": "TestPermissionsRequest"
  56125. // },
  56126. // "response": {
  56127. // "$ref": "TestPermissionsResponse"
  56128. // },
  56129. // "scopes": [
  56130. // "https://www.googleapis.com/auth/cloud-platform",
  56131. // "https://www.googleapis.com/auth/compute",
  56132. // "https://www.googleapis.com/auth/compute.readonly"
  56133. // ]
  56134. // }
  56135. }
  56136. // method id "compute.instanceTemplates.delete":
  56137. type InstanceTemplatesDeleteCall struct {
  56138. s *Service
  56139. project string
  56140. instanceTemplate string
  56141. urlParams_ gensupport.URLParams
  56142. ctx_ context.Context
  56143. header_ http.Header
  56144. }
  56145. // Delete: Deletes the specified instance template. Deleting an instance
  56146. // template is permanent and cannot be undone. It's not possible to
  56147. // delete templates which are in use by an instance group.
  56148. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  56149. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  56150. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56151. c.project = project
  56152. c.instanceTemplate = instanceTemplate
  56153. return c
  56154. }
  56155. // RequestId sets the optional parameter "requestId": An optional
  56156. // request ID to identify requests. Specify a unique request ID so that
  56157. // if you must retry your request, the server will know to ignore the
  56158. // request if it has already been completed.
  56159. //
  56160. // For example, consider a situation where you make an initial request
  56161. // and the request times out. If you make the request again with the
  56162. // same request ID, the server can check if original operation with the
  56163. // same request ID was received, and if so, will ignore the second
  56164. // request. This prevents clients from accidentally creating duplicate
  56165. // commitments.
  56166. //
  56167. // The request ID must be a valid UUID with the exception that zero UUID
  56168. // is not supported (00000000-0000-0000-0000-000000000000).
  56169. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  56170. c.urlParams_.Set("requestId", requestId)
  56171. return c
  56172. }
  56173. // Fields allows partial responses to be retrieved. See
  56174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56175. // for more information.
  56176. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  56177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56178. return c
  56179. }
  56180. // Context sets the context to be used in this call's Do method. Any
  56181. // pending HTTP request will be aborted if the provided context is
  56182. // canceled.
  56183. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  56184. c.ctx_ = ctx
  56185. return c
  56186. }
  56187. // Header returns an http.Header that can be modified by the caller to
  56188. // add HTTP headers to the request.
  56189. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  56190. if c.header_ == nil {
  56191. c.header_ = make(http.Header)
  56192. }
  56193. return c.header_
  56194. }
  56195. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  56196. reqHeaders := make(http.Header)
  56197. for k, v := range c.header_ {
  56198. reqHeaders[k] = v
  56199. }
  56200. reqHeaders.Set("User-Agent", c.s.userAgent())
  56201. var body io.Reader = nil
  56202. c.urlParams_.Set("alt", alt)
  56203. c.urlParams_.Set("prettyPrint", "false")
  56204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  56205. urls += "?" + c.urlParams_.Encode()
  56206. req, err := http.NewRequest("DELETE", urls, body)
  56207. if err != nil {
  56208. return nil, err
  56209. }
  56210. req.Header = reqHeaders
  56211. googleapi.Expand(req.URL, map[string]string{
  56212. "project": c.project,
  56213. "instanceTemplate": c.instanceTemplate,
  56214. })
  56215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56216. }
  56217. // Do executes the "compute.instanceTemplates.delete" call.
  56218. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56219. // status code is an error. Response headers are in either
  56220. // *Operation.ServerResponse.Header or (if a response was returned at
  56221. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56222. // to check whether the returned error was because
  56223. // http.StatusNotModified was returned.
  56224. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56225. gensupport.SetOptions(c.urlParams_, opts...)
  56226. res, err := c.doRequest("json")
  56227. if res != nil && res.StatusCode == http.StatusNotModified {
  56228. if res.Body != nil {
  56229. res.Body.Close()
  56230. }
  56231. return nil, &googleapi.Error{
  56232. Code: res.StatusCode,
  56233. Header: res.Header,
  56234. }
  56235. }
  56236. if err != nil {
  56237. return nil, err
  56238. }
  56239. defer googleapi.CloseBody(res)
  56240. if err := googleapi.CheckResponse(res); err != nil {
  56241. return nil, err
  56242. }
  56243. ret := &Operation{
  56244. ServerResponse: googleapi.ServerResponse{
  56245. Header: res.Header,
  56246. HTTPStatusCode: res.StatusCode,
  56247. },
  56248. }
  56249. target := &ret
  56250. if err := gensupport.DecodeResponse(target, res); err != nil {
  56251. return nil, err
  56252. }
  56253. return ret, nil
  56254. // {
  56255. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.",
  56256. // "httpMethod": "DELETE",
  56257. // "id": "compute.instanceTemplates.delete",
  56258. // "parameterOrder": [
  56259. // "project",
  56260. // "instanceTemplate"
  56261. // ],
  56262. // "parameters": {
  56263. // "instanceTemplate": {
  56264. // "description": "The name of the instance template to delete.",
  56265. // "location": "path",
  56266. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56267. // "required": true,
  56268. // "type": "string"
  56269. // },
  56270. // "project": {
  56271. // "description": "Project ID for this request.",
  56272. // "location": "path",
  56273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56274. // "required": true,
  56275. // "type": "string"
  56276. // },
  56277. // "requestId": {
  56278. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56279. // "location": "query",
  56280. // "type": "string"
  56281. // }
  56282. // },
  56283. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  56284. // "response": {
  56285. // "$ref": "Operation"
  56286. // },
  56287. // "scopes": [
  56288. // "https://www.googleapis.com/auth/cloud-platform",
  56289. // "https://www.googleapis.com/auth/compute"
  56290. // ]
  56291. // }
  56292. }
  56293. // method id "compute.instanceTemplates.get":
  56294. type InstanceTemplatesGetCall struct {
  56295. s *Service
  56296. project string
  56297. instanceTemplate string
  56298. urlParams_ gensupport.URLParams
  56299. ifNoneMatch_ string
  56300. ctx_ context.Context
  56301. header_ http.Header
  56302. }
  56303. // Get: Returns the specified instance template. Gets a list of
  56304. // available instance templates by making a list() request.
  56305. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  56306. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  56307. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56308. c.project = project
  56309. c.instanceTemplate = instanceTemplate
  56310. return c
  56311. }
  56312. // Fields allows partial responses to be retrieved. See
  56313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56314. // for more information.
  56315. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  56316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56317. return c
  56318. }
  56319. // IfNoneMatch sets the optional parameter which makes the operation
  56320. // fail if the object's ETag matches the given value. This is useful for
  56321. // getting updates only after the object has changed since the last
  56322. // request. Use googleapi.IsNotModified to check whether the response
  56323. // error from Do is the result of In-None-Match.
  56324. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  56325. c.ifNoneMatch_ = entityTag
  56326. return c
  56327. }
  56328. // Context sets the context to be used in this call's Do method. Any
  56329. // pending HTTP request will be aborted if the provided context is
  56330. // canceled.
  56331. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  56332. c.ctx_ = ctx
  56333. return c
  56334. }
  56335. // Header returns an http.Header that can be modified by the caller to
  56336. // add HTTP headers to the request.
  56337. func (c *InstanceTemplatesGetCall) Header() http.Header {
  56338. if c.header_ == nil {
  56339. c.header_ = make(http.Header)
  56340. }
  56341. return c.header_
  56342. }
  56343. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  56344. reqHeaders := make(http.Header)
  56345. for k, v := range c.header_ {
  56346. reqHeaders[k] = v
  56347. }
  56348. reqHeaders.Set("User-Agent", c.s.userAgent())
  56349. if c.ifNoneMatch_ != "" {
  56350. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56351. }
  56352. var body io.Reader = nil
  56353. c.urlParams_.Set("alt", alt)
  56354. c.urlParams_.Set("prettyPrint", "false")
  56355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  56356. urls += "?" + c.urlParams_.Encode()
  56357. req, err := http.NewRequest("GET", urls, body)
  56358. if err != nil {
  56359. return nil, err
  56360. }
  56361. req.Header = reqHeaders
  56362. googleapi.Expand(req.URL, map[string]string{
  56363. "project": c.project,
  56364. "instanceTemplate": c.instanceTemplate,
  56365. })
  56366. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56367. }
  56368. // Do executes the "compute.instanceTemplates.get" call.
  56369. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  56370. // non-2xx status code is an error. Response headers are in either
  56371. // *InstanceTemplate.ServerResponse.Header or (if a response was
  56372. // returned at all) in error.(*googleapi.Error).Header. Use
  56373. // googleapi.IsNotModified to check whether the returned error was
  56374. // because http.StatusNotModified was returned.
  56375. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  56376. gensupport.SetOptions(c.urlParams_, opts...)
  56377. res, err := c.doRequest("json")
  56378. if res != nil && res.StatusCode == http.StatusNotModified {
  56379. if res.Body != nil {
  56380. res.Body.Close()
  56381. }
  56382. return nil, &googleapi.Error{
  56383. Code: res.StatusCode,
  56384. Header: res.Header,
  56385. }
  56386. }
  56387. if err != nil {
  56388. return nil, err
  56389. }
  56390. defer googleapi.CloseBody(res)
  56391. if err := googleapi.CheckResponse(res); err != nil {
  56392. return nil, err
  56393. }
  56394. ret := &InstanceTemplate{
  56395. ServerResponse: googleapi.ServerResponse{
  56396. Header: res.Header,
  56397. HTTPStatusCode: res.StatusCode,
  56398. },
  56399. }
  56400. target := &ret
  56401. if err := gensupport.DecodeResponse(target, res); err != nil {
  56402. return nil, err
  56403. }
  56404. return ret, nil
  56405. // {
  56406. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  56407. // "httpMethod": "GET",
  56408. // "id": "compute.instanceTemplates.get",
  56409. // "parameterOrder": [
  56410. // "project",
  56411. // "instanceTemplate"
  56412. // ],
  56413. // "parameters": {
  56414. // "instanceTemplate": {
  56415. // "description": "The name of the instance template.",
  56416. // "location": "path",
  56417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56418. // "required": true,
  56419. // "type": "string"
  56420. // },
  56421. // "project": {
  56422. // "description": "Project ID for this request.",
  56423. // "location": "path",
  56424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56425. // "required": true,
  56426. // "type": "string"
  56427. // }
  56428. // },
  56429. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  56430. // "response": {
  56431. // "$ref": "InstanceTemplate"
  56432. // },
  56433. // "scopes": [
  56434. // "https://www.googleapis.com/auth/cloud-platform",
  56435. // "https://www.googleapis.com/auth/compute",
  56436. // "https://www.googleapis.com/auth/compute.readonly"
  56437. // ]
  56438. // }
  56439. }
  56440. // method id "compute.instanceTemplates.getIamPolicy":
  56441. type InstanceTemplatesGetIamPolicyCall struct {
  56442. s *Service
  56443. project string
  56444. resource string
  56445. urlParams_ gensupport.URLParams
  56446. ifNoneMatch_ string
  56447. ctx_ context.Context
  56448. header_ http.Header
  56449. }
  56450. // GetIamPolicy: Gets the access control policy for a resource. May be
  56451. // empty if no such policy or resource exists.
  56452. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  56453. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56454. c.project = project
  56455. c.resource = resource
  56456. return c
  56457. }
  56458. // Fields allows partial responses to be retrieved. See
  56459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56460. // for more information.
  56461. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  56462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56463. return c
  56464. }
  56465. // IfNoneMatch sets the optional parameter which makes the operation
  56466. // fail if the object's ETag matches the given value. This is useful for
  56467. // getting updates only after the object has changed since the last
  56468. // request. Use googleapi.IsNotModified to check whether the response
  56469. // error from Do is the result of In-None-Match.
  56470. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  56471. c.ifNoneMatch_ = entityTag
  56472. return c
  56473. }
  56474. // Context sets the context to be used in this call's Do method. Any
  56475. // pending HTTP request will be aborted if the provided context is
  56476. // canceled.
  56477. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  56478. c.ctx_ = ctx
  56479. return c
  56480. }
  56481. // Header returns an http.Header that can be modified by the caller to
  56482. // add HTTP headers to the request.
  56483. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  56484. if c.header_ == nil {
  56485. c.header_ = make(http.Header)
  56486. }
  56487. return c.header_
  56488. }
  56489. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  56490. reqHeaders := make(http.Header)
  56491. for k, v := range c.header_ {
  56492. reqHeaders[k] = v
  56493. }
  56494. reqHeaders.Set("User-Agent", c.s.userAgent())
  56495. if c.ifNoneMatch_ != "" {
  56496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56497. }
  56498. var body io.Reader = nil
  56499. c.urlParams_.Set("alt", alt)
  56500. c.urlParams_.Set("prettyPrint", "false")
  56501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  56502. urls += "?" + c.urlParams_.Encode()
  56503. req, err := http.NewRequest("GET", urls, body)
  56504. if err != nil {
  56505. return nil, err
  56506. }
  56507. req.Header = reqHeaders
  56508. googleapi.Expand(req.URL, map[string]string{
  56509. "project": c.project,
  56510. "resource": c.resource,
  56511. })
  56512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56513. }
  56514. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  56515. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  56516. // code is an error. Response headers are in either
  56517. // *Policy.ServerResponse.Header or (if a response was returned at all)
  56518. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  56519. // check whether the returned error was because http.StatusNotModified
  56520. // was returned.
  56521. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  56522. gensupport.SetOptions(c.urlParams_, opts...)
  56523. res, err := c.doRequest("json")
  56524. if res != nil && res.StatusCode == http.StatusNotModified {
  56525. if res.Body != nil {
  56526. res.Body.Close()
  56527. }
  56528. return nil, &googleapi.Error{
  56529. Code: res.StatusCode,
  56530. Header: res.Header,
  56531. }
  56532. }
  56533. if err != nil {
  56534. return nil, err
  56535. }
  56536. defer googleapi.CloseBody(res)
  56537. if err := googleapi.CheckResponse(res); err != nil {
  56538. return nil, err
  56539. }
  56540. ret := &Policy{
  56541. ServerResponse: googleapi.ServerResponse{
  56542. Header: res.Header,
  56543. HTTPStatusCode: res.StatusCode,
  56544. },
  56545. }
  56546. target := &ret
  56547. if err := gensupport.DecodeResponse(target, res); err != nil {
  56548. return nil, err
  56549. }
  56550. return ret, nil
  56551. // {
  56552. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  56553. // "httpMethod": "GET",
  56554. // "id": "compute.instanceTemplates.getIamPolicy",
  56555. // "parameterOrder": [
  56556. // "project",
  56557. // "resource"
  56558. // ],
  56559. // "parameters": {
  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. // "resource": {
  56568. // "description": "Name or id of the resource for this request.",
  56569. // "location": "path",
  56570. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56571. // "required": true,
  56572. // "type": "string"
  56573. // }
  56574. // },
  56575. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  56576. // "response": {
  56577. // "$ref": "Policy"
  56578. // },
  56579. // "scopes": [
  56580. // "https://www.googleapis.com/auth/cloud-platform",
  56581. // "https://www.googleapis.com/auth/compute",
  56582. // "https://www.googleapis.com/auth/compute.readonly"
  56583. // ]
  56584. // }
  56585. }
  56586. // method id "compute.instanceTemplates.insert":
  56587. type InstanceTemplatesInsertCall struct {
  56588. s *Service
  56589. project string
  56590. instancetemplate *InstanceTemplate
  56591. urlParams_ gensupport.URLParams
  56592. ctx_ context.Context
  56593. header_ http.Header
  56594. }
  56595. // Insert: Creates an instance template in the specified project using
  56596. // the data that is included in the request. If you are creating a new
  56597. // template to update an existing instance group, your new instance
  56598. // template must use the same network or, if applicable, the same
  56599. // subnetwork as the original template.
  56600. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  56601. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  56602. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56603. c.project = project
  56604. c.instancetemplate = instancetemplate
  56605. return c
  56606. }
  56607. // RequestId sets the optional parameter "requestId": An optional
  56608. // request ID to identify requests. Specify a unique request ID so that
  56609. // if you must retry your request, the server will know to ignore the
  56610. // request if it has already been completed.
  56611. //
  56612. // For example, consider a situation where you make an initial request
  56613. // and the request times out. If you make the request again with the
  56614. // same request ID, the server can check if original operation with the
  56615. // same request ID was received, and if so, will ignore the second
  56616. // request. This prevents clients from accidentally creating duplicate
  56617. // commitments.
  56618. //
  56619. // The request ID must be a valid UUID with the exception that zero UUID
  56620. // is not supported (00000000-0000-0000-0000-000000000000).
  56621. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  56622. c.urlParams_.Set("requestId", requestId)
  56623. return c
  56624. }
  56625. // Fields allows partial responses to be retrieved. See
  56626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56627. // for more information.
  56628. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  56629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56630. return c
  56631. }
  56632. // Context sets the context to be used in this call's Do method. Any
  56633. // pending HTTP request will be aborted if the provided context is
  56634. // canceled.
  56635. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  56636. c.ctx_ = ctx
  56637. return c
  56638. }
  56639. // Header returns an http.Header that can be modified by the caller to
  56640. // add HTTP headers to the request.
  56641. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  56642. if c.header_ == nil {
  56643. c.header_ = make(http.Header)
  56644. }
  56645. return c.header_
  56646. }
  56647. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  56648. reqHeaders := make(http.Header)
  56649. for k, v := range c.header_ {
  56650. reqHeaders[k] = v
  56651. }
  56652. reqHeaders.Set("User-Agent", c.s.userAgent())
  56653. var body io.Reader = nil
  56654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  56655. if err != nil {
  56656. return nil, err
  56657. }
  56658. reqHeaders.Set("Content-Type", "application/json")
  56659. c.urlParams_.Set("alt", alt)
  56660. c.urlParams_.Set("prettyPrint", "false")
  56661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  56662. urls += "?" + c.urlParams_.Encode()
  56663. req, err := http.NewRequest("POST", urls, body)
  56664. if err != nil {
  56665. return nil, err
  56666. }
  56667. req.Header = reqHeaders
  56668. googleapi.Expand(req.URL, map[string]string{
  56669. "project": c.project,
  56670. })
  56671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56672. }
  56673. // Do executes the "compute.instanceTemplates.insert" call.
  56674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56675. // status code is an error. Response headers are in either
  56676. // *Operation.ServerResponse.Header or (if a response was returned at
  56677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56678. // to check whether the returned error was because
  56679. // http.StatusNotModified was returned.
  56680. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56681. gensupport.SetOptions(c.urlParams_, opts...)
  56682. res, err := c.doRequest("json")
  56683. if res != nil && res.StatusCode == http.StatusNotModified {
  56684. if res.Body != nil {
  56685. res.Body.Close()
  56686. }
  56687. return nil, &googleapi.Error{
  56688. Code: res.StatusCode,
  56689. Header: res.Header,
  56690. }
  56691. }
  56692. if err != nil {
  56693. return nil, err
  56694. }
  56695. defer googleapi.CloseBody(res)
  56696. if err := googleapi.CheckResponse(res); err != nil {
  56697. return nil, err
  56698. }
  56699. ret := &Operation{
  56700. ServerResponse: googleapi.ServerResponse{
  56701. Header: res.Header,
  56702. HTTPStatusCode: res.StatusCode,
  56703. },
  56704. }
  56705. target := &ret
  56706. if err := gensupport.DecodeResponse(target, res); err != nil {
  56707. return nil, err
  56708. }
  56709. return ret, nil
  56710. // {
  56711. // "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.",
  56712. // "httpMethod": "POST",
  56713. // "id": "compute.instanceTemplates.insert",
  56714. // "parameterOrder": [
  56715. // "project"
  56716. // ],
  56717. // "parameters": {
  56718. // "project": {
  56719. // "description": "Project ID for this request.",
  56720. // "location": "path",
  56721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56722. // "required": true,
  56723. // "type": "string"
  56724. // },
  56725. // "requestId": {
  56726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56727. // "location": "query",
  56728. // "type": "string"
  56729. // }
  56730. // },
  56731. // "path": "{project}/global/instanceTemplates",
  56732. // "request": {
  56733. // "$ref": "InstanceTemplate"
  56734. // },
  56735. // "response": {
  56736. // "$ref": "Operation"
  56737. // },
  56738. // "scopes": [
  56739. // "https://www.googleapis.com/auth/cloud-platform",
  56740. // "https://www.googleapis.com/auth/compute"
  56741. // ]
  56742. // }
  56743. }
  56744. // method id "compute.instanceTemplates.list":
  56745. type InstanceTemplatesListCall struct {
  56746. s *Service
  56747. project string
  56748. urlParams_ gensupport.URLParams
  56749. ifNoneMatch_ string
  56750. ctx_ context.Context
  56751. header_ http.Header
  56752. }
  56753. // List: Retrieves a list of instance templates that are contained
  56754. // within the specified project and zone.
  56755. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  56756. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  56757. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56758. c.project = project
  56759. return c
  56760. }
  56761. // Filter sets the optional parameter "filter": A filter expression that
  56762. // filters resources listed in the response. The expression must specify
  56763. // the field name, a comparison operator, and the value that you want to
  56764. // use for filtering. The value must be a string, a number, or a
  56765. // boolean. The comparison operator must be either =, !=, >, or <.
  56766. //
  56767. // For example, if you are filtering Compute Engine instances, you can
  56768. // exclude instances named example-instance by specifying name !=
  56769. // example-instance.
  56770. //
  56771. // You can also filter nested fields. For example, you could specify
  56772. // scheduling.automaticRestart = false to include instances only if they
  56773. // are not scheduled for automatic restarts. You can use filtering on
  56774. // nested fields to filter based on resource labels.
  56775. //
  56776. // To filter on multiple expressions, provide each separate expression
  56777. // within parentheses. For example, (scheduling.automaticRestart = true)
  56778. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56779. // AND expression. However, you can include AND and OR expressions
  56780. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56781. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56782. // true).
  56783. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  56784. c.urlParams_.Set("filter", filter)
  56785. return c
  56786. }
  56787. // MaxResults sets the optional parameter "maxResults": The maximum
  56788. // number of results per page that should be returned. If the number of
  56789. // available results is larger than maxResults, Compute Engine returns a
  56790. // nextPageToken that can be used to get the next page of results in
  56791. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56792. // (Default: 500)
  56793. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  56794. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56795. return c
  56796. }
  56797. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56798. // a certain order. By default, results are returned in alphanumerical
  56799. // order based on the resource name.
  56800. //
  56801. // You can also sort results in descending order based on the creation
  56802. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56803. // based on the creationTimestamp field in reverse chronological order
  56804. // (newest result first). Use this to sort resources like operations so
  56805. // that the newest operation is returned first.
  56806. //
  56807. // Currently, only sorting by name or creationTimestamp desc is
  56808. // supported.
  56809. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  56810. c.urlParams_.Set("orderBy", orderBy)
  56811. return c
  56812. }
  56813. // PageToken sets the optional parameter "pageToken": Specifies a page
  56814. // token to use. Set pageToken to the nextPageToken returned by a
  56815. // previous list request to get the next page of results.
  56816. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  56817. c.urlParams_.Set("pageToken", pageToken)
  56818. return c
  56819. }
  56820. // Fields allows partial responses to be retrieved. See
  56821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56822. // for more information.
  56823. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  56824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56825. return c
  56826. }
  56827. // IfNoneMatch sets the optional parameter which makes the operation
  56828. // fail if the object's ETag matches the given value. This is useful for
  56829. // getting updates only after the object has changed since the last
  56830. // request. Use googleapi.IsNotModified to check whether the response
  56831. // error from Do is the result of In-None-Match.
  56832. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  56833. c.ifNoneMatch_ = entityTag
  56834. return c
  56835. }
  56836. // Context sets the context to be used in this call's Do method. Any
  56837. // pending HTTP request will be aborted if the provided context is
  56838. // canceled.
  56839. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  56840. c.ctx_ = ctx
  56841. return c
  56842. }
  56843. // Header returns an http.Header that can be modified by the caller to
  56844. // add HTTP headers to the request.
  56845. func (c *InstanceTemplatesListCall) Header() http.Header {
  56846. if c.header_ == nil {
  56847. c.header_ = make(http.Header)
  56848. }
  56849. return c.header_
  56850. }
  56851. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  56852. reqHeaders := make(http.Header)
  56853. for k, v := range c.header_ {
  56854. reqHeaders[k] = v
  56855. }
  56856. reqHeaders.Set("User-Agent", c.s.userAgent())
  56857. if c.ifNoneMatch_ != "" {
  56858. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56859. }
  56860. var body io.Reader = nil
  56861. c.urlParams_.Set("alt", alt)
  56862. c.urlParams_.Set("prettyPrint", "false")
  56863. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  56864. urls += "?" + c.urlParams_.Encode()
  56865. req, err := http.NewRequest("GET", urls, body)
  56866. if err != nil {
  56867. return nil, err
  56868. }
  56869. req.Header = reqHeaders
  56870. googleapi.Expand(req.URL, map[string]string{
  56871. "project": c.project,
  56872. })
  56873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56874. }
  56875. // Do executes the "compute.instanceTemplates.list" call.
  56876. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  56877. // non-2xx status code is an error. Response headers are in either
  56878. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  56879. // returned at all) in error.(*googleapi.Error).Header. Use
  56880. // googleapi.IsNotModified to check whether the returned error was
  56881. // because http.StatusNotModified was returned.
  56882. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  56883. gensupport.SetOptions(c.urlParams_, opts...)
  56884. res, err := c.doRequest("json")
  56885. if res != nil && res.StatusCode == http.StatusNotModified {
  56886. if res.Body != nil {
  56887. res.Body.Close()
  56888. }
  56889. return nil, &googleapi.Error{
  56890. Code: res.StatusCode,
  56891. Header: res.Header,
  56892. }
  56893. }
  56894. if err != nil {
  56895. return nil, err
  56896. }
  56897. defer googleapi.CloseBody(res)
  56898. if err := googleapi.CheckResponse(res); err != nil {
  56899. return nil, err
  56900. }
  56901. ret := &InstanceTemplateList{
  56902. ServerResponse: googleapi.ServerResponse{
  56903. Header: res.Header,
  56904. HTTPStatusCode: res.StatusCode,
  56905. },
  56906. }
  56907. target := &ret
  56908. if err := gensupport.DecodeResponse(target, res); err != nil {
  56909. return nil, err
  56910. }
  56911. return ret, nil
  56912. // {
  56913. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  56914. // "httpMethod": "GET",
  56915. // "id": "compute.instanceTemplates.list",
  56916. // "parameterOrder": [
  56917. // "project"
  56918. // ],
  56919. // "parameters": {
  56920. // "filter": {
  56921. // "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).",
  56922. // "location": "query",
  56923. // "type": "string"
  56924. // },
  56925. // "maxResults": {
  56926. // "default": "500",
  56927. // "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)",
  56928. // "format": "uint32",
  56929. // "location": "query",
  56930. // "minimum": "0",
  56931. // "type": "integer"
  56932. // },
  56933. // "orderBy": {
  56934. // "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.",
  56935. // "location": "query",
  56936. // "type": "string"
  56937. // },
  56938. // "pageToken": {
  56939. // "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.",
  56940. // "location": "query",
  56941. // "type": "string"
  56942. // },
  56943. // "project": {
  56944. // "description": "Project ID for this request.",
  56945. // "location": "path",
  56946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56947. // "required": true,
  56948. // "type": "string"
  56949. // }
  56950. // },
  56951. // "path": "{project}/global/instanceTemplates",
  56952. // "response": {
  56953. // "$ref": "InstanceTemplateList"
  56954. // },
  56955. // "scopes": [
  56956. // "https://www.googleapis.com/auth/cloud-platform",
  56957. // "https://www.googleapis.com/auth/compute",
  56958. // "https://www.googleapis.com/auth/compute.readonly"
  56959. // ]
  56960. // }
  56961. }
  56962. // Pages invokes f for each page of results.
  56963. // A non-nil error returned from f will halt the iteration.
  56964. // The provided context supersedes any context provided to the Context method.
  56965. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  56966. c.ctx_ = ctx
  56967. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56968. for {
  56969. x, err := c.Do()
  56970. if err != nil {
  56971. return err
  56972. }
  56973. if err := f(x); err != nil {
  56974. return err
  56975. }
  56976. if x.NextPageToken == "" {
  56977. return nil
  56978. }
  56979. c.PageToken(x.NextPageToken)
  56980. }
  56981. }
  56982. // method id "compute.instanceTemplates.setIamPolicy":
  56983. type InstanceTemplatesSetIamPolicyCall struct {
  56984. s *Service
  56985. project string
  56986. resource string
  56987. globalsetpolicyrequest *GlobalSetPolicyRequest
  56988. urlParams_ gensupport.URLParams
  56989. ctx_ context.Context
  56990. header_ http.Header
  56991. }
  56992. // SetIamPolicy: Sets the access control policy on the specified
  56993. // resource. Replaces any existing policy.
  56994. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  56995. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56996. c.project = project
  56997. c.resource = resource
  56998. c.globalsetpolicyrequest = globalsetpolicyrequest
  56999. return c
  57000. }
  57001. // Fields allows partial responses to be retrieved. See
  57002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57003. // for more information.
  57004. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  57005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57006. return c
  57007. }
  57008. // Context sets the context to be used in this call's Do method. Any
  57009. // pending HTTP request will be aborted if the provided context is
  57010. // canceled.
  57011. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  57012. c.ctx_ = ctx
  57013. return c
  57014. }
  57015. // Header returns an http.Header that can be modified by the caller to
  57016. // add HTTP headers to the request.
  57017. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  57018. if c.header_ == nil {
  57019. c.header_ = make(http.Header)
  57020. }
  57021. return c.header_
  57022. }
  57023. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  57024. reqHeaders := make(http.Header)
  57025. for k, v := range c.header_ {
  57026. reqHeaders[k] = v
  57027. }
  57028. reqHeaders.Set("User-Agent", c.s.userAgent())
  57029. var body io.Reader = nil
  57030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  57031. if err != nil {
  57032. return nil, err
  57033. }
  57034. reqHeaders.Set("Content-Type", "application/json")
  57035. c.urlParams_.Set("alt", alt)
  57036. c.urlParams_.Set("prettyPrint", "false")
  57037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  57038. urls += "?" + c.urlParams_.Encode()
  57039. req, err := http.NewRequest("POST", urls, body)
  57040. if err != nil {
  57041. return nil, err
  57042. }
  57043. req.Header = reqHeaders
  57044. googleapi.Expand(req.URL, map[string]string{
  57045. "project": c.project,
  57046. "resource": c.resource,
  57047. })
  57048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57049. }
  57050. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  57051. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  57052. // code is an error. Response headers are in either
  57053. // *Policy.ServerResponse.Header or (if a response was returned at all)
  57054. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57055. // check whether the returned error was because http.StatusNotModified
  57056. // was returned.
  57057. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  57058. gensupport.SetOptions(c.urlParams_, opts...)
  57059. res, err := c.doRequest("json")
  57060. if res != nil && res.StatusCode == http.StatusNotModified {
  57061. if res.Body != nil {
  57062. res.Body.Close()
  57063. }
  57064. return nil, &googleapi.Error{
  57065. Code: res.StatusCode,
  57066. Header: res.Header,
  57067. }
  57068. }
  57069. if err != nil {
  57070. return nil, err
  57071. }
  57072. defer googleapi.CloseBody(res)
  57073. if err := googleapi.CheckResponse(res); err != nil {
  57074. return nil, err
  57075. }
  57076. ret := &Policy{
  57077. ServerResponse: googleapi.ServerResponse{
  57078. Header: res.Header,
  57079. HTTPStatusCode: res.StatusCode,
  57080. },
  57081. }
  57082. target := &ret
  57083. if err := gensupport.DecodeResponse(target, res); err != nil {
  57084. return nil, err
  57085. }
  57086. return ret, nil
  57087. // {
  57088. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  57089. // "httpMethod": "POST",
  57090. // "id": "compute.instanceTemplates.setIamPolicy",
  57091. // "parameterOrder": [
  57092. // "project",
  57093. // "resource"
  57094. // ],
  57095. // "parameters": {
  57096. // "project": {
  57097. // "description": "Project ID for this request.",
  57098. // "location": "path",
  57099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57100. // "required": true,
  57101. // "type": "string"
  57102. // },
  57103. // "resource": {
  57104. // "description": "Name or id of the resource for this request.",
  57105. // "location": "path",
  57106. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57107. // "required": true,
  57108. // "type": "string"
  57109. // }
  57110. // },
  57111. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  57112. // "request": {
  57113. // "$ref": "GlobalSetPolicyRequest"
  57114. // },
  57115. // "response": {
  57116. // "$ref": "Policy"
  57117. // },
  57118. // "scopes": [
  57119. // "https://www.googleapis.com/auth/cloud-platform",
  57120. // "https://www.googleapis.com/auth/compute"
  57121. // ]
  57122. // }
  57123. }
  57124. // method id "compute.instanceTemplates.testIamPermissions":
  57125. type InstanceTemplatesTestIamPermissionsCall struct {
  57126. s *Service
  57127. project string
  57128. resource string
  57129. testpermissionsrequest *TestPermissionsRequest
  57130. urlParams_ gensupport.URLParams
  57131. ctx_ context.Context
  57132. header_ http.Header
  57133. }
  57134. // TestIamPermissions: Returns permissions that a caller has on the
  57135. // specified resource.
  57136. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  57137. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57138. c.project = project
  57139. c.resource = resource
  57140. c.testpermissionsrequest = testpermissionsrequest
  57141. return c
  57142. }
  57143. // Fields allows partial responses to be retrieved. See
  57144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57145. // for more information.
  57146. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  57147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57148. return c
  57149. }
  57150. // Context sets the context to be used in this call's Do method. Any
  57151. // pending HTTP request will be aborted if the provided context is
  57152. // canceled.
  57153. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  57154. c.ctx_ = ctx
  57155. return c
  57156. }
  57157. // Header returns an http.Header that can be modified by the caller to
  57158. // add HTTP headers to the request.
  57159. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  57160. if c.header_ == nil {
  57161. c.header_ = make(http.Header)
  57162. }
  57163. return c.header_
  57164. }
  57165. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57166. reqHeaders := make(http.Header)
  57167. for k, v := range c.header_ {
  57168. reqHeaders[k] = v
  57169. }
  57170. reqHeaders.Set("User-Agent", c.s.userAgent())
  57171. var body io.Reader = nil
  57172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57173. if err != nil {
  57174. return nil, err
  57175. }
  57176. reqHeaders.Set("Content-Type", "application/json")
  57177. c.urlParams_.Set("alt", alt)
  57178. c.urlParams_.Set("prettyPrint", "false")
  57179. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  57180. urls += "?" + c.urlParams_.Encode()
  57181. req, err := http.NewRequest("POST", urls, body)
  57182. if err != nil {
  57183. return nil, err
  57184. }
  57185. req.Header = reqHeaders
  57186. googleapi.Expand(req.URL, map[string]string{
  57187. "project": c.project,
  57188. "resource": c.resource,
  57189. })
  57190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57191. }
  57192. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  57193. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57194. // non-2xx status code is an error. Response headers are in either
  57195. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  57196. // returned at all) in error.(*googleapi.Error).Header. Use
  57197. // googleapi.IsNotModified to check whether the returned error was
  57198. // because http.StatusNotModified was returned.
  57199. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  57200. gensupport.SetOptions(c.urlParams_, opts...)
  57201. res, err := c.doRequest("json")
  57202. if res != nil && res.StatusCode == http.StatusNotModified {
  57203. if res.Body != nil {
  57204. res.Body.Close()
  57205. }
  57206. return nil, &googleapi.Error{
  57207. Code: res.StatusCode,
  57208. Header: res.Header,
  57209. }
  57210. }
  57211. if err != nil {
  57212. return nil, err
  57213. }
  57214. defer googleapi.CloseBody(res)
  57215. if err := googleapi.CheckResponse(res); err != nil {
  57216. return nil, err
  57217. }
  57218. ret := &TestPermissionsResponse{
  57219. ServerResponse: googleapi.ServerResponse{
  57220. Header: res.Header,
  57221. HTTPStatusCode: res.StatusCode,
  57222. },
  57223. }
  57224. target := &ret
  57225. if err := gensupport.DecodeResponse(target, res); err != nil {
  57226. return nil, err
  57227. }
  57228. return ret, nil
  57229. // {
  57230. // "description": "Returns permissions that a caller has on the specified resource.",
  57231. // "httpMethod": "POST",
  57232. // "id": "compute.instanceTemplates.testIamPermissions",
  57233. // "parameterOrder": [
  57234. // "project",
  57235. // "resource"
  57236. // ],
  57237. // "parameters": {
  57238. // "project": {
  57239. // "description": "Project ID for this request.",
  57240. // "location": "path",
  57241. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57242. // "required": true,
  57243. // "type": "string"
  57244. // },
  57245. // "resource": {
  57246. // "description": "Name or id of the resource for this request.",
  57247. // "location": "path",
  57248. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57249. // "required": true,
  57250. // "type": "string"
  57251. // }
  57252. // },
  57253. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  57254. // "request": {
  57255. // "$ref": "TestPermissionsRequest"
  57256. // },
  57257. // "response": {
  57258. // "$ref": "TestPermissionsResponse"
  57259. // },
  57260. // "scopes": [
  57261. // "https://www.googleapis.com/auth/cloud-platform",
  57262. // "https://www.googleapis.com/auth/compute",
  57263. // "https://www.googleapis.com/auth/compute.readonly"
  57264. // ]
  57265. // }
  57266. }
  57267. // method id "compute.instances.addAccessConfig":
  57268. type InstancesAddAccessConfigCall struct {
  57269. s *Service
  57270. project string
  57271. zone string
  57272. instance string
  57273. accessconfig *AccessConfig
  57274. urlParams_ gensupport.URLParams
  57275. ctx_ context.Context
  57276. header_ http.Header
  57277. }
  57278. // AddAccessConfig: Adds an access config to an instance's network
  57279. // interface.
  57280. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  57281. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  57282. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57283. c.project = project
  57284. c.zone = zone
  57285. c.instance = instance
  57286. c.urlParams_.Set("networkInterface", networkInterface)
  57287. c.accessconfig = accessconfig
  57288. return c
  57289. }
  57290. // RequestId sets the optional parameter "requestId": An optional
  57291. // request ID to identify requests. Specify a unique request ID so that
  57292. // if you must retry your request, the server will know to ignore the
  57293. // request if it has already been completed.
  57294. //
  57295. // For example, consider a situation where you make an initial request
  57296. // and the request times out. If you make the request again with the
  57297. // same request ID, the server can check if original operation with the
  57298. // same request ID was received, and if so, will ignore the second
  57299. // request. This prevents clients from accidentally creating duplicate
  57300. // commitments.
  57301. //
  57302. // The request ID must be a valid UUID with the exception that zero UUID
  57303. // is not supported (00000000-0000-0000-0000-000000000000).
  57304. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  57305. c.urlParams_.Set("requestId", requestId)
  57306. return c
  57307. }
  57308. // Fields allows partial responses to be retrieved. See
  57309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57310. // for more information.
  57311. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  57312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57313. return c
  57314. }
  57315. // Context sets the context to be used in this call's Do method. Any
  57316. // pending HTTP request will be aborted if the provided context is
  57317. // canceled.
  57318. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  57319. c.ctx_ = ctx
  57320. return c
  57321. }
  57322. // Header returns an http.Header that can be modified by the caller to
  57323. // add HTTP headers to the request.
  57324. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  57325. if c.header_ == nil {
  57326. c.header_ = make(http.Header)
  57327. }
  57328. return c.header_
  57329. }
  57330. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  57331. reqHeaders := make(http.Header)
  57332. for k, v := range c.header_ {
  57333. reqHeaders[k] = v
  57334. }
  57335. reqHeaders.Set("User-Agent", c.s.userAgent())
  57336. var body io.Reader = nil
  57337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  57338. if err != nil {
  57339. return nil, err
  57340. }
  57341. reqHeaders.Set("Content-Type", "application/json")
  57342. c.urlParams_.Set("alt", alt)
  57343. c.urlParams_.Set("prettyPrint", "false")
  57344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  57345. urls += "?" + c.urlParams_.Encode()
  57346. req, err := http.NewRequest("POST", urls, body)
  57347. if err != nil {
  57348. return nil, err
  57349. }
  57350. req.Header = reqHeaders
  57351. googleapi.Expand(req.URL, map[string]string{
  57352. "project": c.project,
  57353. "zone": c.zone,
  57354. "instance": c.instance,
  57355. })
  57356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57357. }
  57358. // Do executes the "compute.instances.addAccessConfig" call.
  57359. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57360. // status code is an error. Response headers are in either
  57361. // *Operation.ServerResponse.Header or (if a response was returned at
  57362. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57363. // to check whether the returned error was because
  57364. // http.StatusNotModified was returned.
  57365. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57366. gensupport.SetOptions(c.urlParams_, opts...)
  57367. res, err := c.doRequest("json")
  57368. if res != nil && res.StatusCode == http.StatusNotModified {
  57369. if res.Body != nil {
  57370. res.Body.Close()
  57371. }
  57372. return nil, &googleapi.Error{
  57373. Code: res.StatusCode,
  57374. Header: res.Header,
  57375. }
  57376. }
  57377. if err != nil {
  57378. return nil, err
  57379. }
  57380. defer googleapi.CloseBody(res)
  57381. if err := googleapi.CheckResponse(res); err != nil {
  57382. return nil, err
  57383. }
  57384. ret := &Operation{
  57385. ServerResponse: googleapi.ServerResponse{
  57386. Header: res.Header,
  57387. HTTPStatusCode: res.StatusCode,
  57388. },
  57389. }
  57390. target := &ret
  57391. if err := gensupport.DecodeResponse(target, res); err != nil {
  57392. return nil, err
  57393. }
  57394. return ret, nil
  57395. // {
  57396. // "description": "Adds an access config to an instance's network interface.",
  57397. // "httpMethod": "POST",
  57398. // "id": "compute.instances.addAccessConfig",
  57399. // "parameterOrder": [
  57400. // "project",
  57401. // "zone",
  57402. // "instance",
  57403. // "networkInterface"
  57404. // ],
  57405. // "parameters": {
  57406. // "instance": {
  57407. // "description": "The instance name for this request.",
  57408. // "location": "path",
  57409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57410. // "required": true,
  57411. // "type": "string"
  57412. // },
  57413. // "networkInterface": {
  57414. // "description": "The name of the network interface to add to this instance.",
  57415. // "location": "query",
  57416. // "required": true,
  57417. // "type": "string"
  57418. // },
  57419. // "project": {
  57420. // "description": "Project ID for this request.",
  57421. // "location": "path",
  57422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57423. // "required": true,
  57424. // "type": "string"
  57425. // },
  57426. // "requestId": {
  57427. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57428. // "location": "query",
  57429. // "type": "string"
  57430. // },
  57431. // "zone": {
  57432. // "description": "The name of the zone for this request.",
  57433. // "location": "path",
  57434. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57435. // "required": true,
  57436. // "type": "string"
  57437. // }
  57438. // },
  57439. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  57440. // "request": {
  57441. // "$ref": "AccessConfig"
  57442. // },
  57443. // "response": {
  57444. // "$ref": "Operation"
  57445. // },
  57446. // "scopes": [
  57447. // "https://www.googleapis.com/auth/cloud-platform",
  57448. // "https://www.googleapis.com/auth/compute"
  57449. // ]
  57450. // }
  57451. }
  57452. // method id "compute.instances.aggregatedList":
  57453. type InstancesAggregatedListCall struct {
  57454. s *Service
  57455. project string
  57456. urlParams_ gensupport.URLParams
  57457. ifNoneMatch_ string
  57458. ctx_ context.Context
  57459. header_ http.Header
  57460. }
  57461. // AggregatedList: Retrieves aggregated list of all of the instances in
  57462. // your project across all regions and zones.
  57463. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  57464. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  57465. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57466. c.project = project
  57467. return c
  57468. }
  57469. // Filter sets the optional parameter "filter": A filter expression that
  57470. // filters resources listed in the response. The expression must specify
  57471. // the field name, a comparison operator, and the value that you want to
  57472. // use for filtering. The value must be a string, a number, or a
  57473. // boolean. The comparison operator must be either =, !=, >, or <.
  57474. //
  57475. // For example, if you are filtering Compute Engine instances, you can
  57476. // exclude instances named example-instance by specifying name !=
  57477. // example-instance.
  57478. //
  57479. // You can also filter nested fields. For example, you could specify
  57480. // scheduling.automaticRestart = false to include instances only if they
  57481. // are not scheduled for automatic restarts. You can use filtering on
  57482. // nested fields to filter based on resource labels.
  57483. //
  57484. // To filter on multiple expressions, provide each separate expression
  57485. // within parentheses. For example, (scheduling.automaticRestart = true)
  57486. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57487. // AND expression. However, you can include AND and OR expressions
  57488. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57489. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57490. // true).
  57491. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  57492. c.urlParams_.Set("filter", filter)
  57493. return c
  57494. }
  57495. // MaxResults sets the optional parameter "maxResults": The maximum
  57496. // number of results per page that should be returned. If the number of
  57497. // available results is larger than maxResults, Compute Engine returns a
  57498. // nextPageToken that can be used to get the next page of results in
  57499. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57500. // (Default: 500)
  57501. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  57502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57503. return c
  57504. }
  57505. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57506. // a certain order. By default, results are returned in alphanumerical
  57507. // order based on the resource name.
  57508. //
  57509. // You can also sort results in descending order based on the creation
  57510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57511. // based on the creationTimestamp field in reverse chronological order
  57512. // (newest result first). Use this to sort resources like operations so
  57513. // that the newest operation is returned first.
  57514. //
  57515. // Currently, only sorting by name or creationTimestamp desc is
  57516. // supported.
  57517. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  57518. c.urlParams_.Set("orderBy", orderBy)
  57519. return c
  57520. }
  57521. // PageToken sets the optional parameter "pageToken": Specifies a page
  57522. // token to use. Set pageToken to the nextPageToken returned by a
  57523. // previous list request to get the next page of results.
  57524. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  57525. c.urlParams_.Set("pageToken", pageToken)
  57526. return c
  57527. }
  57528. // Fields allows partial responses to be retrieved. See
  57529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57530. // for more information.
  57531. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  57532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57533. return c
  57534. }
  57535. // IfNoneMatch sets the optional parameter which makes the operation
  57536. // fail if the object's ETag matches the given value. This is useful for
  57537. // getting updates only after the object has changed since the last
  57538. // request. Use googleapi.IsNotModified to check whether the response
  57539. // error from Do is the result of In-None-Match.
  57540. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  57541. c.ifNoneMatch_ = entityTag
  57542. return c
  57543. }
  57544. // Context sets the context to be used in this call's Do method. Any
  57545. // pending HTTP request will be aborted if the provided context is
  57546. // canceled.
  57547. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  57548. c.ctx_ = ctx
  57549. return c
  57550. }
  57551. // Header returns an http.Header that can be modified by the caller to
  57552. // add HTTP headers to the request.
  57553. func (c *InstancesAggregatedListCall) Header() http.Header {
  57554. if c.header_ == nil {
  57555. c.header_ = make(http.Header)
  57556. }
  57557. return c.header_
  57558. }
  57559. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  57560. reqHeaders := make(http.Header)
  57561. for k, v := range c.header_ {
  57562. reqHeaders[k] = v
  57563. }
  57564. reqHeaders.Set("User-Agent", c.s.userAgent())
  57565. if c.ifNoneMatch_ != "" {
  57566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57567. }
  57568. var body io.Reader = nil
  57569. c.urlParams_.Set("alt", alt)
  57570. c.urlParams_.Set("prettyPrint", "false")
  57571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  57572. urls += "?" + c.urlParams_.Encode()
  57573. req, err := http.NewRequest("GET", urls, body)
  57574. if err != nil {
  57575. return nil, err
  57576. }
  57577. req.Header = reqHeaders
  57578. googleapi.Expand(req.URL, map[string]string{
  57579. "project": c.project,
  57580. })
  57581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57582. }
  57583. // Do executes the "compute.instances.aggregatedList" call.
  57584. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  57585. // non-2xx status code is an error. Response headers are in either
  57586. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  57587. // returned at all) in error.(*googleapi.Error).Header. Use
  57588. // googleapi.IsNotModified to check whether the returned error was
  57589. // because http.StatusNotModified was returned.
  57590. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  57591. gensupport.SetOptions(c.urlParams_, opts...)
  57592. res, err := c.doRequest("json")
  57593. if res != nil && res.StatusCode == http.StatusNotModified {
  57594. if res.Body != nil {
  57595. res.Body.Close()
  57596. }
  57597. return nil, &googleapi.Error{
  57598. Code: res.StatusCode,
  57599. Header: res.Header,
  57600. }
  57601. }
  57602. if err != nil {
  57603. return nil, err
  57604. }
  57605. defer googleapi.CloseBody(res)
  57606. if err := googleapi.CheckResponse(res); err != nil {
  57607. return nil, err
  57608. }
  57609. ret := &InstanceAggregatedList{
  57610. ServerResponse: googleapi.ServerResponse{
  57611. Header: res.Header,
  57612. HTTPStatusCode: res.StatusCode,
  57613. },
  57614. }
  57615. target := &ret
  57616. if err := gensupport.DecodeResponse(target, res); err != nil {
  57617. return nil, err
  57618. }
  57619. return ret, nil
  57620. // {
  57621. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  57622. // "httpMethod": "GET",
  57623. // "id": "compute.instances.aggregatedList",
  57624. // "parameterOrder": [
  57625. // "project"
  57626. // ],
  57627. // "parameters": {
  57628. // "filter": {
  57629. // "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).",
  57630. // "location": "query",
  57631. // "type": "string"
  57632. // },
  57633. // "maxResults": {
  57634. // "default": "500",
  57635. // "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)",
  57636. // "format": "uint32",
  57637. // "location": "query",
  57638. // "minimum": "0",
  57639. // "type": "integer"
  57640. // },
  57641. // "orderBy": {
  57642. // "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.",
  57643. // "location": "query",
  57644. // "type": "string"
  57645. // },
  57646. // "pageToken": {
  57647. // "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.",
  57648. // "location": "query",
  57649. // "type": "string"
  57650. // },
  57651. // "project": {
  57652. // "description": "Project ID for this request.",
  57653. // "location": "path",
  57654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57655. // "required": true,
  57656. // "type": "string"
  57657. // }
  57658. // },
  57659. // "path": "{project}/aggregated/instances",
  57660. // "response": {
  57661. // "$ref": "InstanceAggregatedList"
  57662. // },
  57663. // "scopes": [
  57664. // "https://www.googleapis.com/auth/cloud-platform",
  57665. // "https://www.googleapis.com/auth/compute",
  57666. // "https://www.googleapis.com/auth/compute.readonly"
  57667. // ]
  57668. // }
  57669. }
  57670. // Pages invokes f for each page of results.
  57671. // A non-nil error returned from f will halt the iteration.
  57672. // The provided context supersedes any context provided to the Context method.
  57673. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  57674. c.ctx_ = ctx
  57675. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57676. for {
  57677. x, err := c.Do()
  57678. if err != nil {
  57679. return err
  57680. }
  57681. if err := f(x); err != nil {
  57682. return err
  57683. }
  57684. if x.NextPageToken == "" {
  57685. return nil
  57686. }
  57687. c.PageToken(x.NextPageToken)
  57688. }
  57689. }
  57690. // method id "compute.instances.attachDisk":
  57691. type InstancesAttachDiskCall struct {
  57692. s *Service
  57693. project string
  57694. zone string
  57695. instance string
  57696. attacheddisk *AttachedDisk
  57697. urlParams_ gensupport.URLParams
  57698. ctx_ context.Context
  57699. header_ http.Header
  57700. }
  57701. // AttachDisk: Attaches an existing Disk resource to an instance. You
  57702. // must first create the disk before you can attach it. It is not
  57703. // possible to create and attach a disk at the same time. For more
  57704. // information, read Adding a persistent disk to your instance.
  57705. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  57706. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  57707. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57708. c.project = project
  57709. c.zone = zone
  57710. c.instance = instance
  57711. c.attacheddisk = attacheddisk
  57712. return c
  57713. }
  57714. // ForceAttach sets the optional parameter "forceAttach": Whether to
  57715. // force attach the disk even if it's currently attached to another
  57716. // instance. This is only available for regional disks.
  57717. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  57718. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  57719. return c
  57720. }
  57721. // RequestId sets the optional parameter "requestId": An optional
  57722. // request ID to identify requests. Specify a unique request ID so that
  57723. // if you must retry your request, the server will know to ignore the
  57724. // request if it has already been completed.
  57725. //
  57726. // For example, consider a situation where you make an initial request
  57727. // and the request times out. If you make the request again with the
  57728. // same request ID, the server can check if original operation with the
  57729. // same request ID was received, and if so, will ignore the second
  57730. // request. This prevents clients from accidentally creating duplicate
  57731. // commitments.
  57732. //
  57733. // The request ID must be a valid UUID with the exception that zero UUID
  57734. // is not supported (00000000-0000-0000-0000-000000000000).
  57735. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  57736. c.urlParams_.Set("requestId", requestId)
  57737. return c
  57738. }
  57739. // Fields allows partial responses to be retrieved. See
  57740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57741. // for more information.
  57742. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  57743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57744. return c
  57745. }
  57746. // Context sets the context to be used in this call's Do method. Any
  57747. // pending HTTP request will be aborted if the provided context is
  57748. // canceled.
  57749. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  57750. c.ctx_ = ctx
  57751. return c
  57752. }
  57753. // Header returns an http.Header that can be modified by the caller to
  57754. // add HTTP headers to the request.
  57755. func (c *InstancesAttachDiskCall) Header() http.Header {
  57756. if c.header_ == nil {
  57757. c.header_ = make(http.Header)
  57758. }
  57759. return c.header_
  57760. }
  57761. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  57762. reqHeaders := make(http.Header)
  57763. for k, v := range c.header_ {
  57764. reqHeaders[k] = v
  57765. }
  57766. reqHeaders.Set("User-Agent", c.s.userAgent())
  57767. var body io.Reader = nil
  57768. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  57769. if err != nil {
  57770. return nil, err
  57771. }
  57772. reqHeaders.Set("Content-Type", "application/json")
  57773. c.urlParams_.Set("alt", alt)
  57774. c.urlParams_.Set("prettyPrint", "false")
  57775. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  57776. urls += "?" + c.urlParams_.Encode()
  57777. req, err := http.NewRequest("POST", urls, body)
  57778. if err != nil {
  57779. return nil, err
  57780. }
  57781. req.Header = reqHeaders
  57782. googleapi.Expand(req.URL, map[string]string{
  57783. "project": c.project,
  57784. "zone": c.zone,
  57785. "instance": c.instance,
  57786. })
  57787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57788. }
  57789. // Do executes the "compute.instances.attachDisk" call.
  57790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57791. // status code is an error. Response headers are in either
  57792. // *Operation.ServerResponse.Header or (if a response was returned at
  57793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57794. // to check whether the returned error was because
  57795. // http.StatusNotModified was returned.
  57796. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57797. gensupport.SetOptions(c.urlParams_, opts...)
  57798. res, err := c.doRequest("json")
  57799. if res != nil && res.StatusCode == http.StatusNotModified {
  57800. if res.Body != nil {
  57801. res.Body.Close()
  57802. }
  57803. return nil, &googleapi.Error{
  57804. Code: res.StatusCode,
  57805. Header: res.Header,
  57806. }
  57807. }
  57808. if err != nil {
  57809. return nil, err
  57810. }
  57811. defer googleapi.CloseBody(res)
  57812. if err := googleapi.CheckResponse(res); err != nil {
  57813. return nil, err
  57814. }
  57815. ret := &Operation{
  57816. ServerResponse: googleapi.ServerResponse{
  57817. Header: res.Header,
  57818. HTTPStatusCode: res.StatusCode,
  57819. },
  57820. }
  57821. target := &ret
  57822. if err := gensupport.DecodeResponse(target, res); err != nil {
  57823. return nil, err
  57824. }
  57825. return ret, nil
  57826. // {
  57827. // "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.",
  57828. // "httpMethod": "POST",
  57829. // "id": "compute.instances.attachDisk",
  57830. // "parameterOrder": [
  57831. // "project",
  57832. // "zone",
  57833. // "instance"
  57834. // ],
  57835. // "parameters": {
  57836. // "forceAttach": {
  57837. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  57838. // "location": "query",
  57839. // "type": "boolean"
  57840. // },
  57841. // "instance": {
  57842. // "description": "The instance name for this request.",
  57843. // "location": "path",
  57844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57845. // "required": true,
  57846. // "type": "string"
  57847. // },
  57848. // "project": {
  57849. // "description": "Project ID for this request.",
  57850. // "location": "path",
  57851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57852. // "required": true,
  57853. // "type": "string"
  57854. // },
  57855. // "requestId": {
  57856. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57857. // "location": "query",
  57858. // "type": "string"
  57859. // },
  57860. // "zone": {
  57861. // "description": "The name of the zone for this request.",
  57862. // "location": "path",
  57863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57864. // "required": true,
  57865. // "type": "string"
  57866. // }
  57867. // },
  57868. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  57869. // "request": {
  57870. // "$ref": "AttachedDisk"
  57871. // },
  57872. // "response": {
  57873. // "$ref": "Operation"
  57874. // },
  57875. // "scopes": [
  57876. // "https://www.googleapis.com/auth/cloud-platform",
  57877. // "https://www.googleapis.com/auth/compute"
  57878. // ]
  57879. // }
  57880. }
  57881. // method id "compute.instances.delete":
  57882. type InstancesDeleteCall struct {
  57883. s *Service
  57884. project string
  57885. zone string
  57886. instance string
  57887. urlParams_ gensupport.URLParams
  57888. ctx_ context.Context
  57889. header_ http.Header
  57890. }
  57891. // Delete: Deletes the specified Instance resource. For more
  57892. // information, see Stopping or Deleting an Instance.
  57893. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  57894. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  57895. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57896. c.project = project
  57897. c.zone = zone
  57898. c.instance = instance
  57899. return c
  57900. }
  57901. // RequestId sets the optional parameter "requestId": An optional
  57902. // request ID to identify requests. Specify a unique request ID so that
  57903. // if you must retry your request, the server will know to ignore the
  57904. // request if it has already been completed.
  57905. //
  57906. // For example, consider a situation where you make an initial request
  57907. // and the request times out. If you make the request again with the
  57908. // same request ID, the server can check if original operation with the
  57909. // same request ID was received, and if so, will ignore the second
  57910. // request. This prevents clients from accidentally creating duplicate
  57911. // commitments.
  57912. //
  57913. // The request ID must be a valid UUID with the exception that zero UUID
  57914. // is not supported (00000000-0000-0000-0000-000000000000).
  57915. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  57916. c.urlParams_.Set("requestId", requestId)
  57917. return c
  57918. }
  57919. // Fields allows partial responses to be retrieved. See
  57920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57921. // for more information.
  57922. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  57923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57924. return c
  57925. }
  57926. // Context sets the context to be used in this call's Do method. Any
  57927. // pending HTTP request will be aborted if the provided context is
  57928. // canceled.
  57929. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  57930. c.ctx_ = ctx
  57931. return c
  57932. }
  57933. // Header returns an http.Header that can be modified by the caller to
  57934. // add HTTP headers to the request.
  57935. func (c *InstancesDeleteCall) Header() http.Header {
  57936. if c.header_ == nil {
  57937. c.header_ = make(http.Header)
  57938. }
  57939. return c.header_
  57940. }
  57941. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  57942. reqHeaders := make(http.Header)
  57943. for k, v := range c.header_ {
  57944. reqHeaders[k] = v
  57945. }
  57946. reqHeaders.Set("User-Agent", c.s.userAgent())
  57947. var body io.Reader = nil
  57948. c.urlParams_.Set("alt", alt)
  57949. c.urlParams_.Set("prettyPrint", "false")
  57950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  57951. urls += "?" + c.urlParams_.Encode()
  57952. req, err := http.NewRequest("DELETE", urls, body)
  57953. if err != nil {
  57954. return nil, err
  57955. }
  57956. req.Header = reqHeaders
  57957. googleapi.Expand(req.URL, map[string]string{
  57958. "project": c.project,
  57959. "zone": c.zone,
  57960. "instance": c.instance,
  57961. })
  57962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57963. }
  57964. // Do executes the "compute.instances.delete" call.
  57965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57966. // status code is an error. Response headers are in either
  57967. // *Operation.ServerResponse.Header or (if a response was returned at
  57968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57969. // to check whether the returned error was because
  57970. // http.StatusNotModified was returned.
  57971. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57972. gensupport.SetOptions(c.urlParams_, opts...)
  57973. res, err := c.doRequest("json")
  57974. if res != nil && res.StatusCode == http.StatusNotModified {
  57975. if res.Body != nil {
  57976. res.Body.Close()
  57977. }
  57978. return nil, &googleapi.Error{
  57979. Code: res.StatusCode,
  57980. Header: res.Header,
  57981. }
  57982. }
  57983. if err != nil {
  57984. return nil, err
  57985. }
  57986. defer googleapi.CloseBody(res)
  57987. if err := googleapi.CheckResponse(res); err != nil {
  57988. return nil, err
  57989. }
  57990. ret := &Operation{
  57991. ServerResponse: googleapi.ServerResponse{
  57992. Header: res.Header,
  57993. HTTPStatusCode: res.StatusCode,
  57994. },
  57995. }
  57996. target := &ret
  57997. if err := gensupport.DecodeResponse(target, res); err != nil {
  57998. return nil, err
  57999. }
  58000. return ret, nil
  58001. // {
  58002. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  58003. // "httpMethod": "DELETE",
  58004. // "id": "compute.instances.delete",
  58005. // "parameterOrder": [
  58006. // "project",
  58007. // "zone",
  58008. // "instance"
  58009. // ],
  58010. // "parameters": {
  58011. // "instance": {
  58012. // "description": "Name of the instance resource to delete.",
  58013. // "location": "path",
  58014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58015. // "required": true,
  58016. // "type": "string"
  58017. // },
  58018. // "project": {
  58019. // "description": "Project ID for this request.",
  58020. // "location": "path",
  58021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58022. // "required": true,
  58023. // "type": "string"
  58024. // },
  58025. // "requestId": {
  58026. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58027. // "location": "query",
  58028. // "type": "string"
  58029. // },
  58030. // "zone": {
  58031. // "description": "The name of the zone for this request.",
  58032. // "location": "path",
  58033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58034. // "required": true,
  58035. // "type": "string"
  58036. // }
  58037. // },
  58038. // "path": "{project}/zones/{zone}/instances/{instance}",
  58039. // "response": {
  58040. // "$ref": "Operation"
  58041. // },
  58042. // "scopes": [
  58043. // "https://www.googleapis.com/auth/cloud-platform",
  58044. // "https://www.googleapis.com/auth/compute"
  58045. // ]
  58046. // }
  58047. }
  58048. // method id "compute.instances.deleteAccessConfig":
  58049. type InstancesDeleteAccessConfigCall struct {
  58050. s *Service
  58051. project string
  58052. zone string
  58053. instance string
  58054. urlParams_ gensupport.URLParams
  58055. ctx_ context.Context
  58056. header_ http.Header
  58057. }
  58058. // DeleteAccessConfig: Deletes an access config from an instance's
  58059. // network interface.
  58060. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  58061. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  58062. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58063. c.project = project
  58064. c.zone = zone
  58065. c.instance = instance
  58066. c.urlParams_.Set("accessConfig", accessConfig)
  58067. c.urlParams_.Set("networkInterface", networkInterface)
  58068. return c
  58069. }
  58070. // RequestId sets the optional parameter "requestId": An optional
  58071. // request ID to identify requests. Specify a unique request ID so that
  58072. // if you must retry your request, the server will know to ignore the
  58073. // request if it has already been completed.
  58074. //
  58075. // For example, consider a situation where you make an initial request
  58076. // and the request times out. If you make the request again with the
  58077. // same request ID, the server can check if original operation with the
  58078. // same request ID was received, and if so, will ignore the second
  58079. // request. This prevents clients from accidentally creating duplicate
  58080. // commitments.
  58081. //
  58082. // The request ID must be a valid UUID with the exception that zero UUID
  58083. // is not supported (00000000-0000-0000-0000-000000000000).
  58084. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  58085. c.urlParams_.Set("requestId", requestId)
  58086. return c
  58087. }
  58088. // Fields allows partial responses to be retrieved. See
  58089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58090. // for more information.
  58091. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  58092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58093. return c
  58094. }
  58095. // Context sets the context to be used in this call's Do method. Any
  58096. // pending HTTP request will be aborted if the provided context is
  58097. // canceled.
  58098. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  58099. c.ctx_ = ctx
  58100. return c
  58101. }
  58102. // Header returns an http.Header that can be modified by the caller to
  58103. // add HTTP headers to the request.
  58104. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  58105. if c.header_ == nil {
  58106. c.header_ = make(http.Header)
  58107. }
  58108. return c.header_
  58109. }
  58110. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  58111. reqHeaders := make(http.Header)
  58112. for k, v := range c.header_ {
  58113. reqHeaders[k] = v
  58114. }
  58115. reqHeaders.Set("User-Agent", c.s.userAgent())
  58116. var body io.Reader = nil
  58117. c.urlParams_.Set("alt", alt)
  58118. c.urlParams_.Set("prettyPrint", "false")
  58119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  58120. urls += "?" + c.urlParams_.Encode()
  58121. req, err := http.NewRequest("POST", urls, body)
  58122. if err != nil {
  58123. return nil, err
  58124. }
  58125. req.Header = reqHeaders
  58126. googleapi.Expand(req.URL, map[string]string{
  58127. "project": c.project,
  58128. "zone": c.zone,
  58129. "instance": c.instance,
  58130. })
  58131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58132. }
  58133. // Do executes the "compute.instances.deleteAccessConfig" call.
  58134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58135. // status code is an error. Response headers are in either
  58136. // *Operation.ServerResponse.Header or (if a response was returned at
  58137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58138. // to check whether the returned error was because
  58139. // http.StatusNotModified was returned.
  58140. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58141. gensupport.SetOptions(c.urlParams_, opts...)
  58142. res, err := c.doRequest("json")
  58143. if res != nil && res.StatusCode == http.StatusNotModified {
  58144. if res.Body != nil {
  58145. res.Body.Close()
  58146. }
  58147. return nil, &googleapi.Error{
  58148. Code: res.StatusCode,
  58149. Header: res.Header,
  58150. }
  58151. }
  58152. if err != nil {
  58153. return nil, err
  58154. }
  58155. defer googleapi.CloseBody(res)
  58156. if err := googleapi.CheckResponse(res); err != nil {
  58157. return nil, err
  58158. }
  58159. ret := &Operation{
  58160. ServerResponse: googleapi.ServerResponse{
  58161. Header: res.Header,
  58162. HTTPStatusCode: res.StatusCode,
  58163. },
  58164. }
  58165. target := &ret
  58166. if err := gensupport.DecodeResponse(target, res); err != nil {
  58167. return nil, err
  58168. }
  58169. return ret, nil
  58170. // {
  58171. // "description": "Deletes an access config from an instance's network interface.",
  58172. // "httpMethod": "POST",
  58173. // "id": "compute.instances.deleteAccessConfig",
  58174. // "parameterOrder": [
  58175. // "project",
  58176. // "zone",
  58177. // "instance",
  58178. // "accessConfig",
  58179. // "networkInterface"
  58180. // ],
  58181. // "parameters": {
  58182. // "accessConfig": {
  58183. // "description": "The name of the access config to delete.",
  58184. // "location": "query",
  58185. // "required": true,
  58186. // "type": "string"
  58187. // },
  58188. // "instance": {
  58189. // "description": "The instance name for this request.",
  58190. // "location": "path",
  58191. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58192. // "required": true,
  58193. // "type": "string"
  58194. // },
  58195. // "networkInterface": {
  58196. // "description": "The name of the network interface.",
  58197. // "location": "query",
  58198. // "required": true,
  58199. // "type": "string"
  58200. // },
  58201. // "project": {
  58202. // "description": "Project ID for this request.",
  58203. // "location": "path",
  58204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58205. // "required": true,
  58206. // "type": "string"
  58207. // },
  58208. // "requestId": {
  58209. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58210. // "location": "query",
  58211. // "type": "string"
  58212. // },
  58213. // "zone": {
  58214. // "description": "The name of the zone for this request.",
  58215. // "location": "path",
  58216. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58217. // "required": true,
  58218. // "type": "string"
  58219. // }
  58220. // },
  58221. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  58222. // "response": {
  58223. // "$ref": "Operation"
  58224. // },
  58225. // "scopes": [
  58226. // "https://www.googleapis.com/auth/cloud-platform",
  58227. // "https://www.googleapis.com/auth/compute"
  58228. // ]
  58229. // }
  58230. }
  58231. // method id "compute.instances.detachDisk":
  58232. type InstancesDetachDiskCall struct {
  58233. s *Service
  58234. project string
  58235. zone string
  58236. instance string
  58237. urlParams_ gensupport.URLParams
  58238. ctx_ context.Context
  58239. header_ http.Header
  58240. }
  58241. // DetachDisk: Detaches a disk from an instance.
  58242. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  58243. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  58244. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58245. c.project = project
  58246. c.zone = zone
  58247. c.instance = instance
  58248. c.urlParams_.Set("deviceName", deviceName)
  58249. return c
  58250. }
  58251. // RequestId sets the optional parameter "requestId": An optional
  58252. // request ID to identify requests. Specify a unique request ID so that
  58253. // if you must retry your request, the server will know to ignore the
  58254. // request if it has already been completed.
  58255. //
  58256. // For example, consider a situation where you make an initial request
  58257. // and the request times out. If you make the request again with the
  58258. // same request ID, the server can check if original operation with the
  58259. // same request ID was received, and if so, will ignore the second
  58260. // request. This prevents clients from accidentally creating duplicate
  58261. // commitments.
  58262. //
  58263. // The request ID must be a valid UUID with the exception that zero UUID
  58264. // is not supported (00000000-0000-0000-0000-000000000000).
  58265. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  58266. c.urlParams_.Set("requestId", requestId)
  58267. return c
  58268. }
  58269. // Fields allows partial responses to be retrieved. See
  58270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58271. // for more information.
  58272. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  58273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58274. return c
  58275. }
  58276. // Context sets the context to be used in this call's Do method. Any
  58277. // pending HTTP request will be aborted if the provided context is
  58278. // canceled.
  58279. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  58280. c.ctx_ = ctx
  58281. return c
  58282. }
  58283. // Header returns an http.Header that can be modified by the caller to
  58284. // add HTTP headers to the request.
  58285. func (c *InstancesDetachDiskCall) Header() http.Header {
  58286. if c.header_ == nil {
  58287. c.header_ = make(http.Header)
  58288. }
  58289. return c.header_
  58290. }
  58291. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  58292. reqHeaders := make(http.Header)
  58293. for k, v := range c.header_ {
  58294. reqHeaders[k] = v
  58295. }
  58296. reqHeaders.Set("User-Agent", c.s.userAgent())
  58297. var body io.Reader = nil
  58298. c.urlParams_.Set("alt", alt)
  58299. c.urlParams_.Set("prettyPrint", "false")
  58300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  58301. urls += "?" + c.urlParams_.Encode()
  58302. req, err := http.NewRequest("POST", urls, body)
  58303. if err != nil {
  58304. return nil, err
  58305. }
  58306. req.Header = reqHeaders
  58307. googleapi.Expand(req.URL, map[string]string{
  58308. "project": c.project,
  58309. "zone": c.zone,
  58310. "instance": c.instance,
  58311. })
  58312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58313. }
  58314. // Do executes the "compute.instances.detachDisk" call.
  58315. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58316. // status code is an error. Response headers are in either
  58317. // *Operation.ServerResponse.Header or (if a response was returned at
  58318. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58319. // to check whether the returned error was because
  58320. // http.StatusNotModified was returned.
  58321. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58322. gensupport.SetOptions(c.urlParams_, opts...)
  58323. res, err := c.doRequest("json")
  58324. if res != nil && res.StatusCode == http.StatusNotModified {
  58325. if res.Body != nil {
  58326. res.Body.Close()
  58327. }
  58328. return nil, &googleapi.Error{
  58329. Code: res.StatusCode,
  58330. Header: res.Header,
  58331. }
  58332. }
  58333. if err != nil {
  58334. return nil, err
  58335. }
  58336. defer googleapi.CloseBody(res)
  58337. if err := googleapi.CheckResponse(res); err != nil {
  58338. return nil, err
  58339. }
  58340. ret := &Operation{
  58341. ServerResponse: googleapi.ServerResponse{
  58342. Header: res.Header,
  58343. HTTPStatusCode: res.StatusCode,
  58344. },
  58345. }
  58346. target := &ret
  58347. if err := gensupport.DecodeResponse(target, res); err != nil {
  58348. return nil, err
  58349. }
  58350. return ret, nil
  58351. // {
  58352. // "description": "Detaches a disk from an instance.",
  58353. // "httpMethod": "POST",
  58354. // "id": "compute.instances.detachDisk",
  58355. // "parameterOrder": [
  58356. // "project",
  58357. // "zone",
  58358. // "instance",
  58359. // "deviceName"
  58360. // ],
  58361. // "parameters": {
  58362. // "deviceName": {
  58363. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  58364. // "location": "query",
  58365. // "required": true,
  58366. // "type": "string"
  58367. // },
  58368. // "instance": {
  58369. // "description": "Instance name for this request.",
  58370. // "location": "path",
  58371. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58372. // "required": true,
  58373. // "type": "string"
  58374. // },
  58375. // "project": {
  58376. // "description": "Project ID for this request.",
  58377. // "location": "path",
  58378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58379. // "required": true,
  58380. // "type": "string"
  58381. // },
  58382. // "requestId": {
  58383. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58384. // "location": "query",
  58385. // "type": "string"
  58386. // },
  58387. // "zone": {
  58388. // "description": "The name of the zone for this request.",
  58389. // "location": "path",
  58390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58391. // "required": true,
  58392. // "type": "string"
  58393. // }
  58394. // },
  58395. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  58396. // "response": {
  58397. // "$ref": "Operation"
  58398. // },
  58399. // "scopes": [
  58400. // "https://www.googleapis.com/auth/cloud-platform",
  58401. // "https://www.googleapis.com/auth/compute"
  58402. // ]
  58403. // }
  58404. }
  58405. // method id "compute.instances.get":
  58406. type InstancesGetCall struct {
  58407. s *Service
  58408. project string
  58409. zone string
  58410. instance string
  58411. urlParams_ gensupport.URLParams
  58412. ifNoneMatch_ string
  58413. ctx_ context.Context
  58414. header_ http.Header
  58415. }
  58416. // Get: Returns the specified Instance resource. Gets a list of
  58417. // available instances by making a list() request.
  58418. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  58419. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  58420. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58421. c.project = project
  58422. c.zone = zone
  58423. c.instance = instance
  58424. return c
  58425. }
  58426. // Fields allows partial responses to be retrieved. See
  58427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58428. // for more information.
  58429. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  58430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58431. return c
  58432. }
  58433. // IfNoneMatch sets the optional parameter which makes the operation
  58434. // fail if the object's ETag matches the given value. This is useful for
  58435. // getting updates only after the object has changed since the last
  58436. // request. Use googleapi.IsNotModified to check whether the response
  58437. // error from Do is the result of In-None-Match.
  58438. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  58439. c.ifNoneMatch_ = entityTag
  58440. return c
  58441. }
  58442. // Context sets the context to be used in this call's Do method. Any
  58443. // pending HTTP request will be aborted if the provided context is
  58444. // canceled.
  58445. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  58446. c.ctx_ = ctx
  58447. return c
  58448. }
  58449. // Header returns an http.Header that can be modified by the caller to
  58450. // add HTTP headers to the request.
  58451. func (c *InstancesGetCall) Header() http.Header {
  58452. if c.header_ == nil {
  58453. c.header_ = make(http.Header)
  58454. }
  58455. return c.header_
  58456. }
  58457. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  58458. reqHeaders := make(http.Header)
  58459. for k, v := range c.header_ {
  58460. reqHeaders[k] = v
  58461. }
  58462. reqHeaders.Set("User-Agent", c.s.userAgent())
  58463. if c.ifNoneMatch_ != "" {
  58464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58465. }
  58466. var body io.Reader = nil
  58467. c.urlParams_.Set("alt", alt)
  58468. c.urlParams_.Set("prettyPrint", "false")
  58469. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  58470. urls += "?" + c.urlParams_.Encode()
  58471. req, err := http.NewRequest("GET", urls, body)
  58472. if err != nil {
  58473. return nil, err
  58474. }
  58475. req.Header = reqHeaders
  58476. googleapi.Expand(req.URL, map[string]string{
  58477. "project": c.project,
  58478. "zone": c.zone,
  58479. "instance": c.instance,
  58480. })
  58481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58482. }
  58483. // Do executes the "compute.instances.get" call.
  58484. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  58485. // code is an error. Response headers are in either
  58486. // *Instance.ServerResponse.Header or (if a response was returned at
  58487. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58488. // to check whether the returned error was because
  58489. // http.StatusNotModified was returned.
  58490. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  58491. gensupport.SetOptions(c.urlParams_, opts...)
  58492. res, err := c.doRequest("json")
  58493. if res != nil && res.StatusCode == http.StatusNotModified {
  58494. if res.Body != nil {
  58495. res.Body.Close()
  58496. }
  58497. return nil, &googleapi.Error{
  58498. Code: res.StatusCode,
  58499. Header: res.Header,
  58500. }
  58501. }
  58502. if err != nil {
  58503. return nil, err
  58504. }
  58505. defer googleapi.CloseBody(res)
  58506. if err := googleapi.CheckResponse(res); err != nil {
  58507. return nil, err
  58508. }
  58509. ret := &Instance{
  58510. ServerResponse: googleapi.ServerResponse{
  58511. Header: res.Header,
  58512. HTTPStatusCode: res.StatusCode,
  58513. },
  58514. }
  58515. target := &ret
  58516. if err := gensupport.DecodeResponse(target, res); err != nil {
  58517. return nil, err
  58518. }
  58519. return ret, nil
  58520. // {
  58521. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  58522. // "httpMethod": "GET",
  58523. // "id": "compute.instances.get",
  58524. // "parameterOrder": [
  58525. // "project",
  58526. // "zone",
  58527. // "instance"
  58528. // ],
  58529. // "parameters": {
  58530. // "instance": {
  58531. // "description": "Name of the instance resource to return.",
  58532. // "location": "path",
  58533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58534. // "required": true,
  58535. // "type": "string"
  58536. // },
  58537. // "project": {
  58538. // "description": "Project ID for this request.",
  58539. // "location": "path",
  58540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58541. // "required": true,
  58542. // "type": "string"
  58543. // },
  58544. // "zone": {
  58545. // "description": "The name of the zone for this request.",
  58546. // "location": "path",
  58547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58548. // "required": true,
  58549. // "type": "string"
  58550. // }
  58551. // },
  58552. // "path": "{project}/zones/{zone}/instances/{instance}",
  58553. // "response": {
  58554. // "$ref": "Instance"
  58555. // },
  58556. // "scopes": [
  58557. // "https://www.googleapis.com/auth/cloud-platform",
  58558. // "https://www.googleapis.com/auth/compute",
  58559. // "https://www.googleapis.com/auth/compute.readonly"
  58560. // ]
  58561. // }
  58562. }
  58563. // method id "compute.instances.getGuestAttributes":
  58564. type InstancesGetGuestAttributesCall struct {
  58565. s *Service
  58566. project string
  58567. zone string
  58568. instance string
  58569. urlParams_ gensupport.URLParams
  58570. ifNoneMatch_ string
  58571. ctx_ context.Context
  58572. header_ http.Header
  58573. }
  58574. // GetGuestAttributes: Returns the specified guest attributes entry.
  58575. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  58576. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58577. c.project = project
  58578. c.zone = zone
  58579. c.instance = instance
  58580. return c
  58581. }
  58582. // QueryPath sets the optional parameter "queryPath": Specifies the
  58583. // guest attributes path to be queried.
  58584. func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
  58585. c.urlParams_.Set("queryPath", queryPath)
  58586. return c
  58587. }
  58588. // VariableKey sets the optional parameter "variableKey": Specifies the
  58589. // key for the guest attributes entry.
  58590. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  58591. c.urlParams_.Set("variableKey", variableKey)
  58592. return c
  58593. }
  58594. // Fields allows partial responses to be retrieved. See
  58595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58596. // for more information.
  58597. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  58598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58599. return c
  58600. }
  58601. // IfNoneMatch sets the optional parameter which makes the operation
  58602. // fail if the object's ETag matches the given value. This is useful for
  58603. // getting updates only after the object has changed since the last
  58604. // request. Use googleapi.IsNotModified to check whether the response
  58605. // error from Do is the result of In-None-Match.
  58606. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  58607. c.ifNoneMatch_ = entityTag
  58608. return c
  58609. }
  58610. // Context sets the context to be used in this call's Do method. Any
  58611. // pending HTTP request will be aborted if the provided context is
  58612. // canceled.
  58613. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  58614. c.ctx_ = ctx
  58615. return c
  58616. }
  58617. // Header returns an http.Header that can be modified by the caller to
  58618. // add HTTP headers to the request.
  58619. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  58620. if c.header_ == nil {
  58621. c.header_ = make(http.Header)
  58622. }
  58623. return c.header_
  58624. }
  58625. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  58626. reqHeaders := make(http.Header)
  58627. for k, v := range c.header_ {
  58628. reqHeaders[k] = v
  58629. }
  58630. reqHeaders.Set("User-Agent", c.s.userAgent())
  58631. if c.ifNoneMatch_ != "" {
  58632. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58633. }
  58634. var body io.Reader = nil
  58635. c.urlParams_.Set("alt", alt)
  58636. c.urlParams_.Set("prettyPrint", "false")
  58637. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  58638. urls += "?" + c.urlParams_.Encode()
  58639. req, err := http.NewRequest("GET", urls, body)
  58640. if err != nil {
  58641. return nil, err
  58642. }
  58643. req.Header = reqHeaders
  58644. googleapi.Expand(req.URL, map[string]string{
  58645. "project": c.project,
  58646. "zone": c.zone,
  58647. "instance": c.instance,
  58648. })
  58649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58650. }
  58651. // Do executes the "compute.instances.getGuestAttributes" call.
  58652. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  58653. // status code is an error. Response headers are in either
  58654. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  58655. // at all) in error.(*googleapi.Error).Header. Use
  58656. // googleapi.IsNotModified to check whether the returned error was
  58657. // because http.StatusNotModified was returned.
  58658. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  58659. gensupport.SetOptions(c.urlParams_, opts...)
  58660. res, err := c.doRequest("json")
  58661. if res != nil && res.StatusCode == http.StatusNotModified {
  58662. if res.Body != nil {
  58663. res.Body.Close()
  58664. }
  58665. return nil, &googleapi.Error{
  58666. Code: res.StatusCode,
  58667. Header: res.Header,
  58668. }
  58669. }
  58670. if err != nil {
  58671. return nil, err
  58672. }
  58673. defer googleapi.CloseBody(res)
  58674. if err := googleapi.CheckResponse(res); err != nil {
  58675. return nil, err
  58676. }
  58677. ret := &GuestAttributes{
  58678. ServerResponse: googleapi.ServerResponse{
  58679. Header: res.Header,
  58680. HTTPStatusCode: res.StatusCode,
  58681. },
  58682. }
  58683. target := &ret
  58684. if err := gensupport.DecodeResponse(target, res); err != nil {
  58685. return nil, err
  58686. }
  58687. return ret, nil
  58688. // {
  58689. // "description": "Returns the specified guest attributes entry.",
  58690. // "httpMethod": "GET",
  58691. // "id": "compute.instances.getGuestAttributes",
  58692. // "parameterOrder": [
  58693. // "project",
  58694. // "zone",
  58695. // "instance"
  58696. // ],
  58697. // "parameters": {
  58698. // "instance": {
  58699. // "description": "Name of the instance scoping this request.",
  58700. // "location": "path",
  58701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58702. // "required": true,
  58703. // "type": "string"
  58704. // },
  58705. // "project": {
  58706. // "description": "Project ID for this request.",
  58707. // "location": "path",
  58708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58709. // "required": true,
  58710. // "type": "string"
  58711. // },
  58712. // "queryPath": {
  58713. // "description": "Specifies the guest attributes path to be queried.",
  58714. // "location": "query",
  58715. // "type": "string"
  58716. // },
  58717. // "variableKey": {
  58718. // "description": "Specifies the key for the guest attributes entry.",
  58719. // "location": "query",
  58720. // "type": "string"
  58721. // },
  58722. // "zone": {
  58723. // "description": "The name of the zone for this request.",
  58724. // "location": "path",
  58725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58726. // "required": true,
  58727. // "type": "string"
  58728. // }
  58729. // },
  58730. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  58731. // "response": {
  58732. // "$ref": "GuestAttributes"
  58733. // },
  58734. // "scopes": [
  58735. // "https://www.googleapis.com/auth/cloud-platform",
  58736. // "https://www.googleapis.com/auth/compute",
  58737. // "https://www.googleapis.com/auth/compute.readonly"
  58738. // ]
  58739. // }
  58740. }
  58741. // method id "compute.instances.getIamPolicy":
  58742. type InstancesGetIamPolicyCall struct {
  58743. s *Service
  58744. project string
  58745. zone string
  58746. resource string
  58747. urlParams_ gensupport.URLParams
  58748. ifNoneMatch_ string
  58749. ctx_ context.Context
  58750. header_ http.Header
  58751. }
  58752. // GetIamPolicy: Gets the access control policy for a resource. May be
  58753. // empty if no such policy or resource exists.
  58754. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  58755. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58756. c.project = project
  58757. c.zone = zone
  58758. c.resource = resource
  58759. return c
  58760. }
  58761. // Fields allows partial responses to be retrieved. See
  58762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58763. // for more information.
  58764. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  58765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58766. return c
  58767. }
  58768. // IfNoneMatch sets the optional parameter which makes the operation
  58769. // fail if the object's ETag matches the given value. This is useful for
  58770. // getting updates only after the object has changed since the last
  58771. // request. Use googleapi.IsNotModified to check whether the response
  58772. // error from Do is the result of In-None-Match.
  58773. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  58774. c.ifNoneMatch_ = entityTag
  58775. return c
  58776. }
  58777. // Context sets the context to be used in this call's Do method. Any
  58778. // pending HTTP request will be aborted if the provided context is
  58779. // canceled.
  58780. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  58781. c.ctx_ = ctx
  58782. return c
  58783. }
  58784. // Header returns an http.Header that can be modified by the caller to
  58785. // add HTTP headers to the request.
  58786. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  58787. if c.header_ == nil {
  58788. c.header_ = make(http.Header)
  58789. }
  58790. return c.header_
  58791. }
  58792. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  58793. reqHeaders := make(http.Header)
  58794. for k, v := range c.header_ {
  58795. reqHeaders[k] = v
  58796. }
  58797. reqHeaders.Set("User-Agent", c.s.userAgent())
  58798. if c.ifNoneMatch_ != "" {
  58799. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58800. }
  58801. var body io.Reader = nil
  58802. c.urlParams_.Set("alt", alt)
  58803. c.urlParams_.Set("prettyPrint", "false")
  58804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  58805. urls += "?" + c.urlParams_.Encode()
  58806. req, err := http.NewRequest("GET", urls, body)
  58807. if err != nil {
  58808. return nil, err
  58809. }
  58810. req.Header = reqHeaders
  58811. googleapi.Expand(req.URL, map[string]string{
  58812. "project": c.project,
  58813. "zone": c.zone,
  58814. "resource": c.resource,
  58815. })
  58816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58817. }
  58818. // Do executes the "compute.instances.getIamPolicy" call.
  58819. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  58820. // code is an error. Response headers are in either
  58821. // *Policy.ServerResponse.Header or (if a response was returned at all)
  58822. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  58823. // check whether the returned error was because http.StatusNotModified
  58824. // was returned.
  58825. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  58826. gensupport.SetOptions(c.urlParams_, opts...)
  58827. res, err := c.doRequest("json")
  58828. if res != nil && res.StatusCode == http.StatusNotModified {
  58829. if res.Body != nil {
  58830. res.Body.Close()
  58831. }
  58832. return nil, &googleapi.Error{
  58833. Code: res.StatusCode,
  58834. Header: res.Header,
  58835. }
  58836. }
  58837. if err != nil {
  58838. return nil, err
  58839. }
  58840. defer googleapi.CloseBody(res)
  58841. if err := googleapi.CheckResponse(res); err != nil {
  58842. return nil, err
  58843. }
  58844. ret := &Policy{
  58845. ServerResponse: googleapi.ServerResponse{
  58846. Header: res.Header,
  58847. HTTPStatusCode: res.StatusCode,
  58848. },
  58849. }
  58850. target := &ret
  58851. if err := gensupport.DecodeResponse(target, res); err != nil {
  58852. return nil, err
  58853. }
  58854. return ret, nil
  58855. // {
  58856. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  58857. // "httpMethod": "GET",
  58858. // "id": "compute.instances.getIamPolicy",
  58859. // "parameterOrder": [
  58860. // "project",
  58861. // "zone",
  58862. // "resource"
  58863. // ],
  58864. // "parameters": {
  58865. // "project": {
  58866. // "description": "Project ID for this request.",
  58867. // "location": "path",
  58868. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58869. // "required": true,
  58870. // "type": "string"
  58871. // },
  58872. // "resource": {
  58873. // "description": "Name or id of the resource for this request.",
  58874. // "location": "path",
  58875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58876. // "required": true,
  58877. // "type": "string"
  58878. // },
  58879. // "zone": {
  58880. // "description": "The name of the zone for this request.",
  58881. // "location": "path",
  58882. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58883. // "required": true,
  58884. // "type": "string"
  58885. // }
  58886. // },
  58887. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  58888. // "response": {
  58889. // "$ref": "Policy"
  58890. // },
  58891. // "scopes": [
  58892. // "https://www.googleapis.com/auth/cloud-platform",
  58893. // "https://www.googleapis.com/auth/compute",
  58894. // "https://www.googleapis.com/auth/compute.readonly"
  58895. // ]
  58896. // }
  58897. }
  58898. // method id "compute.instances.getSerialPortOutput":
  58899. type InstancesGetSerialPortOutputCall struct {
  58900. s *Service
  58901. project string
  58902. zone string
  58903. instance string
  58904. urlParams_ gensupport.URLParams
  58905. ifNoneMatch_ string
  58906. ctx_ context.Context
  58907. header_ http.Header
  58908. }
  58909. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  58910. // the specified instance.
  58911. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  58912. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  58913. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58914. c.project = project
  58915. c.zone = zone
  58916. c.instance = instance
  58917. return c
  58918. }
  58919. // Port sets the optional parameter "port": Specifies which COM or
  58920. // serial port to retrieve data from.
  58921. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  58922. c.urlParams_.Set("port", fmt.Sprint(port))
  58923. return c
  58924. }
  58925. // Start sets the optional parameter "start": Returns output starting
  58926. // from a specific byte position. Use this to page through output when
  58927. // the output is too large to return in a single request. For the
  58928. // initial request, leave this field unspecified. For subsequent calls,
  58929. // this field should be set to the next value returned in the previous
  58930. // call.
  58931. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  58932. c.urlParams_.Set("start", fmt.Sprint(start))
  58933. return c
  58934. }
  58935. // Fields allows partial responses to be retrieved. See
  58936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58937. // for more information.
  58938. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  58939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58940. return c
  58941. }
  58942. // IfNoneMatch sets the optional parameter which makes the operation
  58943. // fail if the object's ETag matches the given value. This is useful for
  58944. // getting updates only after the object has changed since the last
  58945. // request. Use googleapi.IsNotModified to check whether the response
  58946. // error from Do is the result of In-None-Match.
  58947. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  58948. c.ifNoneMatch_ = entityTag
  58949. return c
  58950. }
  58951. // Context sets the context to be used in this call's Do method. Any
  58952. // pending HTTP request will be aborted if the provided context is
  58953. // canceled.
  58954. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  58955. c.ctx_ = ctx
  58956. return c
  58957. }
  58958. // Header returns an http.Header that can be modified by the caller to
  58959. // add HTTP headers to the request.
  58960. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  58961. if c.header_ == nil {
  58962. c.header_ = make(http.Header)
  58963. }
  58964. return c.header_
  58965. }
  58966. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  58967. reqHeaders := make(http.Header)
  58968. for k, v := range c.header_ {
  58969. reqHeaders[k] = v
  58970. }
  58971. reqHeaders.Set("User-Agent", c.s.userAgent())
  58972. if c.ifNoneMatch_ != "" {
  58973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58974. }
  58975. var body io.Reader = nil
  58976. c.urlParams_.Set("alt", alt)
  58977. c.urlParams_.Set("prettyPrint", "false")
  58978. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  58979. urls += "?" + c.urlParams_.Encode()
  58980. req, err := http.NewRequest("GET", urls, body)
  58981. if err != nil {
  58982. return nil, err
  58983. }
  58984. req.Header = reqHeaders
  58985. googleapi.Expand(req.URL, map[string]string{
  58986. "project": c.project,
  58987. "zone": c.zone,
  58988. "instance": c.instance,
  58989. })
  58990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58991. }
  58992. // Do executes the "compute.instances.getSerialPortOutput" call.
  58993. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  58994. // non-2xx status code is an error. Response headers are in either
  58995. // *SerialPortOutput.ServerResponse.Header or (if a response was
  58996. // returned at all) in error.(*googleapi.Error).Header. Use
  58997. // googleapi.IsNotModified to check whether the returned error was
  58998. // because http.StatusNotModified was returned.
  58999. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  59000. gensupport.SetOptions(c.urlParams_, opts...)
  59001. res, err := c.doRequest("json")
  59002. if res != nil && res.StatusCode == http.StatusNotModified {
  59003. if res.Body != nil {
  59004. res.Body.Close()
  59005. }
  59006. return nil, &googleapi.Error{
  59007. Code: res.StatusCode,
  59008. Header: res.Header,
  59009. }
  59010. }
  59011. if err != nil {
  59012. return nil, err
  59013. }
  59014. defer googleapi.CloseBody(res)
  59015. if err := googleapi.CheckResponse(res); err != nil {
  59016. return nil, err
  59017. }
  59018. ret := &SerialPortOutput{
  59019. ServerResponse: googleapi.ServerResponse{
  59020. Header: res.Header,
  59021. HTTPStatusCode: res.StatusCode,
  59022. },
  59023. }
  59024. target := &ret
  59025. if err := gensupport.DecodeResponse(target, res); err != nil {
  59026. return nil, err
  59027. }
  59028. return ret, nil
  59029. // {
  59030. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  59031. // "httpMethod": "GET",
  59032. // "id": "compute.instances.getSerialPortOutput",
  59033. // "parameterOrder": [
  59034. // "project",
  59035. // "zone",
  59036. // "instance"
  59037. // ],
  59038. // "parameters": {
  59039. // "instance": {
  59040. // "description": "Name of the instance scoping this request.",
  59041. // "location": "path",
  59042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59043. // "required": true,
  59044. // "type": "string"
  59045. // },
  59046. // "port": {
  59047. // "default": "1",
  59048. // "description": "Specifies which COM or serial port to retrieve data from.",
  59049. // "format": "int32",
  59050. // "location": "query",
  59051. // "maximum": "4",
  59052. // "minimum": "1",
  59053. // "type": "integer"
  59054. // },
  59055. // "project": {
  59056. // "description": "Project ID for this request.",
  59057. // "location": "path",
  59058. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59059. // "required": true,
  59060. // "type": "string"
  59061. // },
  59062. // "start": {
  59063. // "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.",
  59064. // "format": "int64",
  59065. // "location": "query",
  59066. // "type": "string"
  59067. // },
  59068. // "zone": {
  59069. // "description": "The name of the zone for this request.",
  59070. // "location": "path",
  59071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59072. // "required": true,
  59073. // "type": "string"
  59074. // }
  59075. // },
  59076. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  59077. // "response": {
  59078. // "$ref": "SerialPortOutput"
  59079. // },
  59080. // "scopes": [
  59081. // "https://www.googleapis.com/auth/cloud-platform",
  59082. // "https://www.googleapis.com/auth/compute",
  59083. // "https://www.googleapis.com/auth/compute.readonly"
  59084. // ]
  59085. // }
  59086. }
  59087. // method id "compute.instances.getShieldedVmIdentity":
  59088. type InstancesGetShieldedVmIdentityCall struct {
  59089. s *Service
  59090. project string
  59091. zone string
  59092. instance string
  59093. urlParams_ gensupport.URLParams
  59094. ifNoneMatch_ string
  59095. ctx_ context.Context
  59096. header_ http.Header
  59097. }
  59098. // GetShieldedVmIdentity: Returns the Shielded VM Identity of an
  59099. // instance
  59100. func (r *InstancesService) GetShieldedVmIdentity(project string, zone string, instance string) *InstancesGetShieldedVmIdentityCall {
  59101. c := &InstancesGetShieldedVmIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59102. c.project = project
  59103. c.zone = zone
  59104. c.instance = instance
  59105. return c
  59106. }
  59107. // Fields allows partial responses to be retrieved. See
  59108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59109. // for more information.
  59110. func (c *InstancesGetShieldedVmIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedVmIdentityCall {
  59111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59112. return c
  59113. }
  59114. // IfNoneMatch sets the optional parameter which makes the operation
  59115. // fail if the object's ETag matches the given value. This is useful for
  59116. // getting updates only after the object has changed since the last
  59117. // request. Use googleapi.IsNotModified to check whether the response
  59118. // error from Do is the result of In-None-Match.
  59119. func (c *InstancesGetShieldedVmIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedVmIdentityCall {
  59120. c.ifNoneMatch_ = entityTag
  59121. return c
  59122. }
  59123. // Context sets the context to be used in this call's Do method. Any
  59124. // pending HTTP request will be aborted if the provided context is
  59125. // canceled.
  59126. func (c *InstancesGetShieldedVmIdentityCall) Context(ctx context.Context) *InstancesGetShieldedVmIdentityCall {
  59127. c.ctx_ = ctx
  59128. return c
  59129. }
  59130. // Header returns an http.Header that can be modified by the caller to
  59131. // add HTTP headers to the request.
  59132. func (c *InstancesGetShieldedVmIdentityCall) Header() http.Header {
  59133. if c.header_ == nil {
  59134. c.header_ = make(http.Header)
  59135. }
  59136. return c.header_
  59137. }
  59138. func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Response, error) {
  59139. reqHeaders := make(http.Header)
  59140. for k, v := range c.header_ {
  59141. reqHeaders[k] = v
  59142. }
  59143. reqHeaders.Set("User-Agent", c.s.userAgent())
  59144. if c.ifNoneMatch_ != "" {
  59145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59146. }
  59147. var body io.Reader = nil
  59148. c.urlParams_.Set("alt", alt)
  59149. c.urlParams_.Set("prettyPrint", "false")
  59150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity")
  59151. urls += "?" + c.urlParams_.Encode()
  59152. req, err := http.NewRequest("GET", urls, body)
  59153. if err != nil {
  59154. return nil, err
  59155. }
  59156. req.Header = reqHeaders
  59157. googleapi.Expand(req.URL, map[string]string{
  59158. "project": c.project,
  59159. "zone": c.zone,
  59160. "instance": c.instance,
  59161. })
  59162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59163. }
  59164. // Do executes the "compute.instances.getShieldedVmIdentity" call.
  59165. // Exactly one of *ShieldedVmIdentity or error will be non-nil. Any
  59166. // non-2xx status code is an error. Response headers are in either
  59167. // *ShieldedVmIdentity.ServerResponse.Header or (if a response was
  59168. // returned at all) in error.(*googleapi.Error).Header. Use
  59169. // googleapi.IsNotModified to check whether the returned error was
  59170. // because http.StatusNotModified was returned.
  59171. func (c *InstancesGetShieldedVmIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedVmIdentity, error) {
  59172. gensupport.SetOptions(c.urlParams_, opts...)
  59173. res, err := c.doRequest("json")
  59174. if res != nil && res.StatusCode == http.StatusNotModified {
  59175. if res.Body != nil {
  59176. res.Body.Close()
  59177. }
  59178. return nil, &googleapi.Error{
  59179. Code: res.StatusCode,
  59180. Header: res.Header,
  59181. }
  59182. }
  59183. if err != nil {
  59184. return nil, err
  59185. }
  59186. defer googleapi.CloseBody(res)
  59187. if err := googleapi.CheckResponse(res); err != nil {
  59188. return nil, err
  59189. }
  59190. ret := &ShieldedVmIdentity{
  59191. ServerResponse: googleapi.ServerResponse{
  59192. Header: res.Header,
  59193. HTTPStatusCode: res.StatusCode,
  59194. },
  59195. }
  59196. target := &ret
  59197. if err := gensupport.DecodeResponse(target, res); err != nil {
  59198. return nil, err
  59199. }
  59200. return ret, nil
  59201. // {
  59202. // "description": "Returns the Shielded VM Identity of an instance",
  59203. // "httpMethod": "GET",
  59204. // "id": "compute.instances.getShieldedVmIdentity",
  59205. // "parameterOrder": [
  59206. // "project",
  59207. // "zone",
  59208. // "instance"
  59209. // ],
  59210. // "parameters": {
  59211. // "instance": {
  59212. // "description": "Name of the instance scoping this request.",
  59213. // "location": "path",
  59214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59215. // "required": true,
  59216. // "type": "string"
  59217. // },
  59218. // "project": {
  59219. // "description": "Project ID for this request.",
  59220. // "location": "path",
  59221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59222. // "required": true,
  59223. // "type": "string"
  59224. // },
  59225. // "zone": {
  59226. // "description": "The name of the zone for this request.",
  59227. // "location": "path",
  59228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59229. // "required": true,
  59230. // "type": "string"
  59231. // }
  59232. // },
  59233. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity",
  59234. // "response": {
  59235. // "$ref": "ShieldedVmIdentity"
  59236. // },
  59237. // "scopes": [
  59238. // "https://www.googleapis.com/auth/cloud-platform",
  59239. // "https://www.googleapis.com/auth/compute",
  59240. // "https://www.googleapis.com/auth/compute.readonly"
  59241. // ]
  59242. // }
  59243. }
  59244. // method id "compute.instances.insert":
  59245. type InstancesInsertCall struct {
  59246. s *Service
  59247. project string
  59248. zone string
  59249. instance *Instance
  59250. urlParams_ gensupport.URLParams
  59251. ctx_ context.Context
  59252. header_ http.Header
  59253. }
  59254. // Insert: Creates an instance resource in the specified project using
  59255. // the data included in the request.
  59256. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  59257. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  59258. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59259. c.project = project
  59260. c.zone = zone
  59261. c.instance = instance
  59262. return c
  59263. }
  59264. // RequestId sets the optional parameter "requestId": An optional
  59265. // request ID to identify requests. Specify a unique request ID so that
  59266. // if you must retry your request, the server will know to ignore the
  59267. // request if it has already been completed.
  59268. //
  59269. // For example, consider a situation where you make an initial request
  59270. // and the request times out. If you make the request again with the
  59271. // same request ID, the server can check if original operation with the
  59272. // same request ID was received, and if so, will ignore the second
  59273. // request. This prevents clients from accidentally creating duplicate
  59274. // commitments.
  59275. //
  59276. // The request ID must be a valid UUID with the exception that zero UUID
  59277. // is not supported (00000000-0000-0000-0000-000000000000).
  59278. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  59279. c.urlParams_.Set("requestId", requestId)
  59280. return c
  59281. }
  59282. // SourceInstanceTemplate sets the optional parameter
  59283. // "sourceInstanceTemplate": Specifies instance template to create the
  59284. // instance.
  59285. //
  59286. // This field is optional. It can be a full or partial URL. For example,
  59287. // the following are all valid URLs to an instance template:
  59288. // -
  59289. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  59290. // - projects/project/global/instanceTemplates/instanceTemplate
  59291. // - global/instanceTemplates/instanceTemplate
  59292. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  59293. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  59294. return c
  59295. }
  59296. // Fields allows partial responses to be retrieved. See
  59297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59298. // for more information.
  59299. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  59300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59301. return c
  59302. }
  59303. // Context sets the context to be used in this call's Do method. Any
  59304. // pending HTTP request will be aborted if the provided context is
  59305. // canceled.
  59306. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  59307. c.ctx_ = ctx
  59308. return c
  59309. }
  59310. // Header returns an http.Header that can be modified by the caller to
  59311. // add HTTP headers to the request.
  59312. func (c *InstancesInsertCall) Header() http.Header {
  59313. if c.header_ == nil {
  59314. c.header_ = make(http.Header)
  59315. }
  59316. return c.header_
  59317. }
  59318. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  59319. reqHeaders := make(http.Header)
  59320. for k, v := range c.header_ {
  59321. reqHeaders[k] = v
  59322. }
  59323. reqHeaders.Set("User-Agent", c.s.userAgent())
  59324. var body io.Reader = nil
  59325. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  59326. if err != nil {
  59327. return nil, err
  59328. }
  59329. reqHeaders.Set("Content-Type", "application/json")
  59330. c.urlParams_.Set("alt", alt)
  59331. c.urlParams_.Set("prettyPrint", "false")
  59332. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  59333. urls += "?" + c.urlParams_.Encode()
  59334. req, err := http.NewRequest("POST", urls, body)
  59335. if err != nil {
  59336. return nil, err
  59337. }
  59338. req.Header = reqHeaders
  59339. googleapi.Expand(req.URL, map[string]string{
  59340. "project": c.project,
  59341. "zone": c.zone,
  59342. })
  59343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59344. }
  59345. // Do executes the "compute.instances.insert" call.
  59346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59347. // status code is an error. Response headers are in either
  59348. // *Operation.ServerResponse.Header or (if a response was returned at
  59349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59350. // to check whether the returned error was because
  59351. // http.StatusNotModified was returned.
  59352. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59353. gensupport.SetOptions(c.urlParams_, opts...)
  59354. res, err := c.doRequest("json")
  59355. if res != nil && res.StatusCode == http.StatusNotModified {
  59356. if res.Body != nil {
  59357. res.Body.Close()
  59358. }
  59359. return nil, &googleapi.Error{
  59360. Code: res.StatusCode,
  59361. Header: res.Header,
  59362. }
  59363. }
  59364. if err != nil {
  59365. return nil, err
  59366. }
  59367. defer googleapi.CloseBody(res)
  59368. if err := googleapi.CheckResponse(res); err != nil {
  59369. return nil, err
  59370. }
  59371. ret := &Operation{
  59372. ServerResponse: googleapi.ServerResponse{
  59373. Header: res.Header,
  59374. HTTPStatusCode: res.StatusCode,
  59375. },
  59376. }
  59377. target := &ret
  59378. if err := gensupport.DecodeResponse(target, res); err != nil {
  59379. return nil, err
  59380. }
  59381. return ret, nil
  59382. // {
  59383. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  59384. // "httpMethod": "POST",
  59385. // "id": "compute.instances.insert",
  59386. // "parameterOrder": [
  59387. // "project",
  59388. // "zone"
  59389. // ],
  59390. // "parameters": {
  59391. // "project": {
  59392. // "description": "Project ID for this request.",
  59393. // "location": "path",
  59394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59395. // "required": true,
  59396. // "type": "string"
  59397. // },
  59398. // "requestId": {
  59399. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59400. // "location": "query",
  59401. // "type": "string"
  59402. // },
  59403. // "sourceInstanceTemplate": {
  59404. // "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",
  59405. // "location": "query",
  59406. // "type": "string"
  59407. // },
  59408. // "zone": {
  59409. // "description": "The name of the zone for this request.",
  59410. // "location": "path",
  59411. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59412. // "required": true,
  59413. // "type": "string"
  59414. // }
  59415. // },
  59416. // "path": "{project}/zones/{zone}/instances",
  59417. // "request": {
  59418. // "$ref": "Instance"
  59419. // },
  59420. // "response": {
  59421. // "$ref": "Operation"
  59422. // },
  59423. // "scopes": [
  59424. // "https://www.googleapis.com/auth/cloud-platform",
  59425. // "https://www.googleapis.com/auth/compute"
  59426. // ]
  59427. // }
  59428. }
  59429. // method id "compute.instances.list":
  59430. type InstancesListCall struct {
  59431. s *Service
  59432. project string
  59433. zone string
  59434. urlParams_ gensupport.URLParams
  59435. ifNoneMatch_ string
  59436. ctx_ context.Context
  59437. header_ http.Header
  59438. }
  59439. // List: Retrieves the list of instances contained within the specified
  59440. // zone.
  59441. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  59442. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  59443. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59444. c.project = project
  59445. c.zone = zone
  59446. return c
  59447. }
  59448. // Filter sets the optional parameter "filter": A filter expression that
  59449. // filters resources listed in the response. The expression must specify
  59450. // the field name, a comparison operator, and the value that you want to
  59451. // use for filtering. The value must be a string, a number, or a
  59452. // boolean. The comparison operator must be either =, !=, >, or <.
  59453. //
  59454. // For example, if you are filtering Compute Engine instances, you can
  59455. // exclude instances named example-instance by specifying name !=
  59456. // example-instance.
  59457. //
  59458. // You can also filter nested fields. For example, you could specify
  59459. // scheduling.automaticRestart = false to include instances only if they
  59460. // are not scheduled for automatic restarts. You can use filtering on
  59461. // nested fields to filter based on resource labels.
  59462. //
  59463. // To filter on multiple expressions, provide each separate expression
  59464. // within parentheses. For example, (scheduling.automaticRestart = true)
  59465. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59466. // AND expression. However, you can include AND and OR expressions
  59467. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59468. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59469. // true).
  59470. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  59471. c.urlParams_.Set("filter", filter)
  59472. return c
  59473. }
  59474. // MaxResults sets the optional parameter "maxResults": The maximum
  59475. // number of results per page that should be returned. If the number of
  59476. // available results is larger than maxResults, Compute Engine returns a
  59477. // nextPageToken that can be used to get the next page of results in
  59478. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59479. // (Default: 500)
  59480. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  59481. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59482. return c
  59483. }
  59484. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59485. // a certain order. By default, results are returned in alphanumerical
  59486. // order based on the resource name.
  59487. //
  59488. // You can also sort results in descending order based on the creation
  59489. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59490. // based on the creationTimestamp field in reverse chronological order
  59491. // (newest result first). Use this to sort resources like operations so
  59492. // that the newest operation is returned first.
  59493. //
  59494. // Currently, only sorting by name or creationTimestamp desc is
  59495. // supported.
  59496. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  59497. c.urlParams_.Set("orderBy", orderBy)
  59498. return c
  59499. }
  59500. // PageToken sets the optional parameter "pageToken": Specifies a page
  59501. // token to use. Set pageToken to the nextPageToken returned by a
  59502. // previous list request to get the next page of results.
  59503. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  59504. c.urlParams_.Set("pageToken", pageToken)
  59505. return c
  59506. }
  59507. // Fields allows partial responses to be retrieved. See
  59508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59509. // for more information.
  59510. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  59511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59512. return c
  59513. }
  59514. // IfNoneMatch sets the optional parameter which makes the operation
  59515. // fail if the object's ETag matches the given value. This is useful for
  59516. // getting updates only after the object has changed since the last
  59517. // request. Use googleapi.IsNotModified to check whether the response
  59518. // error from Do is the result of In-None-Match.
  59519. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  59520. c.ifNoneMatch_ = entityTag
  59521. return c
  59522. }
  59523. // Context sets the context to be used in this call's Do method. Any
  59524. // pending HTTP request will be aborted if the provided context is
  59525. // canceled.
  59526. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  59527. c.ctx_ = ctx
  59528. return c
  59529. }
  59530. // Header returns an http.Header that can be modified by the caller to
  59531. // add HTTP headers to the request.
  59532. func (c *InstancesListCall) Header() http.Header {
  59533. if c.header_ == nil {
  59534. c.header_ = make(http.Header)
  59535. }
  59536. return c.header_
  59537. }
  59538. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  59539. reqHeaders := make(http.Header)
  59540. for k, v := range c.header_ {
  59541. reqHeaders[k] = v
  59542. }
  59543. reqHeaders.Set("User-Agent", c.s.userAgent())
  59544. if c.ifNoneMatch_ != "" {
  59545. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59546. }
  59547. var body io.Reader = nil
  59548. c.urlParams_.Set("alt", alt)
  59549. c.urlParams_.Set("prettyPrint", "false")
  59550. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  59551. urls += "?" + c.urlParams_.Encode()
  59552. req, err := http.NewRequest("GET", urls, body)
  59553. if err != nil {
  59554. return nil, err
  59555. }
  59556. req.Header = reqHeaders
  59557. googleapi.Expand(req.URL, map[string]string{
  59558. "project": c.project,
  59559. "zone": c.zone,
  59560. })
  59561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59562. }
  59563. // Do executes the "compute.instances.list" call.
  59564. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  59565. // status code is an error. Response headers are in either
  59566. // *InstanceList.ServerResponse.Header or (if a response was returned at
  59567. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59568. // to check whether the returned error was because
  59569. // http.StatusNotModified was returned.
  59570. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  59571. gensupport.SetOptions(c.urlParams_, opts...)
  59572. res, err := c.doRequest("json")
  59573. if res != nil && res.StatusCode == http.StatusNotModified {
  59574. if res.Body != nil {
  59575. res.Body.Close()
  59576. }
  59577. return nil, &googleapi.Error{
  59578. Code: res.StatusCode,
  59579. Header: res.Header,
  59580. }
  59581. }
  59582. if err != nil {
  59583. return nil, err
  59584. }
  59585. defer googleapi.CloseBody(res)
  59586. if err := googleapi.CheckResponse(res); err != nil {
  59587. return nil, err
  59588. }
  59589. ret := &InstanceList{
  59590. ServerResponse: googleapi.ServerResponse{
  59591. Header: res.Header,
  59592. HTTPStatusCode: res.StatusCode,
  59593. },
  59594. }
  59595. target := &ret
  59596. if err := gensupport.DecodeResponse(target, res); err != nil {
  59597. return nil, err
  59598. }
  59599. return ret, nil
  59600. // {
  59601. // "description": "Retrieves the list of instances contained within the specified zone.",
  59602. // "httpMethod": "GET",
  59603. // "id": "compute.instances.list",
  59604. // "parameterOrder": [
  59605. // "project",
  59606. // "zone"
  59607. // ],
  59608. // "parameters": {
  59609. // "filter": {
  59610. // "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).",
  59611. // "location": "query",
  59612. // "type": "string"
  59613. // },
  59614. // "maxResults": {
  59615. // "default": "500",
  59616. // "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)",
  59617. // "format": "uint32",
  59618. // "location": "query",
  59619. // "minimum": "0",
  59620. // "type": "integer"
  59621. // },
  59622. // "orderBy": {
  59623. // "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.",
  59624. // "location": "query",
  59625. // "type": "string"
  59626. // },
  59627. // "pageToken": {
  59628. // "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.",
  59629. // "location": "query",
  59630. // "type": "string"
  59631. // },
  59632. // "project": {
  59633. // "description": "Project ID for this request.",
  59634. // "location": "path",
  59635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59636. // "required": true,
  59637. // "type": "string"
  59638. // },
  59639. // "zone": {
  59640. // "description": "The name of the zone for this request.",
  59641. // "location": "path",
  59642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59643. // "required": true,
  59644. // "type": "string"
  59645. // }
  59646. // },
  59647. // "path": "{project}/zones/{zone}/instances",
  59648. // "response": {
  59649. // "$ref": "InstanceList"
  59650. // },
  59651. // "scopes": [
  59652. // "https://www.googleapis.com/auth/cloud-platform",
  59653. // "https://www.googleapis.com/auth/compute",
  59654. // "https://www.googleapis.com/auth/compute.readonly"
  59655. // ]
  59656. // }
  59657. }
  59658. // Pages invokes f for each page of results.
  59659. // A non-nil error returned from f will halt the iteration.
  59660. // The provided context supersedes any context provided to the Context method.
  59661. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  59662. c.ctx_ = ctx
  59663. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59664. for {
  59665. x, err := c.Do()
  59666. if err != nil {
  59667. return err
  59668. }
  59669. if err := f(x); err != nil {
  59670. return err
  59671. }
  59672. if x.NextPageToken == "" {
  59673. return nil
  59674. }
  59675. c.PageToken(x.NextPageToken)
  59676. }
  59677. }
  59678. // method id "compute.instances.listReferrers":
  59679. type InstancesListReferrersCall struct {
  59680. s *Service
  59681. project string
  59682. zone string
  59683. instance string
  59684. urlParams_ gensupport.URLParams
  59685. ifNoneMatch_ string
  59686. ctx_ context.Context
  59687. header_ http.Header
  59688. }
  59689. // ListReferrers: Retrieves the list of referrers to instances contained
  59690. // within the specified zone. For more information, read Viewing
  59691. // Referrers to VM Instances.
  59692. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  59693. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59694. c.project = project
  59695. c.zone = zone
  59696. c.instance = instance
  59697. return c
  59698. }
  59699. // Filter sets the optional parameter "filter": A filter expression that
  59700. // filters resources listed in the response. The expression must specify
  59701. // the field name, a comparison operator, and the value that you want to
  59702. // use for filtering. The value must be a string, a number, or a
  59703. // boolean. The comparison operator must be either =, !=, >, or <.
  59704. //
  59705. // For example, if you are filtering Compute Engine instances, you can
  59706. // exclude instances named example-instance by specifying name !=
  59707. // example-instance.
  59708. //
  59709. // You can also filter nested fields. For example, you could specify
  59710. // scheduling.automaticRestart = false to include instances only if they
  59711. // are not scheduled for automatic restarts. You can use filtering on
  59712. // nested fields to filter based on resource labels.
  59713. //
  59714. // To filter on multiple expressions, provide each separate expression
  59715. // within parentheses. For example, (scheduling.automaticRestart = true)
  59716. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59717. // AND expression. However, you can include AND and OR expressions
  59718. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59719. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59720. // true).
  59721. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  59722. c.urlParams_.Set("filter", filter)
  59723. return c
  59724. }
  59725. // MaxResults sets the optional parameter "maxResults": The maximum
  59726. // number of results per page that should be returned. If the number of
  59727. // available results is larger than maxResults, Compute Engine returns a
  59728. // nextPageToken that can be used to get the next page of results in
  59729. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59730. // (Default: 500)
  59731. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  59732. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59733. return c
  59734. }
  59735. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59736. // a certain order. By default, results are returned in alphanumerical
  59737. // order based on the resource name.
  59738. //
  59739. // You can also sort results in descending order based on the creation
  59740. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59741. // based on the creationTimestamp field in reverse chronological order
  59742. // (newest result first). Use this to sort resources like operations so
  59743. // that the newest operation is returned first.
  59744. //
  59745. // Currently, only sorting by name or creationTimestamp desc is
  59746. // supported.
  59747. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  59748. c.urlParams_.Set("orderBy", orderBy)
  59749. return c
  59750. }
  59751. // PageToken sets the optional parameter "pageToken": Specifies a page
  59752. // token to use. Set pageToken to the nextPageToken returned by a
  59753. // previous list request to get the next page of results.
  59754. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  59755. c.urlParams_.Set("pageToken", pageToken)
  59756. return c
  59757. }
  59758. // Fields allows partial responses to be retrieved. See
  59759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59760. // for more information.
  59761. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  59762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59763. return c
  59764. }
  59765. // IfNoneMatch sets the optional parameter which makes the operation
  59766. // fail if the object's ETag matches the given value. This is useful for
  59767. // getting updates only after the object has changed since the last
  59768. // request. Use googleapi.IsNotModified to check whether the response
  59769. // error from Do is the result of In-None-Match.
  59770. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  59771. c.ifNoneMatch_ = entityTag
  59772. return c
  59773. }
  59774. // Context sets the context to be used in this call's Do method. Any
  59775. // pending HTTP request will be aborted if the provided context is
  59776. // canceled.
  59777. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  59778. c.ctx_ = ctx
  59779. return c
  59780. }
  59781. // Header returns an http.Header that can be modified by the caller to
  59782. // add HTTP headers to the request.
  59783. func (c *InstancesListReferrersCall) Header() http.Header {
  59784. if c.header_ == nil {
  59785. c.header_ = make(http.Header)
  59786. }
  59787. return c.header_
  59788. }
  59789. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  59790. reqHeaders := make(http.Header)
  59791. for k, v := range c.header_ {
  59792. reqHeaders[k] = v
  59793. }
  59794. reqHeaders.Set("User-Agent", c.s.userAgent())
  59795. if c.ifNoneMatch_ != "" {
  59796. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59797. }
  59798. var body io.Reader = nil
  59799. c.urlParams_.Set("alt", alt)
  59800. c.urlParams_.Set("prettyPrint", "false")
  59801. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  59802. urls += "?" + c.urlParams_.Encode()
  59803. req, err := http.NewRequest("GET", urls, body)
  59804. if err != nil {
  59805. return nil, err
  59806. }
  59807. req.Header = reqHeaders
  59808. googleapi.Expand(req.URL, map[string]string{
  59809. "project": c.project,
  59810. "zone": c.zone,
  59811. "instance": c.instance,
  59812. })
  59813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59814. }
  59815. // Do executes the "compute.instances.listReferrers" call.
  59816. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  59817. // non-2xx status code is an error. Response headers are in either
  59818. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  59819. // returned at all) in error.(*googleapi.Error).Header. Use
  59820. // googleapi.IsNotModified to check whether the returned error was
  59821. // because http.StatusNotModified was returned.
  59822. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  59823. gensupport.SetOptions(c.urlParams_, opts...)
  59824. res, err := c.doRequest("json")
  59825. if res != nil && res.StatusCode == http.StatusNotModified {
  59826. if res.Body != nil {
  59827. res.Body.Close()
  59828. }
  59829. return nil, &googleapi.Error{
  59830. Code: res.StatusCode,
  59831. Header: res.Header,
  59832. }
  59833. }
  59834. if err != nil {
  59835. return nil, err
  59836. }
  59837. defer googleapi.CloseBody(res)
  59838. if err := googleapi.CheckResponse(res); err != nil {
  59839. return nil, err
  59840. }
  59841. ret := &InstanceListReferrers{
  59842. ServerResponse: googleapi.ServerResponse{
  59843. Header: res.Header,
  59844. HTTPStatusCode: res.StatusCode,
  59845. },
  59846. }
  59847. target := &ret
  59848. if err := gensupport.DecodeResponse(target, res); err != nil {
  59849. return nil, err
  59850. }
  59851. return ret, nil
  59852. // {
  59853. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  59854. // "httpMethod": "GET",
  59855. // "id": "compute.instances.listReferrers",
  59856. // "parameterOrder": [
  59857. // "project",
  59858. // "zone",
  59859. // "instance"
  59860. // ],
  59861. // "parameters": {
  59862. // "filter": {
  59863. // "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).",
  59864. // "location": "query",
  59865. // "type": "string"
  59866. // },
  59867. // "instance": {
  59868. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  59869. // "location": "path",
  59870. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59871. // "required": true,
  59872. // "type": "string"
  59873. // },
  59874. // "maxResults": {
  59875. // "default": "500",
  59876. // "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)",
  59877. // "format": "uint32",
  59878. // "location": "query",
  59879. // "minimum": "0",
  59880. // "type": "integer"
  59881. // },
  59882. // "orderBy": {
  59883. // "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.",
  59884. // "location": "query",
  59885. // "type": "string"
  59886. // },
  59887. // "pageToken": {
  59888. // "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.",
  59889. // "location": "query",
  59890. // "type": "string"
  59891. // },
  59892. // "project": {
  59893. // "description": "Project ID for this request.",
  59894. // "location": "path",
  59895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59896. // "required": true,
  59897. // "type": "string"
  59898. // },
  59899. // "zone": {
  59900. // "description": "The name of the zone for this request.",
  59901. // "location": "path",
  59902. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59903. // "required": true,
  59904. // "type": "string"
  59905. // }
  59906. // },
  59907. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  59908. // "response": {
  59909. // "$ref": "InstanceListReferrers"
  59910. // },
  59911. // "scopes": [
  59912. // "https://www.googleapis.com/auth/cloud-platform",
  59913. // "https://www.googleapis.com/auth/compute",
  59914. // "https://www.googleapis.com/auth/compute.readonly"
  59915. // ]
  59916. // }
  59917. }
  59918. // Pages invokes f for each page of results.
  59919. // A non-nil error returned from f will halt the iteration.
  59920. // The provided context supersedes any context provided to the Context method.
  59921. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  59922. c.ctx_ = ctx
  59923. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59924. for {
  59925. x, err := c.Do()
  59926. if err != nil {
  59927. return err
  59928. }
  59929. if err := f(x); err != nil {
  59930. return err
  59931. }
  59932. if x.NextPageToken == "" {
  59933. return nil
  59934. }
  59935. c.PageToken(x.NextPageToken)
  59936. }
  59937. }
  59938. // method id "compute.instances.reset":
  59939. type InstancesResetCall struct {
  59940. s *Service
  59941. project string
  59942. zone string
  59943. instance string
  59944. urlParams_ gensupport.URLParams
  59945. ctx_ context.Context
  59946. header_ http.Header
  59947. }
  59948. // Reset: Performs a reset on the instance. For more information, see
  59949. // Resetting an instance.
  59950. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  59951. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  59952. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59953. c.project = project
  59954. c.zone = zone
  59955. c.instance = instance
  59956. return c
  59957. }
  59958. // RequestId sets the optional parameter "requestId": An optional
  59959. // request ID to identify requests. Specify a unique request ID so that
  59960. // if you must retry your request, the server will know to ignore the
  59961. // request if it has already been completed.
  59962. //
  59963. // For example, consider a situation where you make an initial request
  59964. // and the request times out. If you make the request again with the
  59965. // same request ID, the server can check if original operation with the
  59966. // same request ID was received, and if so, will ignore the second
  59967. // request. This prevents clients from accidentally creating duplicate
  59968. // commitments.
  59969. //
  59970. // The request ID must be a valid UUID with the exception that zero UUID
  59971. // is not supported (00000000-0000-0000-0000-000000000000).
  59972. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  59973. c.urlParams_.Set("requestId", requestId)
  59974. return c
  59975. }
  59976. // Fields allows partial responses to be retrieved. See
  59977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59978. // for more information.
  59979. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  59980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59981. return c
  59982. }
  59983. // Context sets the context to be used in this call's Do method. Any
  59984. // pending HTTP request will be aborted if the provided context is
  59985. // canceled.
  59986. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  59987. c.ctx_ = ctx
  59988. return c
  59989. }
  59990. // Header returns an http.Header that can be modified by the caller to
  59991. // add HTTP headers to the request.
  59992. func (c *InstancesResetCall) Header() http.Header {
  59993. if c.header_ == nil {
  59994. c.header_ = make(http.Header)
  59995. }
  59996. return c.header_
  59997. }
  59998. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  59999. reqHeaders := make(http.Header)
  60000. for k, v := range c.header_ {
  60001. reqHeaders[k] = v
  60002. }
  60003. reqHeaders.Set("User-Agent", c.s.userAgent())
  60004. var body io.Reader = nil
  60005. c.urlParams_.Set("alt", alt)
  60006. c.urlParams_.Set("prettyPrint", "false")
  60007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  60008. urls += "?" + c.urlParams_.Encode()
  60009. req, err := http.NewRequest("POST", urls, body)
  60010. if err != nil {
  60011. return nil, err
  60012. }
  60013. req.Header = reqHeaders
  60014. googleapi.Expand(req.URL, map[string]string{
  60015. "project": c.project,
  60016. "zone": c.zone,
  60017. "instance": c.instance,
  60018. })
  60019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60020. }
  60021. // Do executes the "compute.instances.reset" call.
  60022. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60023. // status code is an error. Response headers are in either
  60024. // *Operation.ServerResponse.Header or (if a response was returned at
  60025. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60026. // to check whether the returned error was because
  60027. // http.StatusNotModified was returned.
  60028. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60029. gensupport.SetOptions(c.urlParams_, opts...)
  60030. res, err := c.doRequest("json")
  60031. if res != nil && res.StatusCode == http.StatusNotModified {
  60032. if res.Body != nil {
  60033. res.Body.Close()
  60034. }
  60035. return nil, &googleapi.Error{
  60036. Code: res.StatusCode,
  60037. Header: res.Header,
  60038. }
  60039. }
  60040. if err != nil {
  60041. return nil, err
  60042. }
  60043. defer googleapi.CloseBody(res)
  60044. if err := googleapi.CheckResponse(res); err != nil {
  60045. return nil, err
  60046. }
  60047. ret := &Operation{
  60048. ServerResponse: googleapi.ServerResponse{
  60049. Header: res.Header,
  60050. HTTPStatusCode: res.StatusCode,
  60051. },
  60052. }
  60053. target := &ret
  60054. if err := gensupport.DecodeResponse(target, res); err != nil {
  60055. return nil, err
  60056. }
  60057. return ret, nil
  60058. // {
  60059. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  60060. // "httpMethod": "POST",
  60061. // "id": "compute.instances.reset",
  60062. // "parameterOrder": [
  60063. // "project",
  60064. // "zone",
  60065. // "instance"
  60066. // ],
  60067. // "parameters": {
  60068. // "instance": {
  60069. // "description": "Name of the instance scoping this request.",
  60070. // "location": "path",
  60071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60072. // "required": true,
  60073. // "type": "string"
  60074. // },
  60075. // "project": {
  60076. // "description": "Project ID for this request.",
  60077. // "location": "path",
  60078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60079. // "required": true,
  60080. // "type": "string"
  60081. // },
  60082. // "requestId": {
  60083. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60084. // "location": "query",
  60085. // "type": "string"
  60086. // },
  60087. // "zone": {
  60088. // "description": "The name of the zone for this request.",
  60089. // "location": "path",
  60090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60091. // "required": true,
  60092. // "type": "string"
  60093. // }
  60094. // },
  60095. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  60096. // "response": {
  60097. // "$ref": "Operation"
  60098. // },
  60099. // "scopes": [
  60100. // "https://www.googleapis.com/auth/cloud-platform",
  60101. // "https://www.googleapis.com/auth/compute"
  60102. // ]
  60103. // }
  60104. }
  60105. // method id "compute.instances.resume":
  60106. type InstancesResumeCall struct {
  60107. s *Service
  60108. project string
  60109. zone string
  60110. instance string
  60111. instancesresumerequest *InstancesResumeRequest
  60112. urlParams_ gensupport.URLParams
  60113. ctx_ context.Context
  60114. header_ http.Header
  60115. }
  60116. // Resume: Resumes an instance that was suspended using the
  60117. // instances().suspend method.
  60118. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  60119. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60120. c.project = project
  60121. c.zone = zone
  60122. c.instance = instance
  60123. c.instancesresumerequest = instancesresumerequest
  60124. return c
  60125. }
  60126. // RequestId sets the optional parameter "requestId": An optional
  60127. // request ID to identify requests. Specify a unique request ID so that
  60128. // if you must retry your request, the server will know to ignore the
  60129. // request if it has already been completed.
  60130. //
  60131. // For example, consider a situation where you make an initial request
  60132. // and the request times out. If you make the request again with the
  60133. // same request ID, the server can check if original operation with the
  60134. // same request ID was received, and if so, will ignore the second
  60135. // request. This prevents clients from accidentally creating duplicate
  60136. // commitments.
  60137. //
  60138. // The request ID must be a valid UUID with the exception that zero UUID
  60139. // is not supported (00000000-0000-0000-0000-000000000000).
  60140. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  60141. c.urlParams_.Set("requestId", requestId)
  60142. return c
  60143. }
  60144. // Fields allows partial responses to be retrieved. See
  60145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60146. // for more information.
  60147. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  60148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60149. return c
  60150. }
  60151. // Context sets the context to be used in this call's Do method. Any
  60152. // pending HTTP request will be aborted if the provided context is
  60153. // canceled.
  60154. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  60155. c.ctx_ = ctx
  60156. return c
  60157. }
  60158. // Header returns an http.Header that can be modified by the caller to
  60159. // add HTTP headers to the request.
  60160. func (c *InstancesResumeCall) Header() http.Header {
  60161. if c.header_ == nil {
  60162. c.header_ = make(http.Header)
  60163. }
  60164. return c.header_
  60165. }
  60166. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  60167. reqHeaders := make(http.Header)
  60168. for k, v := range c.header_ {
  60169. reqHeaders[k] = v
  60170. }
  60171. reqHeaders.Set("User-Agent", c.s.userAgent())
  60172. var body io.Reader = nil
  60173. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  60174. if err != nil {
  60175. return nil, err
  60176. }
  60177. reqHeaders.Set("Content-Type", "application/json")
  60178. c.urlParams_.Set("alt", alt)
  60179. c.urlParams_.Set("prettyPrint", "false")
  60180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  60181. urls += "?" + c.urlParams_.Encode()
  60182. req, err := http.NewRequest("POST", urls, body)
  60183. if err != nil {
  60184. return nil, err
  60185. }
  60186. req.Header = reqHeaders
  60187. googleapi.Expand(req.URL, map[string]string{
  60188. "project": c.project,
  60189. "zone": c.zone,
  60190. "instance": c.instance,
  60191. })
  60192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60193. }
  60194. // Do executes the "compute.instances.resume" call.
  60195. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60196. // status code is an error. Response headers are in either
  60197. // *Operation.ServerResponse.Header or (if a response was returned at
  60198. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60199. // to check whether the returned error was because
  60200. // http.StatusNotModified was returned.
  60201. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60202. gensupport.SetOptions(c.urlParams_, opts...)
  60203. res, err := c.doRequest("json")
  60204. if res != nil && res.StatusCode == http.StatusNotModified {
  60205. if res.Body != nil {
  60206. res.Body.Close()
  60207. }
  60208. return nil, &googleapi.Error{
  60209. Code: res.StatusCode,
  60210. Header: res.Header,
  60211. }
  60212. }
  60213. if err != nil {
  60214. return nil, err
  60215. }
  60216. defer googleapi.CloseBody(res)
  60217. if err := googleapi.CheckResponse(res); err != nil {
  60218. return nil, err
  60219. }
  60220. ret := &Operation{
  60221. ServerResponse: googleapi.ServerResponse{
  60222. Header: res.Header,
  60223. HTTPStatusCode: res.StatusCode,
  60224. },
  60225. }
  60226. target := &ret
  60227. if err := gensupport.DecodeResponse(target, res); err != nil {
  60228. return nil, err
  60229. }
  60230. return ret, nil
  60231. // {
  60232. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  60233. // "httpMethod": "POST",
  60234. // "id": "compute.instances.resume",
  60235. // "parameterOrder": [
  60236. // "project",
  60237. // "zone",
  60238. // "instance"
  60239. // ],
  60240. // "parameters": {
  60241. // "instance": {
  60242. // "description": "Name of the instance resource to resume.",
  60243. // "location": "path",
  60244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60245. // "required": true,
  60246. // "type": "string"
  60247. // },
  60248. // "project": {
  60249. // "description": "Project ID for this request.",
  60250. // "location": "path",
  60251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60252. // "required": true,
  60253. // "type": "string"
  60254. // },
  60255. // "requestId": {
  60256. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60257. // "location": "query",
  60258. // "type": "string"
  60259. // },
  60260. // "zone": {
  60261. // "description": "The name of the zone for this request.",
  60262. // "location": "path",
  60263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60264. // "required": true,
  60265. // "type": "string"
  60266. // }
  60267. // },
  60268. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  60269. // "request": {
  60270. // "$ref": "InstancesResumeRequest"
  60271. // },
  60272. // "response": {
  60273. // "$ref": "Operation"
  60274. // },
  60275. // "scopes": [
  60276. // "https://www.googleapis.com/auth/cloud-platform",
  60277. // "https://www.googleapis.com/auth/compute"
  60278. // ]
  60279. // }
  60280. }
  60281. // method id "compute.instances.setDeletionProtection":
  60282. type InstancesSetDeletionProtectionCall struct {
  60283. s *Service
  60284. project string
  60285. zone string
  60286. resource string
  60287. urlParams_ gensupport.URLParams
  60288. ctx_ context.Context
  60289. header_ http.Header
  60290. }
  60291. // SetDeletionProtection: Sets deletion protection on the instance.
  60292. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  60293. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60294. c.project = project
  60295. c.zone = zone
  60296. c.resource = resource
  60297. return c
  60298. }
  60299. // DeletionProtection sets the optional parameter "deletionProtection":
  60300. // Whether the resource should be protected against deletion.
  60301. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  60302. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  60303. return c
  60304. }
  60305. // RequestId sets the optional parameter "requestId": An optional
  60306. // request ID to identify requests. Specify a unique request ID so that
  60307. // if you must retry your request, the server will know to ignore the
  60308. // request if it has already been completed.
  60309. //
  60310. // For example, consider a situation where you make an initial request
  60311. // and the request times out. If you make the request again with the
  60312. // same request ID, the server can check if original operation with the
  60313. // same request ID was received, and if so, will ignore the second
  60314. // request. This prevents clients from accidentally creating duplicate
  60315. // commitments.
  60316. //
  60317. // The request ID must be a valid UUID with the exception that zero UUID
  60318. // is not supported (00000000-0000-0000-0000-000000000000).
  60319. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  60320. c.urlParams_.Set("requestId", requestId)
  60321. return c
  60322. }
  60323. // Fields allows partial responses to be retrieved. See
  60324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60325. // for more information.
  60326. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  60327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60328. return c
  60329. }
  60330. // Context sets the context to be used in this call's Do method. Any
  60331. // pending HTTP request will be aborted if the provided context is
  60332. // canceled.
  60333. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  60334. c.ctx_ = ctx
  60335. return c
  60336. }
  60337. // Header returns an http.Header that can be modified by the caller to
  60338. // add HTTP headers to the request.
  60339. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  60340. if c.header_ == nil {
  60341. c.header_ = make(http.Header)
  60342. }
  60343. return c.header_
  60344. }
  60345. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  60346. reqHeaders := make(http.Header)
  60347. for k, v := range c.header_ {
  60348. reqHeaders[k] = v
  60349. }
  60350. reqHeaders.Set("User-Agent", c.s.userAgent())
  60351. var body io.Reader = nil
  60352. c.urlParams_.Set("alt", alt)
  60353. c.urlParams_.Set("prettyPrint", "false")
  60354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  60355. urls += "?" + c.urlParams_.Encode()
  60356. req, err := http.NewRequest("POST", urls, body)
  60357. if err != nil {
  60358. return nil, err
  60359. }
  60360. req.Header = reqHeaders
  60361. googleapi.Expand(req.URL, map[string]string{
  60362. "project": c.project,
  60363. "zone": c.zone,
  60364. "resource": c.resource,
  60365. })
  60366. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60367. }
  60368. // Do executes the "compute.instances.setDeletionProtection" call.
  60369. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60370. // status code is an error. Response headers are in either
  60371. // *Operation.ServerResponse.Header or (if a response was returned at
  60372. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60373. // to check whether the returned error was because
  60374. // http.StatusNotModified was returned.
  60375. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60376. gensupport.SetOptions(c.urlParams_, opts...)
  60377. res, err := c.doRequest("json")
  60378. if res != nil && res.StatusCode == http.StatusNotModified {
  60379. if res.Body != nil {
  60380. res.Body.Close()
  60381. }
  60382. return nil, &googleapi.Error{
  60383. Code: res.StatusCode,
  60384. Header: res.Header,
  60385. }
  60386. }
  60387. if err != nil {
  60388. return nil, err
  60389. }
  60390. defer googleapi.CloseBody(res)
  60391. if err := googleapi.CheckResponse(res); err != nil {
  60392. return nil, err
  60393. }
  60394. ret := &Operation{
  60395. ServerResponse: googleapi.ServerResponse{
  60396. Header: res.Header,
  60397. HTTPStatusCode: res.StatusCode,
  60398. },
  60399. }
  60400. target := &ret
  60401. if err := gensupport.DecodeResponse(target, res); err != nil {
  60402. return nil, err
  60403. }
  60404. return ret, nil
  60405. // {
  60406. // "description": "Sets deletion protection on the instance.",
  60407. // "httpMethod": "POST",
  60408. // "id": "compute.instances.setDeletionProtection",
  60409. // "parameterOrder": [
  60410. // "project",
  60411. // "zone",
  60412. // "resource"
  60413. // ],
  60414. // "parameters": {
  60415. // "deletionProtection": {
  60416. // "default": "true",
  60417. // "description": "Whether the resource should be protected against deletion.",
  60418. // "location": "query",
  60419. // "type": "boolean"
  60420. // },
  60421. // "project": {
  60422. // "description": "Project ID for this request.",
  60423. // "location": "path",
  60424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60425. // "required": true,
  60426. // "type": "string"
  60427. // },
  60428. // "requestId": {
  60429. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60430. // "location": "query",
  60431. // "type": "string"
  60432. // },
  60433. // "resource": {
  60434. // "description": "Name or id of the resource for this request.",
  60435. // "location": "path",
  60436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60437. // "required": true,
  60438. // "type": "string"
  60439. // },
  60440. // "zone": {
  60441. // "description": "The name of the zone for this request.",
  60442. // "location": "path",
  60443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60444. // "required": true,
  60445. // "type": "string"
  60446. // }
  60447. // },
  60448. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  60449. // "response": {
  60450. // "$ref": "Operation"
  60451. // },
  60452. // "scopes": [
  60453. // "https://www.googleapis.com/auth/cloud-platform",
  60454. // "https://www.googleapis.com/auth/compute"
  60455. // ]
  60456. // }
  60457. }
  60458. // method id "compute.instances.setDiskAutoDelete":
  60459. type InstancesSetDiskAutoDeleteCall struct {
  60460. s *Service
  60461. project string
  60462. zone string
  60463. instance string
  60464. urlParams_ gensupport.URLParams
  60465. ctx_ context.Context
  60466. header_ http.Header
  60467. }
  60468. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  60469. // an instance.
  60470. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  60471. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  60472. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60473. c.project = project
  60474. c.zone = zone
  60475. c.instance = instance
  60476. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  60477. c.urlParams_.Set("deviceName", deviceName)
  60478. return c
  60479. }
  60480. // RequestId sets the optional parameter "requestId": An optional
  60481. // request ID to identify requests. Specify a unique request ID so that
  60482. // if you must retry your request, the server will know to ignore the
  60483. // request if it has already been completed.
  60484. //
  60485. // For example, consider a situation where you make an initial request
  60486. // and the request times out. If you make the request again with the
  60487. // same request ID, the server can check if original operation with the
  60488. // same request ID was received, and if so, will ignore the second
  60489. // request. This prevents clients from accidentally creating duplicate
  60490. // commitments.
  60491. //
  60492. // The request ID must be a valid UUID with the exception that zero UUID
  60493. // is not supported (00000000-0000-0000-0000-000000000000).
  60494. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  60495. c.urlParams_.Set("requestId", requestId)
  60496. return c
  60497. }
  60498. // Fields allows partial responses to be retrieved. See
  60499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60500. // for more information.
  60501. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  60502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60503. return c
  60504. }
  60505. // Context sets the context to be used in this call's Do method. Any
  60506. // pending HTTP request will be aborted if the provided context is
  60507. // canceled.
  60508. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  60509. c.ctx_ = ctx
  60510. return c
  60511. }
  60512. // Header returns an http.Header that can be modified by the caller to
  60513. // add HTTP headers to the request.
  60514. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  60515. if c.header_ == nil {
  60516. c.header_ = make(http.Header)
  60517. }
  60518. return c.header_
  60519. }
  60520. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  60521. reqHeaders := make(http.Header)
  60522. for k, v := range c.header_ {
  60523. reqHeaders[k] = v
  60524. }
  60525. reqHeaders.Set("User-Agent", c.s.userAgent())
  60526. var body io.Reader = nil
  60527. c.urlParams_.Set("alt", alt)
  60528. c.urlParams_.Set("prettyPrint", "false")
  60529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  60530. urls += "?" + c.urlParams_.Encode()
  60531. req, err := http.NewRequest("POST", urls, body)
  60532. if err != nil {
  60533. return nil, err
  60534. }
  60535. req.Header = reqHeaders
  60536. googleapi.Expand(req.URL, map[string]string{
  60537. "project": c.project,
  60538. "zone": c.zone,
  60539. "instance": c.instance,
  60540. })
  60541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60542. }
  60543. // Do executes the "compute.instances.setDiskAutoDelete" call.
  60544. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60545. // status code is an error. Response headers are in either
  60546. // *Operation.ServerResponse.Header or (if a response was returned at
  60547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60548. // to check whether the returned error was because
  60549. // http.StatusNotModified was returned.
  60550. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60551. gensupport.SetOptions(c.urlParams_, opts...)
  60552. res, err := c.doRequest("json")
  60553. if res != nil && res.StatusCode == http.StatusNotModified {
  60554. if res.Body != nil {
  60555. res.Body.Close()
  60556. }
  60557. return nil, &googleapi.Error{
  60558. Code: res.StatusCode,
  60559. Header: res.Header,
  60560. }
  60561. }
  60562. if err != nil {
  60563. return nil, err
  60564. }
  60565. defer googleapi.CloseBody(res)
  60566. if err := googleapi.CheckResponse(res); err != nil {
  60567. return nil, err
  60568. }
  60569. ret := &Operation{
  60570. ServerResponse: googleapi.ServerResponse{
  60571. Header: res.Header,
  60572. HTTPStatusCode: res.StatusCode,
  60573. },
  60574. }
  60575. target := &ret
  60576. if err := gensupport.DecodeResponse(target, res); err != nil {
  60577. return nil, err
  60578. }
  60579. return ret, nil
  60580. // {
  60581. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  60582. // "httpMethod": "POST",
  60583. // "id": "compute.instances.setDiskAutoDelete",
  60584. // "parameterOrder": [
  60585. // "project",
  60586. // "zone",
  60587. // "instance",
  60588. // "autoDelete",
  60589. // "deviceName"
  60590. // ],
  60591. // "parameters": {
  60592. // "autoDelete": {
  60593. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  60594. // "location": "query",
  60595. // "required": true,
  60596. // "type": "boolean"
  60597. // },
  60598. // "deviceName": {
  60599. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  60600. // "location": "query",
  60601. // "pattern": "\\w[\\w.-]{0,254}",
  60602. // "required": true,
  60603. // "type": "string"
  60604. // },
  60605. // "instance": {
  60606. // "description": "The instance name for this request.",
  60607. // "location": "path",
  60608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60609. // "required": true,
  60610. // "type": "string"
  60611. // },
  60612. // "project": {
  60613. // "description": "Project ID for this request.",
  60614. // "location": "path",
  60615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60616. // "required": true,
  60617. // "type": "string"
  60618. // },
  60619. // "requestId": {
  60620. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60621. // "location": "query",
  60622. // "type": "string"
  60623. // },
  60624. // "zone": {
  60625. // "description": "The name of the zone for this request.",
  60626. // "location": "path",
  60627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60628. // "required": true,
  60629. // "type": "string"
  60630. // }
  60631. // },
  60632. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  60633. // "response": {
  60634. // "$ref": "Operation"
  60635. // },
  60636. // "scopes": [
  60637. // "https://www.googleapis.com/auth/cloud-platform",
  60638. // "https://www.googleapis.com/auth/compute"
  60639. // ]
  60640. // }
  60641. }
  60642. // method id "compute.instances.setIamPolicy":
  60643. type InstancesSetIamPolicyCall struct {
  60644. s *Service
  60645. project string
  60646. zone string
  60647. resource string
  60648. zonesetpolicyrequest *ZoneSetPolicyRequest
  60649. urlParams_ gensupport.URLParams
  60650. ctx_ context.Context
  60651. header_ http.Header
  60652. }
  60653. // SetIamPolicy: Sets the access control policy on the specified
  60654. // resource. Replaces any existing policy.
  60655. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  60656. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60657. c.project = project
  60658. c.zone = zone
  60659. c.resource = resource
  60660. c.zonesetpolicyrequest = zonesetpolicyrequest
  60661. return c
  60662. }
  60663. // Fields allows partial responses to be retrieved. See
  60664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60665. // for more information.
  60666. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  60667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60668. return c
  60669. }
  60670. // Context sets the context to be used in this call's Do method. Any
  60671. // pending HTTP request will be aborted if the provided context is
  60672. // canceled.
  60673. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  60674. c.ctx_ = ctx
  60675. return c
  60676. }
  60677. // Header returns an http.Header that can be modified by the caller to
  60678. // add HTTP headers to the request.
  60679. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  60680. if c.header_ == nil {
  60681. c.header_ = make(http.Header)
  60682. }
  60683. return c.header_
  60684. }
  60685. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  60686. reqHeaders := make(http.Header)
  60687. for k, v := range c.header_ {
  60688. reqHeaders[k] = v
  60689. }
  60690. reqHeaders.Set("User-Agent", c.s.userAgent())
  60691. var body io.Reader = nil
  60692. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  60693. if err != nil {
  60694. return nil, err
  60695. }
  60696. reqHeaders.Set("Content-Type", "application/json")
  60697. c.urlParams_.Set("alt", alt)
  60698. c.urlParams_.Set("prettyPrint", "false")
  60699. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  60700. urls += "?" + c.urlParams_.Encode()
  60701. req, err := http.NewRequest("POST", urls, body)
  60702. if err != nil {
  60703. return nil, err
  60704. }
  60705. req.Header = reqHeaders
  60706. googleapi.Expand(req.URL, map[string]string{
  60707. "project": c.project,
  60708. "zone": c.zone,
  60709. "resource": c.resource,
  60710. })
  60711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60712. }
  60713. // Do executes the "compute.instances.setIamPolicy" call.
  60714. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  60715. // code is an error. Response headers are in either
  60716. // *Policy.ServerResponse.Header or (if a response was returned at all)
  60717. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  60718. // check whether the returned error was because http.StatusNotModified
  60719. // was returned.
  60720. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  60721. gensupport.SetOptions(c.urlParams_, opts...)
  60722. res, err := c.doRequest("json")
  60723. if res != nil && res.StatusCode == http.StatusNotModified {
  60724. if res.Body != nil {
  60725. res.Body.Close()
  60726. }
  60727. return nil, &googleapi.Error{
  60728. Code: res.StatusCode,
  60729. Header: res.Header,
  60730. }
  60731. }
  60732. if err != nil {
  60733. return nil, err
  60734. }
  60735. defer googleapi.CloseBody(res)
  60736. if err := googleapi.CheckResponse(res); err != nil {
  60737. return nil, err
  60738. }
  60739. ret := &Policy{
  60740. ServerResponse: googleapi.ServerResponse{
  60741. Header: res.Header,
  60742. HTTPStatusCode: res.StatusCode,
  60743. },
  60744. }
  60745. target := &ret
  60746. if err := gensupport.DecodeResponse(target, res); err != nil {
  60747. return nil, err
  60748. }
  60749. return ret, nil
  60750. // {
  60751. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  60752. // "httpMethod": "POST",
  60753. // "id": "compute.instances.setIamPolicy",
  60754. // "parameterOrder": [
  60755. // "project",
  60756. // "zone",
  60757. // "resource"
  60758. // ],
  60759. // "parameters": {
  60760. // "project": {
  60761. // "description": "Project ID for this request.",
  60762. // "location": "path",
  60763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60764. // "required": true,
  60765. // "type": "string"
  60766. // },
  60767. // "resource": {
  60768. // "description": "Name or id of the resource for this request.",
  60769. // "location": "path",
  60770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60771. // "required": true,
  60772. // "type": "string"
  60773. // },
  60774. // "zone": {
  60775. // "description": "The name of the zone for this request.",
  60776. // "location": "path",
  60777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60778. // "required": true,
  60779. // "type": "string"
  60780. // }
  60781. // },
  60782. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  60783. // "request": {
  60784. // "$ref": "ZoneSetPolicyRequest"
  60785. // },
  60786. // "response": {
  60787. // "$ref": "Policy"
  60788. // },
  60789. // "scopes": [
  60790. // "https://www.googleapis.com/auth/cloud-platform",
  60791. // "https://www.googleapis.com/auth/compute"
  60792. // ]
  60793. // }
  60794. }
  60795. // method id "compute.instances.setLabels":
  60796. type InstancesSetLabelsCall struct {
  60797. s *Service
  60798. project string
  60799. zone string
  60800. instance string
  60801. instancessetlabelsrequest *InstancesSetLabelsRequest
  60802. urlParams_ gensupport.URLParams
  60803. ctx_ context.Context
  60804. header_ http.Header
  60805. }
  60806. // SetLabels: Sets labels on an instance. To learn more about labels,
  60807. // read the Labeling Resources documentation.
  60808. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  60809. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60810. c.project = project
  60811. c.zone = zone
  60812. c.instance = instance
  60813. c.instancessetlabelsrequest = instancessetlabelsrequest
  60814. return c
  60815. }
  60816. // RequestId sets the optional parameter "requestId": An optional
  60817. // request ID to identify requests. Specify a unique request ID so that
  60818. // if you must retry your request, the server will know to ignore the
  60819. // request if it has already been completed.
  60820. //
  60821. // For example, consider a situation where you make an initial request
  60822. // and the request times out. If you make the request again with the
  60823. // same request ID, the server can check if original operation with the
  60824. // same request ID was received, and if so, will ignore the second
  60825. // request. This prevents clients from accidentally creating duplicate
  60826. // commitments.
  60827. //
  60828. // The request ID must be a valid UUID with the exception that zero UUID
  60829. // is not supported (00000000-0000-0000-0000-000000000000).
  60830. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  60831. c.urlParams_.Set("requestId", requestId)
  60832. return c
  60833. }
  60834. // Fields allows partial responses to be retrieved. See
  60835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60836. // for more information.
  60837. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  60838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60839. return c
  60840. }
  60841. // Context sets the context to be used in this call's Do method. Any
  60842. // pending HTTP request will be aborted if the provided context is
  60843. // canceled.
  60844. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  60845. c.ctx_ = ctx
  60846. return c
  60847. }
  60848. // Header returns an http.Header that can be modified by the caller to
  60849. // add HTTP headers to the request.
  60850. func (c *InstancesSetLabelsCall) Header() http.Header {
  60851. if c.header_ == nil {
  60852. c.header_ = make(http.Header)
  60853. }
  60854. return c.header_
  60855. }
  60856. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  60857. reqHeaders := make(http.Header)
  60858. for k, v := range c.header_ {
  60859. reqHeaders[k] = v
  60860. }
  60861. reqHeaders.Set("User-Agent", c.s.userAgent())
  60862. var body io.Reader = nil
  60863. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  60864. if err != nil {
  60865. return nil, err
  60866. }
  60867. reqHeaders.Set("Content-Type", "application/json")
  60868. c.urlParams_.Set("alt", alt)
  60869. c.urlParams_.Set("prettyPrint", "false")
  60870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  60871. urls += "?" + c.urlParams_.Encode()
  60872. req, err := http.NewRequest("POST", urls, body)
  60873. if err != nil {
  60874. return nil, err
  60875. }
  60876. req.Header = reqHeaders
  60877. googleapi.Expand(req.URL, map[string]string{
  60878. "project": c.project,
  60879. "zone": c.zone,
  60880. "instance": c.instance,
  60881. })
  60882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60883. }
  60884. // Do executes the "compute.instances.setLabels" call.
  60885. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60886. // status code is an error. Response headers are in either
  60887. // *Operation.ServerResponse.Header or (if a response was returned at
  60888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60889. // to check whether the returned error was because
  60890. // http.StatusNotModified was returned.
  60891. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60892. gensupport.SetOptions(c.urlParams_, opts...)
  60893. res, err := c.doRequest("json")
  60894. if res != nil && res.StatusCode == http.StatusNotModified {
  60895. if res.Body != nil {
  60896. res.Body.Close()
  60897. }
  60898. return nil, &googleapi.Error{
  60899. Code: res.StatusCode,
  60900. Header: res.Header,
  60901. }
  60902. }
  60903. if err != nil {
  60904. return nil, err
  60905. }
  60906. defer googleapi.CloseBody(res)
  60907. if err := googleapi.CheckResponse(res); err != nil {
  60908. return nil, err
  60909. }
  60910. ret := &Operation{
  60911. ServerResponse: googleapi.ServerResponse{
  60912. Header: res.Header,
  60913. HTTPStatusCode: res.StatusCode,
  60914. },
  60915. }
  60916. target := &ret
  60917. if err := gensupport.DecodeResponse(target, res); err != nil {
  60918. return nil, err
  60919. }
  60920. return ret, nil
  60921. // {
  60922. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  60923. // "httpMethod": "POST",
  60924. // "id": "compute.instances.setLabels",
  60925. // "parameterOrder": [
  60926. // "project",
  60927. // "zone",
  60928. // "instance"
  60929. // ],
  60930. // "parameters": {
  60931. // "instance": {
  60932. // "description": "Name of the instance scoping this request.",
  60933. // "location": "path",
  60934. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60935. // "required": true,
  60936. // "type": "string"
  60937. // },
  60938. // "project": {
  60939. // "description": "Project ID for this request.",
  60940. // "location": "path",
  60941. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60942. // "required": true,
  60943. // "type": "string"
  60944. // },
  60945. // "requestId": {
  60946. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60947. // "location": "query",
  60948. // "type": "string"
  60949. // },
  60950. // "zone": {
  60951. // "description": "The name of the zone for this request.",
  60952. // "location": "path",
  60953. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60954. // "required": true,
  60955. // "type": "string"
  60956. // }
  60957. // },
  60958. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  60959. // "request": {
  60960. // "$ref": "InstancesSetLabelsRequest"
  60961. // },
  60962. // "response": {
  60963. // "$ref": "Operation"
  60964. // },
  60965. // "scopes": [
  60966. // "https://www.googleapis.com/auth/cloud-platform",
  60967. // "https://www.googleapis.com/auth/compute"
  60968. // ]
  60969. // }
  60970. }
  60971. // method id "compute.instances.setMachineResources":
  60972. type InstancesSetMachineResourcesCall struct {
  60973. s *Service
  60974. project string
  60975. zone string
  60976. instance string
  60977. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  60978. urlParams_ gensupport.URLParams
  60979. ctx_ context.Context
  60980. header_ http.Header
  60981. }
  60982. // SetMachineResources: Changes the number and/or type of accelerator
  60983. // for a stopped instance to the values specified in the request.
  60984. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  60985. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60986. c.project = project
  60987. c.zone = zone
  60988. c.instance = instance
  60989. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  60990. return c
  60991. }
  60992. // RequestId sets the optional parameter "requestId": An optional
  60993. // request ID to identify requests. Specify a unique request ID so that
  60994. // if you must retry your request, the server will know to ignore the
  60995. // request if it has already been completed.
  60996. //
  60997. // For example, consider a situation where you make an initial request
  60998. // and the request times out. If you make the request again with the
  60999. // same request ID, the server can check if original operation with the
  61000. // same request ID was received, and if so, will ignore the second
  61001. // request. This prevents clients from accidentally creating duplicate
  61002. // commitments.
  61003. //
  61004. // The request ID must be a valid UUID with the exception that zero UUID
  61005. // is not supported (00000000-0000-0000-0000-000000000000).
  61006. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  61007. c.urlParams_.Set("requestId", requestId)
  61008. return c
  61009. }
  61010. // Fields allows partial responses to be retrieved. See
  61011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61012. // for more information.
  61013. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  61014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61015. return c
  61016. }
  61017. // Context sets the context to be used in this call's Do method. Any
  61018. // pending HTTP request will be aborted if the provided context is
  61019. // canceled.
  61020. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  61021. c.ctx_ = ctx
  61022. return c
  61023. }
  61024. // Header returns an http.Header that can be modified by the caller to
  61025. // add HTTP headers to the request.
  61026. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  61027. if c.header_ == nil {
  61028. c.header_ = make(http.Header)
  61029. }
  61030. return c.header_
  61031. }
  61032. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  61033. reqHeaders := make(http.Header)
  61034. for k, v := range c.header_ {
  61035. reqHeaders[k] = v
  61036. }
  61037. reqHeaders.Set("User-Agent", c.s.userAgent())
  61038. var body io.Reader = nil
  61039. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  61040. if err != nil {
  61041. return nil, err
  61042. }
  61043. reqHeaders.Set("Content-Type", "application/json")
  61044. c.urlParams_.Set("alt", alt)
  61045. c.urlParams_.Set("prettyPrint", "false")
  61046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  61047. urls += "?" + c.urlParams_.Encode()
  61048. req, err := http.NewRequest("POST", urls, body)
  61049. if err != nil {
  61050. return nil, err
  61051. }
  61052. req.Header = reqHeaders
  61053. googleapi.Expand(req.URL, map[string]string{
  61054. "project": c.project,
  61055. "zone": c.zone,
  61056. "instance": c.instance,
  61057. })
  61058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61059. }
  61060. // Do executes the "compute.instances.setMachineResources" call.
  61061. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61062. // status code is an error. Response headers are in either
  61063. // *Operation.ServerResponse.Header or (if a response was returned at
  61064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61065. // to check whether the returned error was because
  61066. // http.StatusNotModified was returned.
  61067. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61068. gensupport.SetOptions(c.urlParams_, opts...)
  61069. res, err := c.doRequest("json")
  61070. if res != nil && res.StatusCode == http.StatusNotModified {
  61071. if res.Body != nil {
  61072. res.Body.Close()
  61073. }
  61074. return nil, &googleapi.Error{
  61075. Code: res.StatusCode,
  61076. Header: res.Header,
  61077. }
  61078. }
  61079. if err != nil {
  61080. return nil, err
  61081. }
  61082. defer googleapi.CloseBody(res)
  61083. if err := googleapi.CheckResponse(res); err != nil {
  61084. return nil, err
  61085. }
  61086. ret := &Operation{
  61087. ServerResponse: googleapi.ServerResponse{
  61088. Header: res.Header,
  61089. HTTPStatusCode: res.StatusCode,
  61090. },
  61091. }
  61092. target := &ret
  61093. if err := gensupport.DecodeResponse(target, res); err != nil {
  61094. return nil, err
  61095. }
  61096. return ret, nil
  61097. // {
  61098. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  61099. // "httpMethod": "POST",
  61100. // "id": "compute.instances.setMachineResources",
  61101. // "parameterOrder": [
  61102. // "project",
  61103. // "zone",
  61104. // "instance"
  61105. // ],
  61106. // "parameters": {
  61107. // "instance": {
  61108. // "description": "Name of the instance scoping this request.",
  61109. // "location": "path",
  61110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61111. // "required": true,
  61112. // "type": "string"
  61113. // },
  61114. // "project": {
  61115. // "description": "Project ID for this request.",
  61116. // "location": "path",
  61117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61118. // "required": true,
  61119. // "type": "string"
  61120. // },
  61121. // "requestId": {
  61122. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61123. // "location": "query",
  61124. // "type": "string"
  61125. // },
  61126. // "zone": {
  61127. // "description": "The name of the zone for this request.",
  61128. // "location": "path",
  61129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61130. // "required": true,
  61131. // "type": "string"
  61132. // }
  61133. // },
  61134. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  61135. // "request": {
  61136. // "$ref": "InstancesSetMachineResourcesRequest"
  61137. // },
  61138. // "response": {
  61139. // "$ref": "Operation"
  61140. // },
  61141. // "scopes": [
  61142. // "https://www.googleapis.com/auth/cloud-platform",
  61143. // "https://www.googleapis.com/auth/compute"
  61144. // ]
  61145. // }
  61146. }
  61147. // method id "compute.instances.setMachineType":
  61148. type InstancesSetMachineTypeCall struct {
  61149. s *Service
  61150. project string
  61151. zone string
  61152. instance string
  61153. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  61154. urlParams_ gensupport.URLParams
  61155. ctx_ context.Context
  61156. header_ http.Header
  61157. }
  61158. // SetMachineType: Changes the machine type for a stopped instance to
  61159. // the machine type specified in the request.
  61160. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  61161. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61162. c.project = project
  61163. c.zone = zone
  61164. c.instance = instance
  61165. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  61166. return c
  61167. }
  61168. // RequestId sets the optional parameter "requestId": An optional
  61169. // request ID to identify requests. Specify a unique request ID so that
  61170. // if you must retry your request, the server will know to ignore the
  61171. // request if it has already been completed.
  61172. //
  61173. // For example, consider a situation where you make an initial request
  61174. // and the request times out. If you make the request again with the
  61175. // same request ID, the server can check if original operation with the
  61176. // same request ID was received, and if so, will ignore the second
  61177. // request. This prevents clients from accidentally creating duplicate
  61178. // commitments.
  61179. //
  61180. // The request ID must be a valid UUID with the exception that zero UUID
  61181. // is not supported (00000000-0000-0000-0000-000000000000).
  61182. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  61183. c.urlParams_.Set("requestId", requestId)
  61184. return c
  61185. }
  61186. // Fields allows partial responses to be retrieved. See
  61187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61188. // for more information.
  61189. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  61190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61191. return c
  61192. }
  61193. // Context sets the context to be used in this call's Do method. Any
  61194. // pending HTTP request will be aborted if the provided context is
  61195. // canceled.
  61196. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  61197. c.ctx_ = ctx
  61198. return c
  61199. }
  61200. // Header returns an http.Header that can be modified by the caller to
  61201. // add HTTP headers to the request.
  61202. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  61203. if c.header_ == nil {
  61204. c.header_ = make(http.Header)
  61205. }
  61206. return c.header_
  61207. }
  61208. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  61209. reqHeaders := make(http.Header)
  61210. for k, v := range c.header_ {
  61211. reqHeaders[k] = v
  61212. }
  61213. reqHeaders.Set("User-Agent", c.s.userAgent())
  61214. var body io.Reader = nil
  61215. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  61216. if err != nil {
  61217. return nil, err
  61218. }
  61219. reqHeaders.Set("Content-Type", "application/json")
  61220. c.urlParams_.Set("alt", alt)
  61221. c.urlParams_.Set("prettyPrint", "false")
  61222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  61223. urls += "?" + c.urlParams_.Encode()
  61224. req, err := http.NewRequest("POST", urls, body)
  61225. if err != nil {
  61226. return nil, err
  61227. }
  61228. req.Header = reqHeaders
  61229. googleapi.Expand(req.URL, map[string]string{
  61230. "project": c.project,
  61231. "zone": c.zone,
  61232. "instance": c.instance,
  61233. })
  61234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61235. }
  61236. // Do executes the "compute.instances.setMachineType" call.
  61237. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61238. // status code is an error. Response headers are in either
  61239. // *Operation.ServerResponse.Header or (if a response was returned at
  61240. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61241. // to check whether the returned error was because
  61242. // http.StatusNotModified was returned.
  61243. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61244. gensupport.SetOptions(c.urlParams_, opts...)
  61245. res, err := c.doRequest("json")
  61246. if res != nil && res.StatusCode == http.StatusNotModified {
  61247. if res.Body != nil {
  61248. res.Body.Close()
  61249. }
  61250. return nil, &googleapi.Error{
  61251. Code: res.StatusCode,
  61252. Header: res.Header,
  61253. }
  61254. }
  61255. if err != nil {
  61256. return nil, err
  61257. }
  61258. defer googleapi.CloseBody(res)
  61259. if err := googleapi.CheckResponse(res); err != nil {
  61260. return nil, err
  61261. }
  61262. ret := &Operation{
  61263. ServerResponse: googleapi.ServerResponse{
  61264. Header: res.Header,
  61265. HTTPStatusCode: res.StatusCode,
  61266. },
  61267. }
  61268. target := &ret
  61269. if err := gensupport.DecodeResponse(target, res); err != nil {
  61270. return nil, err
  61271. }
  61272. return ret, nil
  61273. // {
  61274. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  61275. // "httpMethod": "POST",
  61276. // "id": "compute.instances.setMachineType",
  61277. // "parameterOrder": [
  61278. // "project",
  61279. // "zone",
  61280. // "instance"
  61281. // ],
  61282. // "parameters": {
  61283. // "instance": {
  61284. // "description": "Name of the instance scoping this request.",
  61285. // "location": "path",
  61286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61287. // "required": true,
  61288. // "type": "string"
  61289. // },
  61290. // "project": {
  61291. // "description": "Project ID for this request.",
  61292. // "location": "path",
  61293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61294. // "required": true,
  61295. // "type": "string"
  61296. // },
  61297. // "requestId": {
  61298. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61299. // "location": "query",
  61300. // "type": "string"
  61301. // },
  61302. // "zone": {
  61303. // "description": "The name of the zone for this request.",
  61304. // "location": "path",
  61305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61306. // "required": true,
  61307. // "type": "string"
  61308. // }
  61309. // },
  61310. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  61311. // "request": {
  61312. // "$ref": "InstancesSetMachineTypeRequest"
  61313. // },
  61314. // "response": {
  61315. // "$ref": "Operation"
  61316. // },
  61317. // "scopes": [
  61318. // "https://www.googleapis.com/auth/cloud-platform",
  61319. // "https://www.googleapis.com/auth/compute"
  61320. // ]
  61321. // }
  61322. }
  61323. // method id "compute.instances.setMetadata":
  61324. type InstancesSetMetadataCall struct {
  61325. s *Service
  61326. project string
  61327. zone string
  61328. instance string
  61329. metadata *Metadata
  61330. urlParams_ gensupport.URLParams
  61331. ctx_ context.Context
  61332. header_ http.Header
  61333. }
  61334. // SetMetadata: Sets metadata for the specified instance to the data
  61335. // included in the request.
  61336. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  61337. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  61338. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61339. c.project = project
  61340. c.zone = zone
  61341. c.instance = instance
  61342. c.metadata = metadata
  61343. return c
  61344. }
  61345. // RequestId sets the optional parameter "requestId": An optional
  61346. // request ID to identify requests. Specify a unique request ID so that
  61347. // if you must retry your request, the server will know to ignore the
  61348. // request if it has already been completed.
  61349. //
  61350. // For example, consider a situation where you make an initial request
  61351. // and the request times out. If you make the request again with the
  61352. // same request ID, the server can check if original operation with the
  61353. // same request ID was received, and if so, will ignore the second
  61354. // request. This prevents clients from accidentally creating duplicate
  61355. // commitments.
  61356. //
  61357. // The request ID must be a valid UUID with the exception that zero UUID
  61358. // is not supported (00000000-0000-0000-0000-000000000000).
  61359. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  61360. c.urlParams_.Set("requestId", requestId)
  61361. return c
  61362. }
  61363. // Fields allows partial responses to be retrieved. See
  61364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61365. // for more information.
  61366. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  61367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61368. return c
  61369. }
  61370. // Context sets the context to be used in this call's Do method. Any
  61371. // pending HTTP request will be aborted if the provided context is
  61372. // canceled.
  61373. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  61374. c.ctx_ = ctx
  61375. return c
  61376. }
  61377. // Header returns an http.Header that can be modified by the caller to
  61378. // add HTTP headers to the request.
  61379. func (c *InstancesSetMetadataCall) Header() http.Header {
  61380. if c.header_ == nil {
  61381. c.header_ = make(http.Header)
  61382. }
  61383. return c.header_
  61384. }
  61385. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  61386. reqHeaders := make(http.Header)
  61387. for k, v := range c.header_ {
  61388. reqHeaders[k] = v
  61389. }
  61390. reqHeaders.Set("User-Agent", c.s.userAgent())
  61391. var body io.Reader = nil
  61392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  61393. if err != nil {
  61394. return nil, err
  61395. }
  61396. reqHeaders.Set("Content-Type", "application/json")
  61397. c.urlParams_.Set("alt", alt)
  61398. c.urlParams_.Set("prettyPrint", "false")
  61399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  61400. urls += "?" + c.urlParams_.Encode()
  61401. req, err := http.NewRequest("POST", urls, body)
  61402. if err != nil {
  61403. return nil, err
  61404. }
  61405. req.Header = reqHeaders
  61406. googleapi.Expand(req.URL, map[string]string{
  61407. "project": c.project,
  61408. "zone": c.zone,
  61409. "instance": c.instance,
  61410. })
  61411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61412. }
  61413. // Do executes the "compute.instances.setMetadata" call.
  61414. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61415. // status code is an error. Response headers are in either
  61416. // *Operation.ServerResponse.Header or (if a response was returned at
  61417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61418. // to check whether the returned error was because
  61419. // http.StatusNotModified was returned.
  61420. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61421. gensupport.SetOptions(c.urlParams_, opts...)
  61422. res, err := c.doRequest("json")
  61423. if res != nil && res.StatusCode == http.StatusNotModified {
  61424. if res.Body != nil {
  61425. res.Body.Close()
  61426. }
  61427. return nil, &googleapi.Error{
  61428. Code: res.StatusCode,
  61429. Header: res.Header,
  61430. }
  61431. }
  61432. if err != nil {
  61433. return nil, err
  61434. }
  61435. defer googleapi.CloseBody(res)
  61436. if err := googleapi.CheckResponse(res); err != nil {
  61437. return nil, err
  61438. }
  61439. ret := &Operation{
  61440. ServerResponse: googleapi.ServerResponse{
  61441. Header: res.Header,
  61442. HTTPStatusCode: res.StatusCode,
  61443. },
  61444. }
  61445. target := &ret
  61446. if err := gensupport.DecodeResponse(target, res); err != nil {
  61447. return nil, err
  61448. }
  61449. return ret, nil
  61450. // {
  61451. // "description": "Sets metadata for the specified instance to the data included in the request.",
  61452. // "httpMethod": "POST",
  61453. // "id": "compute.instances.setMetadata",
  61454. // "parameterOrder": [
  61455. // "project",
  61456. // "zone",
  61457. // "instance"
  61458. // ],
  61459. // "parameters": {
  61460. // "instance": {
  61461. // "description": "Name of the instance scoping this request.",
  61462. // "location": "path",
  61463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61464. // "required": true,
  61465. // "type": "string"
  61466. // },
  61467. // "project": {
  61468. // "description": "Project ID for this request.",
  61469. // "location": "path",
  61470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61471. // "required": true,
  61472. // "type": "string"
  61473. // },
  61474. // "requestId": {
  61475. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61476. // "location": "query",
  61477. // "type": "string"
  61478. // },
  61479. // "zone": {
  61480. // "description": "The name of the zone for this request.",
  61481. // "location": "path",
  61482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61483. // "required": true,
  61484. // "type": "string"
  61485. // }
  61486. // },
  61487. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  61488. // "request": {
  61489. // "$ref": "Metadata"
  61490. // },
  61491. // "response": {
  61492. // "$ref": "Operation"
  61493. // },
  61494. // "scopes": [
  61495. // "https://www.googleapis.com/auth/cloud-platform",
  61496. // "https://www.googleapis.com/auth/compute"
  61497. // ]
  61498. // }
  61499. }
  61500. // method id "compute.instances.setMinCpuPlatform":
  61501. type InstancesSetMinCpuPlatformCall struct {
  61502. s *Service
  61503. project string
  61504. zone string
  61505. instance string
  61506. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  61507. urlParams_ gensupport.URLParams
  61508. ctx_ context.Context
  61509. header_ http.Header
  61510. }
  61511. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  61512. // instance should use. This method can only be called on a stopped
  61513. // instance. For more information, read Specifying a Minimum CPU
  61514. // Platform.
  61515. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  61516. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61517. c.project = project
  61518. c.zone = zone
  61519. c.instance = instance
  61520. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  61521. return c
  61522. }
  61523. // RequestId sets the optional parameter "requestId": An optional
  61524. // request ID to identify requests. Specify a unique request ID so that
  61525. // if you must retry your request, the server will know to ignore the
  61526. // request if it has already been completed.
  61527. //
  61528. // For example, consider a situation where you make an initial request
  61529. // and the request times out. If you make the request again with the
  61530. // same request ID, the server can check if original operation with the
  61531. // same request ID was received, and if so, will ignore the second
  61532. // request. This prevents clients from accidentally creating duplicate
  61533. // commitments.
  61534. //
  61535. // The request ID must be a valid UUID with the exception that zero UUID
  61536. // is not supported (00000000-0000-0000-0000-000000000000).
  61537. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  61538. c.urlParams_.Set("requestId", requestId)
  61539. return c
  61540. }
  61541. // Fields allows partial responses to be retrieved. See
  61542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61543. // for more information.
  61544. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  61545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61546. return c
  61547. }
  61548. // Context sets the context to be used in this call's Do method. Any
  61549. // pending HTTP request will be aborted if the provided context is
  61550. // canceled.
  61551. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  61552. c.ctx_ = ctx
  61553. return c
  61554. }
  61555. // Header returns an http.Header that can be modified by the caller to
  61556. // add HTTP headers to the request.
  61557. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  61558. if c.header_ == nil {
  61559. c.header_ = make(http.Header)
  61560. }
  61561. return c.header_
  61562. }
  61563. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  61564. reqHeaders := make(http.Header)
  61565. for k, v := range c.header_ {
  61566. reqHeaders[k] = v
  61567. }
  61568. reqHeaders.Set("User-Agent", c.s.userAgent())
  61569. var body io.Reader = nil
  61570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  61571. if err != nil {
  61572. return nil, err
  61573. }
  61574. reqHeaders.Set("Content-Type", "application/json")
  61575. c.urlParams_.Set("alt", alt)
  61576. c.urlParams_.Set("prettyPrint", "false")
  61577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  61578. urls += "?" + c.urlParams_.Encode()
  61579. req, err := http.NewRequest("POST", urls, body)
  61580. if err != nil {
  61581. return nil, err
  61582. }
  61583. req.Header = reqHeaders
  61584. googleapi.Expand(req.URL, map[string]string{
  61585. "project": c.project,
  61586. "zone": c.zone,
  61587. "instance": c.instance,
  61588. })
  61589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61590. }
  61591. // Do executes the "compute.instances.setMinCpuPlatform" call.
  61592. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61593. // status code is an error. Response headers are in either
  61594. // *Operation.ServerResponse.Header or (if a response was returned at
  61595. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61596. // to check whether the returned error was because
  61597. // http.StatusNotModified was returned.
  61598. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61599. gensupport.SetOptions(c.urlParams_, opts...)
  61600. res, err := c.doRequest("json")
  61601. if res != nil && res.StatusCode == http.StatusNotModified {
  61602. if res.Body != nil {
  61603. res.Body.Close()
  61604. }
  61605. return nil, &googleapi.Error{
  61606. Code: res.StatusCode,
  61607. Header: res.Header,
  61608. }
  61609. }
  61610. if err != nil {
  61611. return nil, err
  61612. }
  61613. defer googleapi.CloseBody(res)
  61614. if err := googleapi.CheckResponse(res); err != nil {
  61615. return nil, err
  61616. }
  61617. ret := &Operation{
  61618. ServerResponse: googleapi.ServerResponse{
  61619. Header: res.Header,
  61620. HTTPStatusCode: res.StatusCode,
  61621. },
  61622. }
  61623. target := &ret
  61624. if err := gensupport.DecodeResponse(target, res); err != nil {
  61625. return nil, err
  61626. }
  61627. return ret, nil
  61628. // {
  61629. // "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.",
  61630. // "httpMethod": "POST",
  61631. // "id": "compute.instances.setMinCpuPlatform",
  61632. // "parameterOrder": [
  61633. // "project",
  61634. // "zone",
  61635. // "instance"
  61636. // ],
  61637. // "parameters": {
  61638. // "instance": {
  61639. // "description": "Name of the instance scoping this request.",
  61640. // "location": "path",
  61641. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61642. // "required": true,
  61643. // "type": "string"
  61644. // },
  61645. // "project": {
  61646. // "description": "Project ID for this request.",
  61647. // "location": "path",
  61648. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61649. // "required": true,
  61650. // "type": "string"
  61651. // },
  61652. // "requestId": {
  61653. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61654. // "location": "query",
  61655. // "type": "string"
  61656. // },
  61657. // "zone": {
  61658. // "description": "The name of the zone for this request.",
  61659. // "location": "path",
  61660. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61661. // "required": true,
  61662. // "type": "string"
  61663. // }
  61664. // },
  61665. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  61666. // "request": {
  61667. // "$ref": "InstancesSetMinCpuPlatformRequest"
  61668. // },
  61669. // "response": {
  61670. // "$ref": "Operation"
  61671. // },
  61672. // "scopes": [
  61673. // "https://www.googleapis.com/auth/cloud-platform",
  61674. // "https://www.googleapis.com/auth/compute"
  61675. // ]
  61676. // }
  61677. }
  61678. // method id "compute.instances.setScheduling":
  61679. type InstancesSetSchedulingCall struct {
  61680. s *Service
  61681. project string
  61682. zone string
  61683. instance string
  61684. scheduling *Scheduling
  61685. urlParams_ gensupport.URLParams
  61686. ctx_ context.Context
  61687. header_ http.Header
  61688. }
  61689. // SetScheduling: Sets an instance's scheduling options.
  61690. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  61691. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  61692. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61693. c.project = project
  61694. c.zone = zone
  61695. c.instance = instance
  61696. c.scheduling = scheduling
  61697. return c
  61698. }
  61699. // RequestId sets the optional parameter "requestId": An optional
  61700. // request ID to identify requests. Specify a unique request ID so that
  61701. // if you must retry your request, the server will know to ignore the
  61702. // request if it has already been completed.
  61703. //
  61704. // For example, consider a situation where you make an initial request
  61705. // and the request times out. If you make the request again with the
  61706. // same request ID, the server can check if original operation with the
  61707. // same request ID was received, and if so, will ignore the second
  61708. // request. This prevents clients from accidentally creating duplicate
  61709. // commitments.
  61710. //
  61711. // The request ID must be a valid UUID with the exception that zero UUID
  61712. // is not supported (00000000-0000-0000-0000-000000000000).
  61713. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  61714. c.urlParams_.Set("requestId", requestId)
  61715. return c
  61716. }
  61717. // Fields allows partial responses to be retrieved. See
  61718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61719. // for more information.
  61720. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  61721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61722. return c
  61723. }
  61724. // Context sets the context to be used in this call's Do method. Any
  61725. // pending HTTP request will be aborted if the provided context is
  61726. // canceled.
  61727. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  61728. c.ctx_ = ctx
  61729. return c
  61730. }
  61731. // Header returns an http.Header that can be modified by the caller to
  61732. // add HTTP headers to the request.
  61733. func (c *InstancesSetSchedulingCall) Header() http.Header {
  61734. if c.header_ == nil {
  61735. c.header_ = make(http.Header)
  61736. }
  61737. return c.header_
  61738. }
  61739. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  61740. reqHeaders := make(http.Header)
  61741. for k, v := range c.header_ {
  61742. reqHeaders[k] = v
  61743. }
  61744. reqHeaders.Set("User-Agent", c.s.userAgent())
  61745. var body io.Reader = nil
  61746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  61747. if err != nil {
  61748. return nil, err
  61749. }
  61750. reqHeaders.Set("Content-Type", "application/json")
  61751. c.urlParams_.Set("alt", alt)
  61752. c.urlParams_.Set("prettyPrint", "false")
  61753. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  61754. urls += "?" + c.urlParams_.Encode()
  61755. req, err := http.NewRequest("POST", urls, body)
  61756. if err != nil {
  61757. return nil, err
  61758. }
  61759. req.Header = reqHeaders
  61760. googleapi.Expand(req.URL, map[string]string{
  61761. "project": c.project,
  61762. "zone": c.zone,
  61763. "instance": c.instance,
  61764. })
  61765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61766. }
  61767. // Do executes the "compute.instances.setScheduling" call.
  61768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61769. // status code is an error. Response headers are in either
  61770. // *Operation.ServerResponse.Header or (if a response was returned at
  61771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61772. // to check whether the returned error was because
  61773. // http.StatusNotModified was returned.
  61774. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61775. gensupport.SetOptions(c.urlParams_, opts...)
  61776. res, err := c.doRequest("json")
  61777. if res != nil && res.StatusCode == http.StatusNotModified {
  61778. if res.Body != nil {
  61779. res.Body.Close()
  61780. }
  61781. return nil, &googleapi.Error{
  61782. Code: res.StatusCode,
  61783. Header: res.Header,
  61784. }
  61785. }
  61786. if err != nil {
  61787. return nil, err
  61788. }
  61789. defer googleapi.CloseBody(res)
  61790. if err := googleapi.CheckResponse(res); err != nil {
  61791. return nil, err
  61792. }
  61793. ret := &Operation{
  61794. ServerResponse: googleapi.ServerResponse{
  61795. Header: res.Header,
  61796. HTTPStatusCode: res.StatusCode,
  61797. },
  61798. }
  61799. target := &ret
  61800. if err := gensupport.DecodeResponse(target, res); err != nil {
  61801. return nil, err
  61802. }
  61803. return ret, nil
  61804. // {
  61805. // "description": "Sets an instance's scheduling options.",
  61806. // "httpMethod": "POST",
  61807. // "id": "compute.instances.setScheduling",
  61808. // "parameterOrder": [
  61809. // "project",
  61810. // "zone",
  61811. // "instance"
  61812. // ],
  61813. // "parameters": {
  61814. // "instance": {
  61815. // "description": "Instance name for this request.",
  61816. // "location": "path",
  61817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61818. // "required": true,
  61819. // "type": "string"
  61820. // },
  61821. // "project": {
  61822. // "description": "Project ID for this request.",
  61823. // "location": "path",
  61824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61825. // "required": true,
  61826. // "type": "string"
  61827. // },
  61828. // "requestId": {
  61829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61830. // "location": "query",
  61831. // "type": "string"
  61832. // },
  61833. // "zone": {
  61834. // "description": "The name of the zone for this request.",
  61835. // "location": "path",
  61836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61837. // "required": true,
  61838. // "type": "string"
  61839. // }
  61840. // },
  61841. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  61842. // "request": {
  61843. // "$ref": "Scheduling"
  61844. // },
  61845. // "response": {
  61846. // "$ref": "Operation"
  61847. // },
  61848. // "scopes": [
  61849. // "https://www.googleapis.com/auth/cloud-platform",
  61850. // "https://www.googleapis.com/auth/compute"
  61851. // ]
  61852. // }
  61853. }
  61854. // method id "compute.instances.setServiceAccount":
  61855. type InstancesSetServiceAccountCall struct {
  61856. s *Service
  61857. project string
  61858. zone string
  61859. instance string
  61860. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  61861. urlParams_ gensupport.URLParams
  61862. ctx_ context.Context
  61863. header_ http.Header
  61864. }
  61865. // SetServiceAccount: Sets the service account on the instance. For more
  61866. // information, read Changing the service account and access scopes for
  61867. // an instance.
  61868. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  61869. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61870. c.project = project
  61871. c.zone = zone
  61872. c.instance = instance
  61873. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  61874. return c
  61875. }
  61876. // RequestId sets the optional parameter "requestId": An optional
  61877. // request ID to identify requests. Specify a unique request ID so that
  61878. // if you must retry your request, the server will know to ignore the
  61879. // request if it has already been completed.
  61880. //
  61881. // For example, consider a situation where you make an initial request
  61882. // and the request times out. If you make the request again with the
  61883. // same request ID, the server can check if original operation with the
  61884. // same request ID was received, and if so, will ignore the second
  61885. // request. This prevents clients from accidentally creating duplicate
  61886. // commitments.
  61887. //
  61888. // The request ID must be a valid UUID with the exception that zero UUID
  61889. // is not supported (00000000-0000-0000-0000-000000000000).
  61890. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  61891. c.urlParams_.Set("requestId", requestId)
  61892. return c
  61893. }
  61894. // Fields allows partial responses to be retrieved. See
  61895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61896. // for more information.
  61897. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  61898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61899. return c
  61900. }
  61901. // Context sets the context to be used in this call's Do method. Any
  61902. // pending HTTP request will be aborted if the provided context is
  61903. // canceled.
  61904. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  61905. c.ctx_ = ctx
  61906. return c
  61907. }
  61908. // Header returns an http.Header that can be modified by the caller to
  61909. // add HTTP headers to the request.
  61910. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  61911. if c.header_ == nil {
  61912. c.header_ = make(http.Header)
  61913. }
  61914. return c.header_
  61915. }
  61916. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  61917. reqHeaders := make(http.Header)
  61918. for k, v := range c.header_ {
  61919. reqHeaders[k] = v
  61920. }
  61921. reqHeaders.Set("User-Agent", c.s.userAgent())
  61922. var body io.Reader = nil
  61923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  61924. if err != nil {
  61925. return nil, err
  61926. }
  61927. reqHeaders.Set("Content-Type", "application/json")
  61928. c.urlParams_.Set("alt", alt)
  61929. c.urlParams_.Set("prettyPrint", "false")
  61930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  61931. urls += "?" + c.urlParams_.Encode()
  61932. req, err := http.NewRequest("POST", urls, body)
  61933. if err != nil {
  61934. return nil, err
  61935. }
  61936. req.Header = reqHeaders
  61937. googleapi.Expand(req.URL, map[string]string{
  61938. "project": c.project,
  61939. "zone": c.zone,
  61940. "instance": c.instance,
  61941. })
  61942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61943. }
  61944. // Do executes the "compute.instances.setServiceAccount" call.
  61945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61946. // status code is an error. Response headers are in either
  61947. // *Operation.ServerResponse.Header or (if a response was returned at
  61948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61949. // to check whether the returned error was because
  61950. // http.StatusNotModified was returned.
  61951. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61952. gensupport.SetOptions(c.urlParams_, opts...)
  61953. res, err := c.doRequest("json")
  61954. if res != nil && res.StatusCode == http.StatusNotModified {
  61955. if res.Body != nil {
  61956. res.Body.Close()
  61957. }
  61958. return nil, &googleapi.Error{
  61959. Code: res.StatusCode,
  61960. Header: res.Header,
  61961. }
  61962. }
  61963. if err != nil {
  61964. return nil, err
  61965. }
  61966. defer googleapi.CloseBody(res)
  61967. if err := googleapi.CheckResponse(res); err != nil {
  61968. return nil, err
  61969. }
  61970. ret := &Operation{
  61971. ServerResponse: googleapi.ServerResponse{
  61972. Header: res.Header,
  61973. HTTPStatusCode: res.StatusCode,
  61974. },
  61975. }
  61976. target := &ret
  61977. if err := gensupport.DecodeResponse(target, res); err != nil {
  61978. return nil, err
  61979. }
  61980. return ret, nil
  61981. // {
  61982. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  61983. // "httpMethod": "POST",
  61984. // "id": "compute.instances.setServiceAccount",
  61985. // "parameterOrder": [
  61986. // "project",
  61987. // "zone",
  61988. // "instance"
  61989. // ],
  61990. // "parameters": {
  61991. // "instance": {
  61992. // "description": "Name of the instance resource to start.",
  61993. // "location": "path",
  61994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61995. // "required": true,
  61996. // "type": "string"
  61997. // },
  61998. // "project": {
  61999. // "description": "Project ID for this request.",
  62000. // "location": "path",
  62001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62002. // "required": true,
  62003. // "type": "string"
  62004. // },
  62005. // "requestId": {
  62006. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62007. // "location": "query",
  62008. // "type": "string"
  62009. // },
  62010. // "zone": {
  62011. // "description": "The name of the zone for this request.",
  62012. // "location": "path",
  62013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62014. // "required": true,
  62015. // "type": "string"
  62016. // }
  62017. // },
  62018. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  62019. // "request": {
  62020. // "$ref": "InstancesSetServiceAccountRequest"
  62021. // },
  62022. // "response": {
  62023. // "$ref": "Operation"
  62024. // },
  62025. // "scopes": [
  62026. // "https://www.googleapis.com/auth/cloud-platform",
  62027. // "https://www.googleapis.com/auth/compute"
  62028. // ]
  62029. // }
  62030. }
  62031. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  62032. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  62033. s *Service
  62034. project string
  62035. zone string
  62036. instance string
  62037. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  62038. urlParams_ gensupport.URLParams
  62039. ctx_ context.Context
  62040. header_ http.Header
  62041. }
  62042. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  62043. // for a VM instance. You can only use this method on a running VM
  62044. // instance. This method supports PATCH semantics and uses the JSON
  62045. // merge patch format and processing rules.
  62046. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  62047. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62048. c.project = project
  62049. c.zone = zone
  62050. c.instance = instance
  62051. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  62052. return c
  62053. }
  62054. // RequestId sets the optional parameter "requestId": An optional
  62055. // request ID to identify requests. Specify a unique request ID so that
  62056. // if you must retry your request, the server will know to ignore the
  62057. // request if it has already been completed.
  62058. //
  62059. // For example, consider a situation where you make an initial request
  62060. // and the request times out. If you make the request again with the
  62061. // same request ID, the server can check if original operation with the
  62062. // same request ID was received, and if so, will ignore the second
  62063. // request. This prevents clients from accidentally creating duplicate
  62064. // commitments.
  62065. //
  62066. // The request ID must be a valid UUID with the exception that zero UUID
  62067. // is not supported (00000000-0000-0000-0000-000000000000).
  62068. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  62069. c.urlParams_.Set("requestId", requestId)
  62070. return c
  62071. }
  62072. // Fields allows partial responses to be retrieved. See
  62073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62074. // for more information.
  62075. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  62076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62077. return c
  62078. }
  62079. // Context sets the context to be used in this call's Do method. Any
  62080. // pending HTTP request will be aborted if the provided context is
  62081. // canceled.
  62082. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  62083. c.ctx_ = ctx
  62084. return c
  62085. }
  62086. // Header returns an http.Header that can be modified by the caller to
  62087. // add HTTP headers to the request.
  62088. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  62089. if c.header_ == nil {
  62090. c.header_ = make(http.Header)
  62091. }
  62092. return c.header_
  62093. }
  62094. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  62095. reqHeaders := make(http.Header)
  62096. for k, v := range c.header_ {
  62097. reqHeaders[k] = v
  62098. }
  62099. reqHeaders.Set("User-Agent", c.s.userAgent())
  62100. var body io.Reader = nil
  62101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  62102. if err != nil {
  62103. return nil, err
  62104. }
  62105. reqHeaders.Set("Content-Type", "application/json")
  62106. c.urlParams_.Set("alt", alt)
  62107. c.urlParams_.Set("prettyPrint", "false")
  62108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  62109. urls += "?" + c.urlParams_.Encode()
  62110. req, err := http.NewRequest("PATCH", urls, body)
  62111. if err != nil {
  62112. return nil, err
  62113. }
  62114. req.Header = reqHeaders
  62115. googleapi.Expand(req.URL, map[string]string{
  62116. "project": c.project,
  62117. "zone": c.zone,
  62118. "instance": c.instance,
  62119. })
  62120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62121. }
  62122. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  62123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62124. // status code is an error. Response headers are in either
  62125. // *Operation.ServerResponse.Header or (if a response was returned at
  62126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62127. // to check whether the returned error was because
  62128. // http.StatusNotModified was returned.
  62129. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62130. gensupport.SetOptions(c.urlParams_, opts...)
  62131. res, err := c.doRequest("json")
  62132. if res != nil && res.StatusCode == http.StatusNotModified {
  62133. if res.Body != nil {
  62134. res.Body.Close()
  62135. }
  62136. return nil, &googleapi.Error{
  62137. Code: res.StatusCode,
  62138. Header: res.Header,
  62139. }
  62140. }
  62141. if err != nil {
  62142. return nil, err
  62143. }
  62144. defer googleapi.CloseBody(res)
  62145. if err := googleapi.CheckResponse(res); err != nil {
  62146. return nil, err
  62147. }
  62148. ret := &Operation{
  62149. ServerResponse: googleapi.ServerResponse{
  62150. Header: res.Header,
  62151. HTTPStatusCode: res.StatusCode,
  62152. },
  62153. }
  62154. target := &ret
  62155. if err := gensupport.DecodeResponse(target, res); err != nil {
  62156. return nil, err
  62157. }
  62158. return ret, nil
  62159. // {
  62160. // "description": "Sets the Shielded VM integrity policy for a VM instance. You can only use this method on a running VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  62161. // "httpMethod": "PATCH",
  62162. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  62163. // "parameterOrder": [
  62164. // "project",
  62165. // "zone",
  62166. // "instance"
  62167. // ],
  62168. // "parameters": {
  62169. // "instance": {
  62170. // "description": "Name of the instance scoping this request.",
  62171. // "location": "path",
  62172. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62173. // "required": true,
  62174. // "type": "string"
  62175. // },
  62176. // "project": {
  62177. // "description": "Project ID for this request.",
  62178. // "location": "path",
  62179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62180. // "required": true,
  62181. // "type": "string"
  62182. // },
  62183. // "requestId": {
  62184. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62185. // "location": "query",
  62186. // "type": "string"
  62187. // },
  62188. // "zone": {
  62189. // "description": "The name of the zone for this request.",
  62190. // "location": "path",
  62191. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62192. // "required": true,
  62193. // "type": "string"
  62194. // }
  62195. // },
  62196. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  62197. // "request": {
  62198. // "$ref": "ShieldedVmIntegrityPolicy"
  62199. // },
  62200. // "response": {
  62201. // "$ref": "Operation"
  62202. // },
  62203. // "scopes": [
  62204. // "https://www.googleapis.com/auth/cloud-platform",
  62205. // "https://www.googleapis.com/auth/compute"
  62206. // ]
  62207. // }
  62208. }
  62209. // method id "compute.instances.setTags":
  62210. type InstancesSetTagsCall struct {
  62211. s *Service
  62212. project string
  62213. zone string
  62214. instance string
  62215. tags *Tags
  62216. urlParams_ gensupport.URLParams
  62217. ctx_ context.Context
  62218. header_ http.Header
  62219. }
  62220. // SetTags: Sets network tags for the specified instance to the data
  62221. // included in the request.
  62222. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  62223. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  62224. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62225. c.project = project
  62226. c.zone = zone
  62227. c.instance = instance
  62228. c.tags = tags
  62229. return c
  62230. }
  62231. // RequestId sets the optional parameter "requestId": An optional
  62232. // request ID to identify requests. Specify a unique request ID so that
  62233. // if you must retry your request, the server will know to ignore the
  62234. // request if it has already been completed.
  62235. //
  62236. // For example, consider a situation where you make an initial request
  62237. // and the request times out. If you make the request again with the
  62238. // same request ID, the server can check if original operation with the
  62239. // same request ID was received, and if so, will ignore the second
  62240. // request. This prevents clients from accidentally creating duplicate
  62241. // commitments.
  62242. //
  62243. // The request ID must be a valid UUID with the exception that zero UUID
  62244. // is not supported (00000000-0000-0000-0000-000000000000).
  62245. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  62246. c.urlParams_.Set("requestId", requestId)
  62247. return c
  62248. }
  62249. // Fields allows partial responses to be retrieved. See
  62250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62251. // for more information.
  62252. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  62253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62254. return c
  62255. }
  62256. // Context sets the context to be used in this call's Do method. Any
  62257. // pending HTTP request will be aborted if the provided context is
  62258. // canceled.
  62259. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  62260. c.ctx_ = ctx
  62261. return c
  62262. }
  62263. // Header returns an http.Header that can be modified by the caller to
  62264. // add HTTP headers to the request.
  62265. func (c *InstancesSetTagsCall) Header() http.Header {
  62266. if c.header_ == nil {
  62267. c.header_ = make(http.Header)
  62268. }
  62269. return c.header_
  62270. }
  62271. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  62272. reqHeaders := make(http.Header)
  62273. for k, v := range c.header_ {
  62274. reqHeaders[k] = v
  62275. }
  62276. reqHeaders.Set("User-Agent", c.s.userAgent())
  62277. var body io.Reader = nil
  62278. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  62279. if err != nil {
  62280. return nil, err
  62281. }
  62282. reqHeaders.Set("Content-Type", "application/json")
  62283. c.urlParams_.Set("alt", alt)
  62284. c.urlParams_.Set("prettyPrint", "false")
  62285. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  62286. urls += "?" + c.urlParams_.Encode()
  62287. req, err := http.NewRequest("POST", urls, body)
  62288. if err != nil {
  62289. return nil, err
  62290. }
  62291. req.Header = reqHeaders
  62292. googleapi.Expand(req.URL, map[string]string{
  62293. "project": c.project,
  62294. "zone": c.zone,
  62295. "instance": c.instance,
  62296. })
  62297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62298. }
  62299. // Do executes the "compute.instances.setTags" call.
  62300. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62301. // status code is an error. Response headers are in either
  62302. // *Operation.ServerResponse.Header or (if a response was returned at
  62303. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62304. // to check whether the returned error was because
  62305. // http.StatusNotModified was returned.
  62306. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62307. gensupport.SetOptions(c.urlParams_, opts...)
  62308. res, err := c.doRequest("json")
  62309. if res != nil && res.StatusCode == http.StatusNotModified {
  62310. if res.Body != nil {
  62311. res.Body.Close()
  62312. }
  62313. return nil, &googleapi.Error{
  62314. Code: res.StatusCode,
  62315. Header: res.Header,
  62316. }
  62317. }
  62318. if err != nil {
  62319. return nil, err
  62320. }
  62321. defer googleapi.CloseBody(res)
  62322. if err := googleapi.CheckResponse(res); err != nil {
  62323. return nil, err
  62324. }
  62325. ret := &Operation{
  62326. ServerResponse: googleapi.ServerResponse{
  62327. Header: res.Header,
  62328. HTTPStatusCode: res.StatusCode,
  62329. },
  62330. }
  62331. target := &ret
  62332. if err := gensupport.DecodeResponse(target, res); err != nil {
  62333. return nil, err
  62334. }
  62335. return ret, nil
  62336. // {
  62337. // "description": "Sets network tags for the specified instance to the data included in the request.",
  62338. // "httpMethod": "POST",
  62339. // "id": "compute.instances.setTags",
  62340. // "parameterOrder": [
  62341. // "project",
  62342. // "zone",
  62343. // "instance"
  62344. // ],
  62345. // "parameters": {
  62346. // "instance": {
  62347. // "description": "Name of the instance scoping this request.",
  62348. // "location": "path",
  62349. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62350. // "required": true,
  62351. // "type": "string"
  62352. // },
  62353. // "project": {
  62354. // "description": "Project ID for this request.",
  62355. // "location": "path",
  62356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62357. // "required": true,
  62358. // "type": "string"
  62359. // },
  62360. // "requestId": {
  62361. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62362. // "location": "query",
  62363. // "type": "string"
  62364. // },
  62365. // "zone": {
  62366. // "description": "The name of the zone for this request.",
  62367. // "location": "path",
  62368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62369. // "required": true,
  62370. // "type": "string"
  62371. // }
  62372. // },
  62373. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  62374. // "request": {
  62375. // "$ref": "Tags"
  62376. // },
  62377. // "response": {
  62378. // "$ref": "Operation"
  62379. // },
  62380. // "scopes": [
  62381. // "https://www.googleapis.com/auth/cloud-platform",
  62382. // "https://www.googleapis.com/auth/compute"
  62383. // ]
  62384. // }
  62385. }
  62386. // method id "compute.instances.simulateMaintenanceEvent":
  62387. type InstancesSimulateMaintenanceEventCall struct {
  62388. s *Service
  62389. project string
  62390. zone string
  62391. instance string
  62392. urlParams_ gensupport.URLParams
  62393. ctx_ context.Context
  62394. header_ http.Header
  62395. }
  62396. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  62397. // instance.
  62398. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  62399. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62400. c.project = project
  62401. c.zone = zone
  62402. c.instance = instance
  62403. return c
  62404. }
  62405. // Fields allows partial responses to be retrieved. See
  62406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62407. // for more information.
  62408. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  62409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62410. return c
  62411. }
  62412. // Context sets the context to be used in this call's Do method. Any
  62413. // pending HTTP request will be aborted if the provided context is
  62414. // canceled.
  62415. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  62416. c.ctx_ = ctx
  62417. return c
  62418. }
  62419. // Header returns an http.Header that can be modified by the caller to
  62420. // add HTTP headers to the request.
  62421. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  62422. if c.header_ == nil {
  62423. c.header_ = make(http.Header)
  62424. }
  62425. return c.header_
  62426. }
  62427. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  62428. reqHeaders := make(http.Header)
  62429. for k, v := range c.header_ {
  62430. reqHeaders[k] = v
  62431. }
  62432. reqHeaders.Set("User-Agent", c.s.userAgent())
  62433. var body io.Reader = nil
  62434. c.urlParams_.Set("alt", alt)
  62435. c.urlParams_.Set("prettyPrint", "false")
  62436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  62437. urls += "?" + c.urlParams_.Encode()
  62438. req, err := http.NewRequest("POST", urls, body)
  62439. if err != nil {
  62440. return nil, err
  62441. }
  62442. req.Header = reqHeaders
  62443. googleapi.Expand(req.URL, map[string]string{
  62444. "project": c.project,
  62445. "zone": c.zone,
  62446. "instance": c.instance,
  62447. })
  62448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62449. }
  62450. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  62451. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62452. // status code is an error. Response headers are in either
  62453. // *Operation.ServerResponse.Header or (if a response was returned at
  62454. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62455. // to check whether the returned error was because
  62456. // http.StatusNotModified was returned.
  62457. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62458. gensupport.SetOptions(c.urlParams_, opts...)
  62459. res, err := c.doRequest("json")
  62460. if res != nil && res.StatusCode == http.StatusNotModified {
  62461. if res.Body != nil {
  62462. res.Body.Close()
  62463. }
  62464. return nil, &googleapi.Error{
  62465. Code: res.StatusCode,
  62466. Header: res.Header,
  62467. }
  62468. }
  62469. if err != nil {
  62470. return nil, err
  62471. }
  62472. defer googleapi.CloseBody(res)
  62473. if err := googleapi.CheckResponse(res); err != nil {
  62474. return nil, err
  62475. }
  62476. ret := &Operation{
  62477. ServerResponse: googleapi.ServerResponse{
  62478. Header: res.Header,
  62479. HTTPStatusCode: res.StatusCode,
  62480. },
  62481. }
  62482. target := &ret
  62483. if err := gensupport.DecodeResponse(target, res); err != nil {
  62484. return nil, err
  62485. }
  62486. return ret, nil
  62487. // {
  62488. // "description": "Simulates a maintenance event on the instance.",
  62489. // "httpMethod": "POST",
  62490. // "id": "compute.instances.simulateMaintenanceEvent",
  62491. // "parameterOrder": [
  62492. // "project",
  62493. // "zone",
  62494. // "instance"
  62495. // ],
  62496. // "parameters": {
  62497. // "instance": {
  62498. // "description": "Name of the instance scoping this request.",
  62499. // "location": "path",
  62500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62501. // "required": true,
  62502. // "type": "string"
  62503. // },
  62504. // "project": {
  62505. // "description": "Project ID for this request.",
  62506. // "location": "path",
  62507. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62508. // "required": true,
  62509. // "type": "string"
  62510. // },
  62511. // "zone": {
  62512. // "description": "The name of the zone for this request.",
  62513. // "location": "path",
  62514. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62515. // "required": true,
  62516. // "type": "string"
  62517. // }
  62518. // },
  62519. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  62520. // "response": {
  62521. // "$ref": "Operation"
  62522. // },
  62523. // "scopes": [
  62524. // "https://www.googleapis.com/auth/cloud-platform",
  62525. // "https://www.googleapis.com/auth/compute"
  62526. // ]
  62527. // }
  62528. }
  62529. // method id "compute.instances.start":
  62530. type InstancesStartCall struct {
  62531. s *Service
  62532. project string
  62533. zone string
  62534. instance string
  62535. urlParams_ gensupport.URLParams
  62536. ctx_ context.Context
  62537. header_ http.Header
  62538. }
  62539. // Start: Starts an instance that was stopped using the instances().stop
  62540. // method. For more information, see Restart an instance.
  62541. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  62542. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  62543. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62544. c.project = project
  62545. c.zone = zone
  62546. c.instance = instance
  62547. return c
  62548. }
  62549. // RequestId sets the optional parameter "requestId": An optional
  62550. // request ID to identify requests. Specify a unique request ID so that
  62551. // if you must retry your request, the server will know to ignore the
  62552. // request if it has already been completed.
  62553. //
  62554. // For example, consider a situation where you make an initial request
  62555. // and the request times out. If you make the request again with the
  62556. // same request ID, the server can check if original operation with the
  62557. // same request ID was received, and if so, will ignore the second
  62558. // request. This prevents clients from accidentally creating duplicate
  62559. // commitments.
  62560. //
  62561. // The request ID must be a valid UUID with the exception that zero UUID
  62562. // is not supported (00000000-0000-0000-0000-000000000000).
  62563. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  62564. c.urlParams_.Set("requestId", requestId)
  62565. return c
  62566. }
  62567. // Fields allows partial responses to be retrieved. See
  62568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62569. // for more information.
  62570. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  62571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62572. return c
  62573. }
  62574. // Context sets the context to be used in this call's Do method. Any
  62575. // pending HTTP request will be aborted if the provided context is
  62576. // canceled.
  62577. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  62578. c.ctx_ = ctx
  62579. return c
  62580. }
  62581. // Header returns an http.Header that can be modified by the caller to
  62582. // add HTTP headers to the request.
  62583. func (c *InstancesStartCall) Header() http.Header {
  62584. if c.header_ == nil {
  62585. c.header_ = make(http.Header)
  62586. }
  62587. return c.header_
  62588. }
  62589. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  62590. reqHeaders := make(http.Header)
  62591. for k, v := range c.header_ {
  62592. reqHeaders[k] = v
  62593. }
  62594. reqHeaders.Set("User-Agent", c.s.userAgent())
  62595. var body io.Reader = nil
  62596. c.urlParams_.Set("alt", alt)
  62597. c.urlParams_.Set("prettyPrint", "false")
  62598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  62599. urls += "?" + c.urlParams_.Encode()
  62600. req, err := http.NewRequest("POST", urls, body)
  62601. if err != nil {
  62602. return nil, err
  62603. }
  62604. req.Header = reqHeaders
  62605. googleapi.Expand(req.URL, map[string]string{
  62606. "project": c.project,
  62607. "zone": c.zone,
  62608. "instance": c.instance,
  62609. })
  62610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62611. }
  62612. // Do executes the "compute.instances.start" call.
  62613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62614. // status code is an error. Response headers are in either
  62615. // *Operation.ServerResponse.Header or (if a response was returned at
  62616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62617. // to check whether the returned error was because
  62618. // http.StatusNotModified was returned.
  62619. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62620. gensupport.SetOptions(c.urlParams_, opts...)
  62621. res, err := c.doRequest("json")
  62622. if res != nil && res.StatusCode == http.StatusNotModified {
  62623. if res.Body != nil {
  62624. res.Body.Close()
  62625. }
  62626. return nil, &googleapi.Error{
  62627. Code: res.StatusCode,
  62628. Header: res.Header,
  62629. }
  62630. }
  62631. if err != nil {
  62632. return nil, err
  62633. }
  62634. defer googleapi.CloseBody(res)
  62635. if err := googleapi.CheckResponse(res); err != nil {
  62636. return nil, err
  62637. }
  62638. ret := &Operation{
  62639. ServerResponse: googleapi.ServerResponse{
  62640. Header: res.Header,
  62641. HTTPStatusCode: res.StatusCode,
  62642. },
  62643. }
  62644. target := &ret
  62645. if err := gensupport.DecodeResponse(target, res); err != nil {
  62646. return nil, err
  62647. }
  62648. return ret, nil
  62649. // {
  62650. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  62651. // "httpMethod": "POST",
  62652. // "id": "compute.instances.start",
  62653. // "parameterOrder": [
  62654. // "project",
  62655. // "zone",
  62656. // "instance"
  62657. // ],
  62658. // "parameters": {
  62659. // "instance": {
  62660. // "description": "Name of the instance resource to start.",
  62661. // "location": "path",
  62662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62663. // "required": true,
  62664. // "type": "string"
  62665. // },
  62666. // "project": {
  62667. // "description": "Project ID for this request.",
  62668. // "location": "path",
  62669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62670. // "required": true,
  62671. // "type": "string"
  62672. // },
  62673. // "requestId": {
  62674. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62675. // "location": "query",
  62676. // "type": "string"
  62677. // },
  62678. // "zone": {
  62679. // "description": "The name of the zone for this request.",
  62680. // "location": "path",
  62681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62682. // "required": true,
  62683. // "type": "string"
  62684. // }
  62685. // },
  62686. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  62687. // "response": {
  62688. // "$ref": "Operation"
  62689. // },
  62690. // "scopes": [
  62691. // "https://www.googleapis.com/auth/cloud-platform",
  62692. // "https://www.googleapis.com/auth/compute"
  62693. // ]
  62694. // }
  62695. }
  62696. // method id "compute.instances.startWithEncryptionKey":
  62697. type InstancesStartWithEncryptionKeyCall struct {
  62698. s *Service
  62699. project string
  62700. zone string
  62701. instance string
  62702. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  62703. urlParams_ gensupport.URLParams
  62704. ctx_ context.Context
  62705. header_ http.Header
  62706. }
  62707. // StartWithEncryptionKey: Starts an instance that was stopped using the
  62708. // instances().stop method. For more information, see Restart an
  62709. // instance.
  62710. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  62711. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62712. c.project = project
  62713. c.zone = zone
  62714. c.instance = instance
  62715. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  62716. return c
  62717. }
  62718. // RequestId sets the optional parameter "requestId": An optional
  62719. // request ID to identify requests. Specify a unique request ID so that
  62720. // if you must retry your request, the server will know to ignore the
  62721. // request if it has already been completed.
  62722. //
  62723. // For example, consider a situation where you make an initial request
  62724. // and the request times out. If you make the request again with the
  62725. // same request ID, the server can check if original operation with the
  62726. // same request ID was received, and if so, will ignore the second
  62727. // request. This prevents clients from accidentally creating duplicate
  62728. // commitments.
  62729. //
  62730. // The request ID must be a valid UUID with the exception that zero UUID
  62731. // is not supported (00000000-0000-0000-0000-000000000000).
  62732. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  62733. c.urlParams_.Set("requestId", requestId)
  62734. return c
  62735. }
  62736. // Fields allows partial responses to be retrieved. See
  62737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62738. // for more information.
  62739. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  62740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62741. return c
  62742. }
  62743. // Context sets the context to be used in this call's Do method. Any
  62744. // pending HTTP request will be aborted if the provided context is
  62745. // canceled.
  62746. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  62747. c.ctx_ = ctx
  62748. return c
  62749. }
  62750. // Header returns an http.Header that can be modified by the caller to
  62751. // add HTTP headers to the request.
  62752. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  62753. if c.header_ == nil {
  62754. c.header_ = make(http.Header)
  62755. }
  62756. return c.header_
  62757. }
  62758. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  62759. reqHeaders := make(http.Header)
  62760. for k, v := range c.header_ {
  62761. reqHeaders[k] = v
  62762. }
  62763. reqHeaders.Set("User-Agent", c.s.userAgent())
  62764. var body io.Reader = nil
  62765. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  62766. if err != nil {
  62767. return nil, err
  62768. }
  62769. reqHeaders.Set("Content-Type", "application/json")
  62770. c.urlParams_.Set("alt", alt)
  62771. c.urlParams_.Set("prettyPrint", "false")
  62772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  62773. urls += "?" + c.urlParams_.Encode()
  62774. req, err := http.NewRequest("POST", urls, body)
  62775. if err != nil {
  62776. return nil, err
  62777. }
  62778. req.Header = reqHeaders
  62779. googleapi.Expand(req.URL, map[string]string{
  62780. "project": c.project,
  62781. "zone": c.zone,
  62782. "instance": c.instance,
  62783. })
  62784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62785. }
  62786. // Do executes the "compute.instances.startWithEncryptionKey" call.
  62787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62788. // status code is an error. Response headers are in either
  62789. // *Operation.ServerResponse.Header or (if a response was returned at
  62790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62791. // to check whether the returned error was because
  62792. // http.StatusNotModified was returned.
  62793. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62794. gensupport.SetOptions(c.urlParams_, opts...)
  62795. res, err := c.doRequest("json")
  62796. if res != nil && res.StatusCode == http.StatusNotModified {
  62797. if res.Body != nil {
  62798. res.Body.Close()
  62799. }
  62800. return nil, &googleapi.Error{
  62801. Code: res.StatusCode,
  62802. Header: res.Header,
  62803. }
  62804. }
  62805. if err != nil {
  62806. return nil, err
  62807. }
  62808. defer googleapi.CloseBody(res)
  62809. if err := googleapi.CheckResponse(res); err != nil {
  62810. return nil, err
  62811. }
  62812. ret := &Operation{
  62813. ServerResponse: googleapi.ServerResponse{
  62814. Header: res.Header,
  62815. HTTPStatusCode: res.StatusCode,
  62816. },
  62817. }
  62818. target := &ret
  62819. if err := gensupport.DecodeResponse(target, res); err != nil {
  62820. return nil, err
  62821. }
  62822. return ret, nil
  62823. // {
  62824. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  62825. // "httpMethod": "POST",
  62826. // "id": "compute.instances.startWithEncryptionKey",
  62827. // "parameterOrder": [
  62828. // "project",
  62829. // "zone",
  62830. // "instance"
  62831. // ],
  62832. // "parameters": {
  62833. // "instance": {
  62834. // "description": "Name of the instance resource to start.",
  62835. // "location": "path",
  62836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62837. // "required": true,
  62838. // "type": "string"
  62839. // },
  62840. // "project": {
  62841. // "description": "Project ID for this request.",
  62842. // "location": "path",
  62843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62844. // "required": true,
  62845. // "type": "string"
  62846. // },
  62847. // "requestId": {
  62848. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62849. // "location": "query",
  62850. // "type": "string"
  62851. // },
  62852. // "zone": {
  62853. // "description": "The name of the zone for this request.",
  62854. // "location": "path",
  62855. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62856. // "required": true,
  62857. // "type": "string"
  62858. // }
  62859. // },
  62860. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  62861. // "request": {
  62862. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  62863. // },
  62864. // "response": {
  62865. // "$ref": "Operation"
  62866. // },
  62867. // "scopes": [
  62868. // "https://www.googleapis.com/auth/cloud-platform",
  62869. // "https://www.googleapis.com/auth/compute"
  62870. // ]
  62871. // }
  62872. }
  62873. // method id "compute.instances.stop":
  62874. type InstancesStopCall struct {
  62875. s *Service
  62876. project string
  62877. zone string
  62878. instance string
  62879. urlParams_ gensupport.URLParams
  62880. ctx_ context.Context
  62881. header_ http.Header
  62882. }
  62883. // Stop: Stops a running instance, shutting it down cleanly, and allows
  62884. // you to restart the instance at a later time. Stopped instances do not
  62885. // incur VM usage charges while they are stopped. However, resources
  62886. // that the VM is using, such as persistent disks and static IP
  62887. // addresses, will continue to be charged until they are deleted. For
  62888. // more information, see Stopping an instance.
  62889. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  62890. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  62891. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62892. c.project = project
  62893. c.zone = zone
  62894. c.instance = instance
  62895. return c
  62896. }
  62897. // RequestId sets the optional parameter "requestId": An optional
  62898. // request ID to identify requests. Specify a unique request ID so that
  62899. // if you must retry your request, the server will know to ignore the
  62900. // request if it has already been completed.
  62901. //
  62902. // For example, consider a situation where you make an initial request
  62903. // and the request times out. If you make the request again with the
  62904. // same request ID, the server can check if original operation with the
  62905. // same request ID was received, and if so, will ignore the second
  62906. // request. This prevents clients from accidentally creating duplicate
  62907. // commitments.
  62908. //
  62909. // The request ID must be a valid UUID with the exception that zero UUID
  62910. // is not supported (00000000-0000-0000-0000-000000000000).
  62911. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  62912. c.urlParams_.Set("requestId", requestId)
  62913. return c
  62914. }
  62915. // Fields allows partial responses to be retrieved. See
  62916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62917. // for more information.
  62918. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  62919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62920. return c
  62921. }
  62922. // Context sets the context to be used in this call's Do method. Any
  62923. // pending HTTP request will be aborted if the provided context is
  62924. // canceled.
  62925. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  62926. c.ctx_ = ctx
  62927. return c
  62928. }
  62929. // Header returns an http.Header that can be modified by the caller to
  62930. // add HTTP headers to the request.
  62931. func (c *InstancesStopCall) Header() http.Header {
  62932. if c.header_ == nil {
  62933. c.header_ = make(http.Header)
  62934. }
  62935. return c.header_
  62936. }
  62937. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  62938. reqHeaders := make(http.Header)
  62939. for k, v := range c.header_ {
  62940. reqHeaders[k] = v
  62941. }
  62942. reqHeaders.Set("User-Agent", c.s.userAgent())
  62943. var body io.Reader = nil
  62944. c.urlParams_.Set("alt", alt)
  62945. c.urlParams_.Set("prettyPrint", "false")
  62946. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  62947. urls += "?" + c.urlParams_.Encode()
  62948. req, err := http.NewRequest("POST", urls, body)
  62949. if err != nil {
  62950. return nil, err
  62951. }
  62952. req.Header = reqHeaders
  62953. googleapi.Expand(req.URL, map[string]string{
  62954. "project": c.project,
  62955. "zone": c.zone,
  62956. "instance": c.instance,
  62957. })
  62958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62959. }
  62960. // Do executes the "compute.instances.stop" call.
  62961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62962. // status code is an error. Response headers are in either
  62963. // *Operation.ServerResponse.Header or (if a response was returned at
  62964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62965. // to check whether the returned error was because
  62966. // http.StatusNotModified was returned.
  62967. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62968. gensupport.SetOptions(c.urlParams_, opts...)
  62969. res, err := c.doRequest("json")
  62970. if res != nil && res.StatusCode == http.StatusNotModified {
  62971. if res.Body != nil {
  62972. res.Body.Close()
  62973. }
  62974. return nil, &googleapi.Error{
  62975. Code: res.StatusCode,
  62976. Header: res.Header,
  62977. }
  62978. }
  62979. if err != nil {
  62980. return nil, err
  62981. }
  62982. defer googleapi.CloseBody(res)
  62983. if err := googleapi.CheckResponse(res); err != nil {
  62984. return nil, err
  62985. }
  62986. ret := &Operation{
  62987. ServerResponse: googleapi.ServerResponse{
  62988. Header: res.Header,
  62989. HTTPStatusCode: res.StatusCode,
  62990. },
  62991. }
  62992. target := &ret
  62993. if err := gensupport.DecodeResponse(target, res); err != nil {
  62994. return nil, err
  62995. }
  62996. return ret, nil
  62997. // {
  62998. // "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.",
  62999. // "httpMethod": "POST",
  63000. // "id": "compute.instances.stop",
  63001. // "parameterOrder": [
  63002. // "project",
  63003. // "zone",
  63004. // "instance"
  63005. // ],
  63006. // "parameters": {
  63007. // "instance": {
  63008. // "description": "Name of the instance resource to stop.",
  63009. // "location": "path",
  63010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63011. // "required": true,
  63012. // "type": "string"
  63013. // },
  63014. // "project": {
  63015. // "description": "Project ID for this request.",
  63016. // "location": "path",
  63017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63018. // "required": true,
  63019. // "type": "string"
  63020. // },
  63021. // "requestId": {
  63022. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63023. // "location": "query",
  63024. // "type": "string"
  63025. // },
  63026. // "zone": {
  63027. // "description": "The name of the zone for this request.",
  63028. // "location": "path",
  63029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63030. // "required": true,
  63031. // "type": "string"
  63032. // }
  63033. // },
  63034. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  63035. // "response": {
  63036. // "$ref": "Operation"
  63037. // },
  63038. // "scopes": [
  63039. // "https://www.googleapis.com/auth/cloud-platform",
  63040. // "https://www.googleapis.com/auth/compute"
  63041. // ]
  63042. // }
  63043. }
  63044. // method id "compute.instances.suspend":
  63045. type InstancesSuspendCall struct {
  63046. s *Service
  63047. project string
  63048. zone string
  63049. instance string
  63050. urlParams_ gensupport.URLParams
  63051. ctx_ context.Context
  63052. header_ http.Header
  63053. }
  63054. // Suspend: This method suspends a running instance, saving its state to
  63055. // persistent storage, and allows you to resume the instance at a later
  63056. // time. Suspended instances incur reduced per-minute, virtual machine
  63057. // usage charges while they are suspended. Any resources the virtual
  63058. // machine is using, such as persistent disks and static IP addresses,
  63059. // will continue to be charged until they are deleted.
  63060. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  63061. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63062. c.project = project
  63063. c.zone = zone
  63064. c.instance = instance
  63065. return c
  63066. }
  63067. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  63068. // true, discard the contents of any attached localSSD partitions.
  63069. // Default value is false (== preserve localSSD data).
  63070. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  63071. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  63072. return c
  63073. }
  63074. // RequestId sets the optional parameter "requestId": An optional
  63075. // request ID to identify requests. Specify a unique request ID so that
  63076. // if you must retry your request, the server will know to ignore the
  63077. // request if it has already been completed.
  63078. //
  63079. // For example, consider a situation where you make an initial request
  63080. // and the request times out. If you make the request again with the
  63081. // same request ID, the server can check if original operation with the
  63082. // same request ID was received, and if so, will ignore the second
  63083. // request. This prevents clients from accidentally creating duplicate
  63084. // commitments.
  63085. //
  63086. // The request ID must be a valid UUID with the exception that zero UUID
  63087. // is not supported (00000000-0000-0000-0000-000000000000).
  63088. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  63089. c.urlParams_.Set("requestId", requestId)
  63090. return c
  63091. }
  63092. // Fields allows partial responses to be retrieved. See
  63093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63094. // for more information.
  63095. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  63096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63097. return c
  63098. }
  63099. // Context sets the context to be used in this call's Do method. Any
  63100. // pending HTTP request will be aborted if the provided context is
  63101. // canceled.
  63102. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  63103. c.ctx_ = ctx
  63104. return c
  63105. }
  63106. // Header returns an http.Header that can be modified by the caller to
  63107. // add HTTP headers to the request.
  63108. func (c *InstancesSuspendCall) Header() http.Header {
  63109. if c.header_ == nil {
  63110. c.header_ = make(http.Header)
  63111. }
  63112. return c.header_
  63113. }
  63114. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  63115. reqHeaders := make(http.Header)
  63116. for k, v := range c.header_ {
  63117. reqHeaders[k] = v
  63118. }
  63119. reqHeaders.Set("User-Agent", c.s.userAgent())
  63120. var body io.Reader = nil
  63121. c.urlParams_.Set("alt", alt)
  63122. c.urlParams_.Set("prettyPrint", "false")
  63123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  63124. urls += "?" + c.urlParams_.Encode()
  63125. req, err := http.NewRequest("POST", urls, body)
  63126. if err != nil {
  63127. return nil, err
  63128. }
  63129. req.Header = reqHeaders
  63130. googleapi.Expand(req.URL, map[string]string{
  63131. "project": c.project,
  63132. "zone": c.zone,
  63133. "instance": c.instance,
  63134. })
  63135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63136. }
  63137. // Do executes the "compute.instances.suspend" call.
  63138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63139. // status code is an error. Response headers are in either
  63140. // *Operation.ServerResponse.Header or (if a response was returned at
  63141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63142. // to check whether the returned error was because
  63143. // http.StatusNotModified was returned.
  63144. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63145. gensupport.SetOptions(c.urlParams_, opts...)
  63146. res, err := c.doRequest("json")
  63147. if res != nil && res.StatusCode == http.StatusNotModified {
  63148. if res.Body != nil {
  63149. res.Body.Close()
  63150. }
  63151. return nil, &googleapi.Error{
  63152. Code: res.StatusCode,
  63153. Header: res.Header,
  63154. }
  63155. }
  63156. if err != nil {
  63157. return nil, err
  63158. }
  63159. defer googleapi.CloseBody(res)
  63160. if err := googleapi.CheckResponse(res); err != nil {
  63161. return nil, err
  63162. }
  63163. ret := &Operation{
  63164. ServerResponse: googleapi.ServerResponse{
  63165. Header: res.Header,
  63166. HTTPStatusCode: res.StatusCode,
  63167. },
  63168. }
  63169. target := &ret
  63170. if err := gensupport.DecodeResponse(target, res); err != nil {
  63171. return nil, err
  63172. }
  63173. return ret, nil
  63174. // {
  63175. // "description": "This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted.",
  63176. // "httpMethod": "POST",
  63177. // "id": "compute.instances.suspend",
  63178. // "parameterOrder": [
  63179. // "project",
  63180. // "zone",
  63181. // "instance"
  63182. // ],
  63183. // "parameters": {
  63184. // "discardLocalSsd": {
  63185. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  63186. // "location": "query",
  63187. // "type": "boolean"
  63188. // },
  63189. // "instance": {
  63190. // "description": "Name of the instance resource to suspend.",
  63191. // "location": "path",
  63192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63193. // "required": true,
  63194. // "type": "string"
  63195. // },
  63196. // "project": {
  63197. // "description": "Project ID for this request.",
  63198. // "location": "path",
  63199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63200. // "required": true,
  63201. // "type": "string"
  63202. // },
  63203. // "requestId": {
  63204. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63205. // "location": "query",
  63206. // "type": "string"
  63207. // },
  63208. // "zone": {
  63209. // "description": "The name of the zone for this request.",
  63210. // "location": "path",
  63211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63212. // "required": true,
  63213. // "type": "string"
  63214. // }
  63215. // },
  63216. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  63217. // "response": {
  63218. // "$ref": "Operation"
  63219. // },
  63220. // "scopes": [
  63221. // "https://www.googleapis.com/auth/cloud-platform",
  63222. // "https://www.googleapis.com/auth/compute"
  63223. // ]
  63224. // }
  63225. }
  63226. // method id "compute.instances.testIamPermissions":
  63227. type InstancesTestIamPermissionsCall struct {
  63228. s *Service
  63229. project string
  63230. zone string
  63231. resource string
  63232. testpermissionsrequest *TestPermissionsRequest
  63233. urlParams_ gensupport.URLParams
  63234. ctx_ context.Context
  63235. header_ http.Header
  63236. }
  63237. // TestIamPermissions: Returns permissions that a caller has on the
  63238. // specified resource.
  63239. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  63240. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63241. c.project = project
  63242. c.zone = zone
  63243. c.resource = resource
  63244. c.testpermissionsrequest = testpermissionsrequest
  63245. return c
  63246. }
  63247. // Fields allows partial responses to be retrieved. See
  63248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63249. // for more information.
  63250. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  63251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63252. return c
  63253. }
  63254. // Context sets the context to be used in this call's Do method. Any
  63255. // pending HTTP request will be aborted if the provided context is
  63256. // canceled.
  63257. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  63258. c.ctx_ = ctx
  63259. return c
  63260. }
  63261. // Header returns an http.Header that can be modified by the caller to
  63262. // add HTTP headers to the request.
  63263. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  63264. if c.header_ == nil {
  63265. c.header_ = make(http.Header)
  63266. }
  63267. return c.header_
  63268. }
  63269. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  63270. reqHeaders := make(http.Header)
  63271. for k, v := range c.header_ {
  63272. reqHeaders[k] = v
  63273. }
  63274. reqHeaders.Set("User-Agent", c.s.userAgent())
  63275. var body io.Reader = nil
  63276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  63277. if err != nil {
  63278. return nil, err
  63279. }
  63280. reqHeaders.Set("Content-Type", "application/json")
  63281. c.urlParams_.Set("alt", alt)
  63282. c.urlParams_.Set("prettyPrint", "false")
  63283. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  63284. urls += "?" + c.urlParams_.Encode()
  63285. req, err := http.NewRequest("POST", urls, body)
  63286. if err != nil {
  63287. return nil, err
  63288. }
  63289. req.Header = reqHeaders
  63290. googleapi.Expand(req.URL, map[string]string{
  63291. "project": c.project,
  63292. "zone": c.zone,
  63293. "resource": c.resource,
  63294. })
  63295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63296. }
  63297. // Do executes the "compute.instances.testIamPermissions" call.
  63298. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  63299. // non-2xx status code is an error. Response headers are in either
  63300. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  63301. // returned at all) in error.(*googleapi.Error).Header. Use
  63302. // googleapi.IsNotModified to check whether the returned error was
  63303. // because http.StatusNotModified was returned.
  63304. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  63305. gensupport.SetOptions(c.urlParams_, opts...)
  63306. res, err := c.doRequest("json")
  63307. if res != nil && res.StatusCode == http.StatusNotModified {
  63308. if res.Body != nil {
  63309. res.Body.Close()
  63310. }
  63311. return nil, &googleapi.Error{
  63312. Code: res.StatusCode,
  63313. Header: res.Header,
  63314. }
  63315. }
  63316. if err != nil {
  63317. return nil, err
  63318. }
  63319. defer googleapi.CloseBody(res)
  63320. if err := googleapi.CheckResponse(res); err != nil {
  63321. return nil, err
  63322. }
  63323. ret := &TestPermissionsResponse{
  63324. ServerResponse: googleapi.ServerResponse{
  63325. Header: res.Header,
  63326. HTTPStatusCode: res.StatusCode,
  63327. },
  63328. }
  63329. target := &ret
  63330. if err := gensupport.DecodeResponse(target, res); err != nil {
  63331. return nil, err
  63332. }
  63333. return ret, nil
  63334. // {
  63335. // "description": "Returns permissions that a caller has on the specified resource.",
  63336. // "httpMethod": "POST",
  63337. // "id": "compute.instances.testIamPermissions",
  63338. // "parameterOrder": [
  63339. // "project",
  63340. // "zone",
  63341. // "resource"
  63342. // ],
  63343. // "parameters": {
  63344. // "project": {
  63345. // "description": "Project ID for this request.",
  63346. // "location": "path",
  63347. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63348. // "required": true,
  63349. // "type": "string"
  63350. // },
  63351. // "resource": {
  63352. // "description": "Name or id of the resource for this request.",
  63353. // "location": "path",
  63354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63355. // "required": true,
  63356. // "type": "string"
  63357. // },
  63358. // "zone": {
  63359. // "description": "The name of the zone for this request.",
  63360. // "location": "path",
  63361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63362. // "required": true,
  63363. // "type": "string"
  63364. // }
  63365. // },
  63366. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  63367. // "request": {
  63368. // "$ref": "TestPermissionsRequest"
  63369. // },
  63370. // "response": {
  63371. // "$ref": "TestPermissionsResponse"
  63372. // },
  63373. // "scopes": [
  63374. // "https://www.googleapis.com/auth/cloud-platform",
  63375. // "https://www.googleapis.com/auth/compute",
  63376. // "https://www.googleapis.com/auth/compute.readonly"
  63377. // ]
  63378. // }
  63379. }
  63380. // method id "compute.instances.updateAccessConfig":
  63381. type InstancesUpdateAccessConfigCall struct {
  63382. s *Service
  63383. project string
  63384. zone string
  63385. instance string
  63386. accessconfig *AccessConfig
  63387. urlParams_ gensupport.URLParams
  63388. ctx_ context.Context
  63389. header_ http.Header
  63390. }
  63391. // UpdateAccessConfig: Updates the specified access config from an
  63392. // instance's network interface with the data included in the request.
  63393. // This method supports PATCH semantics and uses the JSON merge patch
  63394. // format and processing rules.
  63395. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  63396. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63397. c.project = project
  63398. c.zone = zone
  63399. c.instance = instance
  63400. c.urlParams_.Set("networkInterface", networkInterface)
  63401. c.accessconfig = accessconfig
  63402. return c
  63403. }
  63404. // RequestId sets the optional parameter "requestId": An optional
  63405. // request ID to identify requests. Specify a unique request ID so that
  63406. // if you must retry your request, the server will know to ignore the
  63407. // request if it has already been completed.
  63408. //
  63409. // For example, consider a situation where you make an initial request
  63410. // and the request times out. If you make the request again with the
  63411. // same request ID, the server can check if original operation with the
  63412. // same request ID was received, and if so, will ignore the second
  63413. // request. This prevents clients from accidentally creating duplicate
  63414. // commitments.
  63415. //
  63416. // The request ID must be a valid UUID with the exception that zero UUID
  63417. // is not supported (00000000-0000-0000-0000-000000000000).
  63418. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  63419. c.urlParams_.Set("requestId", requestId)
  63420. return c
  63421. }
  63422. // Fields allows partial responses to be retrieved. See
  63423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63424. // for more information.
  63425. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  63426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63427. return c
  63428. }
  63429. // Context sets the context to be used in this call's Do method. Any
  63430. // pending HTTP request will be aborted if the provided context is
  63431. // canceled.
  63432. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  63433. c.ctx_ = ctx
  63434. return c
  63435. }
  63436. // Header returns an http.Header that can be modified by the caller to
  63437. // add HTTP headers to the request.
  63438. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  63439. if c.header_ == nil {
  63440. c.header_ = make(http.Header)
  63441. }
  63442. return c.header_
  63443. }
  63444. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  63445. reqHeaders := make(http.Header)
  63446. for k, v := range c.header_ {
  63447. reqHeaders[k] = v
  63448. }
  63449. reqHeaders.Set("User-Agent", c.s.userAgent())
  63450. var body io.Reader = nil
  63451. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  63452. if err != nil {
  63453. return nil, err
  63454. }
  63455. reqHeaders.Set("Content-Type", "application/json")
  63456. c.urlParams_.Set("alt", alt)
  63457. c.urlParams_.Set("prettyPrint", "false")
  63458. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  63459. urls += "?" + c.urlParams_.Encode()
  63460. req, err := http.NewRequest("POST", urls, body)
  63461. if err != nil {
  63462. return nil, err
  63463. }
  63464. req.Header = reqHeaders
  63465. googleapi.Expand(req.URL, map[string]string{
  63466. "project": c.project,
  63467. "zone": c.zone,
  63468. "instance": c.instance,
  63469. })
  63470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63471. }
  63472. // Do executes the "compute.instances.updateAccessConfig" call.
  63473. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63474. // status code is an error. Response headers are in either
  63475. // *Operation.ServerResponse.Header or (if a response was returned at
  63476. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63477. // to check whether the returned error was because
  63478. // http.StatusNotModified was returned.
  63479. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63480. gensupport.SetOptions(c.urlParams_, opts...)
  63481. res, err := c.doRequest("json")
  63482. if res != nil && res.StatusCode == http.StatusNotModified {
  63483. if res.Body != nil {
  63484. res.Body.Close()
  63485. }
  63486. return nil, &googleapi.Error{
  63487. Code: res.StatusCode,
  63488. Header: res.Header,
  63489. }
  63490. }
  63491. if err != nil {
  63492. return nil, err
  63493. }
  63494. defer googleapi.CloseBody(res)
  63495. if err := googleapi.CheckResponse(res); err != nil {
  63496. return nil, err
  63497. }
  63498. ret := &Operation{
  63499. ServerResponse: googleapi.ServerResponse{
  63500. Header: res.Header,
  63501. HTTPStatusCode: res.StatusCode,
  63502. },
  63503. }
  63504. target := &ret
  63505. if err := gensupport.DecodeResponse(target, res); err != nil {
  63506. return nil, err
  63507. }
  63508. return ret, nil
  63509. // {
  63510. // "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.",
  63511. // "httpMethod": "POST",
  63512. // "id": "compute.instances.updateAccessConfig",
  63513. // "parameterOrder": [
  63514. // "project",
  63515. // "zone",
  63516. // "instance",
  63517. // "networkInterface"
  63518. // ],
  63519. // "parameters": {
  63520. // "instance": {
  63521. // "description": "The instance name for this request.",
  63522. // "location": "path",
  63523. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63524. // "required": true,
  63525. // "type": "string"
  63526. // },
  63527. // "networkInterface": {
  63528. // "description": "The name of the network interface where the access config is attached.",
  63529. // "location": "query",
  63530. // "required": true,
  63531. // "type": "string"
  63532. // },
  63533. // "project": {
  63534. // "description": "Project ID for this request.",
  63535. // "location": "path",
  63536. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63537. // "required": true,
  63538. // "type": "string"
  63539. // },
  63540. // "requestId": {
  63541. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63542. // "location": "query",
  63543. // "type": "string"
  63544. // },
  63545. // "zone": {
  63546. // "description": "The name of the zone for this request.",
  63547. // "location": "path",
  63548. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63549. // "required": true,
  63550. // "type": "string"
  63551. // }
  63552. // },
  63553. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  63554. // "request": {
  63555. // "$ref": "AccessConfig"
  63556. // },
  63557. // "response": {
  63558. // "$ref": "Operation"
  63559. // },
  63560. // "scopes": [
  63561. // "https://www.googleapis.com/auth/cloud-platform",
  63562. // "https://www.googleapis.com/auth/compute"
  63563. // ]
  63564. // }
  63565. }
  63566. // method id "compute.instances.updateDisplayDevice":
  63567. type InstancesUpdateDisplayDeviceCall struct {
  63568. s *Service
  63569. project string
  63570. zone string
  63571. instance string
  63572. displaydevice *DisplayDevice
  63573. urlParams_ gensupport.URLParams
  63574. ctx_ context.Context
  63575. header_ http.Header
  63576. }
  63577. // UpdateDisplayDevice: Updates the Display config for a VM instance.
  63578. // You can only use this method on a stopped VM instance. This method
  63579. // supports PATCH semantics and uses the JSON merge patch format and
  63580. // processing rules.
  63581. func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
  63582. c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63583. c.project = project
  63584. c.zone = zone
  63585. c.instance = instance
  63586. c.displaydevice = displaydevice
  63587. return c
  63588. }
  63589. // RequestId sets the optional parameter "requestId": An optional
  63590. // request ID to identify requests. Specify a unique request ID so that
  63591. // if you must retry your request, the server will know to ignore the
  63592. // request if it has already been completed.
  63593. //
  63594. // For example, consider a situation where you make an initial request
  63595. // and the request times out. If you make the request again with the
  63596. // same request ID, the server can check if original operation with the
  63597. // same request ID was received, and if so, will ignore the second
  63598. // request. This prevents clients from accidentally creating duplicate
  63599. // commitments.
  63600. //
  63601. // The request ID must be a valid UUID with the exception that zero UUID
  63602. // is not supported (00000000-0000-0000-0000-000000000000).
  63603. func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
  63604. c.urlParams_.Set("requestId", requestId)
  63605. return c
  63606. }
  63607. // Fields allows partial responses to be retrieved. See
  63608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63609. // for more information.
  63610. func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
  63611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63612. return c
  63613. }
  63614. // Context sets the context to be used in this call's Do method. Any
  63615. // pending HTTP request will be aborted if the provided context is
  63616. // canceled.
  63617. func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
  63618. c.ctx_ = ctx
  63619. return c
  63620. }
  63621. // Header returns an http.Header that can be modified by the caller to
  63622. // add HTTP headers to the request.
  63623. func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header {
  63624. if c.header_ == nil {
  63625. c.header_ = make(http.Header)
  63626. }
  63627. return c.header_
  63628. }
  63629. func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
  63630. reqHeaders := make(http.Header)
  63631. for k, v := range c.header_ {
  63632. reqHeaders[k] = v
  63633. }
  63634. reqHeaders.Set("User-Agent", c.s.userAgent())
  63635. var body io.Reader = nil
  63636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
  63637. if err != nil {
  63638. return nil, err
  63639. }
  63640. reqHeaders.Set("Content-Type", "application/json")
  63641. c.urlParams_.Set("alt", alt)
  63642. c.urlParams_.Set("prettyPrint", "false")
  63643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
  63644. urls += "?" + c.urlParams_.Encode()
  63645. req, err := http.NewRequest("PATCH", urls, body)
  63646. if err != nil {
  63647. return nil, err
  63648. }
  63649. req.Header = reqHeaders
  63650. googleapi.Expand(req.URL, map[string]string{
  63651. "project": c.project,
  63652. "zone": c.zone,
  63653. "instance": c.instance,
  63654. })
  63655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63656. }
  63657. // Do executes the "compute.instances.updateDisplayDevice" call.
  63658. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63659. // status code is an error. Response headers are in either
  63660. // *Operation.ServerResponse.Header or (if a response was returned at
  63661. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63662. // to check whether the returned error was because
  63663. // http.StatusNotModified was returned.
  63664. func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63665. gensupport.SetOptions(c.urlParams_, opts...)
  63666. res, err := c.doRequest("json")
  63667. if res != nil && res.StatusCode == http.StatusNotModified {
  63668. if res.Body != nil {
  63669. res.Body.Close()
  63670. }
  63671. return nil, &googleapi.Error{
  63672. Code: res.StatusCode,
  63673. Header: res.Header,
  63674. }
  63675. }
  63676. if err != nil {
  63677. return nil, err
  63678. }
  63679. defer googleapi.CloseBody(res)
  63680. if err := googleapi.CheckResponse(res); err != nil {
  63681. return nil, err
  63682. }
  63683. ret := &Operation{
  63684. ServerResponse: googleapi.ServerResponse{
  63685. Header: res.Header,
  63686. HTTPStatusCode: res.StatusCode,
  63687. },
  63688. }
  63689. target := &ret
  63690. if err := gensupport.DecodeResponse(target, res); err != nil {
  63691. return nil, err
  63692. }
  63693. return ret, nil
  63694. // {
  63695. // "description": "Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  63696. // "httpMethod": "PATCH",
  63697. // "id": "compute.instances.updateDisplayDevice",
  63698. // "parameterOrder": [
  63699. // "project",
  63700. // "zone",
  63701. // "instance"
  63702. // ],
  63703. // "parameters": {
  63704. // "instance": {
  63705. // "description": "Name of the instance scoping this request.",
  63706. // "location": "path",
  63707. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63708. // "required": true,
  63709. // "type": "string"
  63710. // },
  63711. // "project": {
  63712. // "description": "Project ID for this request.",
  63713. // "location": "path",
  63714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63715. // "required": true,
  63716. // "type": "string"
  63717. // },
  63718. // "requestId": {
  63719. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63720. // "location": "query",
  63721. // "type": "string"
  63722. // },
  63723. // "zone": {
  63724. // "description": "The name of the zone for this request.",
  63725. // "location": "path",
  63726. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63727. // "required": true,
  63728. // "type": "string"
  63729. // }
  63730. // },
  63731. // "path": "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
  63732. // "request": {
  63733. // "$ref": "DisplayDevice"
  63734. // },
  63735. // "response": {
  63736. // "$ref": "Operation"
  63737. // },
  63738. // "scopes": [
  63739. // "https://www.googleapis.com/auth/cloud-platform",
  63740. // "https://www.googleapis.com/auth/compute"
  63741. // ]
  63742. // }
  63743. }
  63744. // method id "compute.instances.updateNetworkInterface":
  63745. type InstancesUpdateNetworkInterfaceCall struct {
  63746. s *Service
  63747. project string
  63748. zone string
  63749. instance string
  63750. networkinterface *NetworkInterface
  63751. urlParams_ gensupport.URLParams
  63752. ctx_ context.Context
  63753. header_ http.Header
  63754. }
  63755. // UpdateNetworkInterface: Updates an instance's network interface. This
  63756. // method follows PATCH semantics.
  63757. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  63758. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63759. c.project = project
  63760. c.zone = zone
  63761. c.instance = instance
  63762. c.urlParams_.Set("networkInterface", networkInterface)
  63763. c.networkinterface = networkinterface
  63764. return c
  63765. }
  63766. // RequestId sets the optional parameter "requestId": An optional
  63767. // request ID to identify requests. Specify a unique request ID so that
  63768. // if you must retry your request, the server will know to ignore the
  63769. // request if it has already been completed.
  63770. //
  63771. // For example, consider a situation where you make an initial request
  63772. // and the request times out. If you make the request again with the
  63773. // same request ID, the server can check if original operation with the
  63774. // same request ID was received, and if so, will ignore the second
  63775. // request. This prevents clients from accidentally creating duplicate
  63776. // commitments.
  63777. //
  63778. // The request ID must be a valid UUID with the exception that zero UUID
  63779. // is not supported (00000000-0000-0000-0000-000000000000).
  63780. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  63781. c.urlParams_.Set("requestId", requestId)
  63782. return c
  63783. }
  63784. // Fields allows partial responses to be retrieved. See
  63785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63786. // for more information.
  63787. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  63788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63789. return c
  63790. }
  63791. // Context sets the context to be used in this call's Do method. Any
  63792. // pending HTTP request will be aborted if the provided context is
  63793. // canceled.
  63794. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  63795. c.ctx_ = ctx
  63796. return c
  63797. }
  63798. // Header returns an http.Header that can be modified by the caller to
  63799. // add HTTP headers to the request.
  63800. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  63801. if c.header_ == nil {
  63802. c.header_ = make(http.Header)
  63803. }
  63804. return c.header_
  63805. }
  63806. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  63807. reqHeaders := make(http.Header)
  63808. for k, v := range c.header_ {
  63809. reqHeaders[k] = v
  63810. }
  63811. reqHeaders.Set("User-Agent", c.s.userAgent())
  63812. var body io.Reader = nil
  63813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  63814. if err != nil {
  63815. return nil, err
  63816. }
  63817. reqHeaders.Set("Content-Type", "application/json")
  63818. c.urlParams_.Set("alt", alt)
  63819. c.urlParams_.Set("prettyPrint", "false")
  63820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  63821. urls += "?" + c.urlParams_.Encode()
  63822. req, err := http.NewRequest("PATCH", urls, body)
  63823. if err != nil {
  63824. return nil, err
  63825. }
  63826. req.Header = reqHeaders
  63827. googleapi.Expand(req.URL, map[string]string{
  63828. "project": c.project,
  63829. "zone": c.zone,
  63830. "instance": c.instance,
  63831. })
  63832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63833. }
  63834. // Do executes the "compute.instances.updateNetworkInterface" call.
  63835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63836. // status code is an error. Response headers are in either
  63837. // *Operation.ServerResponse.Header or (if a response was returned at
  63838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63839. // to check whether the returned error was because
  63840. // http.StatusNotModified was returned.
  63841. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63842. gensupport.SetOptions(c.urlParams_, opts...)
  63843. res, err := c.doRequest("json")
  63844. if res != nil && res.StatusCode == http.StatusNotModified {
  63845. if res.Body != nil {
  63846. res.Body.Close()
  63847. }
  63848. return nil, &googleapi.Error{
  63849. Code: res.StatusCode,
  63850. Header: res.Header,
  63851. }
  63852. }
  63853. if err != nil {
  63854. return nil, err
  63855. }
  63856. defer googleapi.CloseBody(res)
  63857. if err := googleapi.CheckResponse(res); err != nil {
  63858. return nil, err
  63859. }
  63860. ret := &Operation{
  63861. ServerResponse: googleapi.ServerResponse{
  63862. Header: res.Header,
  63863. HTTPStatusCode: res.StatusCode,
  63864. },
  63865. }
  63866. target := &ret
  63867. if err := gensupport.DecodeResponse(target, res); err != nil {
  63868. return nil, err
  63869. }
  63870. return ret, nil
  63871. // {
  63872. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  63873. // "httpMethod": "PATCH",
  63874. // "id": "compute.instances.updateNetworkInterface",
  63875. // "parameterOrder": [
  63876. // "project",
  63877. // "zone",
  63878. // "instance",
  63879. // "networkInterface"
  63880. // ],
  63881. // "parameters": {
  63882. // "instance": {
  63883. // "description": "The instance name for this request.",
  63884. // "location": "path",
  63885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63886. // "required": true,
  63887. // "type": "string"
  63888. // },
  63889. // "networkInterface": {
  63890. // "description": "The name of the network interface to update.",
  63891. // "location": "query",
  63892. // "required": true,
  63893. // "type": "string"
  63894. // },
  63895. // "project": {
  63896. // "description": "Project ID for this request.",
  63897. // "location": "path",
  63898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63899. // "required": true,
  63900. // "type": "string"
  63901. // },
  63902. // "requestId": {
  63903. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63904. // "location": "query",
  63905. // "type": "string"
  63906. // },
  63907. // "zone": {
  63908. // "description": "The name of the zone for this request.",
  63909. // "location": "path",
  63910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63911. // "required": true,
  63912. // "type": "string"
  63913. // }
  63914. // },
  63915. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  63916. // "request": {
  63917. // "$ref": "NetworkInterface"
  63918. // },
  63919. // "response": {
  63920. // "$ref": "Operation"
  63921. // },
  63922. // "scopes": [
  63923. // "https://www.googleapis.com/auth/cloud-platform",
  63924. // "https://www.googleapis.com/auth/compute"
  63925. // ]
  63926. // }
  63927. }
  63928. // method id "compute.instances.updateShieldedVmConfig":
  63929. type InstancesUpdateShieldedVmConfigCall struct {
  63930. s *Service
  63931. project string
  63932. zone string
  63933. instance string
  63934. shieldedvmconfig *ShieldedVmConfig
  63935. urlParams_ gensupport.URLParams
  63936. ctx_ context.Context
  63937. header_ http.Header
  63938. }
  63939. // UpdateShieldedVmConfig: Updates the Shielded VM config for a VM
  63940. // instance. You can only use this method on a stopped VM instance. This
  63941. // method supports PATCH semantics and uses the JSON merge patch format
  63942. // and processing rules.
  63943. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  63944. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63945. c.project = project
  63946. c.zone = zone
  63947. c.instance = instance
  63948. c.shieldedvmconfig = shieldedvmconfig
  63949. return c
  63950. }
  63951. // RequestId sets the optional parameter "requestId": An optional
  63952. // request ID to identify requests. Specify a unique request ID so that
  63953. // if you must retry your request, the server will know to ignore the
  63954. // request if it has already been completed.
  63955. //
  63956. // For example, consider a situation where you make an initial request
  63957. // and the request times out. If you make the request again with the
  63958. // same request ID, the server can check if original operation with the
  63959. // same request ID was received, and if so, will ignore the second
  63960. // request. This prevents clients from accidentally creating duplicate
  63961. // commitments.
  63962. //
  63963. // The request ID must be a valid UUID with the exception that zero UUID
  63964. // is not supported (00000000-0000-0000-0000-000000000000).
  63965. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  63966. c.urlParams_.Set("requestId", requestId)
  63967. return c
  63968. }
  63969. // Fields allows partial responses to be retrieved. See
  63970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63971. // for more information.
  63972. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  63973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63974. return c
  63975. }
  63976. // Context sets the context to be used in this call's Do method. Any
  63977. // pending HTTP request will be aborted if the provided context is
  63978. // canceled.
  63979. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  63980. c.ctx_ = ctx
  63981. return c
  63982. }
  63983. // Header returns an http.Header that can be modified by the caller to
  63984. // add HTTP headers to the request.
  63985. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  63986. if c.header_ == nil {
  63987. c.header_ = make(http.Header)
  63988. }
  63989. return c.header_
  63990. }
  63991. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  63992. reqHeaders := make(http.Header)
  63993. for k, v := range c.header_ {
  63994. reqHeaders[k] = v
  63995. }
  63996. reqHeaders.Set("User-Agent", c.s.userAgent())
  63997. var body io.Reader = nil
  63998. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  63999. if err != nil {
  64000. return nil, err
  64001. }
  64002. reqHeaders.Set("Content-Type", "application/json")
  64003. c.urlParams_.Set("alt", alt)
  64004. c.urlParams_.Set("prettyPrint", "false")
  64005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  64006. urls += "?" + c.urlParams_.Encode()
  64007. req, err := http.NewRequest("PATCH", urls, body)
  64008. if err != nil {
  64009. return nil, err
  64010. }
  64011. req.Header = reqHeaders
  64012. googleapi.Expand(req.URL, map[string]string{
  64013. "project": c.project,
  64014. "zone": c.zone,
  64015. "instance": c.instance,
  64016. })
  64017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64018. }
  64019. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  64020. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64021. // status code is an error. Response headers are in either
  64022. // *Operation.ServerResponse.Header or (if a response was returned at
  64023. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64024. // to check whether the returned error was because
  64025. // http.StatusNotModified was returned.
  64026. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64027. gensupport.SetOptions(c.urlParams_, opts...)
  64028. res, err := c.doRequest("json")
  64029. if res != nil && res.StatusCode == http.StatusNotModified {
  64030. if res.Body != nil {
  64031. res.Body.Close()
  64032. }
  64033. return nil, &googleapi.Error{
  64034. Code: res.StatusCode,
  64035. Header: res.Header,
  64036. }
  64037. }
  64038. if err != nil {
  64039. return nil, err
  64040. }
  64041. defer googleapi.CloseBody(res)
  64042. if err := googleapi.CheckResponse(res); err != nil {
  64043. return nil, err
  64044. }
  64045. ret := &Operation{
  64046. ServerResponse: googleapi.ServerResponse{
  64047. Header: res.Header,
  64048. HTTPStatusCode: res.StatusCode,
  64049. },
  64050. }
  64051. target := &ret
  64052. if err := gensupport.DecodeResponse(target, res); err != nil {
  64053. return nil, err
  64054. }
  64055. return ret, nil
  64056. // {
  64057. // "description": "Updates the Shielded VM config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  64058. // "httpMethod": "PATCH",
  64059. // "id": "compute.instances.updateShieldedVmConfig",
  64060. // "parameterOrder": [
  64061. // "project",
  64062. // "zone",
  64063. // "instance"
  64064. // ],
  64065. // "parameters": {
  64066. // "instance": {
  64067. // "description": "Name of the instance scoping this request.",
  64068. // "location": "path",
  64069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64070. // "required": true,
  64071. // "type": "string"
  64072. // },
  64073. // "project": {
  64074. // "description": "Project ID for this request.",
  64075. // "location": "path",
  64076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64077. // "required": true,
  64078. // "type": "string"
  64079. // },
  64080. // "requestId": {
  64081. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64082. // "location": "query",
  64083. // "type": "string"
  64084. // },
  64085. // "zone": {
  64086. // "description": "The name of the zone for this request.",
  64087. // "location": "path",
  64088. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64089. // "required": true,
  64090. // "type": "string"
  64091. // }
  64092. // },
  64093. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  64094. // "request": {
  64095. // "$ref": "ShieldedVmConfig"
  64096. // },
  64097. // "response": {
  64098. // "$ref": "Operation"
  64099. // },
  64100. // "scopes": [
  64101. // "https://www.googleapis.com/auth/cloud-platform",
  64102. // "https://www.googleapis.com/auth/compute"
  64103. // ]
  64104. // }
  64105. }
  64106. // method id "compute.interconnectAttachments.aggregatedList":
  64107. type InterconnectAttachmentsAggregatedListCall struct {
  64108. s *Service
  64109. project string
  64110. urlParams_ gensupport.URLParams
  64111. ifNoneMatch_ string
  64112. ctx_ context.Context
  64113. header_ http.Header
  64114. }
  64115. // AggregatedList: Retrieves an aggregated list of interconnect
  64116. // attachments.
  64117. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  64118. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64119. c.project = project
  64120. return c
  64121. }
  64122. // Filter sets the optional parameter "filter": A filter expression that
  64123. // filters resources listed in the response. The expression must specify
  64124. // the field name, a comparison operator, and the value that you want to
  64125. // use for filtering. The value must be a string, a number, or a
  64126. // boolean. The comparison operator must be either =, !=, >, or <.
  64127. //
  64128. // For example, if you are filtering Compute Engine instances, you can
  64129. // exclude instances named example-instance by specifying name !=
  64130. // example-instance.
  64131. //
  64132. // You can also filter nested fields. For example, you could specify
  64133. // scheduling.automaticRestart = false to include instances only if they
  64134. // are not scheduled for automatic restarts. You can use filtering on
  64135. // nested fields to filter based on resource labels.
  64136. //
  64137. // To filter on multiple expressions, provide each separate expression
  64138. // within parentheses. For example, (scheduling.automaticRestart = true)
  64139. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64140. // AND expression. However, you can include AND and OR expressions
  64141. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64142. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64143. // true).
  64144. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  64145. c.urlParams_.Set("filter", filter)
  64146. return c
  64147. }
  64148. // MaxResults sets the optional parameter "maxResults": The maximum
  64149. // number of results per page that should be returned. If the number of
  64150. // available results is larger than maxResults, Compute Engine returns a
  64151. // nextPageToken that can be used to get the next page of results in
  64152. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64153. // (Default: 500)
  64154. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  64155. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64156. return c
  64157. }
  64158. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64159. // a certain order. By default, results are returned in alphanumerical
  64160. // order based on the resource name.
  64161. //
  64162. // You can also sort results in descending order based on the creation
  64163. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64164. // based on the creationTimestamp field in reverse chronological order
  64165. // (newest result first). Use this to sort resources like operations so
  64166. // that the newest operation is returned first.
  64167. //
  64168. // Currently, only sorting by name or creationTimestamp desc is
  64169. // supported.
  64170. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  64171. c.urlParams_.Set("orderBy", orderBy)
  64172. return c
  64173. }
  64174. // PageToken sets the optional parameter "pageToken": Specifies a page
  64175. // token to use. Set pageToken to the nextPageToken returned by a
  64176. // previous list request to get the next page of results.
  64177. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  64178. c.urlParams_.Set("pageToken", pageToken)
  64179. return c
  64180. }
  64181. // Fields allows partial responses to be retrieved. See
  64182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64183. // for more information.
  64184. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  64185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64186. return c
  64187. }
  64188. // IfNoneMatch sets the optional parameter which makes the operation
  64189. // fail if the object's ETag matches the given value. This is useful for
  64190. // getting updates only after the object has changed since the last
  64191. // request. Use googleapi.IsNotModified to check whether the response
  64192. // error from Do is the result of In-None-Match.
  64193. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  64194. c.ifNoneMatch_ = entityTag
  64195. return c
  64196. }
  64197. // Context sets the context to be used in this call's Do method. Any
  64198. // pending HTTP request will be aborted if the provided context is
  64199. // canceled.
  64200. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  64201. c.ctx_ = ctx
  64202. return c
  64203. }
  64204. // Header returns an http.Header that can be modified by the caller to
  64205. // add HTTP headers to the request.
  64206. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  64207. if c.header_ == nil {
  64208. c.header_ = make(http.Header)
  64209. }
  64210. return c.header_
  64211. }
  64212. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  64213. reqHeaders := make(http.Header)
  64214. for k, v := range c.header_ {
  64215. reqHeaders[k] = v
  64216. }
  64217. reqHeaders.Set("User-Agent", c.s.userAgent())
  64218. if c.ifNoneMatch_ != "" {
  64219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64220. }
  64221. var body io.Reader = nil
  64222. c.urlParams_.Set("alt", alt)
  64223. c.urlParams_.Set("prettyPrint", "false")
  64224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  64225. urls += "?" + c.urlParams_.Encode()
  64226. req, err := http.NewRequest("GET", urls, body)
  64227. if err != nil {
  64228. return nil, err
  64229. }
  64230. req.Header = reqHeaders
  64231. googleapi.Expand(req.URL, map[string]string{
  64232. "project": c.project,
  64233. })
  64234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64235. }
  64236. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  64237. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  64238. // non-nil. Any non-2xx status code is an error. Response headers are in
  64239. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  64240. // (if a response was returned at all) in
  64241. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  64242. // whether the returned error was because http.StatusNotModified was
  64243. // returned.
  64244. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  64245. gensupport.SetOptions(c.urlParams_, opts...)
  64246. res, err := c.doRequest("json")
  64247. if res != nil && res.StatusCode == http.StatusNotModified {
  64248. if res.Body != nil {
  64249. res.Body.Close()
  64250. }
  64251. return nil, &googleapi.Error{
  64252. Code: res.StatusCode,
  64253. Header: res.Header,
  64254. }
  64255. }
  64256. if err != nil {
  64257. return nil, err
  64258. }
  64259. defer googleapi.CloseBody(res)
  64260. if err := googleapi.CheckResponse(res); err != nil {
  64261. return nil, err
  64262. }
  64263. ret := &InterconnectAttachmentAggregatedList{
  64264. ServerResponse: googleapi.ServerResponse{
  64265. Header: res.Header,
  64266. HTTPStatusCode: res.StatusCode,
  64267. },
  64268. }
  64269. target := &ret
  64270. if err := gensupport.DecodeResponse(target, res); err != nil {
  64271. return nil, err
  64272. }
  64273. return ret, nil
  64274. // {
  64275. // "description": "Retrieves an aggregated list of interconnect attachments.",
  64276. // "httpMethod": "GET",
  64277. // "id": "compute.interconnectAttachments.aggregatedList",
  64278. // "parameterOrder": [
  64279. // "project"
  64280. // ],
  64281. // "parameters": {
  64282. // "filter": {
  64283. // "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).",
  64284. // "location": "query",
  64285. // "type": "string"
  64286. // },
  64287. // "maxResults": {
  64288. // "default": "500",
  64289. // "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)",
  64290. // "format": "uint32",
  64291. // "location": "query",
  64292. // "minimum": "0",
  64293. // "type": "integer"
  64294. // },
  64295. // "orderBy": {
  64296. // "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.",
  64297. // "location": "query",
  64298. // "type": "string"
  64299. // },
  64300. // "pageToken": {
  64301. // "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.",
  64302. // "location": "query",
  64303. // "type": "string"
  64304. // },
  64305. // "project": {
  64306. // "description": "Project ID for this request.",
  64307. // "location": "path",
  64308. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64309. // "required": true,
  64310. // "type": "string"
  64311. // }
  64312. // },
  64313. // "path": "{project}/aggregated/interconnectAttachments",
  64314. // "response": {
  64315. // "$ref": "InterconnectAttachmentAggregatedList"
  64316. // },
  64317. // "scopes": [
  64318. // "https://www.googleapis.com/auth/cloud-platform",
  64319. // "https://www.googleapis.com/auth/compute",
  64320. // "https://www.googleapis.com/auth/compute.readonly"
  64321. // ]
  64322. // }
  64323. }
  64324. // Pages invokes f for each page of results.
  64325. // A non-nil error returned from f will halt the iteration.
  64326. // The provided context supersedes any context provided to the Context method.
  64327. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  64328. c.ctx_ = ctx
  64329. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64330. for {
  64331. x, err := c.Do()
  64332. if err != nil {
  64333. return err
  64334. }
  64335. if err := f(x); err != nil {
  64336. return err
  64337. }
  64338. if x.NextPageToken == "" {
  64339. return nil
  64340. }
  64341. c.PageToken(x.NextPageToken)
  64342. }
  64343. }
  64344. // method id "compute.interconnectAttachments.delete":
  64345. type InterconnectAttachmentsDeleteCall struct {
  64346. s *Service
  64347. project string
  64348. region string
  64349. interconnectAttachment string
  64350. urlParams_ gensupport.URLParams
  64351. ctx_ context.Context
  64352. header_ http.Header
  64353. }
  64354. // Delete: Deletes the specified interconnect attachment.
  64355. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  64356. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64357. c.project = project
  64358. c.region = region
  64359. c.interconnectAttachment = interconnectAttachment
  64360. return c
  64361. }
  64362. // RequestId sets the optional parameter "requestId": An optional
  64363. // request ID to identify requests. Specify a unique request ID so that
  64364. // if you must retry your request, the server will know to ignore the
  64365. // request if it has already been completed.
  64366. //
  64367. // For example, consider a situation where you make an initial request
  64368. // and the request times out. If you make the request again with the
  64369. // same request ID, the server can check if original operation with the
  64370. // same request ID was received, and if so, will ignore the second
  64371. // request. This prevents clients from accidentally creating duplicate
  64372. // commitments.
  64373. //
  64374. // The request ID must be a valid UUID with the exception that zero UUID
  64375. // is not supported (00000000-0000-0000-0000-000000000000).
  64376. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  64377. c.urlParams_.Set("requestId", requestId)
  64378. return c
  64379. }
  64380. // Fields allows partial responses to be retrieved. See
  64381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64382. // for more information.
  64383. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  64384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64385. return c
  64386. }
  64387. // Context sets the context to be used in this call's Do method. Any
  64388. // pending HTTP request will be aborted if the provided context is
  64389. // canceled.
  64390. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  64391. c.ctx_ = ctx
  64392. return c
  64393. }
  64394. // Header returns an http.Header that can be modified by the caller to
  64395. // add HTTP headers to the request.
  64396. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  64397. if c.header_ == nil {
  64398. c.header_ = make(http.Header)
  64399. }
  64400. return c.header_
  64401. }
  64402. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  64403. reqHeaders := make(http.Header)
  64404. for k, v := range c.header_ {
  64405. reqHeaders[k] = v
  64406. }
  64407. reqHeaders.Set("User-Agent", c.s.userAgent())
  64408. var body io.Reader = nil
  64409. c.urlParams_.Set("alt", alt)
  64410. c.urlParams_.Set("prettyPrint", "false")
  64411. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  64412. urls += "?" + c.urlParams_.Encode()
  64413. req, err := http.NewRequest("DELETE", urls, body)
  64414. if err != nil {
  64415. return nil, err
  64416. }
  64417. req.Header = reqHeaders
  64418. googleapi.Expand(req.URL, map[string]string{
  64419. "project": c.project,
  64420. "region": c.region,
  64421. "interconnectAttachment": c.interconnectAttachment,
  64422. })
  64423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64424. }
  64425. // Do executes the "compute.interconnectAttachments.delete" call.
  64426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64427. // status code is an error. Response headers are in either
  64428. // *Operation.ServerResponse.Header or (if a response was returned at
  64429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64430. // to check whether the returned error was because
  64431. // http.StatusNotModified was returned.
  64432. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64433. gensupport.SetOptions(c.urlParams_, opts...)
  64434. res, err := c.doRequest("json")
  64435. if res != nil && res.StatusCode == http.StatusNotModified {
  64436. if res.Body != nil {
  64437. res.Body.Close()
  64438. }
  64439. return nil, &googleapi.Error{
  64440. Code: res.StatusCode,
  64441. Header: res.Header,
  64442. }
  64443. }
  64444. if err != nil {
  64445. return nil, err
  64446. }
  64447. defer googleapi.CloseBody(res)
  64448. if err := googleapi.CheckResponse(res); err != nil {
  64449. return nil, err
  64450. }
  64451. ret := &Operation{
  64452. ServerResponse: googleapi.ServerResponse{
  64453. Header: res.Header,
  64454. HTTPStatusCode: res.StatusCode,
  64455. },
  64456. }
  64457. target := &ret
  64458. if err := gensupport.DecodeResponse(target, res); err != nil {
  64459. return nil, err
  64460. }
  64461. return ret, nil
  64462. // {
  64463. // "description": "Deletes the specified interconnect attachment.",
  64464. // "httpMethod": "DELETE",
  64465. // "id": "compute.interconnectAttachments.delete",
  64466. // "parameterOrder": [
  64467. // "project",
  64468. // "region",
  64469. // "interconnectAttachment"
  64470. // ],
  64471. // "parameters": {
  64472. // "interconnectAttachment": {
  64473. // "description": "Name of the interconnect attachment to delete.",
  64474. // "location": "path",
  64475. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64476. // "required": true,
  64477. // "type": "string"
  64478. // },
  64479. // "project": {
  64480. // "description": "Project ID for this request.",
  64481. // "location": "path",
  64482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64483. // "required": true,
  64484. // "type": "string"
  64485. // },
  64486. // "region": {
  64487. // "description": "Name of the region for this request.",
  64488. // "location": "path",
  64489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64490. // "required": true,
  64491. // "type": "string"
  64492. // },
  64493. // "requestId": {
  64494. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64495. // "location": "query",
  64496. // "type": "string"
  64497. // }
  64498. // },
  64499. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  64500. // "response": {
  64501. // "$ref": "Operation"
  64502. // },
  64503. // "scopes": [
  64504. // "https://www.googleapis.com/auth/cloud-platform",
  64505. // "https://www.googleapis.com/auth/compute"
  64506. // ]
  64507. // }
  64508. }
  64509. // method id "compute.interconnectAttachments.get":
  64510. type InterconnectAttachmentsGetCall struct {
  64511. s *Service
  64512. project string
  64513. region string
  64514. interconnectAttachment string
  64515. urlParams_ gensupport.URLParams
  64516. ifNoneMatch_ string
  64517. ctx_ context.Context
  64518. header_ http.Header
  64519. }
  64520. // Get: Returns the specified interconnect attachment.
  64521. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  64522. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64523. c.project = project
  64524. c.region = region
  64525. c.interconnectAttachment = interconnectAttachment
  64526. return c
  64527. }
  64528. // Fields allows partial responses to be retrieved. See
  64529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64530. // for more information.
  64531. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  64532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64533. return c
  64534. }
  64535. // IfNoneMatch sets the optional parameter which makes the operation
  64536. // fail if the object's ETag matches the given value. This is useful for
  64537. // getting updates only after the object has changed since the last
  64538. // request. Use googleapi.IsNotModified to check whether the response
  64539. // error from Do is the result of In-None-Match.
  64540. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  64541. c.ifNoneMatch_ = entityTag
  64542. return c
  64543. }
  64544. // Context sets the context to be used in this call's Do method. Any
  64545. // pending HTTP request will be aborted if the provided context is
  64546. // canceled.
  64547. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  64548. c.ctx_ = ctx
  64549. return c
  64550. }
  64551. // Header returns an http.Header that can be modified by the caller to
  64552. // add HTTP headers to the request.
  64553. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  64554. if c.header_ == nil {
  64555. c.header_ = make(http.Header)
  64556. }
  64557. return c.header_
  64558. }
  64559. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  64560. reqHeaders := make(http.Header)
  64561. for k, v := range c.header_ {
  64562. reqHeaders[k] = v
  64563. }
  64564. reqHeaders.Set("User-Agent", c.s.userAgent())
  64565. if c.ifNoneMatch_ != "" {
  64566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64567. }
  64568. var body io.Reader = nil
  64569. c.urlParams_.Set("alt", alt)
  64570. c.urlParams_.Set("prettyPrint", "false")
  64571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  64572. urls += "?" + c.urlParams_.Encode()
  64573. req, err := http.NewRequest("GET", urls, body)
  64574. if err != nil {
  64575. return nil, err
  64576. }
  64577. req.Header = reqHeaders
  64578. googleapi.Expand(req.URL, map[string]string{
  64579. "project": c.project,
  64580. "region": c.region,
  64581. "interconnectAttachment": c.interconnectAttachment,
  64582. })
  64583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64584. }
  64585. // Do executes the "compute.interconnectAttachments.get" call.
  64586. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  64587. // non-2xx status code is an error. Response headers are in either
  64588. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  64589. // returned at all) in error.(*googleapi.Error).Header. Use
  64590. // googleapi.IsNotModified to check whether the returned error was
  64591. // because http.StatusNotModified was returned.
  64592. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  64593. gensupport.SetOptions(c.urlParams_, opts...)
  64594. res, err := c.doRequest("json")
  64595. if res != nil && res.StatusCode == http.StatusNotModified {
  64596. if res.Body != nil {
  64597. res.Body.Close()
  64598. }
  64599. return nil, &googleapi.Error{
  64600. Code: res.StatusCode,
  64601. Header: res.Header,
  64602. }
  64603. }
  64604. if err != nil {
  64605. return nil, err
  64606. }
  64607. defer googleapi.CloseBody(res)
  64608. if err := googleapi.CheckResponse(res); err != nil {
  64609. return nil, err
  64610. }
  64611. ret := &InterconnectAttachment{
  64612. ServerResponse: googleapi.ServerResponse{
  64613. Header: res.Header,
  64614. HTTPStatusCode: res.StatusCode,
  64615. },
  64616. }
  64617. target := &ret
  64618. if err := gensupport.DecodeResponse(target, res); err != nil {
  64619. return nil, err
  64620. }
  64621. return ret, nil
  64622. // {
  64623. // "description": "Returns the specified interconnect attachment.",
  64624. // "httpMethod": "GET",
  64625. // "id": "compute.interconnectAttachments.get",
  64626. // "parameterOrder": [
  64627. // "project",
  64628. // "region",
  64629. // "interconnectAttachment"
  64630. // ],
  64631. // "parameters": {
  64632. // "interconnectAttachment": {
  64633. // "description": "Name of the interconnect attachment to return.",
  64634. // "location": "path",
  64635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64636. // "required": true,
  64637. // "type": "string"
  64638. // },
  64639. // "project": {
  64640. // "description": "Project ID for this request.",
  64641. // "location": "path",
  64642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64643. // "required": true,
  64644. // "type": "string"
  64645. // },
  64646. // "region": {
  64647. // "description": "Name of the region for this request.",
  64648. // "location": "path",
  64649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64650. // "required": true,
  64651. // "type": "string"
  64652. // }
  64653. // },
  64654. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  64655. // "response": {
  64656. // "$ref": "InterconnectAttachment"
  64657. // },
  64658. // "scopes": [
  64659. // "https://www.googleapis.com/auth/cloud-platform",
  64660. // "https://www.googleapis.com/auth/compute",
  64661. // "https://www.googleapis.com/auth/compute.readonly"
  64662. // ]
  64663. // }
  64664. }
  64665. // method id "compute.interconnectAttachments.insert":
  64666. type InterconnectAttachmentsInsertCall struct {
  64667. s *Service
  64668. project string
  64669. region string
  64670. interconnectattachment *InterconnectAttachment
  64671. urlParams_ gensupport.URLParams
  64672. ctx_ context.Context
  64673. header_ http.Header
  64674. }
  64675. // Insert: Creates an InterconnectAttachment in the specified project
  64676. // using the data included in the request.
  64677. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  64678. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64679. c.project = project
  64680. c.region = region
  64681. c.interconnectattachment = interconnectattachment
  64682. return c
  64683. }
  64684. // RequestId sets the optional parameter "requestId": An optional
  64685. // request ID to identify requests. Specify a unique request ID so that
  64686. // if you must retry your request, the server will know to ignore the
  64687. // request if it has already been completed.
  64688. //
  64689. // For example, consider a situation where you make an initial request
  64690. // and the request times out. If you make the request again with the
  64691. // same request ID, the server can check if original operation with the
  64692. // same request ID was received, and if so, will ignore the second
  64693. // request. This prevents clients from accidentally creating duplicate
  64694. // commitments.
  64695. //
  64696. // The request ID must be a valid UUID with the exception that zero UUID
  64697. // is not supported (00000000-0000-0000-0000-000000000000).
  64698. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  64699. c.urlParams_.Set("requestId", requestId)
  64700. return c
  64701. }
  64702. // Fields allows partial responses to be retrieved. See
  64703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64704. // for more information.
  64705. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  64706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64707. return c
  64708. }
  64709. // Context sets the context to be used in this call's Do method. Any
  64710. // pending HTTP request will be aborted if the provided context is
  64711. // canceled.
  64712. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  64713. c.ctx_ = ctx
  64714. return c
  64715. }
  64716. // Header returns an http.Header that can be modified by the caller to
  64717. // add HTTP headers to the request.
  64718. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  64719. if c.header_ == nil {
  64720. c.header_ = make(http.Header)
  64721. }
  64722. return c.header_
  64723. }
  64724. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  64725. reqHeaders := make(http.Header)
  64726. for k, v := range c.header_ {
  64727. reqHeaders[k] = v
  64728. }
  64729. reqHeaders.Set("User-Agent", c.s.userAgent())
  64730. var body io.Reader = nil
  64731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  64732. if err != nil {
  64733. return nil, err
  64734. }
  64735. reqHeaders.Set("Content-Type", "application/json")
  64736. c.urlParams_.Set("alt", alt)
  64737. c.urlParams_.Set("prettyPrint", "false")
  64738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  64739. urls += "?" + c.urlParams_.Encode()
  64740. req, err := http.NewRequest("POST", urls, body)
  64741. if err != nil {
  64742. return nil, err
  64743. }
  64744. req.Header = reqHeaders
  64745. googleapi.Expand(req.URL, map[string]string{
  64746. "project": c.project,
  64747. "region": c.region,
  64748. })
  64749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64750. }
  64751. // Do executes the "compute.interconnectAttachments.insert" call.
  64752. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64753. // status code is an error. Response headers are in either
  64754. // *Operation.ServerResponse.Header or (if a response was returned at
  64755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64756. // to check whether the returned error was because
  64757. // http.StatusNotModified was returned.
  64758. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64759. gensupport.SetOptions(c.urlParams_, opts...)
  64760. res, err := c.doRequest("json")
  64761. if res != nil && res.StatusCode == http.StatusNotModified {
  64762. if res.Body != nil {
  64763. res.Body.Close()
  64764. }
  64765. return nil, &googleapi.Error{
  64766. Code: res.StatusCode,
  64767. Header: res.Header,
  64768. }
  64769. }
  64770. if err != nil {
  64771. return nil, err
  64772. }
  64773. defer googleapi.CloseBody(res)
  64774. if err := googleapi.CheckResponse(res); err != nil {
  64775. return nil, err
  64776. }
  64777. ret := &Operation{
  64778. ServerResponse: googleapi.ServerResponse{
  64779. Header: res.Header,
  64780. HTTPStatusCode: res.StatusCode,
  64781. },
  64782. }
  64783. target := &ret
  64784. if err := gensupport.DecodeResponse(target, res); err != nil {
  64785. return nil, err
  64786. }
  64787. return ret, nil
  64788. // {
  64789. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  64790. // "httpMethod": "POST",
  64791. // "id": "compute.interconnectAttachments.insert",
  64792. // "parameterOrder": [
  64793. // "project",
  64794. // "region"
  64795. // ],
  64796. // "parameters": {
  64797. // "project": {
  64798. // "description": "Project ID for this request.",
  64799. // "location": "path",
  64800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64801. // "required": true,
  64802. // "type": "string"
  64803. // },
  64804. // "region": {
  64805. // "description": "Name of the region for this request.",
  64806. // "location": "path",
  64807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64808. // "required": true,
  64809. // "type": "string"
  64810. // },
  64811. // "requestId": {
  64812. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64813. // "location": "query",
  64814. // "type": "string"
  64815. // }
  64816. // },
  64817. // "path": "{project}/regions/{region}/interconnectAttachments",
  64818. // "request": {
  64819. // "$ref": "InterconnectAttachment"
  64820. // },
  64821. // "response": {
  64822. // "$ref": "Operation"
  64823. // },
  64824. // "scopes": [
  64825. // "https://www.googleapis.com/auth/cloud-platform",
  64826. // "https://www.googleapis.com/auth/compute"
  64827. // ]
  64828. // }
  64829. }
  64830. // method id "compute.interconnectAttachments.list":
  64831. type InterconnectAttachmentsListCall struct {
  64832. s *Service
  64833. project string
  64834. region string
  64835. urlParams_ gensupport.URLParams
  64836. ifNoneMatch_ string
  64837. ctx_ context.Context
  64838. header_ http.Header
  64839. }
  64840. // List: Retrieves the list of interconnect attachments contained within
  64841. // the specified region.
  64842. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  64843. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64844. c.project = project
  64845. c.region = region
  64846. return c
  64847. }
  64848. // Filter sets the optional parameter "filter": A filter expression that
  64849. // filters resources listed in the response. The expression must specify
  64850. // the field name, a comparison operator, and the value that you want to
  64851. // use for filtering. The value must be a string, a number, or a
  64852. // boolean. The comparison operator must be either =, !=, >, or <.
  64853. //
  64854. // For example, if you are filtering Compute Engine instances, you can
  64855. // exclude instances named example-instance by specifying name !=
  64856. // example-instance.
  64857. //
  64858. // You can also filter nested fields. For example, you could specify
  64859. // scheduling.automaticRestart = false to include instances only if they
  64860. // are not scheduled for automatic restarts. You can use filtering on
  64861. // nested fields to filter based on resource labels.
  64862. //
  64863. // To filter on multiple expressions, provide each separate expression
  64864. // within parentheses. For example, (scheduling.automaticRestart = true)
  64865. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64866. // AND expression. However, you can include AND and OR expressions
  64867. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64868. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64869. // true).
  64870. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  64871. c.urlParams_.Set("filter", filter)
  64872. return c
  64873. }
  64874. // MaxResults sets the optional parameter "maxResults": The maximum
  64875. // number of results per page that should be returned. If the number of
  64876. // available results is larger than maxResults, Compute Engine returns a
  64877. // nextPageToken that can be used to get the next page of results in
  64878. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64879. // (Default: 500)
  64880. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  64881. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64882. return c
  64883. }
  64884. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64885. // a certain order. By default, results are returned in alphanumerical
  64886. // order based on the resource name.
  64887. //
  64888. // You can also sort results in descending order based on the creation
  64889. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64890. // based on the creationTimestamp field in reverse chronological order
  64891. // (newest result first). Use this to sort resources like operations so
  64892. // that the newest operation is returned first.
  64893. //
  64894. // Currently, only sorting by name or creationTimestamp desc is
  64895. // supported.
  64896. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  64897. c.urlParams_.Set("orderBy", orderBy)
  64898. return c
  64899. }
  64900. // PageToken sets the optional parameter "pageToken": Specifies a page
  64901. // token to use. Set pageToken to the nextPageToken returned by a
  64902. // previous list request to get the next page of results.
  64903. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  64904. c.urlParams_.Set("pageToken", pageToken)
  64905. return c
  64906. }
  64907. // Fields allows partial responses to be retrieved. See
  64908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64909. // for more information.
  64910. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  64911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64912. return c
  64913. }
  64914. // IfNoneMatch sets the optional parameter which makes the operation
  64915. // fail if the object's ETag matches the given value. This is useful for
  64916. // getting updates only after the object has changed since the last
  64917. // request. Use googleapi.IsNotModified to check whether the response
  64918. // error from Do is the result of In-None-Match.
  64919. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  64920. c.ifNoneMatch_ = entityTag
  64921. return c
  64922. }
  64923. // Context sets the context to be used in this call's Do method. Any
  64924. // pending HTTP request will be aborted if the provided context is
  64925. // canceled.
  64926. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  64927. c.ctx_ = ctx
  64928. return c
  64929. }
  64930. // Header returns an http.Header that can be modified by the caller to
  64931. // add HTTP headers to the request.
  64932. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  64933. if c.header_ == nil {
  64934. c.header_ = make(http.Header)
  64935. }
  64936. return c.header_
  64937. }
  64938. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  64939. reqHeaders := make(http.Header)
  64940. for k, v := range c.header_ {
  64941. reqHeaders[k] = v
  64942. }
  64943. reqHeaders.Set("User-Agent", c.s.userAgent())
  64944. if c.ifNoneMatch_ != "" {
  64945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64946. }
  64947. var body io.Reader = nil
  64948. c.urlParams_.Set("alt", alt)
  64949. c.urlParams_.Set("prettyPrint", "false")
  64950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  64951. urls += "?" + c.urlParams_.Encode()
  64952. req, err := http.NewRequest("GET", urls, body)
  64953. if err != nil {
  64954. return nil, err
  64955. }
  64956. req.Header = reqHeaders
  64957. googleapi.Expand(req.URL, map[string]string{
  64958. "project": c.project,
  64959. "region": c.region,
  64960. })
  64961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64962. }
  64963. // Do executes the "compute.interconnectAttachments.list" call.
  64964. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  64965. // Any non-2xx status code is an error. Response headers are in either
  64966. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  64967. // was returned at all) in error.(*googleapi.Error).Header. Use
  64968. // googleapi.IsNotModified to check whether the returned error was
  64969. // because http.StatusNotModified was returned.
  64970. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  64971. gensupport.SetOptions(c.urlParams_, opts...)
  64972. res, err := c.doRequest("json")
  64973. if res != nil && res.StatusCode == http.StatusNotModified {
  64974. if res.Body != nil {
  64975. res.Body.Close()
  64976. }
  64977. return nil, &googleapi.Error{
  64978. Code: res.StatusCode,
  64979. Header: res.Header,
  64980. }
  64981. }
  64982. if err != nil {
  64983. return nil, err
  64984. }
  64985. defer googleapi.CloseBody(res)
  64986. if err := googleapi.CheckResponse(res); err != nil {
  64987. return nil, err
  64988. }
  64989. ret := &InterconnectAttachmentList{
  64990. ServerResponse: googleapi.ServerResponse{
  64991. Header: res.Header,
  64992. HTTPStatusCode: res.StatusCode,
  64993. },
  64994. }
  64995. target := &ret
  64996. if err := gensupport.DecodeResponse(target, res); err != nil {
  64997. return nil, err
  64998. }
  64999. return ret, nil
  65000. // {
  65001. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  65002. // "httpMethod": "GET",
  65003. // "id": "compute.interconnectAttachments.list",
  65004. // "parameterOrder": [
  65005. // "project",
  65006. // "region"
  65007. // ],
  65008. // "parameters": {
  65009. // "filter": {
  65010. // "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).",
  65011. // "location": "query",
  65012. // "type": "string"
  65013. // },
  65014. // "maxResults": {
  65015. // "default": "500",
  65016. // "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)",
  65017. // "format": "uint32",
  65018. // "location": "query",
  65019. // "minimum": "0",
  65020. // "type": "integer"
  65021. // },
  65022. // "orderBy": {
  65023. // "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.",
  65024. // "location": "query",
  65025. // "type": "string"
  65026. // },
  65027. // "pageToken": {
  65028. // "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.",
  65029. // "location": "query",
  65030. // "type": "string"
  65031. // },
  65032. // "project": {
  65033. // "description": "Project ID for this request.",
  65034. // "location": "path",
  65035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65036. // "required": true,
  65037. // "type": "string"
  65038. // },
  65039. // "region": {
  65040. // "description": "Name of the region for this request.",
  65041. // "location": "path",
  65042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65043. // "required": true,
  65044. // "type": "string"
  65045. // }
  65046. // },
  65047. // "path": "{project}/regions/{region}/interconnectAttachments",
  65048. // "response": {
  65049. // "$ref": "InterconnectAttachmentList"
  65050. // },
  65051. // "scopes": [
  65052. // "https://www.googleapis.com/auth/cloud-platform",
  65053. // "https://www.googleapis.com/auth/compute",
  65054. // "https://www.googleapis.com/auth/compute.readonly"
  65055. // ]
  65056. // }
  65057. }
  65058. // Pages invokes f for each page of results.
  65059. // A non-nil error returned from f will halt the iteration.
  65060. // The provided context supersedes any context provided to the Context method.
  65061. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  65062. c.ctx_ = ctx
  65063. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65064. for {
  65065. x, err := c.Do()
  65066. if err != nil {
  65067. return err
  65068. }
  65069. if err := f(x); err != nil {
  65070. return err
  65071. }
  65072. if x.NextPageToken == "" {
  65073. return nil
  65074. }
  65075. c.PageToken(x.NextPageToken)
  65076. }
  65077. }
  65078. // method id "compute.interconnectAttachments.patch":
  65079. type InterconnectAttachmentsPatchCall struct {
  65080. s *Service
  65081. project string
  65082. region string
  65083. interconnectAttachment string
  65084. interconnectattachment *InterconnectAttachment
  65085. urlParams_ gensupport.URLParams
  65086. ctx_ context.Context
  65087. header_ http.Header
  65088. }
  65089. // Patch: Updates the specified interconnect attachment with the data
  65090. // included in the request. This method supports PATCH semantics and
  65091. // uses the JSON merge patch format and processing rules.
  65092. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  65093. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65094. c.project = project
  65095. c.region = region
  65096. c.interconnectAttachment = interconnectAttachment
  65097. c.interconnectattachment = interconnectattachment
  65098. return c
  65099. }
  65100. // RequestId sets the optional parameter "requestId": An optional
  65101. // request ID to identify requests. Specify a unique request ID so that
  65102. // if you must retry your request, the server will know to ignore the
  65103. // request if it has already been completed.
  65104. //
  65105. // For example, consider a situation where you make an initial request
  65106. // and the request times out. If you make the request again with the
  65107. // same request ID, the server can check if original operation with the
  65108. // same request ID was received, and if so, will ignore the second
  65109. // request. This prevents clients from accidentally creating duplicate
  65110. // commitments.
  65111. //
  65112. // The request ID must be a valid UUID with the exception that zero UUID
  65113. // is not supported (00000000-0000-0000-0000-000000000000).
  65114. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  65115. c.urlParams_.Set("requestId", requestId)
  65116. return c
  65117. }
  65118. // Fields allows partial responses to be retrieved. See
  65119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65120. // for more information.
  65121. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  65122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65123. return c
  65124. }
  65125. // Context sets the context to be used in this call's Do method. Any
  65126. // pending HTTP request will be aborted if the provided context is
  65127. // canceled.
  65128. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  65129. c.ctx_ = ctx
  65130. return c
  65131. }
  65132. // Header returns an http.Header that can be modified by the caller to
  65133. // add HTTP headers to the request.
  65134. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  65135. if c.header_ == nil {
  65136. c.header_ = make(http.Header)
  65137. }
  65138. return c.header_
  65139. }
  65140. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  65141. reqHeaders := make(http.Header)
  65142. for k, v := range c.header_ {
  65143. reqHeaders[k] = v
  65144. }
  65145. reqHeaders.Set("User-Agent", c.s.userAgent())
  65146. var body io.Reader = nil
  65147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  65148. if err != nil {
  65149. return nil, err
  65150. }
  65151. reqHeaders.Set("Content-Type", "application/json")
  65152. c.urlParams_.Set("alt", alt)
  65153. c.urlParams_.Set("prettyPrint", "false")
  65154. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  65155. urls += "?" + c.urlParams_.Encode()
  65156. req, err := http.NewRequest("PATCH", urls, body)
  65157. if err != nil {
  65158. return nil, err
  65159. }
  65160. req.Header = reqHeaders
  65161. googleapi.Expand(req.URL, map[string]string{
  65162. "project": c.project,
  65163. "region": c.region,
  65164. "interconnectAttachment": c.interconnectAttachment,
  65165. })
  65166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65167. }
  65168. // Do executes the "compute.interconnectAttachments.patch" call.
  65169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65170. // status code is an error. Response headers are in either
  65171. // *Operation.ServerResponse.Header or (if a response was returned at
  65172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65173. // to check whether the returned error was because
  65174. // http.StatusNotModified was returned.
  65175. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65176. gensupport.SetOptions(c.urlParams_, opts...)
  65177. res, err := c.doRequest("json")
  65178. if res != nil && res.StatusCode == http.StatusNotModified {
  65179. if res.Body != nil {
  65180. res.Body.Close()
  65181. }
  65182. return nil, &googleapi.Error{
  65183. Code: res.StatusCode,
  65184. Header: res.Header,
  65185. }
  65186. }
  65187. if err != nil {
  65188. return nil, err
  65189. }
  65190. defer googleapi.CloseBody(res)
  65191. if err := googleapi.CheckResponse(res); err != nil {
  65192. return nil, err
  65193. }
  65194. ret := &Operation{
  65195. ServerResponse: googleapi.ServerResponse{
  65196. Header: res.Header,
  65197. HTTPStatusCode: res.StatusCode,
  65198. },
  65199. }
  65200. target := &ret
  65201. if err := gensupport.DecodeResponse(target, res); err != nil {
  65202. return nil, err
  65203. }
  65204. return ret, nil
  65205. // {
  65206. // "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.",
  65207. // "httpMethod": "PATCH",
  65208. // "id": "compute.interconnectAttachments.patch",
  65209. // "parameterOrder": [
  65210. // "project",
  65211. // "region",
  65212. // "interconnectAttachment"
  65213. // ],
  65214. // "parameters": {
  65215. // "interconnectAttachment": {
  65216. // "description": "Name of the interconnect attachment to patch.",
  65217. // "location": "path",
  65218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65219. // "required": true,
  65220. // "type": "string"
  65221. // },
  65222. // "project": {
  65223. // "description": "Project ID for this request.",
  65224. // "location": "path",
  65225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65226. // "required": true,
  65227. // "type": "string"
  65228. // },
  65229. // "region": {
  65230. // "description": "Name of the region scoping this request.",
  65231. // "location": "path",
  65232. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65233. // "required": true,
  65234. // "type": "string"
  65235. // },
  65236. // "requestId": {
  65237. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65238. // "location": "query",
  65239. // "type": "string"
  65240. // }
  65241. // },
  65242. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  65243. // "request": {
  65244. // "$ref": "InterconnectAttachment"
  65245. // },
  65246. // "response": {
  65247. // "$ref": "Operation"
  65248. // },
  65249. // "scopes": [
  65250. // "https://www.googleapis.com/auth/cloud-platform",
  65251. // "https://www.googleapis.com/auth/compute"
  65252. // ]
  65253. // }
  65254. }
  65255. // method id "compute.interconnectAttachments.setLabels":
  65256. type InterconnectAttachmentsSetLabelsCall struct {
  65257. s *Service
  65258. project string
  65259. region string
  65260. resource string
  65261. regionsetlabelsrequest *RegionSetLabelsRequest
  65262. urlParams_ gensupport.URLParams
  65263. ctx_ context.Context
  65264. header_ http.Header
  65265. }
  65266. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  65267. // more about labels, read the Labeling Resources documentation.
  65268. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  65269. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65270. c.project = project
  65271. c.region = region
  65272. c.resource = resource
  65273. c.regionsetlabelsrequest = regionsetlabelsrequest
  65274. return c
  65275. }
  65276. // RequestId sets the optional parameter "requestId": An optional
  65277. // request ID to identify requests. Specify a unique request ID so that
  65278. // if you must retry your request, the server will know to ignore the
  65279. // request if it has already been completed.
  65280. //
  65281. // For example, consider a situation where you make an initial request
  65282. // and the request times out. If you make the request again with the
  65283. // same request ID, the server can check if original operation with the
  65284. // same request ID was received, and if so, will ignore the second
  65285. // request. This prevents clients from accidentally creating duplicate
  65286. // commitments.
  65287. //
  65288. // The request ID must be a valid UUID with the exception that zero UUID
  65289. // is not supported (00000000-0000-0000-0000-000000000000).
  65290. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  65291. c.urlParams_.Set("requestId", requestId)
  65292. return c
  65293. }
  65294. // Fields allows partial responses to be retrieved. See
  65295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65296. // for more information.
  65297. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  65298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65299. return c
  65300. }
  65301. // Context sets the context to be used in this call's Do method. Any
  65302. // pending HTTP request will be aborted if the provided context is
  65303. // canceled.
  65304. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  65305. c.ctx_ = ctx
  65306. return c
  65307. }
  65308. // Header returns an http.Header that can be modified by the caller to
  65309. // add HTTP headers to the request.
  65310. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  65311. if c.header_ == nil {
  65312. c.header_ = make(http.Header)
  65313. }
  65314. return c.header_
  65315. }
  65316. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  65317. reqHeaders := make(http.Header)
  65318. for k, v := range c.header_ {
  65319. reqHeaders[k] = v
  65320. }
  65321. reqHeaders.Set("User-Agent", c.s.userAgent())
  65322. var body io.Reader = nil
  65323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  65324. if err != nil {
  65325. return nil, err
  65326. }
  65327. reqHeaders.Set("Content-Type", "application/json")
  65328. c.urlParams_.Set("alt", alt)
  65329. c.urlParams_.Set("prettyPrint", "false")
  65330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  65331. urls += "?" + c.urlParams_.Encode()
  65332. req, err := http.NewRequest("POST", urls, body)
  65333. if err != nil {
  65334. return nil, err
  65335. }
  65336. req.Header = reqHeaders
  65337. googleapi.Expand(req.URL, map[string]string{
  65338. "project": c.project,
  65339. "region": c.region,
  65340. "resource": c.resource,
  65341. })
  65342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65343. }
  65344. // Do executes the "compute.interconnectAttachments.setLabels" call.
  65345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65346. // status code is an error. Response headers are in either
  65347. // *Operation.ServerResponse.Header or (if a response was returned at
  65348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65349. // to check whether the returned error was because
  65350. // http.StatusNotModified was returned.
  65351. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65352. gensupport.SetOptions(c.urlParams_, opts...)
  65353. res, err := c.doRequest("json")
  65354. if res != nil && res.StatusCode == http.StatusNotModified {
  65355. if res.Body != nil {
  65356. res.Body.Close()
  65357. }
  65358. return nil, &googleapi.Error{
  65359. Code: res.StatusCode,
  65360. Header: res.Header,
  65361. }
  65362. }
  65363. if err != nil {
  65364. return nil, err
  65365. }
  65366. defer googleapi.CloseBody(res)
  65367. if err := googleapi.CheckResponse(res); err != nil {
  65368. return nil, err
  65369. }
  65370. ret := &Operation{
  65371. ServerResponse: googleapi.ServerResponse{
  65372. Header: res.Header,
  65373. HTTPStatusCode: res.StatusCode,
  65374. },
  65375. }
  65376. target := &ret
  65377. if err := gensupport.DecodeResponse(target, res); err != nil {
  65378. return nil, err
  65379. }
  65380. return ret, nil
  65381. // {
  65382. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  65383. // "httpMethod": "POST",
  65384. // "id": "compute.interconnectAttachments.setLabels",
  65385. // "parameterOrder": [
  65386. // "project",
  65387. // "region",
  65388. // "resource"
  65389. // ],
  65390. // "parameters": {
  65391. // "project": {
  65392. // "description": "Project ID for this request.",
  65393. // "location": "path",
  65394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65395. // "required": true,
  65396. // "type": "string"
  65397. // },
  65398. // "region": {
  65399. // "description": "The region for this request.",
  65400. // "location": "path",
  65401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65402. // "required": true,
  65403. // "type": "string"
  65404. // },
  65405. // "requestId": {
  65406. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65407. // "location": "query",
  65408. // "type": "string"
  65409. // },
  65410. // "resource": {
  65411. // "description": "Name or id of the resource for this request.",
  65412. // "location": "path",
  65413. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65414. // "required": true,
  65415. // "type": "string"
  65416. // }
  65417. // },
  65418. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  65419. // "request": {
  65420. // "$ref": "RegionSetLabelsRequest"
  65421. // },
  65422. // "response": {
  65423. // "$ref": "Operation"
  65424. // },
  65425. // "scopes": [
  65426. // "https://www.googleapis.com/auth/cloud-platform",
  65427. // "https://www.googleapis.com/auth/compute"
  65428. // ]
  65429. // }
  65430. }
  65431. // method id "compute.interconnectAttachments.testIamPermissions":
  65432. type InterconnectAttachmentsTestIamPermissionsCall struct {
  65433. s *Service
  65434. project string
  65435. region string
  65436. resource string
  65437. testpermissionsrequest *TestPermissionsRequest
  65438. urlParams_ gensupport.URLParams
  65439. ctx_ context.Context
  65440. header_ http.Header
  65441. }
  65442. // TestIamPermissions: Returns permissions that a caller has on the
  65443. // specified resource.
  65444. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  65445. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65446. c.project = project
  65447. c.region = region
  65448. c.resource = resource
  65449. c.testpermissionsrequest = testpermissionsrequest
  65450. return c
  65451. }
  65452. // Fields allows partial responses to be retrieved. See
  65453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65454. // for more information.
  65455. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  65456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65457. return c
  65458. }
  65459. // Context sets the context to be used in this call's Do method. Any
  65460. // pending HTTP request will be aborted if the provided context is
  65461. // canceled.
  65462. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  65463. c.ctx_ = ctx
  65464. return c
  65465. }
  65466. // Header returns an http.Header that can be modified by the caller to
  65467. // add HTTP headers to the request.
  65468. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  65469. if c.header_ == nil {
  65470. c.header_ = make(http.Header)
  65471. }
  65472. return c.header_
  65473. }
  65474. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  65475. reqHeaders := make(http.Header)
  65476. for k, v := range c.header_ {
  65477. reqHeaders[k] = v
  65478. }
  65479. reqHeaders.Set("User-Agent", c.s.userAgent())
  65480. var body io.Reader = nil
  65481. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  65482. if err != nil {
  65483. return nil, err
  65484. }
  65485. reqHeaders.Set("Content-Type", "application/json")
  65486. c.urlParams_.Set("alt", alt)
  65487. c.urlParams_.Set("prettyPrint", "false")
  65488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  65489. urls += "?" + c.urlParams_.Encode()
  65490. req, err := http.NewRequest("POST", urls, body)
  65491. if err != nil {
  65492. return nil, err
  65493. }
  65494. req.Header = reqHeaders
  65495. googleapi.Expand(req.URL, map[string]string{
  65496. "project": c.project,
  65497. "region": c.region,
  65498. "resource": c.resource,
  65499. })
  65500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65501. }
  65502. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  65503. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  65504. // non-2xx status code is an error. Response headers are in either
  65505. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  65506. // returned at all) in error.(*googleapi.Error).Header. Use
  65507. // googleapi.IsNotModified to check whether the returned error was
  65508. // because http.StatusNotModified was returned.
  65509. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  65510. gensupport.SetOptions(c.urlParams_, opts...)
  65511. res, err := c.doRequest("json")
  65512. if res != nil && res.StatusCode == http.StatusNotModified {
  65513. if res.Body != nil {
  65514. res.Body.Close()
  65515. }
  65516. return nil, &googleapi.Error{
  65517. Code: res.StatusCode,
  65518. Header: res.Header,
  65519. }
  65520. }
  65521. if err != nil {
  65522. return nil, err
  65523. }
  65524. defer googleapi.CloseBody(res)
  65525. if err := googleapi.CheckResponse(res); err != nil {
  65526. return nil, err
  65527. }
  65528. ret := &TestPermissionsResponse{
  65529. ServerResponse: googleapi.ServerResponse{
  65530. Header: res.Header,
  65531. HTTPStatusCode: res.StatusCode,
  65532. },
  65533. }
  65534. target := &ret
  65535. if err := gensupport.DecodeResponse(target, res); err != nil {
  65536. return nil, err
  65537. }
  65538. return ret, nil
  65539. // {
  65540. // "description": "Returns permissions that a caller has on the specified resource.",
  65541. // "httpMethod": "POST",
  65542. // "id": "compute.interconnectAttachments.testIamPermissions",
  65543. // "parameterOrder": [
  65544. // "project",
  65545. // "region",
  65546. // "resource"
  65547. // ],
  65548. // "parameters": {
  65549. // "project": {
  65550. // "description": "Project ID for this request.",
  65551. // "location": "path",
  65552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65553. // "required": true,
  65554. // "type": "string"
  65555. // },
  65556. // "region": {
  65557. // "description": "The name of the region for this request.",
  65558. // "location": "path",
  65559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65560. // "required": true,
  65561. // "type": "string"
  65562. // },
  65563. // "resource": {
  65564. // "description": "Name or id of the resource for this request.",
  65565. // "location": "path",
  65566. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65567. // "required": true,
  65568. // "type": "string"
  65569. // }
  65570. // },
  65571. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  65572. // "request": {
  65573. // "$ref": "TestPermissionsRequest"
  65574. // },
  65575. // "response": {
  65576. // "$ref": "TestPermissionsResponse"
  65577. // },
  65578. // "scopes": [
  65579. // "https://www.googleapis.com/auth/cloud-platform",
  65580. // "https://www.googleapis.com/auth/compute",
  65581. // "https://www.googleapis.com/auth/compute.readonly"
  65582. // ]
  65583. // }
  65584. }
  65585. // method id "compute.interconnectLocations.get":
  65586. type InterconnectLocationsGetCall struct {
  65587. s *Service
  65588. project string
  65589. interconnectLocation string
  65590. urlParams_ gensupport.URLParams
  65591. ifNoneMatch_ string
  65592. ctx_ context.Context
  65593. header_ http.Header
  65594. }
  65595. // Get: Returns the details for the specified interconnect location.
  65596. // Gets a list of available interconnect locations by making a list()
  65597. // request.
  65598. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  65599. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65600. c.project = project
  65601. c.interconnectLocation = interconnectLocation
  65602. return c
  65603. }
  65604. // Fields allows partial responses to be retrieved. See
  65605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65606. // for more information.
  65607. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  65608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65609. return c
  65610. }
  65611. // IfNoneMatch sets the optional parameter which makes the operation
  65612. // fail if the object's ETag matches the given value. This is useful for
  65613. // getting updates only after the object has changed since the last
  65614. // request. Use googleapi.IsNotModified to check whether the response
  65615. // error from Do is the result of In-None-Match.
  65616. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  65617. c.ifNoneMatch_ = entityTag
  65618. return c
  65619. }
  65620. // Context sets the context to be used in this call's Do method. Any
  65621. // pending HTTP request will be aborted if the provided context is
  65622. // canceled.
  65623. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  65624. c.ctx_ = ctx
  65625. return c
  65626. }
  65627. // Header returns an http.Header that can be modified by the caller to
  65628. // add HTTP headers to the request.
  65629. func (c *InterconnectLocationsGetCall) Header() http.Header {
  65630. if c.header_ == nil {
  65631. c.header_ = make(http.Header)
  65632. }
  65633. return c.header_
  65634. }
  65635. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  65636. reqHeaders := make(http.Header)
  65637. for k, v := range c.header_ {
  65638. reqHeaders[k] = v
  65639. }
  65640. reqHeaders.Set("User-Agent", c.s.userAgent())
  65641. if c.ifNoneMatch_ != "" {
  65642. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65643. }
  65644. var body io.Reader = nil
  65645. c.urlParams_.Set("alt", alt)
  65646. c.urlParams_.Set("prettyPrint", "false")
  65647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  65648. urls += "?" + c.urlParams_.Encode()
  65649. req, err := http.NewRequest("GET", urls, body)
  65650. if err != nil {
  65651. return nil, err
  65652. }
  65653. req.Header = reqHeaders
  65654. googleapi.Expand(req.URL, map[string]string{
  65655. "project": c.project,
  65656. "interconnectLocation": c.interconnectLocation,
  65657. })
  65658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65659. }
  65660. // Do executes the "compute.interconnectLocations.get" call.
  65661. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  65662. // non-2xx status code is an error. Response headers are in either
  65663. // *InterconnectLocation.ServerResponse.Header or (if a response was
  65664. // returned at all) in error.(*googleapi.Error).Header. Use
  65665. // googleapi.IsNotModified to check whether the returned error was
  65666. // because http.StatusNotModified was returned.
  65667. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  65668. gensupport.SetOptions(c.urlParams_, opts...)
  65669. res, err := c.doRequest("json")
  65670. if res != nil && res.StatusCode == http.StatusNotModified {
  65671. if res.Body != nil {
  65672. res.Body.Close()
  65673. }
  65674. return nil, &googleapi.Error{
  65675. Code: res.StatusCode,
  65676. Header: res.Header,
  65677. }
  65678. }
  65679. if err != nil {
  65680. return nil, err
  65681. }
  65682. defer googleapi.CloseBody(res)
  65683. if err := googleapi.CheckResponse(res); err != nil {
  65684. return nil, err
  65685. }
  65686. ret := &InterconnectLocation{
  65687. ServerResponse: googleapi.ServerResponse{
  65688. Header: res.Header,
  65689. HTTPStatusCode: res.StatusCode,
  65690. },
  65691. }
  65692. target := &ret
  65693. if err := gensupport.DecodeResponse(target, res); err != nil {
  65694. return nil, err
  65695. }
  65696. return ret, nil
  65697. // {
  65698. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  65699. // "httpMethod": "GET",
  65700. // "id": "compute.interconnectLocations.get",
  65701. // "parameterOrder": [
  65702. // "project",
  65703. // "interconnectLocation"
  65704. // ],
  65705. // "parameters": {
  65706. // "interconnectLocation": {
  65707. // "description": "Name of the interconnect location to return.",
  65708. // "location": "path",
  65709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65710. // "required": true,
  65711. // "type": "string"
  65712. // },
  65713. // "project": {
  65714. // "description": "Project ID for this request.",
  65715. // "location": "path",
  65716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65717. // "required": true,
  65718. // "type": "string"
  65719. // }
  65720. // },
  65721. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  65722. // "response": {
  65723. // "$ref": "InterconnectLocation"
  65724. // },
  65725. // "scopes": [
  65726. // "https://www.googleapis.com/auth/cloud-platform",
  65727. // "https://www.googleapis.com/auth/compute",
  65728. // "https://www.googleapis.com/auth/compute.readonly"
  65729. // ]
  65730. // }
  65731. }
  65732. // method id "compute.interconnectLocations.list":
  65733. type InterconnectLocationsListCall struct {
  65734. s *Service
  65735. project string
  65736. urlParams_ gensupport.URLParams
  65737. ifNoneMatch_ string
  65738. ctx_ context.Context
  65739. header_ http.Header
  65740. }
  65741. // List: Retrieves the list of interconnect locations available to the
  65742. // specified project.
  65743. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  65744. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65745. c.project = project
  65746. return c
  65747. }
  65748. // Filter sets the optional parameter "filter": A filter expression that
  65749. // filters resources listed in the response. The expression must specify
  65750. // the field name, a comparison operator, and the value that you want to
  65751. // use for filtering. The value must be a string, a number, or a
  65752. // boolean. The comparison operator must be either =, !=, >, or <.
  65753. //
  65754. // For example, if you are filtering Compute Engine instances, you can
  65755. // exclude instances named example-instance by specifying name !=
  65756. // example-instance.
  65757. //
  65758. // You can also filter nested fields. For example, you could specify
  65759. // scheduling.automaticRestart = false to include instances only if they
  65760. // are not scheduled for automatic restarts. You can use filtering on
  65761. // nested fields to filter based on resource labels.
  65762. //
  65763. // To filter on multiple expressions, provide each separate expression
  65764. // within parentheses. For example, (scheduling.automaticRestart = true)
  65765. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65766. // AND expression. However, you can include AND and OR expressions
  65767. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65768. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65769. // true).
  65770. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  65771. c.urlParams_.Set("filter", filter)
  65772. return c
  65773. }
  65774. // MaxResults sets the optional parameter "maxResults": The maximum
  65775. // number of results per page that should be returned. If the number of
  65776. // available results is larger than maxResults, Compute Engine returns a
  65777. // nextPageToken that can be used to get the next page of results in
  65778. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65779. // (Default: 500)
  65780. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  65781. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65782. return c
  65783. }
  65784. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65785. // a certain order. By default, results are returned in alphanumerical
  65786. // order based on the resource name.
  65787. //
  65788. // You can also sort results in descending order based on the creation
  65789. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65790. // based on the creationTimestamp field in reverse chronological order
  65791. // (newest result first). Use this to sort resources like operations so
  65792. // that the newest operation is returned first.
  65793. //
  65794. // Currently, only sorting by name or creationTimestamp desc is
  65795. // supported.
  65796. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  65797. c.urlParams_.Set("orderBy", orderBy)
  65798. return c
  65799. }
  65800. // PageToken sets the optional parameter "pageToken": Specifies a page
  65801. // token to use. Set pageToken to the nextPageToken returned by a
  65802. // previous list request to get the next page of results.
  65803. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  65804. c.urlParams_.Set("pageToken", pageToken)
  65805. return c
  65806. }
  65807. // Fields allows partial responses to be retrieved. See
  65808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65809. // for more information.
  65810. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  65811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65812. return c
  65813. }
  65814. // IfNoneMatch sets the optional parameter which makes the operation
  65815. // fail if the object's ETag matches the given value. This is useful for
  65816. // getting updates only after the object has changed since the last
  65817. // request. Use googleapi.IsNotModified to check whether the response
  65818. // error from Do is the result of In-None-Match.
  65819. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  65820. c.ifNoneMatch_ = entityTag
  65821. return c
  65822. }
  65823. // Context sets the context to be used in this call's Do method. Any
  65824. // pending HTTP request will be aborted if the provided context is
  65825. // canceled.
  65826. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  65827. c.ctx_ = ctx
  65828. return c
  65829. }
  65830. // Header returns an http.Header that can be modified by the caller to
  65831. // add HTTP headers to the request.
  65832. func (c *InterconnectLocationsListCall) Header() http.Header {
  65833. if c.header_ == nil {
  65834. c.header_ = make(http.Header)
  65835. }
  65836. return c.header_
  65837. }
  65838. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  65839. reqHeaders := make(http.Header)
  65840. for k, v := range c.header_ {
  65841. reqHeaders[k] = v
  65842. }
  65843. reqHeaders.Set("User-Agent", c.s.userAgent())
  65844. if c.ifNoneMatch_ != "" {
  65845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65846. }
  65847. var body io.Reader = nil
  65848. c.urlParams_.Set("alt", alt)
  65849. c.urlParams_.Set("prettyPrint", "false")
  65850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  65851. urls += "?" + c.urlParams_.Encode()
  65852. req, err := http.NewRequest("GET", urls, body)
  65853. if err != nil {
  65854. return nil, err
  65855. }
  65856. req.Header = reqHeaders
  65857. googleapi.Expand(req.URL, map[string]string{
  65858. "project": c.project,
  65859. })
  65860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65861. }
  65862. // Do executes the "compute.interconnectLocations.list" call.
  65863. // Exactly one of *InterconnectLocationList or error will be non-nil.
  65864. // Any non-2xx status code is an error. Response headers are in either
  65865. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  65866. // returned at all) in error.(*googleapi.Error).Header. Use
  65867. // googleapi.IsNotModified to check whether the returned error was
  65868. // because http.StatusNotModified was returned.
  65869. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  65870. gensupport.SetOptions(c.urlParams_, opts...)
  65871. res, err := c.doRequest("json")
  65872. if res != nil && res.StatusCode == http.StatusNotModified {
  65873. if res.Body != nil {
  65874. res.Body.Close()
  65875. }
  65876. return nil, &googleapi.Error{
  65877. Code: res.StatusCode,
  65878. Header: res.Header,
  65879. }
  65880. }
  65881. if err != nil {
  65882. return nil, err
  65883. }
  65884. defer googleapi.CloseBody(res)
  65885. if err := googleapi.CheckResponse(res); err != nil {
  65886. return nil, err
  65887. }
  65888. ret := &InterconnectLocationList{
  65889. ServerResponse: googleapi.ServerResponse{
  65890. Header: res.Header,
  65891. HTTPStatusCode: res.StatusCode,
  65892. },
  65893. }
  65894. target := &ret
  65895. if err := gensupport.DecodeResponse(target, res); err != nil {
  65896. return nil, err
  65897. }
  65898. return ret, nil
  65899. // {
  65900. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  65901. // "httpMethod": "GET",
  65902. // "id": "compute.interconnectLocations.list",
  65903. // "parameterOrder": [
  65904. // "project"
  65905. // ],
  65906. // "parameters": {
  65907. // "filter": {
  65908. // "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).",
  65909. // "location": "query",
  65910. // "type": "string"
  65911. // },
  65912. // "maxResults": {
  65913. // "default": "500",
  65914. // "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)",
  65915. // "format": "uint32",
  65916. // "location": "query",
  65917. // "minimum": "0",
  65918. // "type": "integer"
  65919. // },
  65920. // "orderBy": {
  65921. // "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.",
  65922. // "location": "query",
  65923. // "type": "string"
  65924. // },
  65925. // "pageToken": {
  65926. // "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.",
  65927. // "location": "query",
  65928. // "type": "string"
  65929. // },
  65930. // "project": {
  65931. // "description": "Project ID for this request.",
  65932. // "location": "path",
  65933. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65934. // "required": true,
  65935. // "type": "string"
  65936. // }
  65937. // },
  65938. // "path": "{project}/global/interconnectLocations",
  65939. // "response": {
  65940. // "$ref": "InterconnectLocationList"
  65941. // },
  65942. // "scopes": [
  65943. // "https://www.googleapis.com/auth/cloud-platform",
  65944. // "https://www.googleapis.com/auth/compute",
  65945. // "https://www.googleapis.com/auth/compute.readonly"
  65946. // ]
  65947. // }
  65948. }
  65949. // Pages invokes f for each page of results.
  65950. // A non-nil error returned from f will halt the iteration.
  65951. // The provided context supersedes any context provided to the Context method.
  65952. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  65953. c.ctx_ = ctx
  65954. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65955. for {
  65956. x, err := c.Do()
  65957. if err != nil {
  65958. return err
  65959. }
  65960. if err := f(x); err != nil {
  65961. return err
  65962. }
  65963. if x.NextPageToken == "" {
  65964. return nil
  65965. }
  65966. c.PageToken(x.NextPageToken)
  65967. }
  65968. }
  65969. // method id "compute.interconnects.delete":
  65970. type InterconnectsDeleteCall struct {
  65971. s *Service
  65972. project string
  65973. interconnect string
  65974. urlParams_ gensupport.URLParams
  65975. ctx_ context.Context
  65976. header_ http.Header
  65977. }
  65978. // Delete: Deletes the specified interconnect.
  65979. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  65980. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65981. c.project = project
  65982. c.interconnect = interconnect
  65983. return c
  65984. }
  65985. // RequestId sets the optional parameter "requestId": An optional
  65986. // request ID to identify requests. Specify a unique request ID so that
  65987. // if you must retry your request, the server will know to ignore the
  65988. // request if it has already been completed.
  65989. //
  65990. // For example, consider a situation where you make an initial request
  65991. // and the request times out. If you make the request again with the
  65992. // same request ID, the server can check if original operation with the
  65993. // same request ID was received, and if so, will ignore the second
  65994. // request. This prevents clients from accidentally creating duplicate
  65995. // commitments.
  65996. //
  65997. // The request ID must be a valid UUID with the exception that zero UUID
  65998. // is not supported (00000000-0000-0000-0000-000000000000).
  65999. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  66000. c.urlParams_.Set("requestId", requestId)
  66001. return c
  66002. }
  66003. // Fields allows partial responses to be retrieved. See
  66004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66005. // for more information.
  66006. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  66007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66008. return c
  66009. }
  66010. // Context sets the context to be used in this call's Do method. Any
  66011. // pending HTTP request will be aborted if the provided context is
  66012. // canceled.
  66013. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  66014. c.ctx_ = ctx
  66015. return c
  66016. }
  66017. // Header returns an http.Header that can be modified by the caller to
  66018. // add HTTP headers to the request.
  66019. func (c *InterconnectsDeleteCall) Header() http.Header {
  66020. if c.header_ == nil {
  66021. c.header_ = make(http.Header)
  66022. }
  66023. return c.header_
  66024. }
  66025. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  66026. reqHeaders := make(http.Header)
  66027. for k, v := range c.header_ {
  66028. reqHeaders[k] = v
  66029. }
  66030. reqHeaders.Set("User-Agent", c.s.userAgent())
  66031. var body io.Reader = nil
  66032. c.urlParams_.Set("alt", alt)
  66033. c.urlParams_.Set("prettyPrint", "false")
  66034. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  66035. urls += "?" + c.urlParams_.Encode()
  66036. req, err := http.NewRequest("DELETE", urls, body)
  66037. if err != nil {
  66038. return nil, err
  66039. }
  66040. req.Header = reqHeaders
  66041. googleapi.Expand(req.URL, map[string]string{
  66042. "project": c.project,
  66043. "interconnect": c.interconnect,
  66044. })
  66045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66046. }
  66047. // Do executes the "compute.interconnects.delete" call.
  66048. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66049. // status code is an error. Response headers are in either
  66050. // *Operation.ServerResponse.Header or (if a response was returned at
  66051. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66052. // to check whether the returned error was because
  66053. // http.StatusNotModified was returned.
  66054. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66055. gensupport.SetOptions(c.urlParams_, opts...)
  66056. res, err := c.doRequest("json")
  66057. if res != nil && res.StatusCode == http.StatusNotModified {
  66058. if res.Body != nil {
  66059. res.Body.Close()
  66060. }
  66061. return nil, &googleapi.Error{
  66062. Code: res.StatusCode,
  66063. Header: res.Header,
  66064. }
  66065. }
  66066. if err != nil {
  66067. return nil, err
  66068. }
  66069. defer googleapi.CloseBody(res)
  66070. if err := googleapi.CheckResponse(res); err != nil {
  66071. return nil, err
  66072. }
  66073. ret := &Operation{
  66074. ServerResponse: googleapi.ServerResponse{
  66075. Header: res.Header,
  66076. HTTPStatusCode: res.StatusCode,
  66077. },
  66078. }
  66079. target := &ret
  66080. if err := gensupport.DecodeResponse(target, res); err != nil {
  66081. return nil, err
  66082. }
  66083. return ret, nil
  66084. // {
  66085. // "description": "Deletes the specified interconnect.",
  66086. // "httpMethod": "DELETE",
  66087. // "id": "compute.interconnects.delete",
  66088. // "parameterOrder": [
  66089. // "project",
  66090. // "interconnect"
  66091. // ],
  66092. // "parameters": {
  66093. // "interconnect": {
  66094. // "description": "Name of the interconnect to delete.",
  66095. // "location": "path",
  66096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66097. // "required": true,
  66098. // "type": "string"
  66099. // },
  66100. // "project": {
  66101. // "description": "Project ID for this request.",
  66102. // "location": "path",
  66103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66104. // "required": true,
  66105. // "type": "string"
  66106. // },
  66107. // "requestId": {
  66108. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66109. // "location": "query",
  66110. // "type": "string"
  66111. // }
  66112. // },
  66113. // "path": "{project}/global/interconnects/{interconnect}",
  66114. // "response": {
  66115. // "$ref": "Operation"
  66116. // },
  66117. // "scopes": [
  66118. // "https://www.googleapis.com/auth/cloud-platform",
  66119. // "https://www.googleapis.com/auth/compute"
  66120. // ]
  66121. // }
  66122. }
  66123. // method id "compute.interconnects.get":
  66124. type InterconnectsGetCall struct {
  66125. s *Service
  66126. project string
  66127. interconnect string
  66128. urlParams_ gensupport.URLParams
  66129. ifNoneMatch_ string
  66130. ctx_ context.Context
  66131. header_ http.Header
  66132. }
  66133. // Get: Returns the specified interconnect. Get a list of available
  66134. // interconnects by making a list() request.
  66135. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  66136. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66137. c.project = project
  66138. c.interconnect = interconnect
  66139. return c
  66140. }
  66141. // Fields allows partial responses to be retrieved. See
  66142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66143. // for more information.
  66144. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  66145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66146. return c
  66147. }
  66148. // IfNoneMatch sets the optional parameter which makes the operation
  66149. // fail if the object's ETag matches the given value. This is useful for
  66150. // getting updates only after the object has changed since the last
  66151. // request. Use googleapi.IsNotModified to check whether the response
  66152. // error from Do is the result of In-None-Match.
  66153. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  66154. c.ifNoneMatch_ = entityTag
  66155. return c
  66156. }
  66157. // Context sets the context to be used in this call's Do method. Any
  66158. // pending HTTP request will be aborted if the provided context is
  66159. // canceled.
  66160. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  66161. c.ctx_ = ctx
  66162. return c
  66163. }
  66164. // Header returns an http.Header that can be modified by the caller to
  66165. // add HTTP headers to the request.
  66166. func (c *InterconnectsGetCall) Header() http.Header {
  66167. if c.header_ == nil {
  66168. c.header_ = make(http.Header)
  66169. }
  66170. return c.header_
  66171. }
  66172. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  66173. reqHeaders := make(http.Header)
  66174. for k, v := range c.header_ {
  66175. reqHeaders[k] = v
  66176. }
  66177. reqHeaders.Set("User-Agent", c.s.userAgent())
  66178. if c.ifNoneMatch_ != "" {
  66179. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66180. }
  66181. var body io.Reader = nil
  66182. c.urlParams_.Set("alt", alt)
  66183. c.urlParams_.Set("prettyPrint", "false")
  66184. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  66185. urls += "?" + c.urlParams_.Encode()
  66186. req, err := http.NewRequest("GET", urls, body)
  66187. if err != nil {
  66188. return nil, err
  66189. }
  66190. req.Header = reqHeaders
  66191. googleapi.Expand(req.URL, map[string]string{
  66192. "project": c.project,
  66193. "interconnect": c.interconnect,
  66194. })
  66195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66196. }
  66197. // Do executes the "compute.interconnects.get" call.
  66198. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  66199. // status code is an error. Response headers are in either
  66200. // *Interconnect.ServerResponse.Header or (if a response was returned at
  66201. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66202. // to check whether the returned error was because
  66203. // http.StatusNotModified was returned.
  66204. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  66205. gensupport.SetOptions(c.urlParams_, opts...)
  66206. res, err := c.doRequest("json")
  66207. if res != nil && res.StatusCode == http.StatusNotModified {
  66208. if res.Body != nil {
  66209. res.Body.Close()
  66210. }
  66211. return nil, &googleapi.Error{
  66212. Code: res.StatusCode,
  66213. Header: res.Header,
  66214. }
  66215. }
  66216. if err != nil {
  66217. return nil, err
  66218. }
  66219. defer googleapi.CloseBody(res)
  66220. if err := googleapi.CheckResponse(res); err != nil {
  66221. return nil, err
  66222. }
  66223. ret := &Interconnect{
  66224. ServerResponse: googleapi.ServerResponse{
  66225. Header: res.Header,
  66226. HTTPStatusCode: res.StatusCode,
  66227. },
  66228. }
  66229. target := &ret
  66230. if err := gensupport.DecodeResponse(target, res); err != nil {
  66231. return nil, err
  66232. }
  66233. return ret, nil
  66234. // {
  66235. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  66236. // "httpMethod": "GET",
  66237. // "id": "compute.interconnects.get",
  66238. // "parameterOrder": [
  66239. // "project",
  66240. // "interconnect"
  66241. // ],
  66242. // "parameters": {
  66243. // "interconnect": {
  66244. // "description": "Name of the interconnect to return.",
  66245. // "location": "path",
  66246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66247. // "required": true,
  66248. // "type": "string"
  66249. // },
  66250. // "project": {
  66251. // "description": "Project ID for this request.",
  66252. // "location": "path",
  66253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66254. // "required": true,
  66255. // "type": "string"
  66256. // }
  66257. // },
  66258. // "path": "{project}/global/interconnects/{interconnect}",
  66259. // "response": {
  66260. // "$ref": "Interconnect"
  66261. // },
  66262. // "scopes": [
  66263. // "https://www.googleapis.com/auth/cloud-platform",
  66264. // "https://www.googleapis.com/auth/compute",
  66265. // "https://www.googleapis.com/auth/compute.readonly"
  66266. // ]
  66267. // }
  66268. }
  66269. // method id "compute.interconnects.getDiagnostics":
  66270. type InterconnectsGetDiagnosticsCall struct {
  66271. s *Service
  66272. project string
  66273. interconnect string
  66274. urlParams_ gensupport.URLParams
  66275. ifNoneMatch_ string
  66276. ctx_ context.Context
  66277. header_ http.Header
  66278. }
  66279. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  66280. // interconnect.
  66281. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  66282. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66283. c.project = project
  66284. c.interconnect = interconnect
  66285. return c
  66286. }
  66287. // Fields allows partial responses to be retrieved. See
  66288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66289. // for more information.
  66290. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  66291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66292. return c
  66293. }
  66294. // IfNoneMatch sets the optional parameter which makes the operation
  66295. // fail if the object's ETag matches the given value. This is useful for
  66296. // getting updates only after the object has changed since the last
  66297. // request. Use googleapi.IsNotModified to check whether the response
  66298. // error from Do is the result of In-None-Match.
  66299. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  66300. c.ifNoneMatch_ = entityTag
  66301. return c
  66302. }
  66303. // Context sets the context to be used in this call's Do method. Any
  66304. // pending HTTP request will be aborted if the provided context is
  66305. // canceled.
  66306. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  66307. c.ctx_ = ctx
  66308. return c
  66309. }
  66310. // Header returns an http.Header that can be modified by the caller to
  66311. // add HTTP headers to the request.
  66312. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  66313. if c.header_ == nil {
  66314. c.header_ = make(http.Header)
  66315. }
  66316. return c.header_
  66317. }
  66318. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  66319. reqHeaders := make(http.Header)
  66320. for k, v := range c.header_ {
  66321. reqHeaders[k] = v
  66322. }
  66323. reqHeaders.Set("User-Agent", c.s.userAgent())
  66324. if c.ifNoneMatch_ != "" {
  66325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66326. }
  66327. var body io.Reader = nil
  66328. c.urlParams_.Set("alt", alt)
  66329. c.urlParams_.Set("prettyPrint", "false")
  66330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  66331. urls += "?" + c.urlParams_.Encode()
  66332. req, err := http.NewRequest("GET", urls, body)
  66333. if err != nil {
  66334. return nil, err
  66335. }
  66336. req.Header = reqHeaders
  66337. googleapi.Expand(req.URL, map[string]string{
  66338. "project": c.project,
  66339. "interconnect": c.interconnect,
  66340. })
  66341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66342. }
  66343. // Do executes the "compute.interconnects.getDiagnostics" call.
  66344. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  66345. // non-nil. Any non-2xx status code is an error. Response headers are in
  66346. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  66347. // (if a response was returned at all) in
  66348. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  66349. // whether the returned error was because http.StatusNotModified was
  66350. // returned.
  66351. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  66352. gensupport.SetOptions(c.urlParams_, opts...)
  66353. res, err := c.doRequest("json")
  66354. if res != nil && res.StatusCode == http.StatusNotModified {
  66355. if res.Body != nil {
  66356. res.Body.Close()
  66357. }
  66358. return nil, &googleapi.Error{
  66359. Code: res.StatusCode,
  66360. Header: res.Header,
  66361. }
  66362. }
  66363. if err != nil {
  66364. return nil, err
  66365. }
  66366. defer googleapi.CloseBody(res)
  66367. if err := googleapi.CheckResponse(res); err != nil {
  66368. return nil, err
  66369. }
  66370. ret := &InterconnectsGetDiagnosticsResponse{
  66371. ServerResponse: googleapi.ServerResponse{
  66372. Header: res.Header,
  66373. HTTPStatusCode: res.StatusCode,
  66374. },
  66375. }
  66376. target := &ret
  66377. if err := gensupport.DecodeResponse(target, res); err != nil {
  66378. return nil, err
  66379. }
  66380. return ret, nil
  66381. // {
  66382. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  66383. // "httpMethod": "GET",
  66384. // "id": "compute.interconnects.getDiagnostics",
  66385. // "parameterOrder": [
  66386. // "project",
  66387. // "interconnect"
  66388. // ],
  66389. // "parameters": {
  66390. // "interconnect": {
  66391. // "description": "Name of the interconnect resource to query.",
  66392. // "location": "path",
  66393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66394. // "required": true,
  66395. // "type": "string"
  66396. // },
  66397. // "project": {
  66398. // "description": "Project ID for this request.",
  66399. // "location": "path",
  66400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66401. // "required": true,
  66402. // "type": "string"
  66403. // }
  66404. // },
  66405. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  66406. // "response": {
  66407. // "$ref": "InterconnectsGetDiagnosticsResponse"
  66408. // },
  66409. // "scopes": [
  66410. // "https://www.googleapis.com/auth/cloud-platform",
  66411. // "https://www.googleapis.com/auth/compute",
  66412. // "https://www.googleapis.com/auth/compute.readonly"
  66413. // ]
  66414. // }
  66415. }
  66416. // method id "compute.interconnects.insert":
  66417. type InterconnectsInsertCall struct {
  66418. s *Service
  66419. project string
  66420. interconnect *Interconnect
  66421. urlParams_ gensupport.URLParams
  66422. ctx_ context.Context
  66423. header_ http.Header
  66424. }
  66425. // Insert: Creates a Interconnect in the specified project using the
  66426. // data included in the request.
  66427. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  66428. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66429. c.project = project
  66430. c.interconnect = interconnect
  66431. return c
  66432. }
  66433. // RequestId sets the optional parameter "requestId": An optional
  66434. // request ID to identify requests. Specify a unique request ID so that
  66435. // if you must retry your request, the server will know to ignore the
  66436. // request if it has already been completed.
  66437. //
  66438. // For example, consider a situation where you make an initial request
  66439. // and the request times out. If you make the request again with the
  66440. // same request ID, the server can check if original operation with the
  66441. // same request ID was received, and if so, will ignore the second
  66442. // request. This prevents clients from accidentally creating duplicate
  66443. // commitments.
  66444. //
  66445. // The request ID must be a valid UUID with the exception that zero UUID
  66446. // is not supported (00000000-0000-0000-0000-000000000000).
  66447. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  66448. c.urlParams_.Set("requestId", requestId)
  66449. return c
  66450. }
  66451. // Fields allows partial responses to be retrieved. See
  66452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66453. // for more information.
  66454. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  66455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66456. return c
  66457. }
  66458. // Context sets the context to be used in this call's Do method. Any
  66459. // pending HTTP request will be aborted if the provided context is
  66460. // canceled.
  66461. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  66462. c.ctx_ = ctx
  66463. return c
  66464. }
  66465. // Header returns an http.Header that can be modified by the caller to
  66466. // add HTTP headers to the request.
  66467. func (c *InterconnectsInsertCall) Header() http.Header {
  66468. if c.header_ == nil {
  66469. c.header_ = make(http.Header)
  66470. }
  66471. return c.header_
  66472. }
  66473. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  66474. reqHeaders := make(http.Header)
  66475. for k, v := range c.header_ {
  66476. reqHeaders[k] = v
  66477. }
  66478. reqHeaders.Set("User-Agent", c.s.userAgent())
  66479. var body io.Reader = nil
  66480. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  66481. if err != nil {
  66482. return nil, err
  66483. }
  66484. reqHeaders.Set("Content-Type", "application/json")
  66485. c.urlParams_.Set("alt", alt)
  66486. c.urlParams_.Set("prettyPrint", "false")
  66487. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  66488. urls += "?" + c.urlParams_.Encode()
  66489. req, err := http.NewRequest("POST", urls, body)
  66490. if err != nil {
  66491. return nil, err
  66492. }
  66493. req.Header = reqHeaders
  66494. googleapi.Expand(req.URL, map[string]string{
  66495. "project": c.project,
  66496. })
  66497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66498. }
  66499. // Do executes the "compute.interconnects.insert" call.
  66500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66501. // status code is an error. Response headers are in either
  66502. // *Operation.ServerResponse.Header or (if a response was returned at
  66503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66504. // to check whether the returned error was because
  66505. // http.StatusNotModified was returned.
  66506. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66507. gensupport.SetOptions(c.urlParams_, opts...)
  66508. res, err := c.doRequest("json")
  66509. if res != nil && res.StatusCode == http.StatusNotModified {
  66510. if res.Body != nil {
  66511. res.Body.Close()
  66512. }
  66513. return nil, &googleapi.Error{
  66514. Code: res.StatusCode,
  66515. Header: res.Header,
  66516. }
  66517. }
  66518. if err != nil {
  66519. return nil, err
  66520. }
  66521. defer googleapi.CloseBody(res)
  66522. if err := googleapi.CheckResponse(res); err != nil {
  66523. return nil, err
  66524. }
  66525. ret := &Operation{
  66526. ServerResponse: googleapi.ServerResponse{
  66527. Header: res.Header,
  66528. HTTPStatusCode: res.StatusCode,
  66529. },
  66530. }
  66531. target := &ret
  66532. if err := gensupport.DecodeResponse(target, res); err != nil {
  66533. return nil, err
  66534. }
  66535. return ret, nil
  66536. // {
  66537. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  66538. // "httpMethod": "POST",
  66539. // "id": "compute.interconnects.insert",
  66540. // "parameterOrder": [
  66541. // "project"
  66542. // ],
  66543. // "parameters": {
  66544. // "project": {
  66545. // "description": "Project ID for this request.",
  66546. // "location": "path",
  66547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66548. // "required": true,
  66549. // "type": "string"
  66550. // },
  66551. // "requestId": {
  66552. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66553. // "location": "query",
  66554. // "type": "string"
  66555. // }
  66556. // },
  66557. // "path": "{project}/global/interconnects",
  66558. // "request": {
  66559. // "$ref": "Interconnect"
  66560. // },
  66561. // "response": {
  66562. // "$ref": "Operation"
  66563. // },
  66564. // "scopes": [
  66565. // "https://www.googleapis.com/auth/cloud-platform",
  66566. // "https://www.googleapis.com/auth/compute"
  66567. // ]
  66568. // }
  66569. }
  66570. // method id "compute.interconnects.list":
  66571. type InterconnectsListCall struct {
  66572. s *Service
  66573. project string
  66574. urlParams_ gensupport.URLParams
  66575. ifNoneMatch_ string
  66576. ctx_ context.Context
  66577. header_ http.Header
  66578. }
  66579. // List: Retrieves the list of interconnect available to the specified
  66580. // project.
  66581. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  66582. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66583. c.project = project
  66584. return c
  66585. }
  66586. // Filter sets the optional parameter "filter": A filter expression that
  66587. // filters resources listed in the response. The expression must specify
  66588. // the field name, a comparison operator, and the value that you want to
  66589. // use for filtering. The value must be a string, a number, or a
  66590. // boolean. The comparison operator must be either =, !=, >, or <.
  66591. //
  66592. // For example, if you are filtering Compute Engine instances, you can
  66593. // exclude instances named example-instance by specifying name !=
  66594. // example-instance.
  66595. //
  66596. // You can also filter nested fields. For example, you could specify
  66597. // scheduling.automaticRestart = false to include instances only if they
  66598. // are not scheduled for automatic restarts. You can use filtering on
  66599. // nested fields to filter based on resource labels.
  66600. //
  66601. // To filter on multiple expressions, provide each separate expression
  66602. // within parentheses. For example, (scheduling.automaticRestart = true)
  66603. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66604. // AND expression. However, you can include AND and OR expressions
  66605. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66606. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66607. // true).
  66608. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  66609. c.urlParams_.Set("filter", filter)
  66610. return c
  66611. }
  66612. // MaxResults sets the optional parameter "maxResults": The maximum
  66613. // number of results per page that should be returned. If the number of
  66614. // available results is larger than maxResults, Compute Engine returns a
  66615. // nextPageToken that can be used to get the next page of results in
  66616. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66617. // (Default: 500)
  66618. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  66619. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66620. return c
  66621. }
  66622. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66623. // a certain order. By default, results are returned in alphanumerical
  66624. // order based on the resource name.
  66625. //
  66626. // You can also sort results in descending order based on the creation
  66627. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66628. // based on the creationTimestamp field in reverse chronological order
  66629. // (newest result first). Use this to sort resources like operations so
  66630. // that the newest operation is returned first.
  66631. //
  66632. // Currently, only sorting by name or creationTimestamp desc is
  66633. // supported.
  66634. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  66635. c.urlParams_.Set("orderBy", orderBy)
  66636. return c
  66637. }
  66638. // PageToken sets the optional parameter "pageToken": Specifies a page
  66639. // token to use. Set pageToken to the nextPageToken returned by a
  66640. // previous list request to get the next page of results.
  66641. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  66642. c.urlParams_.Set("pageToken", pageToken)
  66643. return c
  66644. }
  66645. // Fields allows partial responses to be retrieved. See
  66646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66647. // for more information.
  66648. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  66649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66650. return c
  66651. }
  66652. // IfNoneMatch sets the optional parameter which makes the operation
  66653. // fail if the object's ETag matches the given value. This is useful for
  66654. // getting updates only after the object has changed since the last
  66655. // request. Use googleapi.IsNotModified to check whether the response
  66656. // error from Do is the result of In-None-Match.
  66657. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  66658. c.ifNoneMatch_ = entityTag
  66659. return c
  66660. }
  66661. // Context sets the context to be used in this call's Do method. Any
  66662. // pending HTTP request will be aborted if the provided context is
  66663. // canceled.
  66664. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  66665. c.ctx_ = ctx
  66666. return c
  66667. }
  66668. // Header returns an http.Header that can be modified by the caller to
  66669. // add HTTP headers to the request.
  66670. func (c *InterconnectsListCall) Header() http.Header {
  66671. if c.header_ == nil {
  66672. c.header_ = make(http.Header)
  66673. }
  66674. return c.header_
  66675. }
  66676. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  66677. reqHeaders := make(http.Header)
  66678. for k, v := range c.header_ {
  66679. reqHeaders[k] = v
  66680. }
  66681. reqHeaders.Set("User-Agent", c.s.userAgent())
  66682. if c.ifNoneMatch_ != "" {
  66683. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66684. }
  66685. var body io.Reader = nil
  66686. c.urlParams_.Set("alt", alt)
  66687. c.urlParams_.Set("prettyPrint", "false")
  66688. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  66689. urls += "?" + c.urlParams_.Encode()
  66690. req, err := http.NewRequest("GET", urls, body)
  66691. if err != nil {
  66692. return nil, err
  66693. }
  66694. req.Header = reqHeaders
  66695. googleapi.Expand(req.URL, map[string]string{
  66696. "project": c.project,
  66697. })
  66698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66699. }
  66700. // Do executes the "compute.interconnects.list" call.
  66701. // Exactly one of *InterconnectList or error will be non-nil. Any
  66702. // non-2xx status code is an error. Response headers are in either
  66703. // *InterconnectList.ServerResponse.Header or (if a response was
  66704. // returned at all) in error.(*googleapi.Error).Header. Use
  66705. // googleapi.IsNotModified to check whether the returned error was
  66706. // because http.StatusNotModified was returned.
  66707. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  66708. gensupport.SetOptions(c.urlParams_, opts...)
  66709. res, err := c.doRequest("json")
  66710. if res != nil && res.StatusCode == http.StatusNotModified {
  66711. if res.Body != nil {
  66712. res.Body.Close()
  66713. }
  66714. return nil, &googleapi.Error{
  66715. Code: res.StatusCode,
  66716. Header: res.Header,
  66717. }
  66718. }
  66719. if err != nil {
  66720. return nil, err
  66721. }
  66722. defer googleapi.CloseBody(res)
  66723. if err := googleapi.CheckResponse(res); err != nil {
  66724. return nil, err
  66725. }
  66726. ret := &InterconnectList{
  66727. ServerResponse: googleapi.ServerResponse{
  66728. Header: res.Header,
  66729. HTTPStatusCode: res.StatusCode,
  66730. },
  66731. }
  66732. target := &ret
  66733. if err := gensupport.DecodeResponse(target, res); err != nil {
  66734. return nil, err
  66735. }
  66736. return ret, nil
  66737. // {
  66738. // "description": "Retrieves the list of interconnect available to the specified project.",
  66739. // "httpMethod": "GET",
  66740. // "id": "compute.interconnects.list",
  66741. // "parameterOrder": [
  66742. // "project"
  66743. // ],
  66744. // "parameters": {
  66745. // "filter": {
  66746. // "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).",
  66747. // "location": "query",
  66748. // "type": "string"
  66749. // },
  66750. // "maxResults": {
  66751. // "default": "500",
  66752. // "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)",
  66753. // "format": "uint32",
  66754. // "location": "query",
  66755. // "minimum": "0",
  66756. // "type": "integer"
  66757. // },
  66758. // "orderBy": {
  66759. // "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.",
  66760. // "location": "query",
  66761. // "type": "string"
  66762. // },
  66763. // "pageToken": {
  66764. // "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.",
  66765. // "location": "query",
  66766. // "type": "string"
  66767. // },
  66768. // "project": {
  66769. // "description": "Project ID for this request.",
  66770. // "location": "path",
  66771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66772. // "required": true,
  66773. // "type": "string"
  66774. // }
  66775. // },
  66776. // "path": "{project}/global/interconnects",
  66777. // "response": {
  66778. // "$ref": "InterconnectList"
  66779. // },
  66780. // "scopes": [
  66781. // "https://www.googleapis.com/auth/cloud-platform",
  66782. // "https://www.googleapis.com/auth/compute",
  66783. // "https://www.googleapis.com/auth/compute.readonly"
  66784. // ]
  66785. // }
  66786. }
  66787. // Pages invokes f for each page of results.
  66788. // A non-nil error returned from f will halt the iteration.
  66789. // The provided context supersedes any context provided to the Context method.
  66790. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  66791. c.ctx_ = ctx
  66792. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66793. for {
  66794. x, err := c.Do()
  66795. if err != nil {
  66796. return err
  66797. }
  66798. if err := f(x); err != nil {
  66799. return err
  66800. }
  66801. if x.NextPageToken == "" {
  66802. return nil
  66803. }
  66804. c.PageToken(x.NextPageToken)
  66805. }
  66806. }
  66807. // method id "compute.interconnects.patch":
  66808. type InterconnectsPatchCall struct {
  66809. s *Service
  66810. project string
  66811. interconnect string
  66812. interconnect2 *Interconnect
  66813. urlParams_ gensupport.URLParams
  66814. ctx_ context.Context
  66815. header_ http.Header
  66816. }
  66817. // Patch: Updates the specified interconnect with the data included in
  66818. // the request. This method supports PATCH semantics and uses the JSON
  66819. // merge patch format and processing rules.
  66820. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  66821. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66822. c.project = project
  66823. c.interconnect = interconnect
  66824. c.interconnect2 = interconnect2
  66825. return c
  66826. }
  66827. // RequestId sets the optional parameter "requestId": An optional
  66828. // request ID to identify requests. Specify a unique request ID so that
  66829. // if you must retry your request, the server will know to ignore the
  66830. // request if it has already been completed.
  66831. //
  66832. // For example, consider a situation where you make an initial request
  66833. // and the request times out. If you make the request again with the
  66834. // same request ID, the server can check if original operation with the
  66835. // same request ID was received, and if so, will ignore the second
  66836. // request. This prevents clients from accidentally creating duplicate
  66837. // commitments.
  66838. //
  66839. // The request ID must be a valid UUID with the exception that zero UUID
  66840. // is not supported (00000000-0000-0000-0000-000000000000).
  66841. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  66842. c.urlParams_.Set("requestId", requestId)
  66843. return c
  66844. }
  66845. // Fields allows partial responses to be retrieved. See
  66846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66847. // for more information.
  66848. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  66849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66850. return c
  66851. }
  66852. // Context sets the context to be used in this call's Do method. Any
  66853. // pending HTTP request will be aborted if the provided context is
  66854. // canceled.
  66855. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  66856. c.ctx_ = ctx
  66857. return c
  66858. }
  66859. // Header returns an http.Header that can be modified by the caller to
  66860. // add HTTP headers to the request.
  66861. func (c *InterconnectsPatchCall) Header() http.Header {
  66862. if c.header_ == nil {
  66863. c.header_ = make(http.Header)
  66864. }
  66865. return c.header_
  66866. }
  66867. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  66868. reqHeaders := make(http.Header)
  66869. for k, v := range c.header_ {
  66870. reqHeaders[k] = v
  66871. }
  66872. reqHeaders.Set("User-Agent", c.s.userAgent())
  66873. var body io.Reader = nil
  66874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  66875. if err != nil {
  66876. return nil, err
  66877. }
  66878. reqHeaders.Set("Content-Type", "application/json")
  66879. c.urlParams_.Set("alt", alt)
  66880. c.urlParams_.Set("prettyPrint", "false")
  66881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  66882. urls += "?" + c.urlParams_.Encode()
  66883. req, err := http.NewRequest("PATCH", urls, body)
  66884. if err != nil {
  66885. return nil, err
  66886. }
  66887. req.Header = reqHeaders
  66888. googleapi.Expand(req.URL, map[string]string{
  66889. "project": c.project,
  66890. "interconnect": c.interconnect,
  66891. })
  66892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66893. }
  66894. // Do executes the "compute.interconnects.patch" call.
  66895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66896. // status code is an error. Response headers are in either
  66897. // *Operation.ServerResponse.Header or (if a response was returned at
  66898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66899. // to check whether the returned error was because
  66900. // http.StatusNotModified was returned.
  66901. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66902. gensupport.SetOptions(c.urlParams_, opts...)
  66903. res, err := c.doRequest("json")
  66904. if res != nil && res.StatusCode == http.StatusNotModified {
  66905. if res.Body != nil {
  66906. res.Body.Close()
  66907. }
  66908. return nil, &googleapi.Error{
  66909. Code: res.StatusCode,
  66910. Header: res.Header,
  66911. }
  66912. }
  66913. if err != nil {
  66914. return nil, err
  66915. }
  66916. defer googleapi.CloseBody(res)
  66917. if err := googleapi.CheckResponse(res); err != nil {
  66918. return nil, err
  66919. }
  66920. ret := &Operation{
  66921. ServerResponse: googleapi.ServerResponse{
  66922. Header: res.Header,
  66923. HTTPStatusCode: res.StatusCode,
  66924. },
  66925. }
  66926. target := &ret
  66927. if err := gensupport.DecodeResponse(target, res); err != nil {
  66928. return nil, err
  66929. }
  66930. return ret, nil
  66931. // {
  66932. // "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.",
  66933. // "httpMethod": "PATCH",
  66934. // "id": "compute.interconnects.patch",
  66935. // "parameterOrder": [
  66936. // "project",
  66937. // "interconnect"
  66938. // ],
  66939. // "parameters": {
  66940. // "interconnect": {
  66941. // "description": "Name of the interconnect to update.",
  66942. // "location": "path",
  66943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66944. // "required": true,
  66945. // "type": "string"
  66946. // },
  66947. // "project": {
  66948. // "description": "Project ID for this request.",
  66949. // "location": "path",
  66950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66951. // "required": true,
  66952. // "type": "string"
  66953. // },
  66954. // "requestId": {
  66955. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66956. // "location": "query",
  66957. // "type": "string"
  66958. // }
  66959. // },
  66960. // "path": "{project}/global/interconnects/{interconnect}",
  66961. // "request": {
  66962. // "$ref": "Interconnect"
  66963. // },
  66964. // "response": {
  66965. // "$ref": "Operation"
  66966. // },
  66967. // "scopes": [
  66968. // "https://www.googleapis.com/auth/cloud-platform",
  66969. // "https://www.googleapis.com/auth/compute"
  66970. // ]
  66971. // }
  66972. }
  66973. // method id "compute.interconnects.setLabels":
  66974. type InterconnectsSetLabelsCall struct {
  66975. s *Service
  66976. project string
  66977. resource string
  66978. globalsetlabelsrequest *GlobalSetLabelsRequest
  66979. urlParams_ gensupport.URLParams
  66980. ctx_ context.Context
  66981. header_ http.Header
  66982. }
  66983. // SetLabels: Sets the labels on an Interconnect. To learn more about
  66984. // labels, read the Labeling Resources documentation.
  66985. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  66986. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66987. c.project = project
  66988. c.resource = resource
  66989. c.globalsetlabelsrequest = globalsetlabelsrequest
  66990. return c
  66991. }
  66992. // Fields allows partial responses to be retrieved. See
  66993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66994. // for more information.
  66995. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  66996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66997. return c
  66998. }
  66999. // Context sets the context to be used in this call's Do method. Any
  67000. // pending HTTP request will be aborted if the provided context is
  67001. // canceled.
  67002. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  67003. c.ctx_ = ctx
  67004. return c
  67005. }
  67006. // Header returns an http.Header that can be modified by the caller to
  67007. // add HTTP headers to the request.
  67008. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  67009. if c.header_ == nil {
  67010. c.header_ = make(http.Header)
  67011. }
  67012. return c.header_
  67013. }
  67014. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  67015. reqHeaders := make(http.Header)
  67016. for k, v := range c.header_ {
  67017. reqHeaders[k] = v
  67018. }
  67019. reqHeaders.Set("User-Agent", c.s.userAgent())
  67020. var body io.Reader = nil
  67021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  67022. if err != nil {
  67023. return nil, err
  67024. }
  67025. reqHeaders.Set("Content-Type", "application/json")
  67026. c.urlParams_.Set("alt", alt)
  67027. c.urlParams_.Set("prettyPrint", "false")
  67028. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  67029. urls += "?" + c.urlParams_.Encode()
  67030. req, err := http.NewRequest("POST", urls, body)
  67031. if err != nil {
  67032. return nil, err
  67033. }
  67034. req.Header = reqHeaders
  67035. googleapi.Expand(req.URL, map[string]string{
  67036. "project": c.project,
  67037. "resource": c.resource,
  67038. })
  67039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67040. }
  67041. // Do executes the "compute.interconnects.setLabels" call.
  67042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67043. // status code is an error. Response headers are in either
  67044. // *Operation.ServerResponse.Header or (if a response was returned at
  67045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67046. // to check whether the returned error was because
  67047. // http.StatusNotModified was returned.
  67048. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67049. gensupport.SetOptions(c.urlParams_, opts...)
  67050. res, err := c.doRequest("json")
  67051. if res != nil && res.StatusCode == http.StatusNotModified {
  67052. if res.Body != nil {
  67053. res.Body.Close()
  67054. }
  67055. return nil, &googleapi.Error{
  67056. Code: res.StatusCode,
  67057. Header: res.Header,
  67058. }
  67059. }
  67060. if err != nil {
  67061. return nil, err
  67062. }
  67063. defer googleapi.CloseBody(res)
  67064. if err := googleapi.CheckResponse(res); err != nil {
  67065. return nil, err
  67066. }
  67067. ret := &Operation{
  67068. ServerResponse: googleapi.ServerResponse{
  67069. Header: res.Header,
  67070. HTTPStatusCode: res.StatusCode,
  67071. },
  67072. }
  67073. target := &ret
  67074. if err := gensupport.DecodeResponse(target, res); err != nil {
  67075. return nil, err
  67076. }
  67077. return ret, nil
  67078. // {
  67079. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  67080. // "httpMethod": "POST",
  67081. // "id": "compute.interconnects.setLabels",
  67082. // "parameterOrder": [
  67083. // "project",
  67084. // "resource"
  67085. // ],
  67086. // "parameters": {
  67087. // "project": {
  67088. // "description": "Project ID for this request.",
  67089. // "location": "path",
  67090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67091. // "required": true,
  67092. // "type": "string"
  67093. // },
  67094. // "resource": {
  67095. // "description": "Name or id of the resource for this request.",
  67096. // "location": "path",
  67097. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67098. // "required": true,
  67099. // "type": "string"
  67100. // }
  67101. // },
  67102. // "path": "{project}/global/interconnects/{resource}/setLabels",
  67103. // "request": {
  67104. // "$ref": "GlobalSetLabelsRequest"
  67105. // },
  67106. // "response": {
  67107. // "$ref": "Operation"
  67108. // },
  67109. // "scopes": [
  67110. // "https://www.googleapis.com/auth/cloud-platform",
  67111. // "https://www.googleapis.com/auth/compute"
  67112. // ]
  67113. // }
  67114. }
  67115. // method id "compute.interconnects.testIamPermissions":
  67116. type InterconnectsTestIamPermissionsCall struct {
  67117. s *Service
  67118. project string
  67119. resource string
  67120. testpermissionsrequest *TestPermissionsRequest
  67121. urlParams_ gensupport.URLParams
  67122. ctx_ context.Context
  67123. header_ http.Header
  67124. }
  67125. // TestIamPermissions: Returns permissions that a caller has on the
  67126. // specified resource.
  67127. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  67128. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67129. c.project = project
  67130. c.resource = resource
  67131. c.testpermissionsrequest = testpermissionsrequest
  67132. return c
  67133. }
  67134. // Fields allows partial responses to be retrieved. See
  67135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67136. // for more information.
  67137. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  67138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67139. return c
  67140. }
  67141. // Context sets the context to be used in this call's Do method. Any
  67142. // pending HTTP request will be aborted if the provided context is
  67143. // canceled.
  67144. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  67145. c.ctx_ = ctx
  67146. return c
  67147. }
  67148. // Header returns an http.Header that can be modified by the caller to
  67149. // add HTTP headers to the request.
  67150. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  67151. if c.header_ == nil {
  67152. c.header_ = make(http.Header)
  67153. }
  67154. return c.header_
  67155. }
  67156. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  67157. reqHeaders := make(http.Header)
  67158. for k, v := range c.header_ {
  67159. reqHeaders[k] = v
  67160. }
  67161. reqHeaders.Set("User-Agent", c.s.userAgent())
  67162. var body io.Reader = nil
  67163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  67164. if err != nil {
  67165. return nil, err
  67166. }
  67167. reqHeaders.Set("Content-Type", "application/json")
  67168. c.urlParams_.Set("alt", alt)
  67169. c.urlParams_.Set("prettyPrint", "false")
  67170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  67171. urls += "?" + c.urlParams_.Encode()
  67172. req, err := http.NewRequest("POST", urls, body)
  67173. if err != nil {
  67174. return nil, err
  67175. }
  67176. req.Header = reqHeaders
  67177. googleapi.Expand(req.URL, map[string]string{
  67178. "project": c.project,
  67179. "resource": c.resource,
  67180. })
  67181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67182. }
  67183. // Do executes the "compute.interconnects.testIamPermissions" call.
  67184. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  67185. // non-2xx status code is an error. Response headers are in either
  67186. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  67187. // returned at all) in error.(*googleapi.Error).Header. Use
  67188. // googleapi.IsNotModified to check whether the returned error was
  67189. // because http.StatusNotModified was returned.
  67190. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  67191. gensupport.SetOptions(c.urlParams_, opts...)
  67192. res, err := c.doRequest("json")
  67193. if res != nil && res.StatusCode == http.StatusNotModified {
  67194. if res.Body != nil {
  67195. res.Body.Close()
  67196. }
  67197. return nil, &googleapi.Error{
  67198. Code: res.StatusCode,
  67199. Header: res.Header,
  67200. }
  67201. }
  67202. if err != nil {
  67203. return nil, err
  67204. }
  67205. defer googleapi.CloseBody(res)
  67206. if err := googleapi.CheckResponse(res); err != nil {
  67207. return nil, err
  67208. }
  67209. ret := &TestPermissionsResponse{
  67210. ServerResponse: googleapi.ServerResponse{
  67211. Header: res.Header,
  67212. HTTPStatusCode: res.StatusCode,
  67213. },
  67214. }
  67215. target := &ret
  67216. if err := gensupport.DecodeResponse(target, res); err != nil {
  67217. return nil, err
  67218. }
  67219. return ret, nil
  67220. // {
  67221. // "description": "Returns permissions that a caller has on the specified resource.",
  67222. // "httpMethod": "POST",
  67223. // "id": "compute.interconnects.testIamPermissions",
  67224. // "parameterOrder": [
  67225. // "project",
  67226. // "resource"
  67227. // ],
  67228. // "parameters": {
  67229. // "project": {
  67230. // "description": "Project ID for this request.",
  67231. // "location": "path",
  67232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67233. // "required": true,
  67234. // "type": "string"
  67235. // },
  67236. // "resource": {
  67237. // "description": "Name or id of the resource for this request.",
  67238. // "location": "path",
  67239. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67240. // "required": true,
  67241. // "type": "string"
  67242. // }
  67243. // },
  67244. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  67245. // "request": {
  67246. // "$ref": "TestPermissionsRequest"
  67247. // },
  67248. // "response": {
  67249. // "$ref": "TestPermissionsResponse"
  67250. // },
  67251. // "scopes": [
  67252. // "https://www.googleapis.com/auth/cloud-platform",
  67253. // "https://www.googleapis.com/auth/compute",
  67254. // "https://www.googleapis.com/auth/compute.readonly"
  67255. // ]
  67256. // }
  67257. }
  67258. // method id "compute.licenseCodes.get":
  67259. type LicenseCodesGetCall struct {
  67260. s *Service
  67261. project string
  67262. licenseCode string
  67263. urlParams_ gensupport.URLParams
  67264. ifNoneMatch_ string
  67265. ctx_ context.Context
  67266. header_ http.Header
  67267. }
  67268. // Get: Return a specified license code. License codes are mirrored
  67269. // across all projects that have permissions to read the License Code.
  67270. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  67271. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67272. c.project = project
  67273. c.licenseCode = licenseCode
  67274. return c
  67275. }
  67276. // Fields allows partial responses to be retrieved. See
  67277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67278. // for more information.
  67279. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  67280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67281. return c
  67282. }
  67283. // IfNoneMatch sets the optional parameter which makes the operation
  67284. // fail if the object's ETag matches the given value. This is useful for
  67285. // getting updates only after the object has changed since the last
  67286. // request. Use googleapi.IsNotModified to check whether the response
  67287. // error from Do is the result of In-None-Match.
  67288. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  67289. c.ifNoneMatch_ = entityTag
  67290. return c
  67291. }
  67292. // Context sets the context to be used in this call's Do method. Any
  67293. // pending HTTP request will be aborted if the provided context is
  67294. // canceled.
  67295. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  67296. c.ctx_ = ctx
  67297. return c
  67298. }
  67299. // Header returns an http.Header that can be modified by the caller to
  67300. // add HTTP headers to the request.
  67301. func (c *LicenseCodesGetCall) Header() http.Header {
  67302. if c.header_ == nil {
  67303. c.header_ = make(http.Header)
  67304. }
  67305. return c.header_
  67306. }
  67307. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  67308. reqHeaders := make(http.Header)
  67309. for k, v := range c.header_ {
  67310. reqHeaders[k] = v
  67311. }
  67312. reqHeaders.Set("User-Agent", c.s.userAgent())
  67313. if c.ifNoneMatch_ != "" {
  67314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67315. }
  67316. var body io.Reader = nil
  67317. c.urlParams_.Set("alt", alt)
  67318. c.urlParams_.Set("prettyPrint", "false")
  67319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  67320. urls += "?" + c.urlParams_.Encode()
  67321. req, err := http.NewRequest("GET", urls, body)
  67322. if err != nil {
  67323. return nil, err
  67324. }
  67325. req.Header = reqHeaders
  67326. googleapi.Expand(req.URL, map[string]string{
  67327. "project": c.project,
  67328. "licenseCode": c.licenseCode,
  67329. })
  67330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67331. }
  67332. // Do executes the "compute.licenseCodes.get" call.
  67333. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  67334. // status code is an error. Response headers are in either
  67335. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  67336. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67337. // to check whether the returned error was because
  67338. // http.StatusNotModified was returned.
  67339. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  67340. gensupport.SetOptions(c.urlParams_, opts...)
  67341. res, err := c.doRequest("json")
  67342. if res != nil && res.StatusCode == http.StatusNotModified {
  67343. if res.Body != nil {
  67344. res.Body.Close()
  67345. }
  67346. return nil, &googleapi.Error{
  67347. Code: res.StatusCode,
  67348. Header: res.Header,
  67349. }
  67350. }
  67351. if err != nil {
  67352. return nil, err
  67353. }
  67354. defer googleapi.CloseBody(res)
  67355. if err := googleapi.CheckResponse(res); err != nil {
  67356. return nil, err
  67357. }
  67358. ret := &LicenseCode{
  67359. ServerResponse: googleapi.ServerResponse{
  67360. Header: res.Header,
  67361. HTTPStatusCode: res.StatusCode,
  67362. },
  67363. }
  67364. target := &ret
  67365. if err := gensupport.DecodeResponse(target, res); err != nil {
  67366. return nil, err
  67367. }
  67368. return ret, nil
  67369. // {
  67370. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  67371. // "httpMethod": "GET",
  67372. // "id": "compute.licenseCodes.get",
  67373. // "parameterOrder": [
  67374. // "project",
  67375. // "licenseCode"
  67376. // ],
  67377. // "parameters": {
  67378. // "licenseCode": {
  67379. // "description": "Number corresponding to the License code resource to return.",
  67380. // "location": "path",
  67381. // "pattern": "[0-9]{0,61}?",
  67382. // "required": true,
  67383. // "type": "string"
  67384. // },
  67385. // "project": {
  67386. // "description": "Project ID for this request.",
  67387. // "location": "path",
  67388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67389. // "required": true,
  67390. // "type": "string"
  67391. // }
  67392. // },
  67393. // "path": "{project}/global/licenseCodes/{licenseCode}",
  67394. // "response": {
  67395. // "$ref": "LicenseCode"
  67396. // },
  67397. // "scopes": [
  67398. // "https://www.googleapis.com/auth/cloud-platform",
  67399. // "https://www.googleapis.com/auth/compute",
  67400. // "https://www.googleapis.com/auth/compute.readonly"
  67401. // ]
  67402. // }
  67403. }
  67404. // method id "compute.licenses.delete":
  67405. type LicensesDeleteCall struct {
  67406. s *Service
  67407. project string
  67408. license string
  67409. urlParams_ gensupport.URLParams
  67410. ctx_ context.Context
  67411. header_ http.Header
  67412. }
  67413. // Delete: Deletes the specified license.
  67414. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  67415. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67416. c.project = project
  67417. c.license = license
  67418. return c
  67419. }
  67420. // RequestId sets the optional parameter "requestId": An optional
  67421. // request ID to identify requests. Specify a unique request ID so that
  67422. // if you must retry your request, the server will know to ignore the
  67423. // request if it has already been completed.
  67424. //
  67425. // For example, consider a situation where you make an initial request
  67426. // and the request times out. If you make the request again with the
  67427. // same request ID, the server can check if original operation with the
  67428. // same request ID was received, and if so, will ignore the second
  67429. // request. This prevents clients from accidentally creating duplicate
  67430. // commitments.
  67431. //
  67432. // The request ID must be a valid UUID with the exception that zero UUID
  67433. // is not supported (00000000-0000-0000-0000-000000000000).
  67434. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  67435. c.urlParams_.Set("requestId", requestId)
  67436. return c
  67437. }
  67438. // Fields allows partial responses to be retrieved. See
  67439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67440. // for more information.
  67441. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  67442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67443. return c
  67444. }
  67445. // Context sets the context to be used in this call's Do method. Any
  67446. // pending HTTP request will be aborted if the provided context is
  67447. // canceled.
  67448. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  67449. c.ctx_ = ctx
  67450. return c
  67451. }
  67452. // Header returns an http.Header that can be modified by the caller to
  67453. // add HTTP headers to the request.
  67454. func (c *LicensesDeleteCall) Header() http.Header {
  67455. if c.header_ == nil {
  67456. c.header_ = make(http.Header)
  67457. }
  67458. return c.header_
  67459. }
  67460. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  67461. reqHeaders := make(http.Header)
  67462. for k, v := range c.header_ {
  67463. reqHeaders[k] = v
  67464. }
  67465. reqHeaders.Set("User-Agent", c.s.userAgent())
  67466. var body io.Reader = nil
  67467. c.urlParams_.Set("alt", alt)
  67468. c.urlParams_.Set("prettyPrint", "false")
  67469. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  67470. urls += "?" + c.urlParams_.Encode()
  67471. req, err := http.NewRequest("DELETE", urls, body)
  67472. if err != nil {
  67473. return nil, err
  67474. }
  67475. req.Header = reqHeaders
  67476. googleapi.Expand(req.URL, map[string]string{
  67477. "project": c.project,
  67478. "license": c.license,
  67479. })
  67480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67481. }
  67482. // Do executes the "compute.licenses.delete" call.
  67483. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67484. // status code is an error. Response headers are in either
  67485. // *Operation.ServerResponse.Header or (if a response was returned at
  67486. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67487. // to check whether the returned error was because
  67488. // http.StatusNotModified was returned.
  67489. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67490. gensupport.SetOptions(c.urlParams_, opts...)
  67491. res, err := c.doRequest("json")
  67492. if res != nil && res.StatusCode == http.StatusNotModified {
  67493. if res.Body != nil {
  67494. res.Body.Close()
  67495. }
  67496. return nil, &googleapi.Error{
  67497. Code: res.StatusCode,
  67498. Header: res.Header,
  67499. }
  67500. }
  67501. if err != nil {
  67502. return nil, err
  67503. }
  67504. defer googleapi.CloseBody(res)
  67505. if err := googleapi.CheckResponse(res); err != nil {
  67506. return nil, err
  67507. }
  67508. ret := &Operation{
  67509. ServerResponse: googleapi.ServerResponse{
  67510. Header: res.Header,
  67511. HTTPStatusCode: res.StatusCode,
  67512. },
  67513. }
  67514. target := &ret
  67515. if err := gensupport.DecodeResponse(target, res); err != nil {
  67516. return nil, err
  67517. }
  67518. return ret, nil
  67519. // {
  67520. // "description": "Deletes the specified license.",
  67521. // "httpMethod": "DELETE",
  67522. // "id": "compute.licenses.delete",
  67523. // "parameterOrder": [
  67524. // "project",
  67525. // "license"
  67526. // ],
  67527. // "parameters": {
  67528. // "license": {
  67529. // "description": "Name of the license resource to delete.",
  67530. // "location": "path",
  67531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67532. // "required": true,
  67533. // "type": "string"
  67534. // },
  67535. // "project": {
  67536. // "description": "Project ID for this request.",
  67537. // "location": "path",
  67538. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67539. // "required": true,
  67540. // "type": "string"
  67541. // },
  67542. // "requestId": {
  67543. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67544. // "location": "query",
  67545. // "type": "string"
  67546. // }
  67547. // },
  67548. // "path": "{project}/global/licenses/{license}",
  67549. // "response": {
  67550. // "$ref": "Operation"
  67551. // },
  67552. // "scopes": [
  67553. // "https://www.googleapis.com/auth/cloud-platform",
  67554. // "https://www.googleapis.com/auth/compute"
  67555. // ]
  67556. // }
  67557. }
  67558. // method id "compute.licenses.get":
  67559. type LicensesGetCall struct {
  67560. s *Service
  67561. project string
  67562. license string
  67563. urlParams_ gensupport.URLParams
  67564. ifNoneMatch_ string
  67565. ctx_ context.Context
  67566. header_ http.Header
  67567. }
  67568. // Get: Returns the specified License resource.
  67569. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  67570. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  67571. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67572. c.project = project
  67573. c.license = license
  67574. return c
  67575. }
  67576. // Fields allows partial responses to be retrieved. See
  67577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67578. // for more information.
  67579. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  67580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67581. return c
  67582. }
  67583. // IfNoneMatch sets the optional parameter which makes the operation
  67584. // fail if the object's ETag matches the given value. This is useful for
  67585. // getting updates only after the object has changed since the last
  67586. // request. Use googleapi.IsNotModified to check whether the response
  67587. // error from Do is the result of In-None-Match.
  67588. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  67589. c.ifNoneMatch_ = entityTag
  67590. return c
  67591. }
  67592. // Context sets the context to be used in this call's Do method. Any
  67593. // pending HTTP request will be aborted if the provided context is
  67594. // canceled.
  67595. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  67596. c.ctx_ = ctx
  67597. return c
  67598. }
  67599. // Header returns an http.Header that can be modified by the caller to
  67600. // add HTTP headers to the request.
  67601. func (c *LicensesGetCall) Header() http.Header {
  67602. if c.header_ == nil {
  67603. c.header_ = make(http.Header)
  67604. }
  67605. return c.header_
  67606. }
  67607. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  67608. reqHeaders := make(http.Header)
  67609. for k, v := range c.header_ {
  67610. reqHeaders[k] = v
  67611. }
  67612. reqHeaders.Set("User-Agent", c.s.userAgent())
  67613. if c.ifNoneMatch_ != "" {
  67614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67615. }
  67616. var body io.Reader = nil
  67617. c.urlParams_.Set("alt", alt)
  67618. c.urlParams_.Set("prettyPrint", "false")
  67619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  67620. urls += "?" + c.urlParams_.Encode()
  67621. req, err := http.NewRequest("GET", urls, body)
  67622. if err != nil {
  67623. return nil, err
  67624. }
  67625. req.Header = reqHeaders
  67626. googleapi.Expand(req.URL, map[string]string{
  67627. "project": c.project,
  67628. "license": c.license,
  67629. })
  67630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67631. }
  67632. // Do executes the "compute.licenses.get" call.
  67633. // Exactly one of *License or error will be non-nil. Any non-2xx status
  67634. // code is an error. Response headers are in either
  67635. // *License.ServerResponse.Header or (if a response was returned at all)
  67636. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  67637. // check whether the returned error was because http.StatusNotModified
  67638. // was returned.
  67639. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  67640. gensupport.SetOptions(c.urlParams_, opts...)
  67641. res, err := c.doRequest("json")
  67642. if res != nil && res.StatusCode == http.StatusNotModified {
  67643. if res.Body != nil {
  67644. res.Body.Close()
  67645. }
  67646. return nil, &googleapi.Error{
  67647. Code: res.StatusCode,
  67648. Header: res.Header,
  67649. }
  67650. }
  67651. if err != nil {
  67652. return nil, err
  67653. }
  67654. defer googleapi.CloseBody(res)
  67655. if err := googleapi.CheckResponse(res); err != nil {
  67656. return nil, err
  67657. }
  67658. ret := &License{
  67659. ServerResponse: googleapi.ServerResponse{
  67660. Header: res.Header,
  67661. HTTPStatusCode: res.StatusCode,
  67662. },
  67663. }
  67664. target := &ret
  67665. if err := gensupport.DecodeResponse(target, res); err != nil {
  67666. return nil, err
  67667. }
  67668. return ret, nil
  67669. // {
  67670. // "description": "Returns the specified License resource.",
  67671. // "httpMethod": "GET",
  67672. // "id": "compute.licenses.get",
  67673. // "parameterOrder": [
  67674. // "project",
  67675. // "license"
  67676. // ],
  67677. // "parameters": {
  67678. // "license": {
  67679. // "description": "Name of the License resource to return.",
  67680. // "location": "path",
  67681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67682. // "required": true,
  67683. // "type": "string"
  67684. // },
  67685. // "project": {
  67686. // "description": "Project ID for this request.",
  67687. // "location": "path",
  67688. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67689. // "required": true,
  67690. // "type": "string"
  67691. // }
  67692. // },
  67693. // "path": "{project}/global/licenses/{license}",
  67694. // "response": {
  67695. // "$ref": "License"
  67696. // },
  67697. // "scopes": [
  67698. // "https://www.googleapis.com/auth/cloud-platform",
  67699. // "https://www.googleapis.com/auth/compute",
  67700. // "https://www.googleapis.com/auth/compute.readonly"
  67701. // ]
  67702. // }
  67703. }
  67704. // method id "compute.licenses.insert":
  67705. type LicensesInsertCall struct {
  67706. s *Service
  67707. project string
  67708. license *License
  67709. urlParams_ gensupport.URLParams
  67710. ctx_ context.Context
  67711. header_ http.Header
  67712. }
  67713. // Insert: Create a License resource in the specified project.
  67714. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  67715. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67716. c.project = project
  67717. c.license = license
  67718. return c
  67719. }
  67720. // RequestId sets the optional parameter "requestId": An optional
  67721. // request ID to identify requests. Specify a unique request ID so that
  67722. // if you must retry your request, the server will know to ignore the
  67723. // request if it has already been completed.
  67724. //
  67725. // For example, consider a situation where you make an initial request
  67726. // and the request times out. If you make the request again with the
  67727. // same request ID, the server can check if original operation with the
  67728. // same request ID was received, and if so, will ignore the second
  67729. // request. This prevents clients from accidentally creating duplicate
  67730. // commitments.
  67731. //
  67732. // The request ID must be a valid UUID with the exception that zero UUID
  67733. // is not supported (00000000-0000-0000-0000-000000000000).
  67734. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  67735. c.urlParams_.Set("requestId", requestId)
  67736. return c
  67737. }
  67738. // Fields allows partial responses to be retrieved. See
  67739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67740. // for more information.
  67741. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  67742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67743. return c
  67744. }
  67745. // Context sets the context to be used in this call's Do method. Any
  67746. // pending HTTP request will be aborted if the provided context is
  67747. // canceled.
  67748. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  67749. c.ctx_ = ctx
  67750. return c
  67751. }
  67752. // Header returns an http.Header that can be modified by the caller to
  67753. // add HTTP headers to the request.
  67754. func (c *LicensesInsertCall) Header() http.Header {
  67755. if c.header_ == nil {
  67756. c.header_ = make(http.Header)
  67757. }
  67758. return c.header_
  67759. }
  67760. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  67761. reqHeaders := make(http.Header)
  67762. for k, v := range c.header_ {
  67763. reqHeaders[k] = v
  67764. }
  67765. reqHeaders.Set("User-Agent", c.s.userAgent())
  67766. var body io.Reader = nil
  67767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  67768. if err != nil {
  67769. return nil, err
  67770. }
  67771. reqHeaders.Set("Content-Type", "application/json")
  67772. c.urlParams_.Set("alt", alt)
  67773. c.urlParams_.Set("prettyPrint", "false")
  67774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  67775. urls += "?" + c.urlParams_.Encode()
  67776. req, err := http.NewRequest("POST", urls, body)
  67777. if err != nil {
  67778. return nil, err
  67779. }
  67780. req.Header = reqHeaders
  67781. googleapi.Expand(req.URL, map[string]string{
  67782. "project": c.project,
  67783. })
  67784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67785. }
  67786. // Do executes the "compute.licenses.insert" call.
  67787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67788. // status code is an error. Response headers are in either
  67789. // *Operation.ServerResponse.Header or (if a response was returned at
  67790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67791. // to check whether the returned error was because
  67792. // http.StatusNotModified was returned.
  67793. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67794. gensupport.SetOptions(c.urlParams_, opts...)
  67795. res, err := c.doRequest("json")
  67796. if res != nil && res.StatusCode == http.StatusNotModified {
  67797. if res.Body != nil {
  67798. res.Body.Close()
  67799. }
  67800. return nil, &googleapi.Error{
  67801. Code: res.StatusCode,
  67802. Header: res.Header,
  67803. }
  67804. }
  67805. if err != nil {
  67806. return nil, err
  67807. }
  67808. defer googleapi.CloseBody(res)
  67809. if err := googleapi.CheckResponse(res); err != nil {
  67810. return nil, err
  67811. }
  67812. ret := &Operation{
  67813. ServerResponse: googleapi.ServerResponse{
  67814. Header: res.Header,
  67815. HTTPStatusCode: res.StatusCode,
  67816. },
  67817. }
  67818. target := &ret
  67819. if err := gensupport.DecodeResponse(target, res); err != nil {
  67820. return nil, err
  67821. }
  67822. return ret, nil
  67823. // {
  67824. // "description": "Create a License resource in the specified project.",
  67825. // "httpMethod": "POST",
  67826. // "id": "compute.licenses.insert",
  67827. // "parameterOrder": [
  67828. // "project"
  67829. // ],
  67830. // "parameters": {
  67831. // "project": {
  67832. // "description": "Project ID for this request.",
  67833. // "location": "path",
  67834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67835. // "required": true,
  67836. // "type": "string"
  67837. // },
  67838. // "requestId": {
  67839. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67840. // "location": "query",
  67841. // "type": "string"
  67842. // }
  67843. // },
  67844. // "path": "{project}/global/licenses",
  67845. // "request": {
  67846. // "$ref": "License"
  67847. // },
  67848. // "response": {
  67849. // "$ref": "Operation"
  67850. // },
  67851. // "scopes": [
  67852. // "https://www.googleapis.com/auth/cloud-platform",
  67853. // "https://www.googleapis.com/auth/compute",
  67854. // "https://www.googleapis.com/auth/devstorage.full_control",
  67855. // "https://www.googleapis.com/auth/devstorage.read_only",
  67856. // "https://www.googleapis.com/auth/devstorage.read_write"
  67857. // ]
  67858. // }
  67859. }
  67860. // method id "compute.licenses.list":
  67861. type LicensesListCall struct {
  67862. s *Service
  67863. project string
  67864. urlParams_ gensupport.URLParams
  67865. ifNoneMatch_ string
  67866. ctx_ context.Context
  67867. header_ http.Header
  67868. }
  67869. // List: Retrieves the list of licenses available in the specified
  67870. // project. This method does not get any licenses that belong to other
  67871. // projects, including licenses attached to publicly-available images,
  67872. // like Debian 9. If you want to get a list of publicly-available
  67873. // licenses, use this method to make a request to the respective image
  67874. // project, such as debian-cloud or windows-cloud.
  67875. func (r *LicensesService) List(project string) *LicensesListCall {
  67876. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67877. c.project = project
  67878. return c
  67879. }
  67880. // Filter sets the optional parameter "filter": A filter expression that
  67881. // filters resources listed in the response. The expression must specify
  67882. // the field name, a comparison operator, and the value that you want to
  67883. // use for filtering. The value must be a string, a number, or a
  67884. // boolean. The comparison operator must be either =, !=, >, or <.
  67885. //
  67886. // For example, if you are filtering Compute Engine instances, you can
  67887. // exclude instances named example-instance by specifying name !=
  67888. // example-instance.
  67889. //
  67890. // You can also filter nested fields. For example, you could specify
  67891. // scheduling.automaticRestart = false to include instances only if they
  67892. // are not scheduled for automatic restarts. You can use filtering on
  67893. // nested fields to filter based on resource labels.
  67894. //
  67895. // To filter on multiple expressions, provide each separate expression
  67896. // within parentheses. For example, (scheduling.automaticRestart = true)
  67897. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67898. // AND expression. However, you can include AND and OR expressions
  67899. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67900. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67901. // true).
  67902. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  67903. c.urlParams_.Set("filter", filter)
  67904. return c
  67905. }
  67906. // MaxResults sets the optional parameter "maxResults": The maximum
  67907. // number of results per page that should be returned. If the number of
  67908. // available results is larger than maxResults, Compute Engine returns a
  67909. // nextPageToken that can be used to get the next page of results in
  67910. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67911. // (Default: 500)
  67912. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  67913. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67914. return c
  67915. }
  67916. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67917. // a certain order. By default, results are returned in alphanumerical
  67918. // order based on the resource name.
  67919. //
  67920. // You can also sort results in descending order based on the creation
  67921. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67922. // based on the creationTimestamp field in reverse chronological order
  67923. // (newest result first). Use this to sort resources like operations so
  67924. // that the newest operation is returned first.
  67925. //
  67926. // Currently, only sorting by name or creationTimestamp desc is
  67927. // supported.
  67928. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  67929. c.urlParams_.Set("orderBy", orderBy)
  67930. return c
  67931. }
  67932. // PageToken sets the optional parameter "pageToken": Specifies a page
  67933. // token to use. Set pageToken to the nextPageToken returned by a
  67934. // previous list request to get the next page of results.
  67935. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  67936. c.urlParams_.Set("pageToken", pageToken)
  67937. return c
  67938. }
  67939. // Fields allows partial responses to be retrieved. See
  67940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67941. // for more information.
  67942. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  67943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67944. return c
  67945. }
  67946. // IfNoneMatch sets the optional parameter which makes the operation
  67947. // fail if the object's ETag matches the given value. This is useful for
  67948. // getting updates only after the object has changed since the last
  67949. // request. Use googleapi.IsNotModified to check whether the response
  67950. // error from Do is the result of In-None-Match.
  67951. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  67952. c.ifNoneMatch_ = entityTag
  67953. return c
  67954. }
  67955. // Context sets the context to be used in this call's Do method. Any
  67956. // pending HTTP request will be aborted if the provided context is
  67957. // canceled.
  67958. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  67959. c.ctx_ = ctx
  67960. return c
  67961. }
  67962. // Header returns an http.Header that can be modified by the caller to
  67963. // add HTTP headers to the request.
  67964. func (c *LicensesListCall) Header() http.Header {
  67965. if c.header_ == nil {
  67966. c.header_ = make(http.Header)
  67967. }
  67968. return c.header_
  67969. }
  67970. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  67971. reqHeaders := make(http.Header)
  67972. for k, v := range c.header_ {
  67973. reqHeaders[k] = v
  67974. }
  67975. reqHeaders.Set("User-Agent", c.s.userAgent())
  67976. if c.ifNoneMatch_ != "" {
  67977. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67978. }
  67979. var body io.Reader = nil
  67980. c.urlParams_.Set("alt", alt)
  67981. c.urlParams_.Set("prettyPrint", "false")
  67982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  67983. urls += "?" + c.urlParams_.Encode()
  67984. req, err := http.NewRequest("GET", urls, body)
  67985. if err != nil {
  67986. return nil, err
  67987. }
  67988. req.Header = reqHeaders
  67989. googleapi.Expand(req.URL, map[string]string{
  67990. "project": c.project,
  67991. })
  67992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67993. }
  67994. // Do executes the "compute.licenses.list" call.
  67995. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  67996. // non-2xx status code is an error. Response headers are in either
  67997. // *LicensesListResponse.ServerResponse.Header or (if a response was
  67998. // returned at all) in error.(*googleapi.Error).Header. Use
  67999. // googleapi.IsNotModified to check whether the returned error was
  68000. // because http.StatusNotModified was returned.
  68001. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  68002. gensupport.SetOptions(c.urlParams_, opts...)
  68003. res, err := c.doRequest("json")
  68004. if res != nil && res.StatusCode == http.StatusNotModified {
  68005. if res.Body != nil {
  68006. res.Body.Close()
  68007. }
  68008. return nil, &googleapi.Error{
  68009. Code: res.StatusCode,
  68010. Header: res.Header,
  68011. }
  68012. }
  68013. if err != nil {
  68014. return nil, err
  68015. }
  68016. defer googleapi.CloseBody(res)
  68017. if err := googleapi.CheckResponse(res); err != nil {
  68018. return nil, err
  68019. }
  68020. ret := &LicensesListResponse{
  68021. ServerResponse: googleapi.ServerResponse{
  68022. Header: res.Header,
  68023. HTTPStatusCode: res.StatusCode,
  68024. },
  68025. }
  68026. target := &ret
  68027. if err := gensupport.DecodeResponse(target, res); err != nil {
  68028. return nil, err
  68029. }
  68030. return ret, nil
  68031. // {
  68032. // "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.",
  68033. // "httpMethod": "GET",
  68034. // "id": "compute.licenses.list",
  68035. // "parameterOrder": [
  68036. // "project"
  68037. // ],
  68038. // "parameters": {
  68039. // "filter": {
  68040. // "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).",
  68041. // "location": "query",
  68042. // "type": "string"
  68043. // },
  68044. // "maxResults": {
  68045. // "default": "500",
  68046. // "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)",
  68047. // "format": "uint32",
  68048. // "location": "query",
  68049. // "minimum": "0",
  68050. // "type": "integer"
  68051. // },
  68052. // "orderBy": {
  68053. // "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.",
  68054. // "location": "query",
  68055. // "type": "string"
  68056. // },
  68057. // "pageToken": {
  68058. // "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.",
  68059. // "location": "query",
  68060. // "type": "string"
  68061. // },
  68062. // "project": {
  68063. // "description": "Project ID for this request.",
  68064. // "location": "path",
  68065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68066. // "required": true,
  68067. // "type": "string"
  68068. // }
  68069. // },
  68070. // "path": "{project}/global/licenses",
  68071. // "response": {
  68072. // "$ref": "LicensesListResponse"
  68073. // },
  68074. // "scopes": [
  68075. // "https://www.googleapis.com/auth/cloud-platform",
  68076. // "https://www.googleapis.com/auth/compute",
  68077. // "https://www.googleapis.com/auth/compute.readonly"
  68078. // ]
  68079. // }
  68080. }
  68081. // Pages invokes f for each page of results.
  68082. // A non-nil error returned from f will halt the iteration.
  68083. // The provided context supersedes any context provided to the Context method.
  68084. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  68085. c.ctx_ = ctx
  68086. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68087. for {
  68088. x, err := c.Do()
  68089. if err != nil {
  68090. return err
  68091. }
  68092. if err := f(x); err != nil {
  68093. return err
  68094. }
  68095. if x.NextPageToken == "" {
  68096. return nil
  68097. }
  68098. c.PageToken(x.NextPageToken)
  68099. }
  68100. }
  68101. // method id "compute.licenses.setIamPolicy":
  68102. type LicensesSetIamPolicyCall struct {
  68103. s *Service
  68104. project string
  68105. resource string
  68106. globalsetpolicyrequest *GlobalSetPolicyRequest
  68107. urlParams_ gensupport.URLParams
  68108. ctx_ context.Context
  68109. header_ http.Header
  68110. }
  68111. // SetIamPolicy: Sets the access control policy on the specified
  68112. // resource. Replaces any existing policy.
  68113. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  68114. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68115. c.project = project
  68116. c.resource = resource
  68117. c.globalsetpolicyrequest = globalsetpolicyrequest
  68118. return c
  68119. }
  68120. // Fields allows partial responses to be retrieved. See
  68121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68122. // for more information.
  68123. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  68124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68125. return c
  68126. }
  68127. // Context sets the context to be used in this call's Do method. Any
  68128. // pending HTTP request will be aborted if the provided context is
  68129. // canceled.
  68130. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  68131. c.ctx_ = ctx
  68132. return c
  68133. }
  68134. // Header returns an http.Header that can be modified by the caller to
  68135. // add HTTP headers to the request.
  68136. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  68137. if c.header_ == nil {
  68138. c.header_ = make(http.Header)
  68139. }
  68140. return c.header_
  68141. }
  68142. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  68143. reqHeaders := make(http.Header)
  68144. for k, v := range c.header_ {
  68145. reqHeaders[k] = v
  68146. }
  68147. reqHeaders.Set("User-Agent", c.s.userAgent())
  68148. var body io.Reader = nil
  68149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  68150. if err != nil {
  68151. return nil, err
  68152. }
  68153. reqHeaders.Set("Content-Type", "application/json")
  68154. c.urlParams_.Set("alt", alt)
  68155. c.urlParams_.Set("prettyPrint", "false")
  68156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  68157. urls += "?" + c.urlParams_.Encode()
  68158. req, err := http.NewRequest("POST", urls, body)
  68159. if err != nil {
  68160. return nil, err
  68161. }
  68162. req.Header = reqHeaders
  68163. googleapi.Expand(req.URL, map[string]string{
  68164. "project": c.project,
  68165. "resource": c.resource,
  68166. })
  68167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68168. }
  68169. // Do executes the "compute.licenses.setIamPolicy" call.
  68170. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  68171. // code is an error. Response headers are in either
  68172. // *Policy.ServerResponse.Header or (if a response was returned at all)
  68173. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68174. // check whether the returned error was because http.StatusNotModified
  68175. // was returned.
  68176. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  68177. gensupport.SetOptions(c.urlParams_, opts...)
  68178. res, err := c.doRequest("json")
  68179. if res != nil && res.StatusCode == http.StatusNotModified {
  68180. if res.Body != nil {
  68181. res.Body.Close()
  68182. }
  68183. return nil, &googleapi.Error{
  68184. Code: res.StatusCode,
  68185. Header: res.Header,
  68186. }
  68187. }
  68188. if err != nil {
  68189. return nil, err
  68190. }
  68191. defer googleapi.CloseBody(res)
  68192. if err := googleapi.CheckResponse(res); err != nil {
  68193. return nil, err
  68194. }
  68195. ret := &Policy{
  68196. ServerResponse: googleapi.ServerResponse{
  68197. Header: res.Header,
  68198. HTTPStatusCode: res.StatusCode,
  68199. },
  68200. }
  68201. target := &ret
  68202. if err := gensupport.DecodeResponse(target, res); err != nil {
  68203. return nil, err
  68204. }
  68205. return ret, nil
  68206. // {
  68207. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  68208. // "httpMethod": "POST",
  68209. // "id": "compute.licenses.setIamPolicy",
  68210. // "parameterOrder": [
  68211. // "project",
  68212. // "resource"
  68213. // ],
  68214. // "parameters": {
  68215. // "project": {
  68216. // "description": "Project ID for this request.",
  68217. // "location": "path",
  68218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68219. // "required": true,
  68220. // "type": "string"
  68221. // },
  68222. // "resource": {
  68223. // "description": "Name or id of the resource for this request.",
  68224. // "location": "path",
  68225. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68226. // "required": true,
  68227. // "type": "string"
  68228. // }
  68229. // },
  68230. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  68231. // "request": {
  68232. // "$ref": "GlobalSetPolicyRequest"
  68233. // },
  68234. // "response": {
  68235. // "$ref": "Policy"
  68236. // },
  68237. // "scopes": [
  68238. // "https://www.googleapis.com/auth/cloud-platform",
  68239. // "https://www.googleapis.com/auth/compute"
  68240. // ]
  68241. // }
  68242. }
  68243. // method id "compute.machineTypes.aggregatedList":
  68244. type MachineTypesAggregatedListCall struct {
  68245. s *Service
  68246. project string
  68247. urlParams_ gensupport.URLParams
  68248. ifNoneMatch_ string
  68249. ctx_ context.Context
  68250. header_ http.Header
  68251. }
  68252. // AggregatedList: Retrieves an aggregated list of machine types.
  68253. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  68254. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  68255. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68256. c.project = project
  68257. return c
  68258. }
  68259. // Filter sets the optional parameter "filter": A filter expression that
  68260. // filters resources listed in the response. The expression must specify
  68261. // the field name, a comparison operator, and the value that you want to
  68262. // use for filtering. The value must be a string, a number, or a
  68263. // boolean. The comparison operator must be either =, !=, >, or <.
  68264. //
  68265. // For example, if you are filtering Compute Engine instances, you can
  68266. // exclude instances named example-instance by specifying name !=
  68267. // example-instance.
  68268. //
  68269. // You can also filter nested fields. For example, you could specify
  68270. // scheduling.automaticRestart = false to include instances only if they
  68271. // are not scheduled for automatic restarts. You can use filtering on
  68272. // nested fields to filter based on resource labels.
  68273. //
  68274. // To filter on multiple expressions, provide each separate expression
  68275. // within parentheses. For example, (scheduling.automaticRestart = true)
  68276. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68277. // AND expression. However, you can include AND and OR expressions
  68278. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68279. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68280. // true).
  68281. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  68282. c.urlParams_.Set("filter", filter)
  68283. return c
  68284. }
  68285. // MaxResults sets the optional parameter "maxResults": The maximum
  68286. // number of results per page that should be returned. If the number of
  68287. // available results is larger than maxResults, Compute Engine returns a
  68288. // nextPageToken that can be used to get the next page of results in
  68289. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68290. // (Default: 500)
  68291. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  68292. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68293. return c
  68294. }
  68295. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68296. // a certain order. By default, results are returned in alphanumerical
  68297. // order based on the resource name.
  68298. //
  68299. // You can also sort results in descending order based on the creation
  68300. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68301. // based on the creationTimestamp field in reverse chronological order
  68302. // (newest result first). Use this to sort resources like operations so
  68303. // that the newest operation is returned first.
  68304. //
  68305. // Currently, only sorting by name or creationTimestamp desc is
  68306. // supported.
  68307. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  68308. c.urlParams_.Set("orderBy", orderBy)
  68309. return c
  68310. }
  68311. // PageToken sets the optional parameter "pageToken": Specifies a page
  68312. // token to use. Set pageToken to the nextPageToken returned by a
  68313. // previous list request to get the next page of results.
  68314. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  68315. c.urlParams_.Set("pageToken", pageToken)
  68316. return c
  68317. }
  68318. // Fields allows partial responses to be retrieved. See
  68319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68320. // for more information.
  68321. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  68322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68323. return c
  68324. }
  68325. // IfNoneMatch sets the optional parameter which makes the operation
  68326. // fail if the object's ETag matches the given value. This is useful for
  68327. // getting updates only after the object has changed since the last
  68328. // request. Use googleapi.IsNotModified to check whether the response
  68329. // error from Do is the result of In-None-Match.
  68330. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  68331. c.ifNoneMatch_ = entityTag
  68332. return c
  68333. }
  68334. // Context sets the context to be used in this call's Do method. Any
  68335. // pending HTTP request will be aborted if the provided context is
  68336. // canceled.
  68337. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  68338. c.ctx_ = ctx
  68339. return c
  68340. }
  68341. // Header returns an http.Header that can be modified by the caller to
  68342. // add HTTP headers to the request.
  68343. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  68344. if c.header_ == nil {
  68345. c.header_ = make(http.Header)
  68346. }
  68347. return c.header_
  68348. }
  68349. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  68350. reqHeaders := make(http.Header)
  68351. for k, v := range c.header_ {
  68352. reqHeaders[k] = v
  68353. }
  68354. reqHeaders.Set("User-Agent", c.s.userAgent())
  68355. if c.ifNoneMatch_ != "" {
  68356. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68357. }
  68358. var body io.Reader = nil
  68359. c.urlParams_.Set("alt", alt)
  68360. c.urlParams_.Set("prettyPrint", "false")
  68361. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  68362. urls += "?" + c.urlParams_.Encode()
  68363. req, err := http.NewRequest("GET", urls, body)
  68364. if err != nil {
  68365. return nil, err
  68366. }
  68367. req.Header = reqHeaders
  68368. googleapi.Expand(req.URL, map[string]string{
  68369. "project": c.project,
  68370. })
  68371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68372. }
  68373. // Do executes the "compute.machineTypes.aggregatedList" call.
  68374. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  68375. // Any non-2xx status code is an error. Response headers are in either
  68376. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  68377. // was returned at all) in error.(*googleapi.Error).Header. Use
  68378. // googleapi.IsNotModified to check whether the returned error was
  68379. // because http.StatusNotModified was returned.
  68380. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  68381. gensupport.SetOptions(c.urlParams_, opts...)
  68382. res, err := c.doRequest("json")
  68383. if res != nil && res.StatusCode == http.StatusNotModified {
  68384. if res.Body != nil {
  68385. res.Body.Close()
  68386. }
  68387. return nil, &googleapi.Error{
  68388. Code: res.StatusCode,
  68389. Header: res.Header,
  68390. }
  68391. }
  68392. if err != nil {
  68393. return nil, err
  68394. }
  68395. defer googleapi.CloseBody(res)
  68396. if err := googleapi.CheckResponse(res); err != nil {
  68397. return nil, err
  68398. }
  68399. ret := &MachineTypeAggregatedList{
  68400. ServerResponse: googleapi.ServerResponse{
  68401. Header: res.Header,
  68402. HTTPStatusCode: res.StatusCode,
  68403. },
  68404. }
  68405. target := &ret
  68406. if err := gensupport.DecodeResponse(target, res); err != nil {
  68407. return nil, err
  68408. }
  68409. return ret, nil
  68410. // {
  68411. // "description": "Retrieves an aggregated list of machine types.",
  68412. // "httpMethod": "GET",
  68413. // "id": "compute.machineTypes.aggregatedList",
  68414. // "parameterOrder": [
  68415. // "project"
  68416. // ],
  68417. // "parameters": {
  68418. // "filter": {
  68419. // "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).",
  68420. // "location": "query",
  68421. // "type": "string"
  68422. // },
  68423. // "maxResults": {
  68424. // "default": "500",
  68425. // "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)",
  68426. // "format": "uint32",
  68427. // "location": "query",
  68428. // "minimum": "0",
  68429. // "type": "integer"
  68430. // },
  68431. // "orderBy": {
  68432. // "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.",
  68433. // "location": "query",
  68434. // "type": "string"
  68435. // },
  68436. // "pageToken": {
  68437. // "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.",
  68438. // "location": "query",
  68439. // "type": "string"
  68440. // },
  68441. // "project": {
  68442. // "description": "Project ID for this request.",
  68443. // "location": "path",
  68444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68445. // "required": true,
  68446. // "type": "string"
  68447. // }
  68448. // },
  68449. // "path": "{project}/aggregated/machineTypes",
  68450. // "response": {
  68451. // "$ref": "MachineTypeAggregatedList"
  68452. // },
  68453. // "scopes": [
  68454. // "https://www.googleapis.com/auth/cloud-platform",
  68455. // "https://www.googleapis.com/auth/compute",
  68456. // "https://www.googleapis.com/auth/compute.readonly"
  68457. // ]
  68458. // }
  68459. }
  68460. // Pages invokes f for each page of results.
  68461. // A non-nil error returned from f will halt the iteration.
  68462. // The provided context supersedes any context provided to the Context method.
  68463. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  68464. c.ctx_ = ctx
  68465. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68466. for {
  68467. x, err := c.Do()
  68468. if err != nil {
  68469. return err
  68470. }
  68471. if err := f(x); err != nil {
  68472. return err
  68473. }
  68474. if x.NextPageToken == "" {
  68475. return nil
  68476. }
  68477. c.PageToken(x.NextPageToken)
  68478. }
  68479. }
  68480. // method id "compute.machineTypes.get":
  68481. type MachineTypesGetCall struct {
  68482. s *Service
  68483. project string
  68484. zone string
  68485. machineType string
  68486. urlParams_ gensupport.URLParams
  68487. ifNoneMatch_ string
  68488. ctx_ context.Context
  68489. header_ http.Header
  68490. }
  68491. // Get: Returns the specified machine type. Gets a list of available
  68492. // machine types by making a list() request.
  68493. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  68494. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  68495. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68496. c.project = project
  68497. c.zone = zone
  68498. c.machineType = machineType
  68499. return c
  68500. }
  68501. // Fields allows partial responses to be retrieved. See
  68502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68503. // for more information.
  68504. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  68505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68506. return c
  68507. }
  68508. // IfNoneMatch sets the optional parameter which makes the operation
  68509. // fail if the object's ETag matches the given value. This is useful for
  68510. // getting updates only after the object has changed since the last
  68511. // request. Use googleapi.IsNotModified to check whether the response
  68512. // error from Do is the result of In-None-Match.
  68513. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  68514. c.ifNoneMatch_ = entityTag
  68515. return c
  68516. }
  68517. // Context sets the context to be used in this call's Do method. Any
  68518. // pending HTTP request will be aborted if the provided context is
  68519. // canceled.
  68520. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  68521. c.ctx_ = ctx
  68522. return c
  68523. }
  68524. // Header returns an http.Header that can be modified by the caller to
  68525. // add HTTP headers to the request.
  68526. func (c *MachineTypesGetCall) Header() http.Header {
  68527. if c.header_ == nil {
  68528. c.header_ = make(http.Header)
  68529. }
  68530. return c.header_
  68531. }
  68532. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  68533. reqHeaders := make(http.Header)
  68534. for k, v := range c.header_ {
  68535. reqHeaders[k] = v
  68536. }
  68537. reqHeaders.Set("User-Agent", c.s.userAgent())
  68538. if c.ifNoneMatch_ != "" {
  68539. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68540. }
  68541. var body io.Reader = nil
  68542. c.urlParams_.Set("alt", alt)
  68543. c.urlParams_.Set("prettyPrint", "false")
  68544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  68545. urls += "?" + c.urlParams_.Encode()
  68546. req, err := http.NewRequest("GET", urls, body)
  68547. if err != nil {
  68548. return nil, err
  68549. }
  68550. req.Header = reqHeaders
  68551. googleapi.Expand(req.URL, map[string]string{
  68552. "project": c.project,
  68553. "zone": c.zone,
  68554. "machineType": c.machineType,
  68555. })
  68556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68557. }
  68558. // Do executes the "compute.machineTypes.get" call.
  68559. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  68560. // status code is an error. Response headers are in either
  68561. // *MachineType.ServerResponse.Header or (if a response was returned at
  68562. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68563. // to check whether the returned error was because
  68564. // http.StatusNotModified was returned.
  68565. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  68566. gensupport.SetOptions(c.urlParams_, opts...)
  68567. res, err := c.doRequest("json")
  68568. if res != nil && res.StatusCode == http.StatusNotModified {
  68569. if res.Body != nil {
  68570. res.Body.Close()
  68571. }
  68572. return nil, &googleapi.Error{
  68573. Code: res.StatusCode,
  68574. Header: res.Header,
  68575. }
  68576. }
  68577. if err != nil {
  68578. return nil, err
  68579. }
  68580. defer googleapi.CloseBody(res)
  68581. if err := googleapi.CheckResponse(res); err != nil {
  68582. return nil, err
  68583. }
  68584. ret := &MachineType{
  68585. ServerResponse: googleapi.ServerResponse{
  68586. Header: res.Header,
  68587. HTTPStatusCode: res.StatusCode,
  68588. },
  68589. }
  68590. target := &ret
  68591. if err := gensupport.DecodeResponse(target, res); err != nil {
  68592. return nil, err
  68593. }
  68594. return ret, nil
  68595. // {
  68596. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  68597. // "httpMethod": "GET",
  68598. // "id": "compute.machineTypes.get",
  68599. // "parameterOrder": [
  68600. // "project",
  68601. // "zone",
  68602. // "machineType"
  68603. // ],
  68604. // "parameters": {
  68605. // "machineType": {
  68606. // "description": "Name of the machine type to return.",
  68607. // "location": "path",
  68608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68609. // "required": true,
  68610. // "type": "string"
  68611. // },
  68612. // "project": {
  68613. // "description": "Project ID for this request.",
  68614. // "location": "path",
  68615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68616. // "required": true,
  68617. // "type": "string"
  68618. // },
  68619. // "zone": {
  68620. // "description": "The name of the zone for this request.",
  68621. // "location": "path",
  68622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68623. // "required": true,
  68624. // "type": "string"
  68625. // }
  68626. // },
  68627. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  68628. // "response": {
  68629. // "$ref": "MachineType"
  68630. // },
  68631. // "scopes": [
  68632. // "https://www.googleapis.com/auth/cloud-platform",
  68633. // "https://www.googleapis.com/auth/compute",
  68634. // "https://www.googleapis.com/auth/compute.readonly"
  68635. // ]
  68636. // }
  68637. }
  68638. // method id "compute.machineTypes.list":
  68639. type MachineTypesListCall struct {
  68640. s *Service
  68641. project string
  68642. zone string
  68643. urlParams_ gensupport.URLParams
  68644. ifNoneMatch_ string
  68645. ctx_ context.Context
  68646. header_ http.Header
  68647. }
  68648. // List: Retrieves a list of machine types available to the specified
  68649. // project.
  68650. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  68651. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  68652. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68653. c.project = project
  68654. c.zone = zone
  68655. return c
  68656. }
  68657. // Filter sets the optional parameter "filter": A filter expression that
  68658. // filters resources listed in the response. The expression must specify
  68659. // the field name, a comparison operator, and the value that you want to
  68660. // use for filtering. The value must be a string, a number, or a
  68661. // boolean. The comparison operator must be either =, !=, >, or <.
  68662. //
  68663. // For example, if you are filtering Compute Engine instances, you can
  68664. // exclude instances named example-instance by specifying name !=
  68665. // example-instance.
  68666. //
  68667. // You can also filter nested fields. For example, you could specify
  68668. // scheduling.automaticRestart = false to include instances only if they
  68669. // are not scheduled for automatic restarts. You can use filtering on
  68670. // nested fields to filter based on resource labels.
  68671. //
  68672. // To filter on multiple expressions, provide each separate expression
  68673. // within parentheses. For example, (scheduling.automaticRestart = true)
  68674. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68675. // AND expression. However, you can include AND and OR expressions
  68676. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68677. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68678. // true).
  68679. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  68680. c.urlParams_.Set("filter", filter)
  68681. return c
  68682. }
  68683. // MaxResults sets the optional parameter "maxResults": The maximum
  68684. // number of results per page that should be returned. If the number of
  68685. // available results is larger than maxResults, Compute Engine returns a
  68686. // nextPageToken that can be used to get the next page of results in
  68687. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68688. // (Default: 500)
  68689. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  68690. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68691. return c
  68692. }
  68693. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68694. // a certain order. By default, results are returned in alphanumerical
  68695. // order based on the resource name.
  68696. //
  68697. // You can also sort results in descending order based on the creation
  68698. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68699. // based on the creationTimestamp field in reverse chronological order
  68700. // (newest result first). Use this to sort resources like operations so
  68701. // that the newest operation is returned first.
  68702. //
  68703. // Currently, only sorting by name or creationTimestamp desc is
  68704. // supported.
  68705. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  68706. c.urlParams_.Set("orderBy", orderBy)
  68707. return c
  68708. }
  68709. // PageToken sets the optional parameter "pageToken": Specifies a page
  68710. // token to use. Set pageToken to the nextPageToken returned by a
  68711. // previous list request to get the next page of results.
  68712. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  68713. c.urlParams_.Set("pageToken", pageToken)
  68714. return c
  68715. }
  68716. // Fields allows partial responses to be retrieved. See
  68717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68718. // for more information.
  68719. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  68720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68721. return c
  68722. }
  68723. // IfNoneMatch sets the optional parameter which makes the operation
  68724. // fail if the object's ETag matches the given value. This is useful for
  68725. // getting updates only after the object has changed since the last
  68726. // request. Use googleapi.IsNotModified to check whether the response
  68727. // error from Do is the result of In-None-Match.
  68728. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  68729. c.ifNoneMatch_ = entityTag
  68730. return c
  68731. }
  68732. // Context sets the context to be used in this call's Do method. Any
  68733. // pending HTTP request will be aborted if the provided context is
  68734. // canceled.
  68735. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  68736. c.ctx_ = ctx
  68737. return c
  68738. }
  68739. // Header returns an http.Header that can be modified by the caller to
  68740. // add HTTP headers to the request.
  68741. func (c *MachineTypesListCall) Header() http.Header {
  68742. if c.header_ == nil {
  68743. c.header_ = make(http.Header)
  68744. }
  68745. return c.header_
  68746. }
  68747. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  68748. reqHeaders := make(http.Header)
  68749. for k, v := range c.header_ {
  68750. reqHeaders[k] = v
  68751. }
  68752. reqHeaders.Set("User-Agent", c.s.userAgent())
  68753. if c.ifNoneMatch_ != "" {
  68754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68755. }
  68756. var body io.Reader = nil
  68757. c.urlParams_.Set("alt", alt)
  68758. c.urlParams_.Set("prettyPrint", "false")
  68759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  68760. urls += "?" + c.urlParams_.Encode()
  68761. req, err := http.NewRequest("GET", urls, body)
  68762. if err != nil {
  68763. return nil, err
  68764. }
  68765. req.Header = reqHeaders
  68766. googleapi.Expand(req.URL, map[string]string{
  68767. "project": c.project,
  68768. "zone": c.zone,
  68769. })
  68770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68771. }
  68772. // Do executes the "compute.machineTypes.list" call.
  68773. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  68774. // status code is an error. Response headers are in either
  68775. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  68776. // at all) in error.(*googleapi.Error).Header. Use
  68777. // googleapi.IsNotModified to check whether the returned error was
  68778. // because http.StatusNotModified was returned.
  68779. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  68780. gensupport.SetOptions(c.urlParams_, opts...)
  68781. res, err := c.doRequest("json")
  68782. if res != nil && res.StatusCode == http.StatusNotModified {
  68783. if res.Body != nil {
  68784. res.Body.Close()
  68785. }
  68786. return nil, &googleapi.Error{
  68787. Code: res.StatusCode,
  68788. Header: res.Header,
  68789. }
  68790. }
  68791. if err != nil {
  68792. return nil, err
  68793. }
  68794. defer googleapi.CloseBody(res)
  68795. if err := googleapi.CheckResponse(res); err != nil {
  68796. return nil, err
  68797. }
  68798. ret := &MachineTypeList{
  68799. ServerResponse: googleapi.ServerResponse{
  68800. Header: res.Header,
  68801. HTTPStatusCode: res.StatusCode,
  68802. },
  68803. }
  68804. target := &ret
  68805. if err := gensupport.DecodeResponse(target, res); err != nil {
  68806. return nil, err
  68807. }
  68808. return ret, nil
  68809. // {
  68810. // "description": "Retrieves a list of machine types available to the specified project.",
  68811. // "httpMethod": "GET",
  68812. // "id": "compute.machineTypes.list",
  68813. // "parameterOrder": [
  68814. // "project",
  68815. // "zone"
  68816. // ],
  68817. // "parameters": {
  68818. // "filter": {
  68819. // "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).",
  68820. // "location": "query",
  68821. // "type": "string"
  68822. // },
  68823. // "maxResults": {
  68824. // "default": "500",
  68825. // "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)",
  68826. // "format": "uint32",
  68827. // "location": "query",
  68828. // "minimum": "0",
  68829. // "type": "integer"
  68830. // },
  68831. // "orderBy": {
  68832. // "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.",
  68833. // "location": "query",
  68834. // "type": "string"
  68835. // },
  68836. // "pageToken": {
  68837. // "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.",
  68838. // "location": "query",
  68839. // "type": "string"
  68840. // },
  68841. // "project": {
  68842. // "description": "Project ID for this request.",
  68843. // "location": "path",
  68844. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68845. // "required": true,
  68846. // "type": "string"
  68847. // },
  68848. // "zone": {
  68849. // "description": "The name of the zone for this request.",
  68850. // "location": "path",
  68851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68852. // "required": true,
  68853. // "type": "string"
  68854. // }
  68855. // },
  68856. // "path": "{project}/zones/{zone}/machineTypes",
  68857. // "response": {
  68858. // "$ref": "MachineTypeList"
  68859. // },
  68860. // "scopes": [
  68861. // "https://www.googleapis.com/auth/cloud-platform",
  68862. // "https://www.googleapis.com/auth/compute",
  68863. // "https://www.googleapis.com/auth/compute.readonly"
  68864. // ]
  68865. // }
  68866. }
  68867. // Pages invokes f for each page of results.
  68868. // A non-nil error returned from f will halt the iteration.
  68869. // The provided context supersedes any context provided to the Context method.
  68870. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  68871. c.ctx_ = ctx
  68872. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68873. for {
  68874. x, err := c.Do()
  68875. if err != nil {
  68876. return err
  68877. }
  68878. if err := f(x); err != nil {
  68879. return err
  68880. }
  68881. if x.NextPageToken == "" {
  68882. return nil
  68883. }
  68884. c.PageToken(x.NextPageToken)
  68885. }
  68886. }
  68887. // method id "compute.networkEndpointGroups.aggregatedList":
  68888. type NetworkEndpointGroupsAggregatedListCall struct {
  68889. s *Service
  68890. project string
  68891. urlParams_ gensupport.URLParams
  68892. ifNoneMatch_ string
  68893. ctx_ context.Context
  68894. header_ http.Header
  68895. }
  68896. // AggregatedList: Retrieves the list of network endpoint groups and
  68897. // sorts them by zone.
  68898. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  68899. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68900. c.project = project
  68901. return c
  68902. }
  68903. // Filter sets the optional parameter "filter": A filter expression that
  68904. // filters resources listed in the response. The expression must specify
  68905. // the field name, a comparison operator, and the value that you want to
  68906. // use for filtering. The value must be a string, a number, or a
  68907. // boolean. The comparison operator must be either =, !=, >, or <.
  68908. //
  68909. // For example, if you are filtering Compute Engine instances, you can
  68910. // exclude instances named example-instance by specifying name !=
  68911. // example-instance.
  68912. //
  68913. // You can also filter nested fields. For example, you could specify
  68914. // scheduling.automaticRestart = false to include instances only if they
  68915. // are not scheduled for automatic restarts. You can use filtering on
  68916. // nested fields to filter based on resource labels.
  68917. //
  68918. // To filter on multiple expressions, provide each separate expression
  68919. // within parentheses. For example, (scheduling.automaticRestart = true)
  68920. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68921. // AND expression. However, you can include AND and OR expressions
  68922. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68923. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68924. // true).
  68925. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  68926. c.urlParams_.Set("filter", filter)
  68927. return c
  68928. }
  68929. // MaxResults sets the optional parameter "maxResults": The maximum
  68930. // number of results per page that should be returned. If the number of
  68931. // available results is larger than maxResults, Compute Engine returns a
  68932. // nextPageToken that can be used to get the next page of results in
  68933. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68934. // (Default: 500)
  68935. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  68936. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68937. return c
  68938. }
  68939. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68940. // a certain order. By default, results are returned in alphanumerical
  68941. // order based on the resource name.
  68942. //
  68943. // You can also sort results in descending order based on the creation
  68944. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68945. // based on the creationTimestamp field in reverse chronological order
  68946. // (newest result first). Use this to sort resources like operations so
  68947. // that the newest operation is returned first.
  68948. //
  68949. // Currently, only sorting by name or creationTimestamp desc is
  68950. // supported.
  68951. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  68952. c.urlParams_.Set("orderBy", orderBy)
  68953. return c
  68954. }
  68955. // PageToken sets the optional parameter "pageToken": Specifies a page
  68956. // token to use. Set pageToken to the nextPageToken returned by a
  68957. // previous list request to get the next page of results.
  68958. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  68959. c.urlParams_.Set("pageToken", pageToken)
  68960. return c
  68961. }
  68962. // Fields allows partial responses to be retrieved. See
  68963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68964. // for more information.
  68965. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  68966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68967. return c
  68968. }
  68969. // IfNoneMatch sets the optional parameter which makes the operation
  68970. // fail if the object's ETag matches the given value. This is useful for
  68971. // getting updates only after the object has changed since the last
  68972. // request. Use googleapi.IsNotModified to check whether the response
  68973. // error from Do is the result of In-None-Match.
  68974. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  68975. c.ifNoneMatch_ = entityTag
  68976. return c
  68977. }
  68978. // Context sets the context to be used in this call's Do method. Any
  68979. // pending HTTP request will be aborted if the provided context is
  68980. // canceled.
  68981. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  68982. c.ctx_ = ctx
  68983. return c
  68984. }
  68985. // Header returns an http.Header that can be modified by the caller to
  68986. // add HTTP headers to the request.
  68987. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  68988. if c.header_ == nil {
  68989. c.header_ = make(http.Header)
  68990. }
  68991. return c.header_
  68992. }
  68993. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  68994. reqHeaders := make(http.Header)
  68995. for k, v := range c.header_ {
  68996. reqHeaders[k] = v
  68997. }
  68998. reqHeaders.Set("User-Agent", c.s.userAgent())
  68999. if c.ifNoneMatch_ != "" {
  69000. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69001. }
  69002. var body io.Reader = nil
  69003. c.urlParams_.Set("alt", alt)
  69004. c.urlParams_.Set("prettyPrint", "false")
  69005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  69006. urls += "?" + c.urlParams_.Encode()
  69007. req, err := http.NewRequest("GET", urls, body)
  69008. if err != nil {
  69009. return nil, err
  69010. }
  69011. req.Header = reqHeaders
  69012. googleapi.Expand(req.URL, map[string]string{
  69013. "project": c.project,
  69014. })
  69015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69016. }
  69017. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  69018. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  69019. // non-nil. Any non-2xx status code is an error. Response headers are in
  69020. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  69021. // (if a response was returned at all) in
  69022. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  69023. // whether the returned error was because http.StatusNotModified was
  69024. // returned.
  69025. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  69026. gensupport.SetOptions(c.urlParams_, opts...)
  69027. res, err := c.doRequest("json")
  69028. if res != nil && res.StatusCode == http.StatusNotModified {
  69029. if res.Body != nil {
  69030. res.Body.Close()
  69031. }
  69032. return nil, &googleapi.Error{
  69033. Code: res.StatusCode,
  69034. Header: res.Header,
  69035. }
  69036. }
  69037. if err != nil {
  69038. return nil, err
  69039. }
  69040. defer googleapi.CloseBody(res)
  69041. if err := googleapi.CheckResponse(res); err != nil {
  69042. return nil, err
  69043. }
  69044. ret := &NetworkEndpointGroupAggregatedList{
  69045. ServerResponse: googleapi.ServerResponse{
  69046. Header: res.Header,
  69047. HTTPStatusCode: res.StatusCode,
  69048. },
  69049. }
  69050. target := &ret
  69051. if err := gensupport.DecodeResponse(target, res); err != nil {
  69052. return nil, err
  69053. }
  69054. return ret, nil
  69055. // {
  69056. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  69057. // "httpMethod": "GET",
  69058. // "id": "compute.networkEndpointGroups.aggregatedList",
  69059. // "parameterOrder": [
  69060. // "project"
  69061. // ],
  69062. // "parameters": {
  69063. // "filter": {
  69064. // "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).",
  69065. // "location": "query",
  69066. // "type": "string"
  69067. // },
  69068. // "maxResults": {
  69069. // "default": "500",
  69070. // "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)",
  69071. // "format": "uint32",
  69072. // "location": "query",
  69073. // "minimum": "0",
  69074. // "type": "integer"
  69075. // },
  69076. // "orderBy": {
  69077. // "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.",
  69078. // "location": "query",
  69079. // "type": "string"
  69080. // },
  69081. // "pageToken": {
  69082. // "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.",
  69083. // "location": "query",
  69084. // "type": "string"
  69085. // },
  69086. // "project": {
  69087. // "description": "Project ID for this request.",
  69088. // "location": "path",
  69089. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69090. // "required": true,
  69091. // "type": "string"
  69092. // }
  69093. // },
  69094. // "path": "{project}/aggregated/networkEndpointGroups",
  69095. // "response": {
  69096. // "$ref": "NetworkEndpointGroupAggregatedList"
  69097. // },
  69098. // "scopes": [
  69099. // "https://www.googleapis.com/auth/cloud-platform",
  69100. // "https://www.googleapis.com/auth/compute",
  69101. // "https://www.googleapis.com/auth/compute.readonly"
  69102. // ]
  69103. // }
  69104. }
  69105. // Pages invokes f for each page of results.
  69106. // A non-nil error returned from f will halt the iteration.
  69107. // The provided context supersedes any context provided to the Context method.
  69108. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  69109. c.ctx_ = ctx
  69110. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69111. for {
  69112. x, err := c.Do()
  69113. if err != nil {
  69114. return err
  69115. }
  69116. if err := f(x); err != nil {
  69117. return err
  69118. }
  69119. if x.NextPageToken == "" {
  69120. return nil
  69121. }
  69122. c.PageToken(x.NextPageToken)
  69123. }
  69124. }
  69125. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  69126. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  69127. s *Service
  69128. project string
  69129. zone string
  69130. networkEndpointGroup string
  69131. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  69132. urlParams_ gensupport.URLParams
  69133. ctx_ context.Context
  69134. header_ http.Header
  69135. }
  69136. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  69137. // specified network endpoint group.
  69138. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  69139. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69140. c.project = project
  69141. c.zone = zone
  69142. c.networkEndpointGroup = networkEndpointGroup
  69143. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  69144. return c
  69145. }
  69146. // RequestId sets the optional parameter "requestId": An optional
  69147. // request ID to identify requests. Specify a unique request ID so that
  69148. // if you must retry your request, the server will know to ignore the
  69149. // request if it has already been completed.
  69150. //
  69151. // For example, consider a situation where you make an initial request
  69152. // and the request times out. If you make the request again with the
  69153. // same request ID, the server can check if original operation with the
  69154. // same request ID was received, and if so, will ignore the second
  69155. // request. This prevents clients from accidentally creating duplicate
  69156. // commitments.
  69157. //
  69158. // The request ID must be a valid UUID with the exception that zero UUID
  69159. // is not supported (00000000-0000-0000-0000-000000000000).
  69160. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  69161. c.urlParams_.Set("requestId", requestId)
  69162. return c
  69163. }
  69164. // Fields allows partial responses to be retrieved. See
  69165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69166. // for more information.
  69167. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  69168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69169. return c
  69170. }
  69171. // Context sets the context to be used in this call's Do method. Any
  69172. // pending HTTP request will be aborted if the provided context is
  69173. // canceled.
  69174. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  69175. c.ctx_ = ctx
  69176. return c
  69177. }
  69178. // Header returns an http.Header that can be modified by the caller to
  69179. // add HTTP headers to the request.
  69180. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  69181. if c.header_ == nil {
  69182. c.header_ = make(http.Header)
  69183. }
  69184. return c.header_
  69185. }
  69186. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  69187. reqHeaders := make(http.Header)
  69188. for k, v := range c.header_ {
  69189. reqHeaders[k] = v
  69190. }
  69191. reqHeaders.Set("User-Agent", c.s.userAgent())
  69192. var body io.Reader = nil
  69193. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  69194. if err != nil {
  69195. return nil, err
  69196. }
  69197. reqHeaders.Set("Content-Type", "application/json")
  69198. c.urlParams_.Set("alt", alt)
  69199. c.urlParams_.Set("prettyPrint", "false")
  69200. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  69201. urls += "?" + c.urlParams_.Encode()
  69202. req, err := http.NewRequest("POST", urls, body)
  69203. if err != nil {
  69204. return nil, err
  69205. }
  69206. req.Header = reqHeaders
  69207. googleapi.Expand(req.URL, map[string]string{
  69208. "project": c.project,
  69209. "zone": c.zone,
  69210. "networkEndpointGroup": c.networkEndpointGroup,
  69211. })
  69212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69213. }
  69214. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  69215. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69216. // status code is an error. Response headers are in either
  69217. // *Operation.ServerResponse.Header or (if a response was returned at
  69218. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69219. // to check whether the returned error was because
  69220. // http.StatusNotModified was returned.
  69221. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69222. gensupport.SetOptions(c.urlParams_, opts...)
  69223. res, err := c.doRequest("json")
  69224. if res != nil && res.StatusCode == http.StatusNotModified {
  69225. if res.Body != nil {
  69226. res.Body.Close()
  69227. }
  69228. return nil, &googleapi.Error{
  69229. Code: res.StatusCode,
  69230. Header: res.Header,
  69231. }
  69232. }
  69233. if err != nil {
  69234. return nil, err
  69235. }
  69236. defer googleapi.CloseBody(res)
  69237. if err := googleapi.CheckResponse(res); err != nil {
  69238. return nil, err
  69239. }
  69240. ret := &Operation{
  69241. ServerResponse: googleapi.ServerResponse{
  69242. Header: res.Header,
  69243. HTTPStatusCode: res.StatusCode,
  69244. },
  69245. }
  69246. target := &ret
  69247. if err := gensupport.DecodeResponse(target, res); err != nil {
  69248. return nil, err
  69249. }
  69250. return ret, nil
  69251. // {
  69252. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  69253. // "httpMethod": "POST",
  69254. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  69255. // "parameterOrder": [
  69256. // "project",
  69257. // "zone",
  69258. // "networkEndpointGroup"
  69259. // ],
  69260. // "parameters": {
  69261. // "networkEndpointGroup": {
  69262. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  69263. // "location": "path",
  69264. // "required": true,
  69265. // "type": "string"
  69266. // },
  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. // "requestId": {
  69275. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69276. // "location": "query",
  69277. // "type": "string"
  69278. // },
  69279. // "zone": {
  69280. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  69281. // "location": "path",
  69282. // "required": true,
  69283. // "type": "string"
  69284. // }
  69285. // },
  69286. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  69287. // "request": {
  69288. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  69289. // },
  69290. // "response": {
  69291. // "$ref": "Operation"
  69292. // },
  69293. // "scopes": [
  69294. // "https://www.googleapis.com/auth/cloud-platform",
  69295. // "https://www.googleapis.com/auth/compute"
  69296. // ]
  69297. // }
  69298. }
  69299. // method id "compute.networkEndpointGroups.delete":
  69300. type NetworkEndpointGroupsDeleteCall struct {
  69301. s *Service
  69302. project string
  69303. zone string
  69304. networkEndpointGroup string
  69305. urlParams_ gensupport.URLParams
  69306. ctx_ context.Context
  69307. header_ http.Header
  69308. }
  69309. // Delete: Deletes the specified network endpoint group. The network
  69310. // endpoints in the NEG and the VM instances they belong to are not
  69311. // terminated when the NEG is deleted. Note that the NEG cannot be
  69312. // deleted if there are backend services referencing it.
  69313. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  69314. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69315. c.project = project
  69316. c.zone = zone
  69317. c.networkEndpointGroup = networkEndpointGroup
  69318. return c
  69319. }
  69320. // RequestId sets the optional parameter "requestId": An optional
  69321. // request ID to identify requests. Specify a unique request ID so that
  69322. // if you must retry your request, the server will know to ignore the
  69323. // request if it has already been completed.
  69324. //
  69325. // For example, consider a situation where you make an initial request
  69326. // and the request times out. If you make the request again with the
  69327. // same request ID, the server can check if original operation with the
  69328. // same request ID was received, and if so, will ignore the second
  69329. // request. This prevents clients from accidentally creating duplicate
  69330. // commitments.
  69331. //
  69332. // The request ID must be a valid UUID with the exception that zero UUID
  69333. // is not supported (00000000-0000-0000-0000-000000000000).
  69334. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  69335. c.urlParams_.Set("requestId", requestId)
  69336. return c
  69337. }
  69338. // Fields allows partial responses to be retrieved. See
  69339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69340. // for more information.
  69341. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  69342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69343. return c
  69344. }
  69345. // Context sets the context to be used in this call's Do method. Any
  69346. // pending HTTP request will be aborted if the provided context is
  69347. // canceled.
  69348. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  69349. c.ctx_ = ctx
  69350. return c
  69351. }
  69352. // Header returns an http.Header that can be modified by the caller to
  69353. // add HTTP headers to the request.
  69354. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  69355. if c.header_ == nil {
  69356. c.header_ = make(http.Header)
  69357. }
  69358. return c.header_
  69359. }
  69360. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  69361. reqHeaders := make(http.Header)
  69362. for k, v := range c.header_ {
  69363. reqHeaders[k] = v
  69364. }
  69365. reqHeaders.Set("User-Agent", c.s.userAgent())
  69366. var body io.Reader = nil
  69367. c.urlParams_.Set("alt", alt)
  69368. c.urlParams_.Set("prettyPrint", "false")
  69369. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  69370. urls += "?" + c.urlParams_.Encode()
  69371. req, err := http.NewRequest("DELETE", urls, body)
  69372. if err != nil {
  69373. return nil, err
  69374. }
  69375. req.Header = reqHeaders
  69376. googleapi.Expand(req.URL, map[string]string{
  69377. "project": c.project,
  69378. "zone": c.zone,
  69379. "networkEndpointGroup": c.networkEndpointGroup,
  69380. })
  69381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69382. }
  69383. // Do executes the "compute.networkEndpointGroups.delete" call.
  69384. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69385. // status code is an error. Response headers are in either
  69386. // *Operation.ServerResponse.Header or (if a response was returned at
  69387. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69388. // to check whether the returned error was because
  69389. // http.StatusNotModified was returned.
  69390. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69391. gensupport.SetOptions(c.urlParams_, opts...)
  69392. res, err := c.doRequest("json")
  69393. if res != nil && res.StatusCode == http.StatusNotModified {
  69394. if res.Body != nil {
  69395. res.Body.Close()
  69396. }
  69397. return nil, &googleapi.Error{
  69398. Code: res.StatusCode,
  69399. Header: res.Header,
  69400. }
  69401. }
  69402. if err != nil {
  69403. return nil, err
  69404. }
  69405. defer googleapi.CloseBody(res)
  69406. if err := googleapi.CheckResponse(res); err != nil {
  69407. return nil, err
  69408. }
  69409. ret := &Operation{
  69410. ServerResponse: googleapi.ServerResponse{
  69411. Header: res.Header,
  69412. HTTPStatusCode: res.StatusCode,
  69413. },
  69414. }
  69415. target := &ret
  69416. if err := gensupport.DecodeResponse(target, res); err != nil {
  69417. return nil, err
  69418. }
  69419. return ret, nil
  69420. // {
  69421. // "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.",
  69422. // "httpMethod": "DELETE",
  69423. // "id": "compute.networkEndpointGroups.delete",
  69424. // "parameterOrder": [
  69425. // "project",
  69426. // "zone",
  69427. // "networkEndpointGroup"
  69428. // ],
  69429. // "parameters": {
  69430. // "networkEndpointGroup": {
  69431. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  69432. // "location": "path",
  69433. // "required": true,
  69434. // "type": "string"
  69435. // },
  69436. // "project": {
  69437. // "description": "Project ID for this request.",
  69438. // "location": "path",
  69439. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69440. // "required": true,
  69441. // "type": "string"
  69442. // },
  69443. // "requestId": {
  69444. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69445. // "location": "query",
  69446. // "type": "string"
  69447. // },
  69448. // "zone": {
  69449. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  69450. // "location": "path",
  69451. // "required": true,
  69452. // "type": "string"
  69453. // }
  69454. // },
  69455. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  69456. // "response": {
  69457. // "$ref": "Operation"
  69458. // },
  69459. // "scopes": [
  69460. // "https://www.googleapis.com/auth/cloud-platform",
  69461. // "https://www.googleapis.com/auth/compute"
  69462. // ]
  69463. // }
  69464. }
  69465. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  69466. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  69467. s *Service
  69468. project string
  69469. zone string
  69470. networkEndpointGroup string
  69471. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  69472. urlParams_ gensupport.URLParams
  69473. ctx_ context.Context
  69474. header_ http.Header
  69475. }
  69476. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  69477. // specified network endpoint group.
  69478. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  69479. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69480. c.project = project
  69481. c.zone = zone
  69482. c.networkEndpointGroup = networkEndpointGroup
  69483. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  69484. return c
  69485. }
  69486. // RequestId sets the optional parameter "requestId": An optional
  69487. // request ID to identify requests. Specify a unique request ID so that
  69488. // if you must retry your request, the server will know to ignore the
  69489. // request if it has already been completed.
  69490. //
  69491. // For example, consider a situation where you make an initial request
  69492. // and the request times out. If you make the request again with the
  69493. // same request ID, the server can check if original operation with the
  69494. // same request ID was received, and if so, will ignore the second
  69495. // request. This prevents clients from accidentally creating duplicate
  69496. // commitments.
  69497. //
  69498. // The request ID must be a valid UUID with the exception that zero UUID
  69499. // is not supported (00000000-0000-0000-0000-000000000000).
  69500. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  69501. c.urlParams_.Set("requestId", requestId)
  69502. return c
  69503. }
  69504. // Fields allows partial responses to be retrieved. See
  69505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69506. // for more information.
  69507. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  69508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  69521. if c.header_ == nil {
  69522. c.header_ = make(http.Header)
  69523. }
  69524. return c.header_
  69525. }
  69526. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) 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. var body io.Reader = nil
  69533. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  69534. if err != nil {
  69535. return nil, err
  69536. }
  69537. reqHeaders.Set("Content-Type", "application/json")
  69538. c.urlParams_.Set("alt", alt)
  69539. c.urlParams_.Set("prettyPrint", "false")
  69540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  69541. urls += "?" + c.urlParams_.Encode()
  69542. req, err := http.NewRequest("POST", urls, body)
  69543. if err != nil {
  69544. return nil, err
  69545. }
  69546. req.Header = reqHeaders
  69547. googleapi.Expand(req.URL, map[string]string{
  69548. "project": c.project,
  69549. "zone": c.zone,
  69550. "networkEndpointGroup": c.networkEndpointGroup,
  69551. })
  69552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69553. }
  69554. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  69555. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69556. // status code is an error. Response headers are in either
  69557. // *Operation.ServerResponse.Header or (if a response was returned at
  69558. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69559. // to check whether the returned error was because
  69560. // http.StatusNotModified was returned.
  69561. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69562. gensupport.SetOptions(c.urlParams_, opts...)
  69563. res, err := c.doRequest("json")
  69564. if res != nil && res.StatusCode == http.StatusNotModified {
  69565. if res.Body != nil {
  69566. res.Body.Close()
  69567. }
  69568. return nil, &googleapi.Error{
  69569. Code: res.StatusCode,
  69570. Header: res.Header,
  69571. }
  69572. }
  69573. if err != nil {
  69574. return nil, err
  69575. }
  69576. defer googleapi.CloseBody(res)
  69577. if err := googleapi.CheckResponse(res); err != nil {
  69578. return nil, err
  69579. }
  69580. ret := &Operation{
  69581. ServerResponse: googleapi.ServerResponse{
  69582. Header: res.Header,
  69583. HTTPStatusCode: res.StatusCode,
  69584. },
  69585. }
  69586. target := &ret
  69587. if err := gensupport.DecodeResponse(target, res); err != nil {
  69588. return nil, err
  69589. }
  69590. return ret, nil
  69591. // {
  69592. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  69593. // "httpMethod": "POST",
  69594. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  69595. // "parameterOrder": [
  69596. // "project",
  69597. // "zone",
  69598. // "networkEndpointGroup"
  69599. // ],
  69600. // "parameters": {
  69601. // "networkEndpointGroup": {
  69602. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  69603. // "location": "path",
  69604. // "required": true,
  69605. // "type": "string"
  69606. // },
  69607. // "project": {
  69608. // "description": "Project ID for this request.",
  69609. // "location": "path",
  69610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69611. // "required": true,
  69612. // "type": "string"
  69613. // },
  69614. // "requestId": {
  69615. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69616. // "location": "query",
  69617. // "type": "string"
  69618. // },
  69619. // "zone": {
  69620. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  69621. // "location": "path",
  69622. // "required": true,
  69623. // "type": "string"
  69624. // }
  69625. // },
  69626. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  69627. // "request": {
  69628. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  69629. // },
  69630. // "response": {
  69631. // "$ref": "Operation"
  69632. // },
  69633. // "scopes": [
  69634. // "https://www.googleapis.com/auth/cloud-platform",
  69635. // "https://www.googleapis.com/auth/compute"
  69636. // ]
  69637. // }
  69638. }
  69639. // method id "compute.networkEndpointGroups.get":
  69640. type NetworkEndpointGroupsGetCall struct {
  69641. s *Service
  69642. project string
  69643. zone string
  69644. networkEndpointGroup string
  69645. urlParams_ gensupport.URLParams
  69646. ifNoneMatch_ string
  69647. ctx_ context.Context
  69648. header_ http.Header
  69649. }
  69650. // Get: Returns the specified network endpoint group. Gets a list of
  69651. // available network endpoint groups by making a list() request.
  69652. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  69653. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69654. c.project = project
  69655. c.zone = zone
  69656. c.networkEndpointGroup = networkEndpointGroup
  69657. return c
  69658. }
  69659. // Fields allows partial responses to be retrieved. See
  69660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69661. // for more information.
  69662. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  69663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69664. return c
  69665. }
  69666. // IfNoneMatch sets the optional parameter which makes the operation
  69667. // fail if the object's ETag matches the given value. This is useful for
  69668. // getting updates only after the object has changed since the last
  69669. // request. Use googleapi.IsNotModified to check whether the response
  69670. // error from Do is the result of In-None-Match.
  69671. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  69672. c.ifNoneMatch_ = entityTag
  69673. return c
  69674. }
  69675. // Context sets the context to be used in this call's Do method. Any
  69676. // pending HTTP request will be aborted if the provided context is
  69677. // canceled.
  69678. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  69679. c.ctx_ = ctx
  69680. return c
  69681. }
  69682. // Header returns an http.Header that can be modified by the caller to
  69683. // add HTTP headers to the request.
  69684. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  69685. if c.header_ == nil {
  69686. c.header_ = make(http.Header)
  69687. }
  69688. return c.header_
  69689. }
  69690. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  69691. reqHeaders := make(http.Header)
  69692. for k, v := range c.header_ {
  69693. reqHeaders[k] = v
  69694. }
  69695. reqHeaders.Set("User-Agent", c.s.userAgent())
  69696. if c.ifNoneMatch_ != "" {
  69697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69698. }
  69699. var body io.Reader = nil
  69700. c.urlParams_.Set("alt", alt)
  69701. c.urlParams_.Set("prettyPrint", "false")
  69702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  69703. urls += "?" + c.urlParams_.Encode()
  69704. req, err := http.NewRequest("GET", urls, body)
  69705. if err != nil {
  69706. return nil, err
  69707. }
  69708. req.Header = reqHeaders
  69709. googleapi.Expand(req.URL, map[string]string{
  69710. "project": c.project,
  69711. "zone": c.zone,
  69712. "networkEndpointGroup": c.networkEndpointGroup,
  69713. })
  69714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69715. }
  69716. // Do executes the "compute.networkEndpointGroups.get" call.
  69717. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  69718. // non-2xx status code is an error. Response headers are in either
  69719. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  69720. // returned at all) in error.(*googleapi.Error).Header. Use
  69721. // googleapi.IsNotModified to check whether the returned error was
  69722. // because http.StatusNotModified was returned.
  69723. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  69724. gensupport.SetOptions(c.urlParams_, opts...)
  69725. res, err := c.doRequest("json")
  69726. if res != nil && res.StatusCode == http.StatusNotModified {
  69727. if res.Body != nil {
  69728. res.Body.Close()
  69729. }
  69730. return nil, &googleapi.Error{
  69731. Code: res.StatusCode,
  69732. Header: res.Header,
  69733. }
  69734. }
  69735. if err != nil {
  69736. return nil, err
  69737. }
  69738. defer googleapi.CloseBody(res)
  69739. if err := googleapi.CheckResponse(res); err != nil {
  69740. return nil, err
  69741. }
  69742. ret := &NetworkEndpointGroup{
  69743. ServerResponse: googleapi.ServerResponse{
  69744. Header: res.Header,
  69745. HTTPStatusCode: res.StatusCode,
  69746. },
  69747. }
  69748. target := &ret
  69749. if err := gensupport.DecodeResponse(target, res); err != nil {
  69750. return nil, err
  69751. }
  69752. return ret, nil
  69753. // {
  69754. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  69755. // "httpMethod": "GET",
  69756. // "id": "compute.networkEndpointGroups.get",
  69757. // "parameterOrder": [
  69758. // "project",
  69759. // "zone",
  69760. // "networkEndpointGroup"
  69761. // ],
  69762. // "parameters": {
  69763. // "networkEndpointGroup": {
  69764. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  69765. // "location": "path",
  69766. // "required": true,
  69767. // "type": "string"
  69768. // },
  69769. // "project": {
  69770. // "description": "Project ID for this request.",
  69771. // "location": "path",
  69772. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69773. // "required": true,
  69774. // "type": "string"
  69775. // },
  69776. // "zone": {
  69777. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  69778. // "location": "path",
  69779. // "required": true,
  69780. // "type": "string"
  69781. // }
  69782. // },
  69783. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  69784. // "response": {
  69785. // "$ref": "NetworkEndpointGroup"
  69786. // },
  69787. // "scopes": [
  69788. // "https://www.googleapis.com/auth/cloud-platform",
  69789. // "https://www.googleapis.com/auth/compute",
  69790. // "https://www.googleapis.com/auth/compute.readonly"
  69791. // ]
  69792. // }
  69793. }
  69794. // method id "compute.networkEndpointGroups.insert":
  69795. type NetworkEndpointGroupsInsertCall struct {
  69796. s *Service
  69797. project string
  69798. zone string
  69799. networkendpointgroup *NetworkEndpointGroup
  69800. urlParams_ gensupport.URLParams
  69801. ctx_ context.Context
  69802. header_ http.Header
  69803. }
  69804. // Insert: Creates a network endpoint group in the specified project
  69805. // using the parameters that are included in the request.
  69806. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  69807. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69808. c.project = project
  69809. c.zone = zone
  69810. c.networkendpointgroup = networkendpointgroup
  69811. return c
  69812. }
  69813. // RequestId sets the optional parameter "requestId": An optional
  69814. // request ID to identify requests. Specify a unique request ID so that
  69815. // if you must retry your request, the server will know to ignore the
  69816. // request if it has already been completed.
  69817. //
  69818. // For example, consider a situation where you make an initial request
  69819. // and the request times out. If you make the request again with the
  69820. // same request ID, the server can check if original operation with the
  69821. // same request ID was received, and if so, will ignore the second
  69822. // request. This prevents clients from accidentally creating duplicate
  69823. // commitments.
  69824. //
  69825. // The request ID must be a valid UUID with the exception that zero UUID
  69826. // is not supported (00000000-0000-0000-0000-000000000000).
  69827. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  69828. c.urlParams_.Set("requestId", requestId)
  69829. return c
  69830. }
  69831. // Fields allows partial responses to be retrieved. See
  69832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69833. // for more information.
  69834. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  69835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69836. return c
  69837. }
  69838. // Context sets the context to be used in this call's Do method. Any
  69839. // pending HTTP request will be aborted if the provided context is
  69840. // canceled.
  69841. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  69842. c.ctx_ = ctx
  69843. return c
  69844. }
  69845. // Header returns an http.Header that can be modified by the caller to
  69846. // add HTTP headers to the request.
  69847. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  69848. if c.header_ == nil {
  69849. c.header_ = make(http.Header)
  69850. }
  69851. return c.header_
  69852. }
  69853. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  69854. reqHeaders := make(http.Header)
  69855. for k, v := range c.header_ {
  69856. reqHeaders[k] = v
  69857. }
  69858. reqHeaders.Set("User-Agent", c.s.userAgent())
  69859. var body io.Reader = nil
  69860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  69861. if err != nil {
  69862. return nil, err
  69863. }
  69864. reqHeaders.Set("Content-Type", "application/json")
  69865. c.urlParams_.Set("alt", alt)
  69866. c.urlParams_.Set("prettyPrint", "false")
  69867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  69868. urls += "?" + c.urlParams_.Encode()
  69869. req, err := http.NewRequest("POST", urls, body)
  69870. if err != nil {
  69871. return nil, err
  69872. }
  69873. req.Header = reqHeaders
  69874. googleapi.Expand(req.URL, map[string]string{
  69875. "project": c.project,
  69876. "zone": c.zone,
  69877. })
  69878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69879. }
  69880. // Do executes the "compute.networkEndpointGroups.insert" call.
  69881. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69882. // status code is an error. Response headers are in either
  69883. // *Operation.ServerResponse.Header or (if a response was returned at
  69884. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69885. // to check whether the returned error was because
  69886. // http.StatusNotModified was returned.
  69887. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69888. gensupport.SetOptions(c.urlParams_, opts...)
  69889. res, err := c.doRequest("json")
  69890. if res != nil && res.StatusCode == http.StatusNotModified {
  69891. if res.Body != nil {
  69892. res.Body.Close()
  69893. }
  69894. return nil, &googleapi.Error{
  69895. Code: res.StatusCode,
  69896. Header: res.Header,
  69897. }
  69898. }
  69899. if err != nil {
  69900. return nil, err
  69901. }
  69902. defer googleapi.CloseBody(res)
  69903. if err := googleapi.CheckResponse(res); err != nil {
  69904. return nil, err
  69905. }
  69906. ret := &Operation{
  69907. ServerResponse: googleapi.ServerResponse{
  69908. Header: res.Header,
  69909. HTTPStatusCode: res.StatusCode,
  69910. },
  69911. }
  69912. target := &ret
  69913. if err := gensupport.DecodeResponse(target, res); err != nil {
  69914. return nil, err
  69915. }
  69916. return ret, nil
  69917. // {
  69918. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  69919. // "httpMethod": "POST",
  69920. // "id": "compute.networkEndpointGroups.insert",
  69921. // "parameterOrder": [
  69922. // "project",
  69923. // "zone"
  69924. // ],
  69925. // "parameters": {
  69926. // "project": {
  69927. // "description": "Project ID for this request.",
  69928. // "location": "path",
  69929. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69930. // "required": true,
  69931. // "type": "string"
  69932. // },
  69933. // "requestId": {
  69934. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69935. // "location": "query",
  69936. // "type": "string"
  69937. // },
  69938. // "zone": {
  69939. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  69940. // "location": "path",
  69941. // "required": true,
  69942. // "type": "string"
  69943. // }
  69944. // },
  69945. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  69946. // "request": {
  69947. // "$ref": "NetworkEndpointGroup"
  69948. // },
  69949. // "response": {
  69950. // "$ref": "Operation"
  69951. // },
  69952. // "scopes": [
  69953. // "https://www.googleapis.com/auth/cloud-platform",
  69954. // "https://www.googleapis.com/auth/compute"
  69955. // ]
  69956. // }
  69957. }
  69958. // method id "compute.networkEndpointGroups.list":
  69959. type NetworkEndpointGroupsListCall struct {
  69960. s *Service
  69961. project string
  69962. zone string
  69963. urlParams_ gensupport.URLParams
  69964. ifNoneMatch_ string
  69965. ctx_ context.Context
  69966. header_ http.Header
  69967. }
  69968. // List: Retrieves the list of network endpoint groups that are located
  69969. // in the specified project and zone.
  69970. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  69971. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69972. c.project = project
  69973. c.zone = zone
  69974. return c
  69975. }
  69976. // Filter sets the optional parameter "filter": A filter expression that
  69977. // filters resources listed in the response. The expression must specify
  69978. // the field name, a comparison operator, and the value that you want to
  69979. // use for filtering. The value must be a string, a number, or a
  69980. // boolean. The comparison operator must be either =, !=, >, or <.
  69981. //
  69982. // For example, if you are filtering Compute Engine instances, you can
  69983. // exclude instances named example-instance by specifying name !=
  69984. // example-instance.
  69985. //
  69986. // You can also filter nested fields. For example, you could specify
  69987. // scheduling.automaticRestart = false to include instances only if they
  69988. // are not scheduled for automatic restarts. You can use filtering on
  69989. // nested fields to filter based on resource labels.
  69990. //
  69991. // To filter on multiple expressions, provide each separate expression
  69992. // within parentheses. For example, (scheduling.automaticRestart = true)
  69993. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69994. // AND expression. However, you can include AND and OR expressions
  69995. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69996. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69997. // true).
  69998. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  69999. c.urlParams_.Set("filter", filter)
  70000. return c
  70001. }
  70002. // MaxResults sets the optional parameter "maxResults": The maximum
  70003. // number of results per page that should be returned. If the number of
  70004. // available results is larger than maxResults, Compute Engine returns a
  70005. // nextPageToken that can be used to get the next page of results in
  70006. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70007. // (Default: 500)
  70008. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  70009. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70010. return c
  70011. }
  70012. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70013. // a certain order. By default, results are returned in alphanumerical
  70014. // order based on the resource name.
  70015. //
  70016. // You can also sort results in descending order based on the creation
  70017. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70018. // based on the creationTimestamp field in reverse chronological order
  70019. // (newest result first). Use this to sort resources like operations so
  70020. // that the newest operation is returned first.
  70021. //
  70022. // Currently, only sorting by name or creationTimestamp desc is
  70023. // supported.
  70024. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  70025. c.urlParams_.Set("orderBy", orderBy)
  70026. return c
  70027. }
  70028. // PageToken sets the optional parameter "pageToken": Specifies a page
  70029. // token to use. Set pageToken to the nextPageToken returned by a
  70030. // previous list request to get the next page of results.
  70031. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  70032. c.urlParams_.Set("pageToken", pageToken)
  70033. return c
  70034. }
  70035. // Fields allows partial responses to be retrieved. See
  70036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70037. // for more information.
  70038. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  70039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70040. return c
  70041. }
  70042. // IfNoneMatch sets the optional parameter which makes the operation
  70043. // fail if the object's ETag matches the given value. This is useful for
  70044. // getting updates only after the object has changed since the last
  70045. // request. Use googleapi.IsNotModified to check whether the response
  70046. // error from Do is the result of In-None-Match.
  70047. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  70048. c.ifNoneMatch_ = entityTag
  70049. return c
  70050. }
  70051. // Context sets the context to be used in this call's Do method. Any
  70052. // pending HTTP request will be aborted if the provided context is
  70053. // canceled.
  70054. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  70055. c.ctx_ = ctx
  70056. return c
  70057. }
  70058. // Header returns an http.Header that can be modified by the caller to
  70059. // add HTTP headers to the request.
  70060. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  70061. if c.header_ == nil {
  70062. c.header_ = make(http.Header)
  70063. }
  70064. return c.header_
  70065. }
  70066. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  70067. reqHeaders := make(http.Header)
  70068. for k, v := range c.header_ {
  70069. reqHeaders[k] = v
  70070. }
  70071. reqHeaders.Set("User-Agent", c.s.userAgent())
  70072. if c.ifNoneMatch_ != "" {
  70073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70074. }
  70075. var body io.Reader = nil
  70076. c.urlParams_.Set("alt", alt)
  70077. c.urlParams_.Set("prettyPrint", "false")
  70078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  70079. urls += "?" + c.urlParams_.Encode()
  70080. req, err := http.NewRequest("GET", urls, body)
  70081. if err != nil {
  70082. return nil, err
  70083. }
  70084. req.Header = reqHeaders
  70085. googleapi.Expand(req.URL, map[string]string{
  70086. "project": c.project,
  70087. "zone": c.zone,
  70088. })
  70089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70090. }
  70091. // Do executes the "compute.networkEndpointGroups.list" call.
  70092. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  70093. // Any non-2xx status code is an error. Response headers are in either
  70094. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  70095. // returned at all) in error.(*googleapi.Error).Header. Use
  70096. // googleapi.IsNotModified to check whether the returned error was
  70097. // because http.StatusNotModified was returned.
  70098. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  70099. gensupport.SetOptions(c.urlParams_, opts...)
  70100. res, err := c.doRequest("json")
  70101. if res != nil && res.StatusCode == http.StatusNotModified {
  70102. if res.Body != nil {
  70103. res.Body.Close()
  70104. }
  70105. return nil, &googleapi.Error{
  70106. Code: res.StatusCode,
  70107. Header: res.Header,
  70108. }
  70109. }
  70110. if err != nil {
  70111. return nil, err
  70112. }
  70113. defer googleapi.CloseBody(res)
  70114. if err := googleapi.CheckResponse(res); err != nil {
  70115. return nil, err
  70116. }
  70117. ret := &NetworkEndpointGroupList{
  70118. ServerResponse: googleapi.ServerResponse{
  70119. Header: res.Header,
  70120. HTTPStatusCode: res.StatusCode,
  70121. },
  70122. }
  70123. target := &ret
  70124. if err := gensupport.DecodeResponse(target, res); err != nil {
  70125. return nil, err
  70126. }
  70127. return ret, nil
  70128. // {
  70129. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  70130. // "httpMethod": "GET",
  70131. // "id": "compute.networkEndpointGroups.list",
  70132. // "parameterOrder": [
  70133. // "project",
  70134. // "zone"
  70135. // ],
  70136. // "parameters": {
  70137. // "filter": {
  70138. // "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).",
  70139. // "location": "query",
  70140. // "type": "string"
  70141. // },
  70142. // "maxResults": {
  70143. // "default": "500",
  70144. // "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)",
  70145. // "format": "uint32",
  70146. // "location": "query",
  70147. // "minimum": "0",
  70148. // "type": "integer"
  70149. // },
  70150. // "orderBy": {
  70151. // "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.",
  70152. // "location": "query",
  70153. // "type": "string"
  70154. // },
  70155. // "pageToken": {
  70156. // "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.",
  70157. // "location": "query",
  70158. // "type": "string"
  70159. // },
  70160. // "project": {
  70161. // "description": "Project ID for this request.",
  70162. // "location": "path",
  70163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70164. // "required": true,
  70165. // "type": "string"
  70166. // },
  70167. // "zone": {
  70168. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  70169. // "location": "path",
  70170. // "required": true,
  70171. // "type": "string"
  70172. // }
  70173. // },
  70174. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  70175. // "response": {
  70176. // "$ref": "NetworkEndpointGroupList"
  70177. // },
  70178. // "scopes": [
  70179. // "https://www.googleapis.com/auth/cloud-platform",
  70180. // "https://www.googleapis.com/auth/compute",
  70181. // "https://www.googleapis.com/auth/compute.readonly"
  70182. // ]
  70183. // }
  70184. }
  70185. // Pages invokes f for each page of results.
  70186. // A non-nil error returned from f will halt the iteration.
  70187. // The provided context supersedes any context provided to the Context method.
  70188. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  70189. c.ctx_ = ctx
  70190. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70191. for {
  70192. x, err := c.Do()
  70193. if err != nil {
  70194. return err
  70195. }
  70196. if err := f(x); err != nil {
  70197. return err
  70198. }
  70199. if x.NextPageToken == "" {
  70200. return nil
  70201. }
  70202. c.PageToken(x.NextPageToken)
  70203. }
  70204. }
  70205. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  70206. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  70207. s *Service
  70208. project string
  70209. zone string
  70210. networkEndpointGroup string
  70211. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  70212. urlParams_ gensupport.URLParams
  70213. ctx_ context.Context
  70214. header_ http.Header
  70215. }
  70216. // ListNetworkEndpoints: Lists the network endpoints in the specified
  70217. // network endpoint group.
  70218. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70219. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70220. c.project = project
  70221. c.zone = zone
  70222. c.networkEndpointGroup = networkEndpointGroup
  70223. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  70224. return c
  70225. }
  70226. // Filter sets the optional parameter "filter": A filter expression that
  70227. // filters resources listed in the response. The expression must specify
  70228. // the field name, a comparison operator, and the value that you want to
  70229. // use for filtering. The value must be a string, a number, or a
  70230. // boolean. The comparison operator must be either =, !=, >, or <.
  70231. //
  70232. // For example, if you are filtering Compute Engine instances, you can
  70233. // exclude instances named example-instance by specifying name !=
  70234. // example-instance.
  70235. //
  70236. // You can also filter nested fields. For example, you could specify
  70237. // scheduling.automaticRestart = false to include instances only if they
  70238. // are not scheduled for automatic restarts. You can use filtering on
  70239. // nested fields to filter based on resource labels.
  70240. //
  70241. // To filter on multiple expressions, provide each separate expression
  70242. // within parentheses. For example, (scheduling.automaticRestart = true)
  70243. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70244. // AND expression. However, you can include AND and OR expressions
  70245. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70246. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70247. // true).
  70248. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70249. c.urlParams_.Set("filter", filter)
  70250. return c
  70251. }
  70252. // MaxResults sets the optional parameter "maxResults": The maximum
  70253. // number of results per page that should be returned. If the number of
  70254. // available results is larger than maxResults, Compute Engine returns a
  70255. // nextPageToken that can be used to get the next page of results in
  70256. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70257. // (Default: 500)
  70258. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70259. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70260. return c
  70261. }
  70262. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70263. // a certain order. By default, results are returned in alphanumerical
  70264. // order based on the resource name.
  70265. //
  70266. // You can also sort results in descending order based on the creation
  70267. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70268. // based on the creationTimestamp field in reverse chronological order
  70269. // (newest result first). Use this to sort resources like operations so
  70270. // that the newest operation is returned first.
  70271. //
  70272. // Currently, only sorting by name or creationTimestamp desc is
  70273. // supported.
  70274. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70275. c.urlParams_.Set("orderBy", orderBy)
  70276. return c
  70277. }
  70278. // PageToken sets the optional parameter "pageToken": Specifies a page
  70279. // token to use. Set pageToken to the nextPageToken returned by a
  70280. // previous list request to get the next page of results.
  70281. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70282. c.urlParams_.Set("pageToken", pageToken)
  70283. return c
  70284. }
  70285. // Fields allows partial responses to be retrieved. See
  70286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70287. // for more information.
  70288. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70290. return c
  70291. }
  70292. // Context sets the context to be used in this call's Do method. Any
  70293. // pending HTTP request will be aborted if the provided context is
  70294. // canceled.
  70295. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  70296. c.ctx_ = ctx
  70297. return c
  70298. }
  70299. // Header returns an http.Header that can be modified by the caller to
  70300. // add HTTP headers to the request.
  70301. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  70302. if c.header_ == nil {
  70303. c.header_ = make(http.Header)
  70304. }
  70305. return c.header_
  70306. }
  70307. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  70308. reqHeaders := make(http.Header)
  70309. for k, v := range c.header_ {
  70310. reqHeaders[k] = v
  70311. }
  70312. reqHeaders.Set("User-Agent", c.s.userAgent())
  70313. var body io.Reader = nil
  70314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  70315. if err != nil {
  70316. return nil, err
  70317. }
  70318. reqHeaders.Set("Content-Type", "application/json")
  70319. c.urlParams_.Set("alt", alt)
  70320. c.urlParams_.Set("prettyPrint", "false")
  70321. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  70322. urls += "?" + c.urlParams_.Encode()
  70323. req, err := http.NewRequest("POST", urls, body)
  70324. if err != nil {
  70325. return nil, err
  70326. }
  70327. req.Header = reqHeaders
  70328. googleapi.Expand(req.URL, map[string]string{
  70329. "project": c.project,
  70330. "zone": c.zone,
  70331. "networkEndpointGroup": c.networkEndpointGroup,
  70332. })
  70333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70334. }
  70335. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  70336. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  70337. // will be non-nil. Any non-2xx status code is an error. Response
  70338. // headers are in either
  70339. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  70340. // (if a response was returned at all) in
  70341. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  70342. // whether the returned error was because http.StatusNotModified was
  70343. // returned.
  70344. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  70345. gensupport.SetOptions(c.urlParams_, opts...)
  70346. res, err := c.doRequest("json")
  70347. if res != nil && res.StatusCode == http.StatusNotModified {
  70348. if res.Body != nil {
  70349. res.Body.Close()
  70350. }
  70351. return nil, &googleapi.Error{
  70352. Code: res.StatusCode,
  70353. Header: res.Header,
  70354. }
  70355. }
  70356. if err != nil {
  70357. return nil, err
  70358. }
  70359. defer googleapi.CloseBody(res)
  70360. if err := googleapi.CheckResponse(res); err != nil {
  70361. return nil, err
  70362. }
  70363. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  70364. ServerResponse: googleapi.ServerResponse{
  70365. Header: res.Header,
  70366. HTTPStatusCode: res.StatusCode,
  70367. },
  70368. }
  70369. target := &ret
  70370. if err := gensupport.DecodeResponse(target, res); err != nil {
  70371. return nil, err
  70372. }
  70373. return ret, nil
  70374. // {
  70375. // "description": "Lists the network endpoints in the specified network endpoint group.",
  70376. // "httpMethod": "POST",
  70377. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  70378. // "parameterOrder": [
  70379. // "project",
  70380. // "zone",
  70381. // "networkEndpointGroup"
  70382. // ],
  70383. // "parameters": {
  70384. // "filter": {
  70385. // "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).",
  70386. // "location": "query",
  70387. // "type": "string"
  70388. // },
  70389. // "maxResults": {
  70390. // "default": "500",
  70391. // "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)",
  70392. // "format": "uint32",
  70393. // "location": "query",
  70394. // "minimum": "0",
  70395. // "type": "integer"
  70396. // },
  70397. // "networkEndpointGroup": {
  70398. // "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.",
  70399. // "location": "path",
  70400. // "required": true,
  70401. // "type": "string"
  70402. // },
  70403. // "orderBy": {
  70404. // "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.",
  70405. // "location": "query",
  70406. // "type": "string"
  70407. // },
  70408. // "pageToken": {
  70409. // "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.",
  70410. // "location": "query",
  70411. // "type": "string"
  70412. // },
  70413. // "project": {
  70414. // "description": "Project ID for this request.",
  70415. // "location": "path",
  70416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70417. // "required": true,
  70418. // "type": "string"
  70419. // },
  70420. // "zone": {
  70421. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  70422. // "location": "path",
  70423. // "required": true,
  70424. // "type": "string"
  70425. // }
  70426. // },
  70427. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  70428. // "request": {
  70429. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  70430. // },
  70431. // "response": {
  70432. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  70433. // },
  70434. // "scopes": [
  70435. // "https://www.googleapis.com/auth/cloud-platform",
  70436. // "https://www.googleapis.com/auth/compute",
  70437. // "https://www.googleapis.com/auth/compute.readonly"
  70438. // ]
  70439. // }
  70440. }
  70441. // Pages invokes f for each page of results.
  70442. // A non-nil error returned from f will halt the iteration.
  70443. // The provided context supersedes any context provided to the Context method.
  70444. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  70445. c.ctx_ = ctx
  70446. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70447. for {
  70448. x, err := c.Do()
  70449. if err != nil {
  70450. return err
  70451. }
  70452. if err := f(x); err != nil {
  70453. return err
  70454. }
  70455. if x.NextPageToken == "" {
  70456. return nil
  70457. }
  70458. c.PageToken(x.NextPageToken)
  70459. }
  70460. }
  70461. // method id "compute.networkEndpointGroups.testIamPermissions":
  70462. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  70463. s *Service
  70464. project string
  70465. zone string
  70466. resource string
  70467. testpermissionsrequest *TestPermissionsRequest
  70468. urlParams_ gensupport.URLParams
  70469. ctx_ context.Context
  70470. header_ http.Header
  70471. }
  70472. // TestIamPermissions: Returns permissions that a caller has on the
  70473. // specified resource.
  70474. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  70475. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70476. c.project = project
  70477. c.zone = zone
  70478. c.resource = resource
  70479. c.testpermissionsrequest = testpermissionsrequest
  70480. return c
  70481. }
  70482. // Fields allows partial responses to be retrieved. See
  70483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70484. // for more information.
  70485. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  70486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70487. return c
  70488. }
  70489. // Context sets the context to be used in this call's Do method. Any
  70490. // pending HTTP request will be aborted if the provided context is
  70491. // canceled.
  70492. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  70493. c.ctx_ = ctx
  70494. return c
  70495. }
  70496. // Header returns an http.Header that can be modified by the caller to
  70497. // add HTTP headers to the request.
  70498. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  70499. if c.header_ == nil {
  70500. c.header_ = make(http.Header)
  70501. }
  70502. return c.header_
  70503. }
  70504. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  70505. reqHeaders := make(http.Header)
  70506. for k, v := range c.header_ {
  70507. reqHeaders[k] = v
  70508. }
  70509. reqHeaders.Set("User-Agent", c.s.userAgent())
  70510. var body io.Reader = nil
  70511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  70512. if err != nil {
  70513. return nil, err
  70514. }
  70515. reqHeaders.Set("Content-Type", "application/json")
  70516. c.urlParams_.Set("alt", alt)
  70517. c.urlParams_.Set("prettyPrint", "false")
  70518. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  70519. urls += "?" + c.urlParams_.Encode()
  70520. req, err := http.NewRequest("POST", urls, body)
  70521. if err != nil {
  70522. return nil, err
  70523. }
  70524. req.Header = reqHeaders
  70525. googleapi.Expand(req.URL, map[string]string{
  70526. "project": c.project,
  70527. "zone": c.zone,
  70528. "resource": c.resource,
  70529. })
  70530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70531. }
  70532. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  70533. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  70534. // non-2xx status code is an error. Response headers are in either
  70535. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  70536. // returned at all) in error.(*googleapi.Error).Header. Use
  70537. // googleapi.IsNotModified to check whether the returned error was
  70538. // because http.StatusNotModified was returned.
  70539. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  70540. gensupport.SetOptions(c.urlParams_, opts...)
  70541. res, err := c.doRequest("json")
  70542. if res != nil && res.StatusCode == http.StatusNotModified {
  70543. if res.Body != nil {
  70544. res.Body.Close()
  70545. }
  70546. return nil, &googleapi.Error{
  70547. Code: res.StatusCode,
  70548. Header: res.Header,
  70549. }
  70550. }
  70551. if err != nil {
  70552. return nil, err
  70553. }
  70554. defer googleapi.CloseBody(res)
  70555. if err := googleapi.CheckResponse(res); err != nil {
  70556. return nil, err
  70557. }
  70558. ret := &TestPermissionsResponse{
  70559. ServerResponse: googleapi.ServerResponse{
  70560. Header: res.Header,
  70561. HTTPStatusCode: res.StatusCode,
  70562. },
  70563. }
  70564. target := &ret
  70565. if err := gensupport.DecodeResponse(target, res); err != nil {
  70566. return nil, err
  70567. }
  70568. return ret, nil
  70569. // {
  70570. // "description": "Returns permissions that a caller has on the specified resource.",
  70571. // "httpMethod": "POST",
  70572. // "id": "compute.networkEndpointGroups.testIamPermissions",
  70573. // "parameterOrder": [
  70574. // "project",
  70575. // "zone",
  70576. // "resource"
  70577. // ],
  70578. // "parameters": {
  70579. // "project": {
  70580. // "description": "Project ID for this request.",
  70581. // "location": "path",
  70582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70583. // "required": true,
  70584. // "type": "string"
  70585. // },
  70586. // "resource": {
  70587. // "description": "Name or id of the resource for this request.",
  70588. // "location": "path",
  70589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70590. // "required": true,
  70591. // "type": "string"
  70592. // },
  70593. // "zone": {
  70594. // "description": "The name of the zone for this request.",
  70595. // "location": "path",
  70596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70597. // "required": true,
  70598. // "type": "string"
  70599. // }
  70600. // },
  70601. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  70602. // "request": {
  70603. // "$ref": "TestPermissionsRequest"
  70604. // },
  70605. // "response": {
  70606. // "$ref": "TestPermissionsResponse"
  70607. // },
  70608. // "scopes": [
  70609. // "https://www.googleapis.com/auth/cloud-platform",
  70610. // "https://www.googleapis.com/auth/compute",
  70611. // "https://www.googleapis.com/auth/compute.readonly"
  70612. // ]
  70613. // }
  70614. }
  70615. // method id "compute.networks.addPeering":
  70616. type NetworksAddPeeringCall struct {
  70617. s *Service
  70618. project string
  70619. network string
  70620. networksaddpeeringrequest *NetworksAddPeeringRequest
  70621. urlParams_ gensupport.URLParams
  70622. ctx_ context.Context
  70623. header_ http.Header
  70624. }
  70625. // AddPeering: Adds a peering to the specified network.
  70626. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  70627. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70628. c.project = project
  70629. c.network = network
  70630. c.networksaddpeeringrequest = networksaddpeeringrequest
  70631. return c
  70632. }
  70633. // RequestId sets the optional parameter "requestId": An optional
  70634. // request ID to identify requests. Specify a unique request ID so that
  70635. // if you must retry your request, the server will know to ignore the
  70636. // request if it has already been completed.
  70637. //
  70638. // For example, consider a situation where you make an initial request
  70639. // and the request times out. If you make the request again with the
  70640. // same request ID, the server can check if original operation with the
  70641. // same request ID was received, and if so, will ignore the second
  70642. // request. This prevents clients from accidentally creating duplicate
  70643. // commitments.
  70644. //
  70645. // The request ID must be a valid UUID with the exception that zero UUID
  70646. // is not supported (00000000-0000-0000-0000-000000000000).
  70647. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  70648. c.urlParams_.Set("requestId", requestId)
  70649. return c
  70650. }
  70651. // Fields allows partial responses to be retrieved. See
  70652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70653. // for more information.
  70654. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  70655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70656. return c
  70657. }
  70658. // Context sets the context to be used in this call's Do method. Any
  70659. // pending HTTP request will be aborted if the provided context is
  70660. // canceled.
  70661. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  70662. c.ctx_ = ctx
  70663. return c
  70664. }
  70665. // Header returns an http.Header that can be modified by the caller to
  70666. // add HTTP headers to the request.
  70667. func (c *NetworksAddPeeringCall) Header() http.Header {
  70668. if c.header_ == nil {
  70669. c.header_ = make(http.Header)
  70670. }
  70671. return c.header_
  70672. }
  70673. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  70674. reqHeaders := make(http.Header)
  70675. for k, v := range c.header_ {
  70676. reqHeaders[k] = v
  70677. }
  70678. reqHeaders.Set("User-Agent", c.s.userAgent())
  70679. var body io.Reader = nil
  70680. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  70681. if err != nil {
  70682. return nil, err
  70683. }
  70684. reqHeaders.Set("Content-Type", "application/json")
  70685. c.urlParams_.Set("alt", alt)
  70686. c.urlParams_.Set("prettyPrint", "false")
  70687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  70688. urls += "?" + c.urlParams_.Encode()
  70689. req, err := http.NewRequest("POST", urls, body)
  70690. if err != nil {
  70691. return nil, err
  70692. }
  70693. req.Header = reqHeaders
  70694. googleapi.Expand(req.URL, map[string]string{
  70695. "project": c.project,
  70696. "network": c.network,
  70697. })
  70698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70699. }
  70700. // Do executes the "compute.networks.addPeering" call.
  70701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70702. // status code is an error. Response headers are in either
  70703. // *Operation.ServerResponse.Header or (if a response was returned at
  70704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70705. // to check whether the returned error was because
  70706. // http.StatusNotModified was returned.
  70707. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70708. gensupport.SetOptions(c.urlParams_, opts...)
  70709. res, err := c.doRequest("json")
  70710. if res != nil && res.StatusCode == http.StatusNotModified {
  70711. if res.Body != nil {
  70712. res.Body.Close()
  70713. }
  70714. return nil, &googleapi.Error{
  70715. Code: res.StatusCode,
  70716. Header: res.Header,
  70717. }
  70718. }
  70719. if err != nil {
  70720. return nil, err
  70721. }
  70722. defer googleapi.CloseBody(res)
  70723. if err := googleapi.CheckResponse(res); err != nil {
  70724. return nil, err
  70725. }
  70726. ret := &Operation{
  70727. ServerResponse: googleapi.ServerResponse{
  70728. Header: res.Header,
  70729. HTTPStatusCode: res.StatusCode,
  70730. },
  70731. }
  70732. target := &ret
  70733. if err := gensupport.DecodeResponse(target, res); err != nil {
  70734. return nil, err
  70735. }
  70736. return ret, nil
  70737. // {
  70738. // "description": "Adds a peering to the specified network.",
  70739. // "httpMethod": "POST",
  70740. // "id": "compute.networks.addPeering",
  70741. // "parameterOrder": [
  70742. // "project",
  70743. // "network"
  70744. // ],
  70745. // "parameters": {
  70746. // "network": {
  70747. // "description": "Name of the network resource to add peering to.",
  70748. // "location": "path",
  70749. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70750. // "required": true,
  70751. // "type": "string"
  70752. // },
  70753. // "project": {
  70754. // "description": "Project ID for this request.",
  70755. // "location": "path",
  70756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70757. // "required": true,
  70758. // "type": "string"
  70759. // },
  70760. // "requestId": {
  70761. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70762. // "location": "query",
  70763. // "type": "string"
  70764. // }
  70765. // },
  70766. // "path": "{project}/global/networks/{network}/addPeering",
  70767. // "request": {
  70768. // "$ref": "NetworksAddPeeringRequest"
  70769. // },
  70770. // "response": {
  70771. // "$ref": "Operation"
  70772. // },
  70773. // "scopes": [
  70774. // "https://www.googleapis.com/auth/cloud-platform",
  70775. // "https://www.googleapis.com/auth/compute"
  70776. // ]
  70777. // }
  70778. }
  70779. // method id "compute.networks.delete":
  70780. type NetworksDeleteCall struct {
  70781. s *Service
  70782. project string
  70783. network string
  70784. urlParams_ gensupport.URLParams
  70785. ctx_ context.Context
  70786. header_ http.Header
  70787. }
  70788. // Delete: Deletes the specified network.
  70789. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  70790. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  70791. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70792. c.project = project
  70793. c.network = network
  70794. return c
  70795. }
  70796. // RequestId sets the optional parameter "requestId": An optional
  70797. // request ID to identify requests. Specify a unique request ID so that
  70798. // if you must retry your request, the server will know to ignore the
  70799. // request if it has already been completed.
  70800. //
  70801. // For example, consider a situation where you make an initial request
  70802. // and the request times out. If you make the request again with the
  70803. // same request ID, the server can check if original operation with the
  70804. // same request ID was received, and if so, will ignore the second
  70805. // request. This prevents clients from accidentally creating duplicate
  70806. // commitments.
  70807. //
  70808. // The request ID must be a valid UUID with the exception that zero UUID
  70809. // is not supported (00000000-0000-0000-0000-000000000000).
  70810. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  70811. c.urlParams_.Set("requestId", requestId)
  70812. return c
  70813. }
  70814. // Fields allows partial responses to be retrieved. See
  70815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70816. // for more information.
  70817. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  70818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70819. return c
  70820. }
  70821. // Context sets the context to be used in this call's Do method. Any
  70822. // pending HTTP request will be aborted if the provided context is
  70823. // canceled.
  70824. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  70825. c.ctx_ = ctx
  70826. return c
  70827. }
  70828. // Header returns an http.Header that can be modified by the caller to
  70829. // add HTTP headers to the request.
  70830. func (c *NetworksDeleteCall) Header() http.Header {
  70831. if c.header_ == nil {
  70832. c.header_ = make(http.Header)
  70833. }
  70834. return c.header_
  70835. }
  70836. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  70837. reqHeaders := make(http.Header)
  70838. for k, v := range c.header_ {
  70839. reqHeaders[k] = v
  70840. }
  70841. reqHeaders.Set("User-Agent", c.s.userAgent())
  70842. var body io.Reader = nil
  70843. c.urlParams_.Set("alt", alt)
  70844. c.urlParams_.Set("prettyPrint", "false")
  70845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  70846. urls += "?" + c.urlParams_.Encode()
  70847. req, err := http.NewRequest("DELETE", urls, body)
  70848. if err != nil {
  70849. return nil, err
  70850. }
  70851. req.Header = reqHeaders
  70852. googleapi.Expand(req.URL, map[string]string{
  70853. "project": c.project,
  70854. "network": c.network,
  70855. })
  70856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70857. }
  70858. // Do executes the "compute.networks.delete" call.
  70859. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70860. // status code is an error. Response headers are in either
  70861. // *Operation.ServerResponse.Header or (if a response was returned at
  70862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70863. // to check whether the returned error was because
  70864. // http.StatusNotModified was returned.
  70865. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70866. gensupport.SetOptions(c.urlParams_, opts...)
  70867. res, err := c.doRequest("json")
  70868. if res != nil && res.StatusCode == http.StatusNotModified {
  70869. if res.Body != nil {
  70870. res.Body.Close()
  70871. }
  70872. return nil, &googleapi.Error{
  70873. Code: res.StatusCode,
  70874. Header: res.Header,
  70875. }
  70876. }
  70877. if err != nil {
  70878. return nil, err
  70879. }
  70880. defer googleapi.CloseBody(res)
  70881. if err := googleapi.CheckResponse(res); err != nil {
  70882. return nil, err
  70883. }
  70884. ret := &Operation{
  70885. ServerResponse: googleapi.ServerResponse{
  70886. Header: res.Header,
  70887. HTTPStatusCode: res.StatusCode,
  70888. },
  70889. }
  70890. target := &ret
  70891. if err := gensupport.DecodeResponse(target, res); err != nil {
  70892. return nil, err
  70893. }
  70894. return ret, nil
  70895. // {
  70896. // "description": "Deletes the specified network.",
  70897. // "httpMethod": "DELETE",
  70898. // "id": "compute.networks.delete",
  70899. // "parameterOrder": [
  70900. // "project",
  70901. // "network"
  70902. // ],
  70903. // "parameters": {
  70904. // "network": {
  70905. // "description": "Name of the network to delete.",
  70906. // "location": "path",
  70907. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70908. // "required": true,
  70909. // "type": "string"
  70910. // },
  70911. // "project": {
  70912. // "description": "Project ID for this request.",
  70913. // "location": "path",
  70914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70915. // "required": true,
  70916. // "type": "string"
  70917. // },
  70918. // "requestId": {
  70919. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70920. // "location": "query",
  70921. // "type": "string"
  70922. // }
  70923. // },
  70924. // "path": "{project}/global/networks/{network}",
  70925. // "response": {
  70926. // "$ref": "Operation"
  70927. // },
  70928. // "scopes": [
  70929. // "https://www.googleapis.com/auth/cloud-platform",
  70930. // "https://www.googleapis.com/auth/compute"
  70931. // ]
  70932. // }
  70933. }
  70934. // method id "compute.networks.get":
  70935. type NetworksGetCall struct {
  70936. s *Service
  70937. project string
  70938. network string
  70939. urlParams_ gensupport.URLParams
  70940. ifNoneMatch_ string
  70941. ctx_ context.Context
  70942. header_ http.Header
  70943. }
  70944. // Get: Returns the specified network. Gets a list of available networks
  70945. // by making a list() request.
  70946. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  70947. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  70948. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70949. c.project = project
  70950. c.network = network
  70951. return c
  70952. }
  70953. // Fields allows partial responses to be retrieved. See
  70954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70955. // for more information.
  70956. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  70957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70958. return c
  70959. }
  70960. // IfNoneMatch sets the optional parameter which makes the operation
  70961. // fail if the object's ETag matches the given value. This is useful for
  70962. // getting updates only after the object has changed since the last
  70963. // request. Use googleapi.IsNotModified to check whether the response
  70964. // error from Do is the result of In-None-Match.
  70965. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  70966. c.ifNoneMatch_ = entityTag
  70967. return c
  70968. }
  70969. // Context sets the context to be used in this call's Do method. Any
  70970. // pending HTTP request will be aborted if the provided context is
  70971. // canceled.
  70972. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  70973. c.ctx_ = ctx
  70974. return c
  70975. }
  70976. // Header returns an http.Header that can be modified by the caller to
  70977. // add HTTP headers to the request.
  70978. func (c *NetworksGetCall) Header() http.Header {
  70979. if c.header_ == nil {
  70980. c.header_ = make(http.Header)
  70981. }
  70982. return c.header_
  70983. }
  70984. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  70985. reqHeaders := make(http.Header)
  70986. for k, v := range c.header_ {
  70987. reqHeaders[k] = v
  70988. }
  70989. reqHeaders.Set("User-Agent", c.s.userAgent())
  70990. if c.ifNoneMatch_ != "" {
  70991. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70992. }
  70993. var body io.Reader = nil
  70994. c.urlParams_.Set("alt", alt)
  70995. c.urlParams_.Set("prettyPrint", "false")
  70996. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  70997. urls += "?" + c.urlParams_.Encode()
  70998. req, err := http.NewRequest("GET", urls, body)
  70999. if err != nil {
  71000. return nil, err
  71001. }
  71002. req.Header = reqHeaders
  71003. googleapi.Expand(req.URL, map[string]string{
  71004. "project": c.project,
  71005. "network": c.network,
  71006. })
  71007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71008. }
  71009. // Do executes the "compute.networks.get" call.
  71010. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  71011. // code is an error. Response headers are in either
  71012. // *Network.ServerResponse.Header or (if a response was returned at all)
  71013. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71014. // check whether the returned error was because http.StatusNotModified
  71015. // was returned.
  71016. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  71017. gensupport.SetOptions(c.urlParams_, opts...)
  71018. res, err := c.doRequest("json")
  71019. if res != nil && res.StatusCode == http.StatusNotModified {
  71020. if res.Body != nil {
  71021. res.Body.Close()
  71022. }
  71023. return nil, &googleapi.Error{
  71024. Code: res.StatusCode,
  71025. Header: res.Header,
  71026. }
  71027. }
  71028. if err != nil {
  71029. return nil, err
  71030. }
  71031. defer googleapi.CloseBody(res)
  71032. if err := googleapi.CheckResponse(res); err != nil {
  71033. return nil, err
  71034. }
  71035. ret := &Network{
  71036. ServerResponse: googleapi.ServerResponse{
  71037. Header: res.Header,
  71038. HTTPStatusCode: res.StatusCode,
  71039. },
  71040. }
  71041. target := &ret
  71042. if err := gensupport.DecodeResponse(target, res); err != nil {
  71043. return nil, err
  71044. }
  71045. return ret, nil
  71046. // {
  71047. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  71048. // "httpMethod": "GET",
  71049. // "id": "compute.networks.get",
  71050. // "parameterOrder": [
  71051. // "project",
  71052. // "network"
  71053. // ],
  71054. // "parameters": {
  71055. // "network": {
  71056. // "description": "Name of the network to return.",
  71057. // "location": "path",
  71058. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71059. // "required": true,
  71060. // "type": "string"
  71061. // },
  71062. // "project": {
  71063. // "description": "Project ID for this request.",
  71064. // "location": "path",
  71065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71066. // "required": true,
  71067. // "type": "string"
  71068. // }
  71069. // },
  71070. // "path": "{project}/global/networks/{network}",
  71071. // "response": {
  71072. // "$ref": "Network"
  71073. // },
  71074. // "scopes": [
  71075. // "https://www.googleapis.com/auth/cloud-platform",
  71076. // "https://www.googleapis.com/auth/compute",
  71077. // "https://www.googleapis.com/auth/compute.readonly"
  71078. // ]
  71079. // }
  71080. }
  71081. // method id "compute.networks.insert":
  71082. type NetworksInsertCall struct {
  71083. s *Service
  71084. project string
  71085. network *Network
  71086. urlParams_ gensupport.URLParams
  71087. ctx_ context.Context
  71088. header_ http.Header
  71089. }
  71090. // Insert: Creates a network in the specified project using the data
  71091. // included in the request.
  71092. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  71093. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  71094. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71095. c.project = project
  71096. c.network = network
  71097. return c
  71098. }
  71099. // RequestId sets the optional parameter "requestId": An optional
  71100. // request ID to identify requests. Specify a unique request ID so that
  71101. // if you must retry your request, the server will know to ignore the
  71102. // request if it has already been completed.
  71103. //
  71104. // For example, consider a situation where you make an initial request
  71105. // and the request times out. If you make the request again with the
  71106. // same request ID, the server can check if original operation with the
  71107. // same request ID was received, and if so, will ignore the second
  71108. // request. This prevents clients from accidentally creating duplicate
  71109. // commitments.
  71110. //
  71111. // The request ID must be a valid UUID with the exception that zero UUID
  71112. // is not supported (00000000-0000-0000-0000-000000000000).
  71113. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  71114. c.urlParams_.Set("requestId", requestId)
  71115. return c
  71116. }
  71117. // Fields allows partial responses to be retrieved. See
  71118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71119. // for more information.
  71120. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  71121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71122. return c
  71123. }
  71124. // Context sets the context to be used in this call's Do method. Any
  71125. // pending HTTP request will be aborted if the provided context is
  71126. // canceled.
  71127. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  71128. c.ctx_ = ctx
  71129. return c
  71130. }
  71131. // Header returns an http.Header that can be modified by the caller to
  71132. // add HTTP headers to the request.
  71133. func (c *NetworksInsertCall) Header() http.Header {
  71134. if c.header_ == nil {
  71135. c.header_ = make(http.Header)
  71136. }
  71137. return c.header_
  71138. }
  71139. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  71140. reqHeaders := make(http.Header)
  71141. for k, v := range c.header_ {
  71142. reqHeaders[k] = v
  71143. }
  71144. reqHeaders.Set("User-Agent", c.s.userAgent())
  71145. var body io.Reader = nil
  71146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  71147. if err != nil {
  71148. return nil, err
  71149. }
  71150. reqHeaders.Set("Content-Type", "application/json")
  71151. c.urlParams_.Set("alt", alt)
  71152. c.urlParams_.Set("prettyPrint", "false")
  71153. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  71154. urls += "?" + c.urlParams_.Encode()
  71155. req, err := http.NewRequest("POST", urls, body)
  71156. if err != nil {
  71157. return nil, err
  71158. }
  71159. req.Header = reqHeaders
  71160. googleapi.Expand(req.URL, map[string]string{
  71161. "project": c.project,
  71162. })
  71163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71164. }
  71165. // Do executes the "compute.networks.insert" call.
  71166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71167. // status code is an error. Response headers are in either
  71168. // *Operation.ServerResponse.Header or (if a response was returned at
  71169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71170. // to check whether the returned error was because
  71171. // http.StatusNotModified was returned.
  71172. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71173. gensupport.SetOptions(c.urlParams_, opts...)
  71174. res, err := c.doRequest("json")
  71175. if res != nil && res.StatusCode == http.StatusNotModified {
  71176. if res.Body != nil {
  71177. res.Body.Close()
  71178. }
  71179. return nil, &googleapi.Error{
  71180. Code: res.StatusCode,
  71181. Header: res.Header,
  71182. }
  71183. }
  71184. if err != nil {
  71185. return nil, err
  71186. }
  71187. defer googleapi.CloseBody(res)
  71188. if err := googleapi.CheckResponse(res); err != nil {
  71189. return nil, err
  71190. }
  71191. ret := &Operation{
  71192. ServerResponse: googleapi.ServerResponse{
  71193. Header: res.Header,
  71194. HTTPStatusCode: res.StatusCode,
  71195. },
  71196. }
  71197. target := &ret
  71198. if err := gensupport.DecodeResponse(target, res); err != nil {
  71199. return nil, err
  71200. }
  71201. return ret, nil
  71202. // {
  71203. // "description": "Creates a network in the specified project using the data included in the request.",
  71204. // "httpMethod": "POST",
  71205. // "id": "compute.networks.insert",
  71206. // "parameterOrder": [
  71207. // "project"
  71208. // ],
  71209. // "parameters": {
  71210. // "project": {
  71211. // "description": "Project ID for this request.",
  71212. // "location": "path",
  71213. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71214. // "required": true,
  71215. // "type": "string"
  71216. // },
  71217. // "requestId": {
  71218. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71219. // "location": "query",
  71220. // "type": "string"
  71221. // }
  71222. // },
  71223. // "path": "{project}/global/networks",
  71224. // "request": {
  71225. // "$ref": "Network"
  71226. // },
  71227. // "response": {
  71228. // "$ref": "Operation"
  71229. // },
  71230. // "scopes": [
  71231. // "https://www.googleapis.com/auth/cloud-platform",
  71232. // "https://www.googleapis.com/auth/compute"
  71233. // ]
  71234. // }
  71235. }
  71236. // method id "compute.networks.list":
  71237. type NetworksListCall struct {
  71238. s *Service
  71239. project string
  71240. urlParams_ gensupport.URLParams
  71241. ifNoneMatch_ string
  71242. ctx_ context.Context
  71243. header_ http.Header
  71244. }
  71245. // List: Retrieves the list of networks available to the specified
  71246. // project.
  71247. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  71248. func (r *NetworksService) List(project string) *NetworksListCall {
  71249. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71250. c.project = project
  71251. return c
  71252. }
  71253. // Filter sets the optional parameter "filter": A filter expression that
  71254. // filters resources listed in the response. The expression must specify
  71255. // the field name, a comparison operator, and the value that you want to
  71256. // use for filtering. The value must be a string, a number, or a
  71257. // boolean. The comparison operator must be either =, !=, >, or <.
  71258. //
  71259. // For example, if you are filtering Compute Engine instances, you can
  71260. // exclude instances named example-instance by specifying name !=
  71261. // example-instance.
  71262. //
  71263. // You can also filter nested fields. For example, you could specify
  71264. // scheduling.automaticRestart = false to include instances only if they
  71265. // are not scheduled for automatic restarts. You can use filtering on
  71266. // nested fields to filter based on resource labels.
  71267. //
  71268. // To filter on multiple expressions, provide each separate expression
  71269. // within parentheses. For example, (scheduling.automaticRestart = true)
  71270. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71271. // AND expression. However, you can include AND and OR expressions
  71272. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71273. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71274. // true).
  71275. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  71276. c.urlParams_.Set("filter", filter)
  71277. return c
  71278. }
  71279. // MaxResults sets the optional parameter "maxResults": The maximum
  71280. // number of results per page that should be returned. If the number of
  71281. // available results is larger than maxResults, Compute Engine returns a
  71282. // nextPageToken that can be used to get the next page of results in
  71283. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71284. // (Default: 500)
  71285. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  71286. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71287. return c
  71288. }
  71289. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71290. // a certain order. By default, results are returned in alphanumerical
  71291. // order based on the resource name.
  71292. //
  71293. // You can also sort results in descending order based on the creation
  71294. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71295. // based on the creationTimestamp field in reverse chronological order
  71296. // (newest result first). Use this to sort resources like operations so
  71297. // that the newest operation is returned first.
  71298. //
  71299. // Currently, only sorting by name or creationTimestamp desc is
  71300. // supported.
  71301. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  71302. c.urlParams_.Set("orderBy", orderBy)
  71303. return c
  71304. }
  71305. // PageToken sets the optional parameter "pageToken": Specifies a page
  71306. // token to use. Set pageToken to the nextPageToken returned by a
  71307. // previous list request to get the next page of results.
  71308. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  71309. c.urlParams_.Set("pageToken", pageToken)
  71310. return c
  71311. }
  71312. // Fields allows partial responses to be retrieved. See
  71313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71314. // for more information.
  71315. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  71316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71317. return c
  71318. }
  71319. // IfNoneMatch sets the optional parameter which makes the operation
  71320. // fail if the object's ETag matches the given value. This is useful for
  71321. // getting updates only after the object has changed since the last
  71322. // request. Use googleapi.IsNotModified to check whether the response
  71323. // error from Do is the result of In-None-Match.
  71324. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  71325. c.ifNoneMatch_ = entityTag
  71326. return c
  71327. }
  71328. // Context sets the context to be used in this call's Do method. Any
  71329. // pending HTTP request will be aborted if the provided context is
  71330. // canceled.
  71331. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  71332. c.ctx_ = ctx
  71333. return c
  71334. }
  71335. // Header returns an http.Header that can be modified by the caller to
  71336. // add HTTP headers to the request.
  71337. func (c *NetworksListCall) Header() http.Header {
  71338. if c.header_ == nil {
  71339. c.header_ = make(http.Header)
  71340. }
  71341. return c.header_
  71342. }
  71343. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  71344. reqHeaders := make(http.Header)
  71345. for k, v := range c.header_ {
  71346. reqHeaders[k] = v
  71347. }
  71348. reqHeaders.Set("User-Agent", c.s.userAgent())
  71349. if c.ifNoneMatch_ != "" {
  71350. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71351. }
  71352. var body io.Reader = nil
  71353. c.urlParams_.Set("alt", alt)
  71354. c.urlParams_.Set("prettyPrint", "false")
  71355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  71356. urls += "?" + c.urlParams_.Encode()
  71357. req, err := http.NewRequest("GET", urls, body)
  71358. if err != nil {
  71359. return nil, err
  71360. }
  71361. req.Header = reqHeaders
  71362. googleapi.Expand(req.URL, map[string]string{
  71363. "project": c.project,
  71364. })
  71365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71366. }
  71367. // Do executes the "compute.networks.list" call.
  71368. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  71369. // status code is an error. Response headers are in either
  71370. // *NetworkList.ServerResponse.Header or (if a response was returned at
  71371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71372. // to check whether the returned error was because
  71373. // http.StatusNotModified was returned.
  71374. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  71375. gensupport.SetOptions(c.urlParams_, opts...)
  71376. res, err := c.doRequest("json")
  71377. if res != nil && res.StatusCode == http.StatusNotModified {
  71378. if res.Body != nil {
  71379. res.Body.Close()
  71380. }
  71381. return nil, &googleapi.Error{
  71382. Code: res.StatusCode,
  71383. Header: res.Header,
  71384. }
  71385. }
  71386. if err != nil {
  71387. return nil, err
  71388. }
  71389. defer googleapi.CloseBody(res)
  71390. if err := googleapi.CheckResponse(res); err != nil {
  71391. return nil, err
  71392. }
  71393. ret := &NetworkList{
  71394. ServerResponse: googleapi.ServerResponse{
  71395. Header: res.Header,
  71396. HTTPStatusCode: res.StatusCode,
  71397. },
  71398. }
  71399. target := &ret
  71400. if err := gensupport.DecodeResponse(target, res); err != nil {
  71401. return nil, err
  71402. }
  71403. return ret, nil
  71404. // {
  71405. // "description": "Retrieves the list of networks available to the specified project.",
  71406. // "httpMethod": "GET",
  71407. // "id": "compute.networks.list",
  71408. // "parameterOrder": [
  71409. // "project"
  71410. // ],
  71411. // "parameters": {
  71412. // "filter": {
  71413. // "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).",
  71414. // "location": "query",
  71415. // "type": "string"
  71416. // },
  71417. // "maxResults": {
  71418. // "default": "500",
  71419. // "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)",
  71420. // "format": "uint32",
  71421. // "location": "query",
  71422. // "minimum": "0",
  71423. // "type": "integer"
  71424. // },
  71425. // "orderBy": {
  71426. // "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.",
  71427. // "location": "query",
  71428. // "type": "string"
  71429. // },
  71430. // "pageToken": {
  71431. // "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.",
  71432. // "location": "query",
  71433. // "type": "string"
  71434. // },
  71435. // "project": {
  71436. // "description": "Project ID for this request.",
  71437. // "location": "path",
  71438. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71439. // "required": true,
  71440. // "type": "string"
  71441. // }
  71442. // },
  71443. // "path": "{project}/global/networks",
  71444. // "response": {
  71445. // "$ref": "NetworkList"
  71446. // },
  71447. // "scopes": [
  71448. // "https://www.googleapis.com/auth/cloud-platform",
  71449. // "https://www.googleapis.com/auth/compute",
  71450. // "https://www.googleapis.com/auth/compute.readonly"
  71451. // ]
  71452. // }
  71453. }
  71454. // Pages invokes f for each page of results.
  71455. // A non-nil error returned from f will halt the iteration.
  71456. // The provided context supersedes any context provided to the Context method.
  71457. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  71458. c.ctx_ = ctx
  71459. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71460. for {
  71461. x, err := c.Do()
  71462. if err != nil {
  71463. return err
  71464. }
  71465. if err := f(x); err != nil {
  71466. return err
  71467. }
  71468. if x.NextPageToken == "" {
  71469. return nil
  71470. }
  71471. c.PageToken(x.NextPageToken)
  71472. }
  71473. }
  71474. // method id "compute.networks.listPeeringRoutes":
  71475. type NetworksListPeeringRoutesCall struct {
  71476. s *Service
  71477. project string
  71478. network string
  71479. urlParams_ gensupport.URLParams
  71480. ifNoneMatch_ string
  71481. ctx_ context.Context
  71482. header_ http.Header
  71483. }
  71484. // ListPeeringRoutes: Lists the peering routes exchanged over peering
  71485. // connection.
  71486. func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
  71487. c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71488. c.project = project
  71489. c.network = network
  71490. return c
  71491. }
  71492. // Direction sets the optional parameter "direction": The direction of
  71493. // the exchanged routes.
  71494. //
  71495. // Possible values:
  71496. // "INCOMING"
  71497. // "OUTGOING"
  71498. func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
  71499. c.urlParams_.Set("direction", direction)
  71500. return c
  71501. }
  71502. // Filter sets the optional parameter "filter": A filter expression that
  71503. // filters resources listed in the response. The expression must specify
  71504. // the field name, a comparison operator, and the value that you want to
  71505. // use for filtering. The value must be a string, a number, or a
  71506. // boolean. The comparison operator must be either =, !=, >, or <.
  71507. //
  71508. // For example, if you are filtering Compute Engine instances, you can
  71509. // exclude instances named example-instance by specifying name !=
  71510. // example-instance.
  71511. //
  71512. // You can also filter nested fields. For example, you could specify
  71513. // scheduling.automaticRestart = false to include instances only if they
  71514. // are not scheduled for automatic restarts. You can use filtering on
  71515. // nested fields to filter based on resource labels.
  71516. //
  71517. // To filter on multiple expressions, provide each separate expression
  71518. // within parentheses. For example, (scheduling.automaticRestart = true)
  71519. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71520. // AND expression. However, you can include AND and OR expressions
  71521. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71522. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71523. // true).
  71524. func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
  71525. c.urlParams_.Set("filter", filter)
  71526. return c
  71527. }
  71528. // MaxResults sets the optional parameter "maxResults": The maximum
  71529. // number of results per page that should be returned. If the number of
  71530. // available results is larger than maxResults, Compute Engine returns a
  71531. // nextPageToken that can be used to get the next page of results in
  71532. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71533. // (Default: 500)
  71534. func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
  71535. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71536. return c
  71537. }
  71538. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71539. // a certain order. By default, results are returned in alphanumerical
  71540. // order based on the resource name.
  71541. //
  71542. // You can also sort results in descending order based on the creation
  71543. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71544. // based on the creationTimestamp field in reverse chronological order
  71545. // (newest result first). Use this to sort resources like operations so
  71546. // that the newest operation is returned first.
  71547. //
  71548. // Currently, only sorting by name or creationTimestamp desc is
  71549. // supported.
  71550. func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
  71551. c.urlParams_.Set("orderBy", orderBy)
  71552. return c
  71553. }
  71554. // PageToken sets the optional parameter "pageToken": Specifies a page
  71555. // token to use. Set pageToken to the nextPageToken returned by a
  71556. // previous list request to get the next page of results.
  71557. func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
  71558. c.urlParams_.Set("pageToken", pageToken)
  71559. return c
  71560. }
  71561. // PeeringName sets the optional parameter "peeringName": The response
  71562. // will show routes exchanged over the given peering connection.
  71563. func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
  71564. c.urlParams_.Set("peeringName", peeringName)
  71565. return c
  71566. }
  71567. // Region sets the optional parameter "region": The region of the
  71568. // request. The response will include all subnet routes, static routes
  71569. // and dynamic routes in the region.
  71570. func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
  71571. c.urlParams_.Set("region", region)
  71572. return c
  71573. }
  71574. // Fields allows partial responses to be retrieved. See
  71575. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71576. // for more information.
  71577. func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
  71578. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71579. return c
  71580. }
  71581. // IfNoneMatch sets the optional parameter which makes the operation
  71582. // fail if the object's ETag matches the given value. This is useful for
  71583. // getting updates only after the object has changed since the last
  71584. // request. Use googleapi.IsNotModified to check whether the response
  71585. // error from Do is the result of In-None-Match.
  71586. func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
  71587. c.ifNoneMatch_ = entityTag
  71588. return c
  71589. }
  71590. // Context sets the context to be used in this call's Do method. Any
  71591. // pending HTTP request will be aborted if the provided context is
  71592. // canceled.
  71593. func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
  71594. c.ctx_ = ctx
  71595. return c
  71596. }
  71597. // Header returns an http.Header that can be modified by the caller to
  71598. // add HTTP headers to the request.
  71599. func (c *NetworksListPeeringRoutesCall) Header() http.Header {
  71600. if c.header_ == nil {
  71601. c.header_ = make(http.Header)
  71602. }
  71603. return c.header_
  71604. }
  71605. func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
  71606. reqHeaders := make(http.Header)
  71607. for k, v := range c.header_ {
  71608. reqHeaders[k] = v
  71609. }
  71610. reqHeaders.Set("User-Agent", c.s.userAgent())
  71611. if c.ifNoneMatch_ != "" {
  71612. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71613. }
  71614. var body io.Reader = nil
  71615. c.urlParams_.Set("alt", alt)
  71616. c.urlParams_.Set("prettyPrint", "false")
  71617. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listPeeringRoutes")
  71618. urls += "?" + c.urlParams_.Encode()
  71619. req, err := http.NewRequest("GET", urls, body)
  71620. if err != nil {
  71621. return nil, err
  71622. }
  71623. req.Header = reqHeaders
  71624. googleapi.Expand(req.URL, map[string]string{
  71625. "project": c.project,
  71626. "network": c.network,
  71627. })
  71628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71629. }
  71630. // Do executes the "compute.networks.listPeeringRoutes" call.
  71631. // Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
  71632. // Any non-2xx status code is an error. Response headers are in either
  71633. // *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response
  71634. // was returned at all) in error.(*googleapi.Error).Header. Use
  71635. // googleapi.IsNotModified to check whether the returned error was
  71636. // because http.StatusNotModified was returned.
  71637. func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) {
  71638. gensupport.SetOptions(c.urlParams_, opts...)
  71639. res, err := c.doRequest("json")
  71640. if res != nil && res.StatusCode == http.StatusNotModified {
  71641. if res.Body != nil {
  71642. res.Body.Close()
  71643. }
  71644. return nil, &googleapi.Error{
  71645. Code: res.StatusCode,
  71646. Header: res.Header,
  71647. }
  71648. }
  71649. if err != nil {
  71650. return nil, err
  71651. }
  71652. defer googleapi.CloseBody(res)
  71653. if err := googleapi.CheckResponse(res); err != nil {
  71654. return nil, err
  71655. }
  71656. ret := &ExchangedPeeringRoutesList{
  71657. ServerResponse: googleapi.ServerResponse{
  71658. Header: res.Header,
  71659. HTTPStatusCode: res.StatusCode,
  71660. },
  71661. }
  71662. target := &ret
  71663. if err := gensupport.DecodeResponse(target, res); err != nil {
  71664. return nil, err
  71665. }
  71666. return ret, nil
  71667. // {
  71668. // "description": "Lists the peering routes exchanged over peering connection.",
  71669. // "httpMethod": "GET",
  71670. // "id": "compute.networks.listPeeringRoutes",
  71671. // "parameterOrder": [
  71672. // "project",
  71673. // "network"
  71674. // ],
  71675. // "parameters": {
  71676. // "direction": {
  71677. // "description": "The direction of the exchanged routes.",
  71678. // "enum": [
  71679. // "INCOMING",
  71680. // "OUTGOING"
  71681. // ],
  71682. // "enumDescriptions": [
  71683. // "",
  71684. // ""
  71685. // ],
  71686. // "location": "query",
  71687. // "type": "string"
  71688. // },
  71689. // "filter": {
  71690. // "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).",
  71691. // "location": "query",
  71692. // "type": "string"
  71693. // },
  71694. // "maxResults": {
  71695. // "default": "500",
  71696. // "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)",
  71697. // "format": "uint32",
  71698. // "location": "query",
  71699. // "minimum": "0",
  71700. // "type": "integer"
  71701. // },
  71702. // "network": {
  71703. // "description": "Name of the network for this request.",
  71704. // "location": "path",
  71705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71706. // "required": true,
  71707. // "type": "string"
  71708. // },
  71709. // "orderBy": {
  71710. // "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.",
  71711. // "location": "query",
  71712. // "type": "string"
  71713. // },
  71714. // "pageToken": {
  71715. // "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.",
  71716. // "location": "query",
  71717. // "type": "string"
  71718. // },
  71719. // "peeringName": {
  71720. // "description": "The response will show routes exchanged over the given peering connection.",
  71721. // "location": "query",
  71722. // "type": "string"
  71723. // },
  71724. // "project": {
  71725. // "description": "Project ID for this request.",
  71726. // "location": "path",
  71727. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71728. // "required": true,
  71729. // "type": "string"
  71730. // },
  71731. // "region": {
  71732. // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
  71733. // "location": "query",
  71734. // "type": "string"
  71735. // }
  71736. // },
  71737. // "path": "{project}/global/networks/{network}/listPeeringRoutes",
  71738. // "response": {
  71739. // "$ref": "ExchangedPeeringRoutesList"
  71740. // },
  71741. // "scopes": [
  71742. // "https://www.googleapis.com/auth/cloud-platform",
  71743. // "https://www.googleapis.com/auth/compute",
  71744. // "https://www.googleapis.com/auth/compute.readonly"
  71745. // ]
  71746. // }
  71747. }
  71748. // Pages invokes f for each page of results.
  71749. // A non-nil error returned from f will halt the iteration.
  71750. // The provided context supersedes any context provided to the Context method.
  71751. func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error {
  71752. c.ctx_ = ctx
  71753. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71754. for {
  71755. x, err := c.Do()
  71756. if err != nil {
  71757. return err
  71758. }
  71759. if err := f(x); err != nil {
  71760. return err
  71761. }
  71762. if x.NextPageToken == "" {
  71763. return nil
  71764. }
  71765. c.PageToken(x.NextPageToken)
  71766. }
  71767. }
  71768. // method id "compute.networks.patch":
  71769. type NetworksPatchCall struct {
  71770. s *Service
  71771. project string
  71772. network string
  71773. network2 *Network
  71774. urlParams_ gensupport.URLParams
  71775. ctx_ context.Context
  71776. header_ http.Header
  71777. }
  71778. // Patch: Patches the specified network with the data included in the
  71779. // request. Only the following fields can be modified:
  71780. // routingConfig.routingMode.
  71781. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  71782. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71783. c.project = project
  71784. c.network = network
  71785. c.network2 = network2
  71786. return c
  71787. }
  71788. // RequestId sets the optional parameter "requestId": An optional
  71789. // request ID to identify requests. Specify a unique request ID so that
  71790. // if you must retry your request, the server will know to ignore the
  71791. // request if it has already been completed.
  71792. //
  71793. // For example, consider a situation where you make an initial request
  71794. // and the request times out. If you make the request again with the
  71795. // same request ID, the server can check if original operation with the
  71796. // same request ID was received, and if so, will ignore the second
  71797. // request. This prevents clients from accidentally creating duplicate
  71798. // commitments.
  71799. //
  71800. // The request ID must be a valid UUID with the exception that zero UUID
  71801. // is not supported (00000000-0000-0000-0000-000000000000).
  71802. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  71803. c.urlParams_.Set("requestId", requestId)
  71804. return c
  71805. }
  71806. // Fields allows partial responses to be retrieved. See
  71807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71808. // for more information.
  71809. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  71810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71811. return c
  71812. }
  71813. // Context sets the context to be used in this call's Do method. Any
  71814. // pending HTTP request will be aborted if the provided context is
  71815. // canceled.
  71816. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  71817. c.ctx_ = ctx
  71818. return c
  71819. }
  71820. // Header returns an http.Header that can be modified by the caller to
  71821. // add HTTP headers to the request.
  71822. func (c *NetworksPatchCall) Header() http.Header {
  71823. if c.header_ == nil {
  71824. c.header_ = make(http.Header)
  71825. }
  71826. return c.header_
  71827. }
  71828. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  71829. reqHeaders := make(http.Header)
  71830. for k, v := range c.header_ {
  71831. reqHeaders[k] = v
  71832. }
  71833. reqHeaders.Set("User-Agent", c.s.userAgent())
  71834. var body io.Reader = nil
  71835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  71836. if err != nil {
  71837. return nil, err
  71838. }
  71839. reqHeaders.Set("Content-Type", "application/json")
  71840. c.urlParams_.Set("alt", alt)
  71841. c.urlParams_.Set("prettyPrint", "false")
  71842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  71843. urls += "?" + c.urlParams_.Encode()
  71844. req, err := http.NewRequest("PATCH", urls, body)
  71845. if err != nil {
  71846. return nil, err
  71847. }
  71848. req.Header = reqHeaders
  71849. googleapi.Expand(req.URL, map[string]string{
  71850. "project": c.project,
  71851. "network": c.network,
  71852. })
  71853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71854. }
  71855. // Do executes the "compute.networks.patch" call.
  71856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71857. // status code is an error. Response headers are in either
  71858. // *Operation.ServerResponse.Header or (if a response was returned at
  71859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71860. // to check whether the returned error was because
  71861. // http.StatusNotModified was returned.
  71862. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71863. gensupport.SetOptions(c.urlParams_, opts...)
  71864. res, err := c.doRequest("json")
  71865. if res != nil && res.StatusCode == http.StatusNotModified {
  71866. if res.Body != nil {
  71867. res.Body.Close()
  71868. }
  71869. return nil, &googleapi.Error{
  71870. Code: res.StatusCode,
  71871. Header: res.Header,
  71872. }
  71873. }
  71874. if err != nil {
  71875. return nil, err
  71876. }
  71877. defer googleapi.CloseBody(res)
  71878. if err := googleapi.CheckResponse(res); err != nil {
  71879. return nil, err
  71880. }
  71881. ret := &Operation{
  71882. ServerResponse: googleapi.ServerResponse{
  71883. Header: res.Header,
  71884. HTTPStatusCode: res.StatusCode,
  71885. },
  71886. }
  71887. target := &ret
  71888. if err := gensupport.DecodeResponse(target, res); err != nil {
  71889. return nil, err
  71890. }
  71891. return ret, nil
  71892. // {
  71893. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  71894. // "httpMethod": "PATCH",
  71895. // "id": "compute.networks.patch",
  71896. // "parameterOrder": [
  71897. // "project",
  71898. // "network"
  71899. // ],
  71900. // "parameters": {
  71901. // "network": {
  71902. // "description": "Name of the network to update.",
  71903. // "location": "path",
  71904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71905. // "required": true,
  71906. // "type": "string"
  71907. // },
  71908. // "project": {
  71909. // "description": "Project ID for this request.",
  71910. // "location": "path",
  71911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71912. // "required": true,
  71913. // "type": "string"
  71914. // },
  71915. // "requestId": {
  71916. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71917. // "location": "query",
  71918. // "type": "string"
  71919. // }
  71920. // },
  71921. // "path": "{project}/global/networks/{network}",
  71922. // "request": {
  71923. // "$ref": "Network"
  71924. // },
  71925. // "response": {
  71926. // "$ref": "Operation"
  71927. // },
  71928. // "scopes": [
  71929. // "https://www.googleapis.com/auth/cloud-platform",
  71930. // "https://www.googleapis.com/auth/compute"
  71931. // ]
  71932. // }
  71933. }
  71934. // method id "compute.networks.removePeering":
  71935. type NetworksRemovePeeringCall struct {
  71936. s *Service
  71937. project string
  71938. network string
  71939. networksremovepeeringrequest *NetworksRemovePeeringRequest
  71940. urlParams_ gensupport.URLParams
  71941. ctx_ context.Context
  71942. header_ http.Header
  71943. }
  71944. // RemovePeering: Removes a peering from the specified network.
  71945. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  71946. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71947. c.project = project
  71948. c.network = network
  71949. c.networksremovepeeringrequest = networksremovepeeringrequest
  71950. return c
  71951. }
  71952. // RequestId sets the optional parameter "requestId": An optional
  71953. // request ID to identify requests. Specify a unique request ID so that
  71954. // if you must retry your request, the server will know to ignore the
  71955. // request if it has already been completed.
  71956. //
  71957. // For example, consider a situation where you make an initial request
  71958. // and the request times out. If you make the request again with the
  71959. // same request ID, the server can check if original operation with the
  71960. // same request ID was received, and if so, will ignore the second
  71961. // request. This prevents clients from accidentally creating duplicate
  71962. // commitments.
  71963. //
  71964. // The request ID must be a valid UUID with the exception that zero UUID
  71965. // is not supported (00000000-0000-0000-0000-000000000000).
  71966. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  71967. c.urlParams_.Set("requestId", requestId)
  71968. return c
  71969. }
  71970. // Fields allows partial responses to be retrieved. See
  71971. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71972. // for more information.
  71973. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  71974. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71975. return c
  71976. }
  71977. // Context sets the context to be used in this call's Do method. Any
  71978. // pending HTTP request will be aborted if the provided context is
  71979. // canceled.
  71980. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  71981. c.ctx_ = ctx
  71982. return c
  71983. }
  71984. // Header returns an http.Header that can be modified by the caller to
  71985. // add HTTP headers to the request.
  71986. func (c *NetworksRemovePeeringCall) Header() http.Header {
  71987. if c.header_ == nil {
  71988. c.header_ = make(http.Header)
  71989. }
  71990. return c.header_
  71991. }
  71992. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  71993. reqHeaders := make(http.Header)
  71994. for k, v := range c.header_ {
  71995. reqHeaders[k] = v
  71996. }
  71997. reqHeaders.Set("User-Agent", c.s.userAgent())
  71998. var body io.Reader = nil
  71999. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  72000. if err != nil {
  72001. return nil, err
  72002. }
  72003. reqHeaders.Set("Content-Type", "application/json")
  72004. c.urlParams_.Set("alt", alt)
  72005. c.urlParams_.Set("prettyPrint", "false")
  72006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  72007. urls += "?" + c.urlParams_.Encode()
  72008. req, err := http.NewRequest("POST", urls, body)
  72009. if err != nil {
  72010. return nil, err
  72011. }
  72012. req.Header = reqHeaders
  72013. googleapi.Expand(req.URL, map[string]string{
  72014. "project": c.project,
  72015. "network": c.network,
  72016. })
  72017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72018. }
  72019. // Do executes the "compute.networks.removePeering" call.
  72020. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72021. // status code is an error. Response headers are in either
  72022. // *Operation.ServerResponse.Header or (if a response was returned at
  72023. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72024. // to check whether the returned error was because
  72025. // http.StatusNotModified was returned.
  72026. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72027. gensupport.SetOptions(c.urlParams_, opts...)
  72028. res, err := c.doRequest("json")
  72029. if res != nil && res.StatusCode == http.StatusNotModified {
  72030. if res.Body != nil {
  72031. res.Body.Close()
  72032. }
  72033. return nil, &googleapi.Error{
  72034. Code: res.StatusCode,
  72035. Header: res.Header,
  72036. }
  72037. }
  72038. if err != nil {
  72039. return nil, err
  72040. }
  72041. defer googleapi.CloseBody(res)
  72042. if err := googleapi.CheckResponse(res); err != nil {
  72043. return nil, err
  72044. }
  72045. ret := &Operation{
  72046. ServerResponse: googleapi.ServerResponse{
  72047. Header: res.Header,
  72048. HTTPStatusCode: res.StatusCode,
  72049. },
  72050. }
  72051. target := &ret
  72052. if err := gensupport.DecodeResponse(target, res); err != nil {
  72053. return nil, err
  72054. }
  72055. return ret, nil
  72056. // {
  72057. // "description": "Removes a peering from the specified network.",
  72058. // "httpMethod": "POST",
  72059. // "id": "compute.networks.removePeering",
  72060. // "parameterOrder": [
  72061. // "project",
  72062. // "network"
  72063. // ],
  72064. // "parameters": {
  72065. // "network": {
  72066. // "description": "Name of the network resource to remove peering from.",
  72067. // "location": "path",
  72068. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72069. // "required": true,
  72070. // "type": "string"
  72071. // },
  72072. // "project": {
  72073. // "description": "Project ID for this request.",
  72074. // "location": "path",
  72075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72076. // "required": true,
  72077. // "type": "string"
  72078. // },
  72079. // "requestId": {
  72080. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72081. // "location": "query",
  72082. // "type": "string"
  72083. // }
  72084. // },
  72085. // "path": "{project}/global/networks/{network}/removePeering",
  72086. // "request": {
  72087. // "$ref": "NetworksRemovePeeringRequest"
  72088. // },
  72089. // "response": {
  72090. // "$ref": "Operation"
  72091. // },
  72092. // "scopes": [
  72093. // "https://www.googleapis.com/auth/cloud-platform",
  72094. // "https://www.googleapis.com/auth/compute"
  72095. // ]
  72096. // }
  72097. }
  72098. // method id "compute.networks.switchToCustomMode":
  72099. type NetworksSwitchToCustomModeCall struct {
  72100. s *Service
  72101. project string
  72102. network string
  72103. urlParams_ gensupport.URLParams
  72104. ctx_ context.Context
  72105. header_ http.Header
  72106. }
  72107. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  72108. // to custom subnet mode.
  72109. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  72110. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72111. c.project = project
  72112. c.network = network
  72113. return c
  72114. }
  72115. // RequestId sets the optional parameter "requestId": An optional
  72116. // request ID to identify requests. Specify a unique request ID so that
  72117. // if you must retry your request, the server will know to ignore the
  72118. // request if it has already been completed.
  72119. //
  72120. // For example, consider a situation where you make an initial request
  72121. // and the request times out. If you make the request again with the
  72122. // same request ID, the server can check if original operation with the
  72123. // same request ID was received, and if so, will ignore the second
  72124. // request. This prevents clients from accidentally creating duplicate
  72125. // commitments.
  72126. //
  72127. // The request ID must be a valid UUID with the exception that zero UUID
  72128. // is not supported (00000000-0000-0000-0000-000000000000).
  72129. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  72130. c.urlParams_.Set("requestId", requestId)
  72131. return c
  72132. }
  72133. // Fields allows partial responses to be retrieved. See
  72134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72135. // for more information.
  72136. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  72137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72138. return c
  72139. }
  72140. // Context sets the context to be used in this call's Do method. Any
  72141. // pending HTTP request will be aborted if the provided context is
  72142. // canceled.
  72143. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  72144. c.ctx_ = ctx
  72145. return c
  72146. }
  72147. // Header returns an http.Header that can be modified by the caller to
  72148. // add HTTP headers to the request.
  72149. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  72150. if c.header_ == nil {
  72151. c.header_ = make(http.Header)
  72152. }
  72153. return c.header_
  72154. }
  72155. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  72156. reqHeaders := make(http.Header)
  72157. for k, v := range c.header_ {
  72158. reqHeaders[k] = v
  72159. }
  72160. reqHeaders.Set("User-Agent", c.s.userAgent())
  72161. var body io.Reader = nil
  72162. c.urlParams_.Set("alt", alt)
  72163. c.urlParams_.Set("prettyPrint", "false")
  72164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  72165. urls += "?" + c.urlParams_.Encode()
  72166. req, err := http.NewRequest("POST", urls, body)
  72167. if err != nil {
  72168. return nil, err
  72169. }
  72170. req.Header = reqHeaders
  72171. googleapi.Expand(req.URL, map[string]string{
  72172. "project": c.project,
  72173. "network": c.network,
  72174. })
  72175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72176. }
  72177. // Do executes the "compute.networks.switchToCustomMode" call.
  72178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72179. // status code is an error. Response headers are in either
  72180. // *Operation.ServerResponse.Header or (if a response was returned at
  72181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72182. // to check whether the returned error was because
  72183. // http.StatusNotModified was returned.
  72184. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72185. gensupport.SetOptions(c.urlParams_, opts...)
  72186. res, err := c.doRequest("json")
  72187. if res != nil && res.StatusCode == http.StatusNotModified {
  72188. if res.Body != nil {
  72189. res.Body.Close()
  72190. }
  72191. return nil, &googleapi.Error{
  72192. Code: res.StatusCode,
  72193. Header: res.Header,
  72194. }
  72195. }
  72196. if err != nil {
  72197. return nil, err
  72198. }
  72199. defer googleapi.CloseBody(res)
  72200. if err := googleapi.CheckResponse(res); err != nil {
  72201. return nil, err
  72202. }
  72203. ret := &Operation{
  72204. ServerResponse: googleapi.ServerResponse{
  72205. Header: res.Header,
  72206. HTTPStatusCode: res.StatusCode,
  72207. },
  72208. }
  72209. target := &ret
  72210. if err := gensupport.DecodeResponse(target, res); err != nil {
  72211. return nil, err
  72212. }
  72213. return ret, nil
  72214. // {
  72215. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  72216. // "httpMethod": "POST",
  72217. // "id": "compute.networks.switchToCustomMode",
  72218. // "parameterOrder": [
  72219. // "project",
  72220. // "network"
  72221. // ],
  72222. // "parameters": {
  72223. // "network": {
  72224. // "description": "Name of the network to be updated.",
  72225. // "location": "path",
  72226. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72227. // "required": true,
  72228. // "type": "string"
  72229. // },
  72230. // "project": {
  72231. // "description": "Project ID for this request.",
  72232. // "location": "path",
  72233. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72234. // "required": true,
  72235. // "type": "string"
  72236. // },
  72237. // "requestId": {
  72238. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72239. // "location": "query",
  72240. // "type": "string"
  72241. // }
  72242. // },
  72243. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  72244. // "response": {
  72245. // "$ref": "Operation"
  72246. // },
  72247. // "scopes": [
  72248. // "https://www.googleapis.com/auth/cloud-platform",
  72249. // "https://www.googleapis.com/auth/compute"
  72250. // ]
  72251. // }
  72252. }
  72253. // method id "compute.networks.testIamPermissions":
  72254. type NetworksTestIamPermissionsCall struct {
  72255. s *Service
  72256. project string
  72257. resource string
  72258. testpermissionsrequest *TestPermissionsRequest
  72259. urlParams_ gensupport.URLParams
  72260. ctx_ context.Context
  72261. header_ http.Header
  72262. }
  72263. // TestIamPermissions: Returns permissions that a caller has on the
  72264. // specified resource.
  72265. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  72266. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72267. c.project = project
  72268. c.resource = resource
  72269. c.testpermissionsrequest = testpermissionsrequest
  72270. return c
  72271. }
  72272. // Fields allows partial responses to be retrieved. See
  72273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72274. // for more information.
  72275. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  72276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72277. return c
  72278. }
  72279. // Context sets the context to be used in this call's Do method. Any
  72280. // pending HTTP request will be aborted if the provided context is
  72281. // canceled.
  72282. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  72283. c.ctx_ = ctx
  72284. return c
  72285. }
  72286. // Header returns an http.Header that can be modified by the caller to
  72287. // add HTTP headers to the request.
  72288. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  72289. if c.header_ == nil {
  72290. c.header_ = make(http.Header)
  72291. }
  72292. return c.header_
  72293. }
  72294. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  72295. reqHeaders := make(http.Header)
  72296. for k, v := range c.header_ {
  72297. reqHeaders[k] = v
  72298. }
  72299. reqHeaders.Set("User-Agent", c.s.userAgent())
  72300. var body io.Reader = nil
  72301. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  72302. if err != nil {
  72303. return nil, err
  72304. }
  72305. reqHeaders.Set("Content-Type", "application/json")
  72306. c.urlParams_.Set("alt", alt)
  72307. c.urlParams_.Set("prettyPrint", "false")
  72308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  72309. urls += "?" + c.urlParams_.Encode()
  72310. req, err := http.NewRequest("POST", urls, body)
  72311. if err != nil {
  72312. return nil, err
  72313. }
  72314. req.Header = reqHeaders
  72315. googleapi.Expand(req.URL, map[string]string{
  72316. "project": c.project,
  72317. "resource": c.resource,
  72318. })
  72319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72320. }
  72321. // Do executes the "compute.networks.testIamPermissions" call.
  72322. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  72323. // non-2xx status code is an error. Response headers are in either
  72324. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  72325. // returned at all) in error.(*googleapi.Error).Header. Use
  72326. // googleapi.IsNotModified to check whether the returned error was
  72327. // because http.StatusNotModified was returned.
  72328. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  72329. gensupport.SetOptions(c.urlParams_, opts...)
  72330. res, err := c.doRequest("json")
  72331. if res != nil && res.StatusCode == http.StatusNotModified {
  72332. if res.Body != nil {
  72333. res.Body.Close()
  72334. }
  72335. return nil, &googleapi.Error{
  72336. Code: res.StatusCode,
  72337. Header: res.Header,
  72338. }
  72339. }
  72340. if err != nil {
  72341. return nil, err
  72342. }
  72343. defer googleapi.CloseBody(res)
  72344. if err := googleapi.CheckResponse(res); err != nil {
  72345. return nil, err
  72346. }
  72347. ret := &TestPermissionsResponse{
  72348. ServerResponse: googleapi.ServerResponse{
  72349. Header: res.Header,
  72350. HTTPStatusCode: res.StatusCode,
  72351. },
  72352. }
  72353. target := &ret
  72354. if err := gensupport.DecodeResponse(target, res); err != nil {
  72355. return nil, err
  72356. }
  72357. return ret, nil
  72358. // {
  72359. // "description": "Returns permissions that a caller has on the specified resource.",
  72360. // "httpMethod": "POST",
  72361. // "id": "compute.networks.testIamPermissions",
  72362. // "parameterOrder": [
  72363. // "project",
  72364. // "resource"
  72365. // ],
  72366. // "parameters": {
  72367. // "project": {
  72368. // "description": "Project ID for this request.",
  72369. // "location": "path",
  72370. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72371. // "required": true,
  72372. // "type": "string"
  72373. // },
  72374. // "resource": {
  72375. // "description": "Name or id of the resource for this request.",
  72376. // "location": "path",
  72377. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72378. // "required": true,
  72379. // "type": "string"
  72380. // }
  72381. // },
  72382. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  72383. // "request": {
  72384. // "$ref": "TestPermissionsRequest"
  72385. // },
  72386. // "response": {
  72387. // "$ref": "TestPermissionsResponse"
  72388. // },
  72389. // "scopes": [
  72390. // "https://www.googleapis.com/auth/cloud-platform",
  72391. // "https://www.googleapis.com/auth/compute",
  72392. // "https://www.googleapis.com/auth/compute.readonly"
  72393. // ]
  72394. // }
  72395. }
  72396. // method id "compute.networks.updatePeering":
  72397. type NetworksUpdatePeeringCall struct {
  72398. s *Service
  72399. project string
  72400. network string
  72401. networksupdatepeeringrequest *NetworksUpdatePeeringRequest
  72402. urlParams_ gensupport.URLParams
  72403. ctx_ context.Context
  72404. header_ http.Header
  72405. }
  72406. // UpdatePeering: Updates the specified network peering with the data
  72407. // included in the request Only the following fields can be modified:
  72408. // NetworkPeering.export_custom_routes, and
  72409. // NetworkPeering.import_custom_routes
  72410. func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
  72411. c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72412. c.project = project
  72413. c.network = network
  72414. c.networksupdatepeeringrequest = networksupdatepeeringrequest
  72415. return c
  72416. }
  72417. // RequestId sets the optional parameter "requestId": An optional
  72418. // request ID to identify requests. Specify a unique request ID so that
  72419. // if you must retry your request, the server will know to ignore the
  72420. // request if it has already been completed.
  72421. //
  72422. // For example, consider a situation where you make an initial request
  72423. // and the request times out. If you make the request again with the
  72424. // same request ID, the server can check if original operation with the
  72425. // same request ID was received, and if so, will ignore the second
  72426. // request. This prevents clients from accidentally creating duplicate
  72427. // commitments.
  72428. //
  72429. // The request ID must be a valid UUID with the exception that zero UUID
  72430. // is not supported (00000000-0000-0000-0000-000000000000).
  72431. func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
  72432. c.urlParams_.Set("requestId", requestId)
  72433. return c
  72434. }
  72435. // Fields allows partial responses to be retrieved. See
  72436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72437. // for more information.
  72438. func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
  72439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72440. return c
  72441. }
  72442. // Context sets the context to be used in this call's Do method. Any
  72443. // pending HTTP request will be aborted if the provided context is
  72444. // canceled.
  72445. func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
  72446. c.ctx_ = ctx
  72447. return c
  72448. }
  72449. // Header returns an http.Header that can be modified by the caller to
  72450. // add HTTP headers to the request.
  72451. func (c *NetworksUpdatePeeringCall) Header() http.Header {
  72452. if c.header_ == nil {
  72453. c.header_ = make(http.Header)
  72454. }
  72455. return c.header_
  72456. }
  72457. func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
  72458. reqHeaders := make(http.Header)
  72459. for k, v := range c.header_ {
  72460. reqHeaders[k] = v
  72461. }
  72462. reqHeaders.Set("User-Agent", c.s.userAgent())
  72463. var body io.Reader = nil
  72464. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
  72465. if err != nil {
  72466. return nil, err
  72467. }
  72468. reqHeaders.Set("Content-Type", "application/json")
  72469. c.urlParams_.Set("alt", alt)
  72470. c.urlParams_.Set("prettyPrint", "false")
  72471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/updatePeering")
  72472. urls += "?" + c.urlParams_.Encode()
  72473. req, err := http.NewRequest("PATCH", urls, body)
  72474. if err != nil {
  72475. return nil, err
  72476. }
  72477. req.Header = reqHeaders
  72478. googleapi.Expand(req.URL, map[string]string{
  72479. "project": c.project,
  72480. "network": c.network,
  72481. })
  72482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72483. }
  72484. // Do executes the "compute.networks.updatePeering" call.
  72485. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72486. // status code is an error. Response headers are in either
  72487. // *Operation.ServerResponse.Header or (if a response was returned at
  72488. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72489. // to check whether the returned error was because
  72490. // http.StatusNotModified was returned.
  72491. func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72492. gensupport.SetOptions(c.urlParams_, opts...)
  72493. res, err := c.doRequest("json")
  72494. if res != nil && res.StatusCode == http.StatusNotModified {
  72495. if res.Body != nil {
  72496. res.Body.Close()
  72497. }
  72498. return nil, &googleapi.Error{
  72499. Code: res.StatusCode,
  72500. Header: res.Header,
  72501. }
  72502. }
  72503. if err != nil {
  72504. return nil, err
  72505. }
  72506. defer googleapi.CloseBody(res)
  72507. if err := googleapi.CheckResponse(res); err != nil {
  72508. return nil, err
  72509. }
  72510. ret := &Operation{
  72511. ServerResponse: googleapi.ServerResponse{
  72512. Header: res.Header,
  72513. HTTPStatusCode: res.StatusCode,
  72514. },
  72515. }
  72516. target := &ret
  72517. if err := gensupport.DecodeResponse(target, res); err != nil {
  72518. return nil, err
  72519. }
  72520. return ret, nil
  72521. // {
  72522. // "description": "Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes",
  72523. // "httpMethod": "PATCH",
  72524. // "id": "compute.networks.updatePeering",
  72525. // "parameterOrder": [
  72526. // "project",
  72527. // "network"
  72528. // ],
  72529. // "parameters": {
  72530. // "network": {
  72531. // "description": "Name of the network resource which the updated peering is belonging to.",
  72532. // "location": "path",
  72533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72534. // "required": true,
  72535. // "type": "string"
  72536. // },
  72537. // "project": {
  72538. // "description": "Project ID for this request.",
  72539. // "location": "path",
  72540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72541. // "required": true,
  72542. // "type": "string"
  72543. // },
  72544. // "requestId": {
  72545. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72546. // "location": "query",
  72547. // "type": "string"
  72548. // }
  72549. // },
  72550. // "path": "{project}/global/networks/{network}/updatePeering",
  72551. // "request": {
  72552. // "$ref": "NetworksUpdatePeeringRequest"
  72553. // },
  72554. // "response": {
  72555. // "$ref": "Operation"
  72556. // },
  72557. // "scopes": [
  72558. // "https://www.googleapis.com/auth/cloud-platform",
  72559. // "https://www.googleapis.com/auth/compute"
  72560. // ]
  72561. // }
  72562. }
  72563. // method id "compute.nodeGroups.addNodes":
  72564. type NodeGroupsAddNodesCall struct {
  72565. s *Service
  72566. project string
  72567. zone string
  72568. nodeGroup string
  72569. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  72570. urlParams_ gensupport.URLParams
  72571. ctx_ context.Context
  72572. header_ http.Header
  72573. }
  72574. // AddNodes: Adds specified number of nodes to the node group.
  72575. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  72576. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72577. c.project = project
  72578. c.zone = zone
  72579. c.nodeGroup = nodeGroup
  72580. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  72581. return c
  72582. }
  72583. // RequestId sets the optional parameter "requestId": An optional
  72584. // request ID to identify requests. Specify a unique request ID so that
  72585. // if you must retry your request, the server will know to ignore the
  72586. // request if it has already been completed.
  72587. //
  72588. // For example, consider a situation where you make an initial request
  72589. // and the request times out. If you make the request again with the
  72590. // same request ID, the server can check if original operation with the
  72591. // same request ID was received, and if so, will ignore the second
  72592. // request. This prevents clients from accidentally creating duplicate
  72593. // commitments.
  72594. //
  72595. // The request ID must be a valid UUID with the exception that zero UUID
  72596. // is not supported (00000000-0000-0000-0000-000000000000).
  72597. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  72598. c.urlParams_.Set("requestId", requestId)
  72599. return c
  72600. }
  72601. // Fields allows partial responses to be retrieved. See
  72602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72603. // for more information.
  72604. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  72605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72606. return c
  72607. }
  72608. // Context sets the context to be used in this call's Do method. Any
  72609. // pending HTTP request will be aborted if the provided context is
  72610. // canceled.
  72611. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  72612. c.ctx_ = ctx
  72613. return c
  72614. }
  72615. // Header returns an http.Header that can be modified by the caller to
  72616. // add HTTP headers to the request.
  72617. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  72618. if c.header_ == nil {
  72619. c.header_ = make(http.Header)
  72620. }
  72621. return c.header_
  72622. }
  72623. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  72624. reqHeaders := make(http.Header)
  72625. for k, v := range c.header_ {
  72626. reqHeaders[k] = v
  72627. }
  72628. reqHeaders.Set("User-Agent", c.s.userAgent())
  72629. var body io.Reader = nil
  72630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  72631. if err != nil {
  72632. return nil, err
  72633. }
  72634. reqHeaders.Set("Content-Type", "application/json")
  72635. c.urlParams_.Set("alt", alt)
  72636. c.urlParams_.Set("prettyPrint", "false")
  72637. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  72638. urls += "?" + c.urlParams_.Encode()
  72639. req, err := http.NewRequest("POST", urls, body)
  72640. if err != nil {
  72641. return nil, err
  72642. }
  72643. req.Header = reqHeaders
  72644. googleapi.Expand(req.URL, map[string]string{
  72645. "project": c.project,
  72646. "zone": c.zone,
  72647. "nodeGroup": c.nodeGroup,
  72648. })
  72649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72650. }
  72651. // Do executes the "compute.nodeGroups.addNodes" call.
  72652. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72653. // status code is an error. Response headers are in either
  72654. // *Operation.ServerResponse.Header or (if a response was returned at
  72655. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72656. // to check whether the returned error was because
  72657. // http.StatusNotModified was returned.
  72658. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72659. gensupport.SetOptions(c.urlParams_, opts...)
  72660. res, err := c.doRequest("json")
  72661. if res != nil && res.StatusCode == http.StatusNotModified {
  72662. if res.Body != nil {
  72663. res.Body.Close()
  72664. }
  72665. return nil, &googleapi.Error{
  72666. Code: res.StatusCode,
  72667. Header: res.Header,
  72668. }
  72669. }
  72670. if err != nil {
  72671. return nil, err
  72672. }
  72673. defer googleapi.CloseBody(res)
  72674. if err := googleapi.CheckResponse(res); err != nil {
  72675. return nil, err
  72676. }
  72677. ret := &Operation{
  72678. ServerResponse: googleapi.ServerResponse{
  72679. Header: res.Header,
  72680. HTTPStatusCode: res.StatusCode,
  72681. },
  72682. }
  72683. target := &ret
  72684. if err := gensupport.DecodeResponse(target, res); err != nil {
  72685. return nil, err
  72686. }
  72687. return ret, nil
  72688. // {
  72689. // "description": "Adds specified number of nodes to the node group.",
  72690. // "httpMethod": "POST",
  72691. // "id": "compute.nodeGroups.addNodes",
  72692. // "parameterOrder": [
  72693. // "project",
  72694. // "zone",
  72695. // "nodeGroup"
  72696. // ],
  72697. // "parameters": {
  72698. // "nodeGroup": {
  72699. // "description": "Name of the NodeGroup resource.",
  72700. // "location": "path",
  72701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72702. // "required": true,
  72703. // "type": "string"
  72704. // },
  72705. // "project": {
  72706. // "description": "Project ID for this request.",
  72707. // "location": "path",
  72708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72709. // "required": true,
  72710. // "type": "string"
  72711. // },
  72712. // "requestId": {
  72713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72714. // "location": "query",
  72715. // "type": "string"
  72716. // },
  72717. // "zone": {
  72718. // "description": "The name of the zone for this request.",
  72719. // "location": "path",
  72720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72721. // "required": true,
  72722. // "type": "string"
  72723. // }
  72724. // },
  72725. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  72726. // "request": {
  72727. // "$ref": "NodeGroupsAddNodesRequest"
  72728. // },
  72729. // "response": {
  72730. // "$ref": "Operation"
  72731. // },
  72732. // "scopes": [
  72733. // "https://www.googleapis.com/auth/cloud-platform",
  72734. // "https://www.googleapis.com/auth/compute"
  72735. // ]
  72736. // }
  72737. }
  72738. // method id "compute.nodeGroups.aggregatedList":
  72739. type NodeGroupsAggregatedListCall struct {
  72740. s *Service
  72741. project string
  72742. urlParams_ gensupport.URLParams
  72743. ifNoneMatch_ string
  72744. ctx_ context.Context
  72745. header_ http.Header
  72746. }
  72747. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  72748. // use nodeGroups.listNodes for more details about each group.
  72749. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  72750. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72751. c.project = project
  72752. return c
  72753. }
  72754. // Filter sets the optional parameter "filter": A filter expression that
  72755. // filters resources listed in the response. The expression must specify
  72756. // the field name, a comparison operator, and the value that you want to
  72757. // use for filtering. The value must be a string, a number, or a
  72758. // boolean. The comparison operator must be either =, !=, >, or <.
  72759. //
  72760. // For example, if you are filtering Compute Engine instances, you can
  72761. // exclude instances named example-instance by specifying name !=
  72762. // example-instance.
  72763. //
  72764. // You can also filter nested fields. For example, you could specify
  72765. // scheduling.automaticRestart = false to include instances only if they
  72766. // are not scheduled for automatic restarts. You can use filtering on
  72767. // nested fields to filter based on resource labels.
  72768. //
  72769. // To filter on multiple expressions, provide each separate expression
  72770. // within parentheses. For example, (scheduling.automaticRestart = true)
  72771. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72772. // AND expression. However, you can include AND and OR expressions
  72773. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72774. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72775. // true).
  72776. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  72777. c.urlParams_.Set("filter", filter)
  72778. return c
  72779. }
  72780. // MaxResults sets the optional parameter "maxResults": The maximum
  72781. // number of results per page that should be returned. If the number of
  72782. // available results is larger than maxResults, Compute Engine returns a
  72783. // nextPageToken that can be used to get the next page of results in
  72784. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72785. // (Default: 500)
  72786. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  72787. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72788. return c
  72789. }
  72790. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72791. // a certain order. By default, results are returned in alphanumerical
  72792. // order based on the resource name.
  72793. //
  72794. // You can also sort results in descending order based on the creation
  72795. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72796. // based on the creationTimestamp field in reverse chronological order
  72797. // (newest result first). Use this to sort resources like operations so
  72798. // that the newest operation is returned first.
  72799. //
  72800. // Currently, only sorting by name or creationTimestamp desc is
  72801. // supported.
  72802. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  72803. c.urlParams_.Set("orderBy", orderBy)
  72804. return c
  72805. }
  72806. // PageToken sets the optional parameter "pageToken": Specifies a page
  72807. // token to use. Set pageToken to the nextPageToken returned by a
  72808. // previous list request to get the next page of results.
  72809. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  72810. c.urlParams_.Set("pageToken", pageToken)
  72811. return c
  72812. }
  72813. // Fields allows partial responses to be retrieved. See
  72814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72815. // for more information.
  72816. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  72817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72818. return c
  72819. }
  72820. // IfNoneMatch sets the optional parameter which makes the operation
  72821. // fail if the object's ETag matches the given value. This is useful for
  72822. // getting updates only after the object has changed since the last
  72823. // request. Use googleapi.IsNotModified to check whether the response
  72824. // error from Do is the result of In-None-Match.
  72825. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  72826. c.ifNoneMatch_ = entityTag
  72827. return c
  72828. }
  72829. // Context sets the context to be used in this call's Do method. Any
  72830. // pending HTTP request will be aborted if the provided context is
  72831. // canceled.
  72832. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  72833. c.ctx_ = ctx
  72834. return c
  72835. }
  72836. // Header returns an http.Header that can be modified by the caller to
  72837. // add HTTP headers to the request.
  72838. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  72839. if c.header_ == nil {
  72840. c.header_ = make(http.Header)
  72841. }
  72842. return c.header_
  72843. }
  72844. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72845. reqHeaders := make(http.Header)
  72846. for k, v := range c.header_ {
  72847. reqHeaders[k] = v
  72848. }
  72849. reqHeaders.Set("User-Agent", c.s.userAgent())
  72850. if c.ifNoneMatch_ != "" {
  72851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72852. }
  72853. var body io.Reader = nil
  72854. c.urlParams_.Set("alt", alt)
  72855. c.urlParams_.Set("prettyPrint", "false")
  72856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  72857. urls += "?" + c.urlParams_.Encode()
  72858. req, err := http.NewRequest("GET", urls, body)
  72859. if err != nil {
  72860. return nil, err
  72861. }
  72862. req.Header = reqHeaders
  72863. googleapi.Expand(req.URL, map[string]string{
  72864. "project": c.project,
  72865. })
  72866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72867. }
  72868. // Do executes the "compute.nodeGroups.aggregatedList" call.
  72869. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  72870. // non-2xx status code is an error. Response headers are in either
  72871. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  72872. // returned at all) in error.(*googleapi.Error).Header. Use
  72873. // googleapi.IsNotModified to check whether the returned error was
  72874. // because http.StatusNotModified was returned.
  72875. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  72876. gensupport.SetOptions(c.urlParams_, opts...)
  72877. res, err := c.doRequest("json")
  72878. if res != nil && res.StatusCode == http.StatusNotModified {
  72879. if res.Body != nil {
  72880. res.Body.Close()
  72881. }
  72882. return nil, &googleapi.Error{
  72883. Code: res.StatusCode,
  72884. Header: res.Header,
  72885. }
  72886. }
  72887. if err != nil {
  72888. return nil, err
  72889. }
  72890. defer googleapi.CloseBody(res)
  72891. if err := googleapi.CheckResponse(res); err != nil {
  72892. return nil, err
  72893. }
  72894. ret := &NodeGroupAggregatedList{
  72895. ServerResponse: googleapi.ServerResponse{
  72896. Header: res.Header,
  72897. HTTPStatusCode: res.StatusCode,
  72898. },
  72899. }
  72900. target := &ret
  72901. if err := gensupport.DecodeResponse(target, res); err != nil {
  72902. return nil, err
  72903. }
  72904. return ret, nil
  72905. // {
  72906. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  72907. // "httpMethod": "GET",
  72908. // "id": "compute.nodeGroups.aggregatedList",
  72909. // "parameterOrder": [
  72910. // "project"
  72911. // ],
  72912. // "parameters": {
  72913. // "filter": {
  72914. // "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).",
  72915. // "location": "query",
  72916. // "type": "string"
  72917. // },
  72918. // "maxResults": {
  72919. // "default": "500",
  72920. // "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)",
  72921. // "format": "uint32",
  72922. // "location": "query",
  72923. // "minimum": "0",
  72924. // "type": "integer"
  72925. // },
  72926. // "orderBy": {
  72927. // "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.",
  72928. // "location": "query",
  72929. // "type": "string"
  72930. // },
  72931. // "pageToken": {
  72932. // "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.",
  72933. // "location": "query",
  72934. // "type": "string"
  72935. // },
  72936. // "project": {
  72937. // "description": "Project ID for this request.",
  72938. // "location": "path",
  72939. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72940. // "required": true,
  72941. // "type": "string"
  72942. // }
  72943. // },
  72944. // "path": "{project}/aggregated/nodeGroups",
  72945. // "response": {
  72946. // "$ref": "NodeGroupAggregatedList"
  72947. // },
  72948. // "scopes": [
  72949. // "https://www.googleapis.com/auth/cloud-platform",
  72950. // "https://www.googleapis.com/auth/compute",
  72951. // "https://www.googleapis.com/auth/compute.readonly"
  72952. // ]
  72953. // }
  72954. }
  72955. // Pages invokes f for each page of results.
  72956. // A non-nil error returned from f will halt the iteration.
  72957. // The provided context supersedes any context provided to the Context method.
  72958. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  72959. c.ctx_ = ctx
  72960. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72961. for {
  72962. x, err := c.Do()
  72963. if err != nil {
  72964. return err
  72965. }
  72966. if err := f(x); err != nil {
  72967. return err
  72968. }
  72969. if x.NextPageToken == "" {
  72970. return nil
  72971. }
  72972. c.PageToken(x.NextPageToken)
  72973. }
  72974. }
  72975. // method id "compute.nodeGroups.delete":
  72976. type NodeGroupsDeleteCall struct {
  72977. s *Service
  72978. project string
  72979. zone string
  72980. nodeGroup string
  72981. urlParams_ gensupport.URLParams
  72982. ctx_ context.Context
  72983. header_ http.Header
  72984. }
  72985. // Delete: Deletes the specified NodeGroup resource.
  72986. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  72987. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72988. c.project = project
  72989. c.zone = zone
  72990. c.nodeGroup = nodeGroup
  72991. return c
  72992. }
  72993. // RequestId sets the optional parameter "requestId": An optional
  72994. // request ID to identify requests. Specify a unique request ID so that
  72995. // if you must retry your request, the server will know to ignore the
  72996. // request if it has already been completed.
  72997. //
  72998. // For example, consider a situation where you make an initial request
  72999. // and the request times out. If you make the request again with the
  73000. // same request ID, the server can check if original operation with the
  73001. // same request ID was received, and if so, will ignore the second
  73002. // request. This prevents clients from accidentally creating duplicate
  73003. // commitments.
  73004. //
  73005. // The request ID must be a valid UUID with the exception that zero UUID
  73006. // is not supported (00000000-0000-0000-0000-000000000000).
  73007. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  73008. c.urlParams_.Set("requestId", requestId)
  73009. return c
  73010. }
  73011. // Fields allows partial responses to be retrieved. See
  73012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73013. // for more information.
  73014. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  73015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73016. return c
  73017. }
  73018. // Context sets the context to be used in this call's Do method. Any
  73019. // pending HTTP request will be aborted if the provided context is
  73020. // canceled.
  73021. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  73022. c.ctx_ = ctx
  73023. return c
  73024. }
  73025. // Header returns an http.Header that can be modified by the caller to
  73026. // add HTTP headers to the request.
  73027. func (c *NodeGroupsDeleteCall) Header() http.Header {
  73028. if c.header_ == nil {
  73029. c.header_ = make(http.Header)
  73030. }
  73031. return c.header_
  73032. }
  73033. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  73034. reqHeaders := make(http.Header)
  73035. for k, v := range c.header_ {
  73036. reqHeaders[k] = v
  73037. }
  73038. reqHeaders.Set("User-Agent", c.s.userAgent())
  73039. var body io.Reader = nil
  73040. c.urlParams_.Set("alt", alt)
  73041. c.urlParams_.Set("prettyPrint", "false")
  73042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  73043. urls += "?" + c.urlParams_.Encode()
  73044. req, err := http.NewRequest("DELETE", urls, body)
  73045. if err != nil {
  73046. return nil, err
  73047. }
  73048. req.Header = reqHeaders
  73049. googleapi.Expand(req.URL, map[string]string{
  73050. "project": c.project,
  73051. "zone": c.zone,
  73052. "nodeGroup": c.nodeGroup,
  73053. })
  73054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73055. }
  73056. // Do executes the "compute.nodeGroups.delete" call.
  73057. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73058. // status code is an error. Response headers are in either
  73059. // *Operation.ServerResponse.Header or (if a response was returned at
  73060. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73061. // to check whether the returned error was because
  73062. // http.StatusNotModified was returned.
  73063. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73064. gensupport.SetOptions(c.urlParams_, opts...)
  73065. res, err := c.doRequest("json")
  73066. if res != nil && res.StatusCode == http.StatusNotModified {
  73067. if res.Body != nil {
  73068. res.Body.Close()
  73069. }
  73070. return nil, &googleapi.Error{
  73071. Code: res.StatusCode,
  73072. Header: res.Header,
  73073. }
  73074. }
  73075. if err != nil {
  73076. return nil, err
  73077. }
  73078. defer googleapi.CloseBody(res)
  73079. if err := googleapi.CheckResponse(res); err != nil {
  73080. return nil, err
  73081. }
  73082. ret := &Operation{
  73083. ServerResponse: googleapi.ServerResponse{
  73084. Header: res.Header,
  73085. HTTPStatusCode: res.StatusCode,
  73086. },
  73087. }
  73088. target := &ret
  73089. if err := gensupport.DecodeResponse(target, res); err != nil {
  73090. return nil, err
  73091. }
  73092. return ret, nil
  73093. // {
  73094. // "description": "Deletes the specified NodeGroup resource.",
  73095. // "httpMethod": "DELETE",
  73096. // "id": "compute.nodeGroups.delete",
  73097. // "parameterOrder": [
  73098. // "project",
  73099. // "zone",
  73100. // "nodeGroup"
  73101. // ],
  73102. // "parameters": {
  73103. // "nodeGroup": {
  73104. // "description": "Name of the NodeGroup resource to delete.",
  73105. // "location": "path",
  73106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73107. // "required": true,
  73108. // "type": "string"
  73109. // },
  73110. // "project": {
  73111. // "description": "Project ID for this request.",
  73112. // "location": "path",
  73113. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73114. // "required": true,
  73115. // "type": "string"
  73116. // },
  73117. // "requestId": {
  73118. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73119. // "location": "query",
  73120. // "type": "string"
  73121. // },
  73122. // "zone": {
  73123. // "description": "The name of the zone for this request.",
  73124. // "location": "path",
  73125. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73126. // "required": true,
  73127. // "type": "string"
  73128. // }
  73129. // },
  73130. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  73131. // "response": {
  73132. // "$ref": "Operation"
  73133. // },
  73134. // "scopes": [
  73135. // "https://www.googleapis.com/auth/cloud-platform",
  73136. // "https://www.googleapis.com/auth/compute"
  73137. // ]
  73138. // }
  73139. }
  73140. // method id "compute.nodeGroups.deleteNodes":
  73141. type NodeGroupsDeleteNodesCall struct {
  73142. s *Service
  73143. project string
  73144. zone string
  73145. nodeGroup string
  73146. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  73147. urlParams_ gensupport.URLParams
  73148. ctx_ context.Context
  73149. header_ http.Header
  73150. }
  73151. // DeleteNodes: Deletes specified nodes from the node group.
  73152. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  73153. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73154. c.project = project
  73155. c.zone = zone
  73156. c.nodeGroup = nodeGroup
  73157. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  73158. return c
  73159. }
  73160. // RequestId sets the optional parameter "requestId": An optional
  73161. // request ID to identify requests. Specify a unique request ID so that
  73162. // if you must retry your request, the server will know to ignore the
  73163. // request if it has already been completed.
  73164. //
  73165. // For example, consider a situation where you make an initial request
  73166. // and the request times out. If you make the request again with the
  73167. // same request ID, the server can check if original operation with the
  73168. // same request ID was received, and if so, will ignore the second
  73169. // request. This prevents clients from accidentally creating duplicate
  73170. // commitments.
  73171. //
  73172. // The request ID must be a valid UUID with the exception that zero UUID
  73173. // is not supported (00000000-0000-0000-0000-000000000000).
  73174. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  73175. c.urlParams_.Set("requestId", requestId)
  73176. return c
  73177. }
  73178. // Fields allows partial responses to be retrieved. See
  73179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73180. // for more information.
  73181. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  73182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73183. return c
  73184. }
  73185. // Context sets the context to be used in this call's Do method. Any
  73186. // pending HTTP request will be aborted if the provided context is
  73187. // canceled.
  73188. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  73189. c.ctx_ = ctx
  73190. return c
  73191. }
  73192. // Header returns an http.Header that can be modified by the caller to
  73193. // add HTTP headers to the request.
  73194. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  73195. if c.header_ == nil {
  73196. c.header_ = make(http.Header)
  73197. }
  73198. return c.header_
  73199. }
  73200. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  73201. reqHeaders := make(http.Header)
  73202. for k, v := range c.header_ {
  73203. reqHeaders[k] = v
  73204. }
  73205. reqHeaders.Set("User-Agent", c.s.userAgent())
  73206. var body io.Reader = nil
  73207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  73208. if err != nil {
  73209. return nil, err
  73210. }
  73211. reqHeaders.Set("Content-Type", "application/json")
  73212. c.urlParams_.Set("alt", alt)
  73213. c.urlParams_.Set("prettyPrint", "false")
  73214. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  73215. urls += "?" + c.urlParams_.Encode()
  73216. req, err := http.NewRequest("POST", urls, body)
  73217. if err != nil {
  73218. return nil, err
  73219. }
  73220. req.Header = reqHeaders
  73221. googleapi.Expand(req.URL, map[string]string{
  73222. "project": c.project,
  73223. "zone": c.zone,
  73224. "nodeGroup": c.nodeGroup,
  73225. })
  73226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73227. }
  73228. // Do executes the "compute.nodeGroups.deleteNodes" call.
  73229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73230. // status code is an error. Response headers are in either
  73231. // *Operation.ServerResponse.Header or (if a response was returned at
  73232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73233. // to check whether the returned error was because
  73234. // http.StatusNotModified was returned.
  73235. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73236. gensupport.SetOptions(c.urlParams_, opts...)
  73237. res, err := c.doRequest("json")
  73238. if res != nil && res.StatusCode == http.StatusNotModified {
  73239. if res.Body != nil {
  73240. res.Body.Close()
  73241. }
  73242. return nil, &googleapi.Error{
  73243. Code: res.StatusCode,
  73244. Header: res.Header,
  73245. }
  73246. }
  73247. if err != nil {
  73248. return nil, err
  73249. }
  73250. defer googleapi.CloseBody(res)
  73251. if err := googleapi.CheckResponse(res); err != nil {
  73252. return nil, err
  73253. }
  73254. ret := &Operation{
  73255. ServerResponse: googleapi.ServerResponse{
  73256. Header: res.Header,
  73257. HTTPStatusCode: res.StatusCode,
  73258. },
  73259. }
  73260. target := &ret
  73261. if err := gensupport.DecodeResponse(target, res); err != nil {
  73262. return nil, err
  73263. }
  73264. return ret, nil
  73265. // {
  73266. // "description": "Deletes specified nodes from the node group.",
  73267. // "httpMethod": "POST",
  73268. // "id": "compute.nodeGroups.deleteNodes",
  73269. // "parameterOrder": [
  73270. // "project",
  73271. // "zone",
  73272. // "nodeGroup"
  73273. // ],
  73274. // "parameters": {
  73275. // "nodeGroup": {
  73276. // "description": "Name of the NodeGroup resource to delete.",
  73277. // "location": "path",
  73278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73279. // "required": true,
  73280. // "type": "string"
  73281. // },
  73282. // "project": {
  73283. // "description": "Project ID for this request.",
  73284. // "location": "path",
  73285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73286. // "required": true,
  73287. // "type": "string"
  73288. // },
  73289. // "requestId": {
  73290. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73291. // "location": "query",
  73292. // "type": "string"
  73293. // },
  73294. // "zone": {
  73295. // "description": "The name of the zone for this request.",
  73296. // "location": "path",
  73297. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73298. // "required": true,
  73299. // "type": "string"
  73300. // }
  73301. // },
  73302. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  73303. // "request": {
  73304. // "$ref": "NodeGroupsDeleteNodesRequest"
  73305. // },
  73306. // "response": {
  73307. // "$ref": "Operation"
  73308. // },
  73309. // "scopes": [
  73310. // "https://www.googleapis.com/auth/cloud-platform",
  73311. // "https://www.googleapis.com/auth/compute"
  73312. // ]
  73313. // }
  73314. }
  73315. // method id "compute.nodeGroups.get":
  73316. type NodeGroupsGetCall struct {
  73317. s *Service
  73318. project string
  73319. zone string
  73320. nodeGroup string
  73321. urlParams_ gensupport.URLParams
  73322. ifNoneMatch_ string
  73323. ctx_ context.Context
  73324. header_ http.Header
  73325. }
  73326. // Get: Returns the specified NodeGroup. Get a list of available
  73327. // NodeGroups by making a list() request. Note: the "nodes" field should
  73328. // not be used. Use nodeGroups.listNodes instead.
  73329. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  73330. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73331. c.project = project
  73332. c.zone = zone
  73333. c.nodeGroup = nodeGroup
  73334. return c
  73335. }
  73336. // Fields allows partial responses to be retrieved. See
  73337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73338. // for more information.
  73339. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  73340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73341. return c
  73342. }
  73343. // IfNoneMatch sets the optional parameter which makes the operation
  73344. // fail if the object's ETag matches the given value. This is useful for
  73345. // getting updates only after the object has changed since the last
  73346. // request. Use googleapi.IsNotModified to check whether the response
  73347. // error from Do is the result of In-None-Match.
  73348. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  73349. c.ifNoneMatch_ = entityTag
  73350. return c
  73351. }
  73352. // Context sets the context to be used in this call's Do method. Any
  73353. // pending HTTP request will be aborted if the provided context is
  73354. // canceled.
  73355. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  73356. c.ctx_ = ctx
  73357. return c
  73358. }
  73359. // Header returns an http.Header that can be modified by the caller to
  73360. // add HTTP headers to the request.
  73361. func (c *NodeGroupsGetCall) Header() http.Header {
  73362. if c.header_ == nil {
  73363. c.header_ = make(http.Header)
  73364. }
  73365. return c.header_
  73366. }
  73367. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  73368. reqHeaders := make(http.Header)
  73369. for k, v := range c.header_ {
  73370. reqHeaders[k] = v
  73371. }
  73372. reqHeaders.Set("User-Agent", c.s.userAgent())
  73373. if c.ifNoneMatch_ != "" {
  73374. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73375. }
  73376. var body io.Reader = nil
  73377. c.urlParams_.Set("alt", alt)
  73378. c.urlParams_.Set("prettyPrint", "false")
  73379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  73380. urls += "?" + c.urlParams_.Encode()
  73381. req, err := http.NewRequest("GET", urls, body)
  73382. if err != nil {
  73383. return nil, err
  73384. }
  73385. req.Header = reqHeaders
  73386. googleapi.Expand(req.URL, map[string]string{
  73387. "project": c.project,
  73388. "zone": c.zone,
  73389. "nodeGroup": c.nodeGroup,
  73390. })
  73391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73392. }
  73393. // Do executes the "compute.nodeGroups.get" call.
  73394. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  73395. // status code is an error. Response headers are in either
  73396. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  73397. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73398. // to check whether the returned error was because
  73399. // http.StatusNotModified was returned.
  73400. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  73401. gensupport.SetOptions(c.urlParams_, opts...)
  73402. res, err := c.doRequest("json")
  73403. if res != nil && res.StatusCode == http.StatusNotModified {
  73404. if res.Body != nil {
  73405. res.Body.Close()
  73406. }
  73407. return nil, &googleapi.Error{
  73408. Code: res.StatusCode,
  73409. Header: res.Header,
  73410. }
  73411. }
  73412. if err != nil {
  73413. return nil, err
  73414. }
  73415. defer googleapi.CloseBody(res)
  73416. if err := googleapi.CheckResponse(res); err != nil {
  73417. return nil, err
  73418. }
  73419. ret := &NodeGroup{
  73420. ServerResponse: googleapi.ServerResponse{
  73421. Header: res.Header,
  73422. HTTPStatusCode: res.StatusCode,
  73423. },
  73424. }
  73425. target := &ret
  73426. if err := gensupport.DecodeResponse(target, res); err != nil {
  73427. return nil, err
  73428. }
  73429. return ret, nil
  73430. // {
  73431. // "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.",
  73432. // "httpMethod": "GET",
  73433. // "id": "compute.nodeGroups.get",
  73434. // "parameterOrder": [
  73435. // "project",
  73436. // "zone",
  73437. // "nodeGroup"
  73438. // ],
  73439. // "parameters": {
  73440. // "nodeGroup": {
  73441. // "description": "Name of the node group to return.",
  73442. // "location": "path",
  73443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73444. // "required": true,
  73445. // "type": "string"
  73446. // },
  73447. // "project": {
  73448. // "description": "Project ID for this request.",
  73449. // "location": "path",
  73450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73451. // "required": true,
  73452. // "type": "string"
  73453. // },
  73454. // "zone": {
  73455. // "description": "The name of the zone for this request.",
  73456. // "location": "path",
  73457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73458. // "required": true,
  73459. // "type": "string"
  73460. // }
  73461. // },
  73462. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  73463. // "response": {
  73464. // "$ref": "NodeGroup"
  73465. // },
  73466. // "scopes": [
  73467. // "https://www.googleapis.com/auth/cloud-platform",
  73468. // "https://www.googleapis.com/auth/compute",
  73469. // "https://www.googleapis.com/auth/compute.readonly"
  73470. // ]
  73471. // }
  73472. }
  73473. // method id "compute.nodeGroups.getIamPolicy":
  73474. type NodeGroupsGetIamPolicyCall struct {
  73475. s *Service
  73476. project string
  73477. zone string
  73478. resource string
  73479. urlParams_ gensupport.URLParams
  73480. ifNoneMatch_ string
  73481. ctx_ context.Context
  73482. header_ http.Header
  73483. }
  73484. // GetIamPolicy: Gets the access control policy for a resource. May be
  73485. // empty if no such policy or resource exists.
  73486. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  73487. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73488. c.project = project
  73489. c.zone = zone
  73490. c.resource = resource
  73491. return c
  73492. }
  73493. // Fields allows partial responses to be retrieved. See
  73494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73495. // for more information.
  73496. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  73497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73498. return c
  73499. }
  73500. // IfNoneMatch sets the optional parameter which makes the operation
  73501. // fail if the object's ETag matches the given value. This is useful for
  73502. // getting updates only after the object has changed since the last
  73503. // request. Use googleapi.IsNotModified to check whether the response
  73504. // error from Do is the result of In-None-Match.
  73505. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  73506. c.ifNoneMatch_ = entityTag
  73507. return c
  73508. }
  73509. // Context sets the context to be used in this call's Do method. Any
  73510. // pending HTTP request will be aborted if the provided context is
  73511. // canceled.
  73512. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  73513. c.ctx_ = ctx
  73514. return c
  73515. }
  73516. // Header returns an http.Header that can be modified by the caller to
  73517. // add HTTP headers to the request.
  73518. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  73519. if c.header_ == nil {
  73520. c.header_ = make(http.Header)
  73521. }
  73522. return c.header_
  73523. }
  73524. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  73525. reqHeaders := make(http.Header)
  73526. for k, v := range c.header_ {
  73527. reqHeaders[k] = v
  73528. }
  73529. reqHeaders.Set("User-Agent", c.s.userAgent())
  73530. if c.ifNoneMatch_ != "" {
  73531. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73532. }
  73533. var body io.Reader = nil
  73534. c.urlParams_.Set("alt", alt)
  73535. c.urlParams_.Set("prettyPrint", "false")
  73536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  73537. urls += "?" + c.urlParams_.Encode()
  73538. req, err := http.NewRequest("GET", urls, body)
  73539. if err != nil {
  73540. return nil, err
  73541. }
  73542. req.Header = reqHeaders
  73543. googleapi.Expand(req.URL, map[string]string{
  73544. "project": c.project,
  73545. "zone": c.zone,
  73546. "resource": c.resource,
  73547. })
  73548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73549. }
  73550. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  73551. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  73552. // code is an error. Response headers are in either
  73553. // *Policy.ServerResponse.Header or (if a response was returned at all)
  73554. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  73555. // check whether the returned error was because http.StatusNotModified
  73556. // was returned.
  73557. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  73558. gensupport.SetOptions(c.urlParams_, opts...)
  73559. res, err := c.doRequest("json")
  73560. if res != nil && res.StatusCode == http.StatusNotModified {
  73561. if res.Body != nil {
  73562. res.Body.Close()
  73563. }
  73564. return nil, &googleapi.Error{
  73565. Code: res.StatusCode,
  73566. Header: res.Header,
  73567. }
  73568. }
  73569. if err != nil {
  73570. return nil, err
  73571. }
  73572. defer googleapi.CloseBody(res)
  73573. if err := googleapi.CheckResponse(res); err != nil {
  73574. return nil, err
  73575. }
  73576. ret := &Policy{
  73577. ServerResponse: googleapi.ServerResponse{
  73578. Header: res.Header,
  73579. HTTPStatusCode: res.StatusCode,
  73580. },
  73581. }
  73582. target := &ret
  73583. if err := gensupport.DecodeResponse(target, res); err != nil {
  73584. return nil, err
  73585. }
  73586. return ret, nil
  73587. // {
  73588. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  73589. // "httpMethod": "GET",
  73590. // "id": "compute.nodeGroups.getIamPolicy",
  73591. // "parameterOrder": [
  73592. // "project",
  73593. // "zone",
  73594. // "resource"
  73595. // ],
  73596. // "parameters": {
  73597. // "project": {
  73598. // "description": "Project ID for this request.",
  73599. // "location": "path",
  73600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73601. // "required": true,
  73602. // "type": "string"
  73603. // },
  73604. // "resource": {
  73605. // "description": "Name or id of the resource for this request.",
  73606. // "location": "path",
  73607. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73608. // "required": true,
  73609. // "type": "string"
  73610. // },
  73611. // "zone": {
  73612. // "description": "The name of the zone for this request.",
  73613. // "location": "path",
  73614. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73615. // "required": true,
  73616. // "type": "string"
  73617. // }
  73618. // },
  73619. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  73620. // "response": {
  73621. // "$ref": "Policy"
  73622. // },
  73623. // "scopes": [
  73624. // "https://www.googleapis.com/auth/cloud-platform",
  73625. // "https://www.googleapis.com/auth/compute",
  73626. // "https://www.googleapis.com/auth/compute.readonly"
  73627. // ]
  73628. // }
  73629. }
  73630. // method id "compute.nodeGroups.insert":
  73631. type NodeGroupsInsertCall struct {
  73632. s *Service
  73633. project string
  73634. zone string
  73635. nodegroup *NodeGroup
  73636. urlParams_ gensupport.URLParams
  73637. ctx_ context.Context
  73638. header_ http.Header
  73639. }
  73640. // Insert: Creates a NodeGroup resource in the specified project using
  73641. // the data included in the request.
  73642. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  73643. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73644. c.project = project
  73645. c.zone = zone
  73646. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  73647. c.nodegroup = nodegroup
  73648. return c
  73649. }
  73650. // RequestId sets the optional parameter "requestId": An optional
  73651. // request ID to identify requests. Specify a unique request ID so that
  73652. // if you must retry your request, the server will know to ignore the
  73653. // request if it has already been completed.
  73654. //
  73655. // For example, consider a situation where you make an initial request
  73656. // and the request times out. If you make the request again with the
  73657. // same request ID, the server can check if original operation with the
  73658. // same request ID was received, and if so, will ignore the second
  73659. // request. This prevents clients from accidentally creating duplicate
  73660. // commitments.
  73661. //
  73662. // The request ID must be a valid UUID with the exception that zero UUID
  73663. // is not supported (00000000-0000-0000-0000-000000000000).
  73664. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  73665. c.urlParams_.Set("requestId", requestId)
  73666. return c
  73667. }
  73668. // Fields allows partial responses to be retrieved. See
  73669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73670. // for more information.
  73671. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  73672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73673. return c
  73674. }
  73675. // Context sets the context to be used in this call's Do method. Any
  73676. // pending HTTP request will be aborted if the provided context is
  73677. // canceled.
  73678. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  73679. c.ctx_ = ctx
  73680. return c
  73681. }
  73682. // Header returns an http.Header that can be modified by the caller to
  73683. // add HTTP headers to the request.
  73684. func (c *NodeGroupsInsertCall) Header() http.Header {
  73685. if c.header_ == nil {
  73686. c.header_ = make(http.Header)
  73687. }
  73688. return c.header_
  73689. }
  73690. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  73691. reqHeaders := make(http.Header)
  73692. for k, v := range c.header_ {
  73693. reqHeaders[k] = v
  73694. }
  73695. reqHeaders.Set("User-Agent", c.s.userAgent())
  73696. var body io.Reader = nil
  73697. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  73698. if err != nil {
  73699. return nil, err
  73700. }
  73701. reqHeaders.Set("Content-Type", "application/json")
  73702. c.urlParams_.Set("alt", alt)
  73703. c.urlParams_.Set("prettyPrint", "false")
  73704. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  73705. urls += "?" + c.urlParams_.Encode()
  73706. req, err := http.NewRequest("POST", urls, body)
  73707. if err != nil {
  73708. return nil, err
  73709. }
  73710. req.Header = reqHeaders
  73711. googleapi.Expand(req.URL, map[string]string{
  73712. "project": c.project,
  73713. "zone": c.zone,
  73714. })
  73715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73716. }
  73717. // Do executes the "compute.nodeGroups.insert" call.
  73718. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73719. // status code is an error. Response headers are in either
  73720. // *Operation.ServerResponse.Header or (if a response was returned at
  73721. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73722. // to check whether the returned error was because
  73723. // http.StatusNotModified was returned.
  73724. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73725. gensupport.SetOptions(c.urlParams_, opts...)
  73726. res, err := c.doRequest("json")
  73727. if res != nil && res.StatusCode == http.StatusNotModified {
  73728. if res.Body != nil {
  73729. res.Body.Close()
  73730. }
  73731. return nil, &googleapi.Error{
  73732. Code: res.StatusCode,
  73733. Header: res.Header,
  73734. }
  73735. }
  73736. if err != nil {
  73737. return nil, err
  73738. }
  73739. defer googleapi.CloseBody(res)
  73740. if err := googleapi.CheckResponse(res); err != nil {
  73741. return nil, err
  73742. }
  73743. ret := &Operation{
  73744. ServerResponse: googleapi.ServerResponse{
  73745. Header: res.Header,
  73746. HTTPStatusCode: res.StatusCode,
  73747. },
  73748. }
  73749. target := &ret
  73750. if err := gensupport.DecodeResponse(target, res); err != nil {
  73751. return nil, err
  73752. }
  73753. return ret, nil
  73754. // {
  73755. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  73756. // "httpMethod": "POST",
  73757. // "id": "compute.nodeGroups.insert",
  73758. // "parameterOrder": [
  73759. // "project",
  73760. // "zone",
  73761. // "initialNodeCount"
  73762. // ],
  73763. // "parameters": {
  73764. // "initialNodeCount": {
  73765. // "description": "Initial count of nodes in the node group.",
  73766. // "format": "int32",
  73767. // "location": "query",
  73768. // "required": true,
  73769. // "type": "integer"
  73770. // },
  73771. // "project": {
  73772. // "description": "Project ID for this request.",
  73773. // "location": "path",
  73774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73775. // "required": true,
  73776. // "type": "string"
  73777. // },
  73778. // "requestId": {
  73779. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73780. // "location": "query",
  73781. // "type": "string"
  73782. // },
  73783. // "zone": {
  73784. // "description": "The name of the zone for this request.",
  73785. // "location": "path",
  73786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73787. // "required": true,
  73788. // "type": "string"
  73789. // }
  73790. // },
  73791. // "path": "{project}/zones/{zone}/nodeGroups",
  73792. // "request": {
  73793. // "$ref": "NodeGroup"
  73794. // },
  73795. // "response": {
  73796. // "$ref": "Operation"
  73797. // },
  73798. // "scopes": [
  73799. // "https://www.googleapis.com/auth/cloud-platform",
  73800. // "https://www.googleapis.com/auth/compute"
  73801. // ]
  73802. // }
  73803. }
  73804. // method id "compute.nodeGroups.list":
  73805. type NodeGroupsListCall struct {
  73806. s *Service
  73807. project string
  73808. zone string
  73809. urlParams_ gensupport.URLParams
  73810. ifNoneMatch_ string
  73811. ctx_ context.Context
  73812. header_ http.Header
  73813. }
  73814. // List: Retrieves a list of node groups available to the specified
  73815. // project. Note: use nodeGroups.listNodes for more details about each
  73816. // group.
  73817. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  73818. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73819. c.project = project
  73820. c.zone = zone
  73821. return c
  73822. }
  73823. // Filter sets the optional parameter "filter": A filter expression that
  73824. // filters resources listed in the response. The expression must specify
  73825. // the field name, a comparison operator, and the value that you want to
  73826. // use for filtering. The value must be a string, a number, or a
  73827. // boolean. The comparison operator must be either =, !=, >, or <.
  73828. //
  73829. // For example, if you are filtering Compute Engine instances, you can
  73830. // exclude instances named example-instance by specifying name !=
  73831. // example-instance.
  73832. //
  73833. // You can also filter nested fields. For example, you could specify
  73834. // scheduling.automaticRestart = false to include instances only if they
  73835. // are not scheduled for automatic restarts. You can use filtering on
  73836. // nested fields to filter based on resource labels.
  73837. //
  73838. // To filter on multiple expressions, provide each separate expression
  73839. // within parentheses. For example, (scheduling.automaticRestart = true)
  73840. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73841. // AND expression. However, you can include AND and OR expressions
  73842. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73843. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73844. // true).
  73845. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  73846. c.urlParams_.Set("filter", filter)
  73847. return c
  73848. }
  73849. // MaxResults sets the optional parameter "maxResults": The maximum
  73850. // number of results per page that should be returned. If the number of
  73851. // available results is larger than maxResults, Compute Engine returns a
  73852. // nextPageToken that can be used to get the next page of results in
  73853. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73854. // (Default: 500)
  73855. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  73856. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73857. return c
  73858. }
  73859. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73860. // a certain order. By default, results are returned in alphanumerical
  73861. // order based on the resource name.
  73862. //
  73863. // You can also sort results in descending order based on the creation
  73864. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73865. // based on the creationTimestamp field in reverse chronological order
  73866. // (newest result first). Use this to sort resources like operations so
  73867. // that the newest operation is returned first.
  73868. //
  73869. // Currently, only sorting by name or creationTimestamp desc is
  73870. // supported.
  73871. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  73872. c.urlParams_.Set("orderBy", orderBy)
  73873. return c
  73874. }
  73875. // PageToken sets the optional parameter "pageToken": Specifies a page
  73876. // token to use. Set pageToken to the nextPageToken returned by a
  73877. // previous list request to get the next page of results.
  73878. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  73879. c.urlParams_.Set("pageToken", pageToken)
  73880. return c
  73881. }
  73882. // Fields allows partial responses to be retrieved. See
  73883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73884. // for more information.
  73885. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  73886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73887. return c
  73888. }
  73889. // IfNoneMatch sets the optional parameter which makes the operation
  73890. // fail if the object's ETag matches the given value. This is useful for
  73891. // getting updates only after the object has changed since the last
  73892. // request. Use googleapi.IsNotModified to check whether the response
  73893. // error from Do is the result of In-None-Match.
  73894. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  73895. c.ifNoneMatch_ = entityTag
  73896. return c
  73897. }
  73898. // Context sets the context to be used in this call's Do method. Any
  73899. // pending HTTP request will be aborted if the provided context is
  73900. // canceled.
  73901. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  73902. c.ctx_ = ctx
  73903. return c
  73904. }
  73905. // Header returns an http.Header that can be modified by the caller to
  73906. // add HTTP headers to the request.
  73907. func (c *NodeGroupsListCall) Header() http.Header {
  73908. if c.header_ == nil {
  73909. c.header_ = make(http.Header)
  73910. }
  73911. return c.header_
  73912. }
  73913. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  73914. reqHeaders := make(http.Header)
  73915. for k, v := range c.header_ {
  73916. reqHeaders[k] = v
  73917. }
  73918. reqHeaders.Set("User-Agent", c.s.userAgent())
  73919. if c.ifNoneMatch_ != "" {
  73920. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73921. }
  73922. var body io.Reader = nil
  73923. c.urlParams_.Set("alt", alt)
  73924. c.urlParams_.Set("prettyPrint", "false")
  73925. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  73926. urls += "?" + c.urlParams_.Encode()
  73927. req, err := http.NewRequest("GET", urls, body)
  73928. if err != nil {
  73929. return nil, err
  73930. }
  73931. req.Header = reqHeaders
  73932. googleapi.Expand(req.URL, map[string]string{
  73933. "project": c.project,
  73934. "zone": c.zone,
  73935. })
  73936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73937. }
  73938. // Do executes the "compute.nodeGroups.list" call.
  73939. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  73940. // status code is an error. Response headers are in either
  73941. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  73942. // at all) in error.(*googleapi.Error).Header. Use
  73943. // googleapi.IsNotModified to check whether the returned error was
  73944. // because http.StatusNotModified was returned.
  73945. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  73946. gensupport.SetOptions(c.urlParams_, opts...)
  73947. res, err := c.doRequest("json")
  73948. if res != nil && res.StatusCode == http.StatusNotModified {
  73949. if res.Body != nil {
  73950. res.Body.Close()
  73951. }
  73952. return nil, &googleapi.Error{
  73953. Code: res.StatusCode,
  73954. Header: res.Header,
  73955. }
  73956. }
  73957. if err != nil {
  73958. return nil, err
  73959. }
  73960. defer googleapi.CloseBody(res)
  73961. if err := googleapi.CheckResponse(res); err != nil {
  73962. return nil, err
  73963. }
  73964. ret := &NodeGroupList{
  73965. ServerResponse: googleapi.ServerResponse{
  73966. Header: res.Header,
  73967. HTTPStatusCode: res.StatusCode,
  73968. },
  73969. }
  73970. target := &ret
  73971. if err := gensupport.DecodeResponse(target, res); err != nil {
  73972. return nil, err
  73973. }
  73974. return ret, nil
  73975. // {
  73976. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  73977. // "httpMethod": "GET",
  73978. // "id": "compute.nodeGroups.list",
  73979. // "parameterOrder": [
  73980. // "project",
  73981. // "zone"
  73982. // ],
  73983. // "parameters": {
  73984. // "filter": {
  73985. // "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).",
  73986. // "location": "query",
  73987. // "type": "string"
  73988. // },
  73989. // "maxResults": {
  73990. // "default": "500",
  73991. // "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)",
  73992. // "format": "uint32",
  73993. // "location": "query",
  73994. // "minimum": "0",
  73995. // "type": "integer"
  73996. // },
  73997. // "orderBy": {
  73998. // "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.",
  73999. // "location": "query",
  74000. // "type": "string"
  74001. // },
  74002. // "pageToken": {
  74003. // "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.",
  74004. // "location": "query",
  74005. // "type": "string"
  74006. // },
  74007. // "project": {
  74008. // "description": "Project ID for this request.",
  74009. // "location": "path",
  74010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74011. // "required": true,
  74012. // "type": "string"
  74013. // },
  74014. // "zone": {
  74015. // "description": "The name of the zone for this request.",
  74016. // "location": "path",
  74017. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74018. // "required": true,
  74019. // "type": "string"
  74020. // }
  74021. // },
  74022. // "path": "{project}/zones/{zone}/nodeGroups",
  74023. // "response": {
  74024. // "$ref": "NodeGroupList"
  74025. // },
  74026. // "scopes": [
  74027. // "https://www.googleapis.com/auth/cloud-platform",
  74028. // "https://www.googleapis.com/auth/compute",
  74029. // "https://www.googleapis.com/auth/compute.readonly"
  74030. // ]
  74031. // }
  74032. }
  74033. // Pages invokes f for each page of results.
  74034. // A non-nil error returned from f will halt the iteration.
  74035. // The provided context supersedes any context provided to the Context method.
  74036. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  74037. c.ctx_ = ctx
  74038. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74039. for {
  74040. x, err := c.Do()
  74041. if err != nil {
  74042. return err
  74043. }
  74044. if err := f(x); err != nil {
  74045. return err
  74046. }
  74047. if x.NextPageToken == "" {
  74048. return nil
  74049. }
  74050. c.PageToken(x.NextPageToken)
  74051. }
  74052. }
  74053. // method id "compute.nodeGroups.listNodes":
  74054. type NodeGroupsListNodesCall struct {
  74055. s *Service
  74056. project string
  74057. zone string
  74058. nodeGroup string
  74059. urlParams_ gensupport.URLParams
  74060. ctx_ context.Context
  74061. header_ http.Header
  74062. }
  74063. // ListNodes: Lists nodes in the node group.
  74064. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  74065. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74066. c.project = project
  74067. c.zone = zone
  74068. c.nodeGroup = nodeGroup
  74069. return c
  74070. }
  74071. // Filter sets the optional parameter "filter": A filter expression that
  74072. // filters resources listed in the response. The expression must specify
  74073. // the field name, a comparison operator, and the value that you want to
  74074. // use for filtering. The value must be a string, a number, or a
  74075. // boolean. The comparison operator must be either =, !=, >, or <.
  74076. //
  74077. // For example, if you are filtering Compute Engine instances, you can
  74078. // exclude instances named example-instance by specifying name !=
  74079. // example-instance.
  74080. //
  74081. // You can also filter nested fields. For example, you could specify
  74082. // scheduling.automaticRestart = false to include instances only if they
  74083. // are not scheduled for automatic restarts. You can use filtering on
  74084. // nested fields to filter based on resource labels.
  74085. //
  74086. // To filter on multiple expressions, provide each separate expression
  74087. // within parentheses. For example, (scheduling.automaticRestart = true)
  74088. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74089. // AND expression. However, you can include AND and OR expressions
  74090. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74091. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74092. // true).
  74093. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  74094. c.urlParams_.Set("filter", filter)
  74095. return c
  74096. }
  74097. // MaxResults sets the optional parameter "maxResults": The maximum
  74098. // number of results per page that should be returned. If the number of
  74099. // available results is larger than maxResults, Compute Engine returns a
  74100. // nextPageToken that can be used to get the next page of results in
  74101. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74102. // (Default: 500)
  74103. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  74104. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74105. return c
  74106. }
  74107. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74108. // a certain order. By default, results are returned in alphanumerical
  74109. // order based on the resource name.
  74110. //
  74111. // You can also sort results in descending order based on the creation
  74112. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74113. // based on the creationTimestamp field in reverse chronological order
  74114. // (newest result first). Use this to sort resources like operations so
  74115. // that the newest operation is returned first.
  74116. //
  74117. // Currently, only sorting by name or creationTimestamp desc is
  74118. // supported.
  74119. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  74120. c.urlParams_.Set("orderBy", orderBy)
  74121. return c
  74122. }
  74123. // PageToken sets the optional parameter "pageToken": Specifies a page
  74124. // token to use. Set pageToken to the nextPageToken returned by a
  74125. // previous list request to get the next page of results.
  74126. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  74127. c.urlParams_.Set("pageToken", pageToken)
  74128. return c
  74129. }
  74130. // Fields allows partial responses to be retrieved. See
  74131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74132. // for more information.
  74133. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  74134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74135. return c
  74136. }
  74137. // Context sets the context to be used in this call's Do method. Any
  74138. // pending HTTP request will be aborted if the provided context is
  74139. // canceled.
  74140. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  74141. c.ctx_ = ctx
  74142. return c
  74143. }
  74144. // Header returns an http.Header that can be modified by the caller to
  74145. // add HTTP headers to the request.
  74146. func (c *NodeGroupsListNodesCall) Header() http.Header {
  74147. if c.header_ == nil {
  74148. c.header_ = make(http.Header)
  74149. }
  74150. return c.header_
  74151. }
  74152. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  74153. reqHeaders := make(http.Header)
  74154. for k, v := range c.header_ {
  74155. reqHeaders[k] = v
  74156. }
  74157. reqHeaders.Set("User-Agent", c.s.userAgent())
  74158. var body io.Reader = nil
  74159. c.urlParams_.Set("alt", alt)
  74160. c.urlParams_.Set("prettyPrint", "false")
  74161. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  74162. urls += "?" + c.urlParams_.Encode()
  74163. req, err := http.NewRequest("POST", urls, body)
  74164. if err != nil {
  74165. return nil, err
  74166. }
  74167. req.Header = reqHeaders
  74168. googleapi.Expand(req.URL, map[string]string{
  74169. "project": c.project,
  74170. "zone": c.zone,
  74171. "nodeGroup": c.nodeGroup,
  74172. })
  74173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74174. }
  74175. // Do executes the "compute.nodeGroups.listNodes" call.
  74176. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  74177. // non-2xx status code is an error. Response headers are in either
  74178. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  74179. // returned at all) in error.(*googleapi.Error).Header. Use
  74180. // googleapi.IsNotModified to check whether the returned error was
  74181. // because http.StatusNotModified was returned.
  74182. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  74183. gensupport.SetOptions(c.urlParams_, opts...)
  74184. res, err := c.doRequest("json")
  74185. if res != nil && res.StatusCode == http.StatusNotModified {
  74186. if res.Body != nil {
  74187. res.Body.Close()
  74188. }
  74189. return nil, &googleapi.Error{
  74190. Code: res.StatusCode,
  74191. Header: res.Header,
  74192. }
  74193. }
  74194. if err != nil {
  74195. return nil, err
  74196. }
  74197. defer googleapi.CloseBody(res)
  74198. if err := googleapi.CheckResponse(res); err != nil {
  74199. return nil, err
  74200. }
  74201. ret := &NodeGroupsListNodes{
  74202. ServerResponse: googleapi.ServerResponse{
  74203. Header: res.Header,
  74204. HTTPStatusCode: res.StatusCode,
  74205. },
  74206. }
  74207. target := &ret
  74208. if err := gensupport.DecodeResponse(target, res); err != nil {
  74209. return nil, err
  74210. }
  74211. return ret, nil
  74212. // {
  74213. // "description": "Lists nodes in the node group.",
  74214. // "httpMethod": "POST",
  74215. // "id": "compute.nodeGroups.listNodes",
  74216. // "parameterOrder": [
  74217. // "project",
  74218. // "zone",
  74219. // "nodeGroup"
  74220. // ],
  74221. // "parameters": {
  74222. // "filter": {
  74223. // "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).",
  74224. // "location": "query",
  74225. // "type": "string"
  74226. // },
  74227. // "maxResults": {
  74228. // "default": "500",
  74229. // "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)",
  74230. // "format": "uint32",
  74231. // "location": "query",
  74232. // "minimum": "0",
  74233. // "type": "integer"
  74234. // },
  74235. // "nodeGroup": {
  74236. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  74237. // "location": "path",
  74238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74239. // "required": true,
  74240. // "type": "string"
  74241. // },
  74242. // "orderBy": {
  74243. // "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.",
  74244. // "location": "query",
  74245. // "type": "string"
  74246. // },
  74247. // "pageToken": {
  74248. // "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.",
  74249. // "location": "query",
  74250. // "type": "string"
  74251. // },
  74252. // "project": {
  74253. // "description": "Project ID for this request.",
  74254. // "location": "path",
  74255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74256. // "required": true,
  74257. // "type": "string"
  74258. // },
  74259. // "zone": {
  74260. // "description": "The name of the zone for this request.",
  74261. // "location": "path",
  74262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74263. // "required": true,
  74264. // "type": "string"
  74265. // }
  74266. // },
  74267. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  74268. // "response": {
  74269. // "$ref": "NodeGroupsListNodes"
  74270. // },
  74271. // "scopes": [
  74272. // "https://www.googleapis.com/auth/cloud-platform",
  74273. // "https://www.googleapis.com/auth/compute",
  74274. // "https://www.googleapis.com/auth/compute.readonly"
  74275. // ]
  74276. // }
  74277. }
  74278. // Pages invokes f for each page of results.
  74279. // A non-nil error returned from f will halt the iteration.
  74280. // The provided context supersedes any context provided to the Context method.
  74281. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  74282. c.ctx_ = ctx
  74283. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74284. for {
  74285. x, err := c.Do()
  74286. if err != nil {
  74287. return err
  74288. }
  74289. if err := f(x); err != nil {
  74290. return err
  74291. }
  74292. if x.NextPageToken == "" {
  74293. return nil
  74294. }
  74295. c.PageToken(x.NextPageToken)
  74296. }
  74297. }
  74298. // method id "compute.nodeGroups.setIamPolicy":
  74299. type NodeGroupsSetIamPolicyCall struct {
  74300. s *Service
  74301. project string
  74302. zone string
  74303. resource string
  74304. zonesetpolicyrequest *ZoneSetPolicyRequest
  74305. urlParams_ gensupport.URLParams
  74306. ctx_ context.Context
  74307. header_ http.Header
  74308. }
  74309. // SetIamPolicy: Sets the access control policy on the specified
  74310. // resource. Replaces any existing policy.
  74311. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  74312. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74313. c.project = project
  74314. c.zone = zone
  74315. c.resource = resource
  74316. c.zonesetpolicyrequest = zonesetpolicyrequest
  74317. return c
  74318. }
  74319. // Fields allows partial responses to be retrieved. See
  74320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74321. // for more information.
  74322. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  74323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74324. return c
  74325. }
  74326. // Context sets the context to be used in this call's Do method. Any
  74327. // pending HTTP request will be aborted if the provided context is
  74328. // canceled.
  74329. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  74330. c.ctx_ = ctx
  74331. return c
  74332. }
  74333. // Header returns an http.Header that can be modified by the caller to
  74334. // add HTTP headers to the request.
  74335. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  74336. if c.header_ == nil {
  74337. c.header_ = make(http.Header)
  74338. }
  74339. return c.header_
  74340. }
  74341. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  74342. reqHeaders := make(http.Header)
  74343. for k, v := range c.header_ {
  74344. reqHeaders[k] = v
  74345. }
  74346. reqHeaders.Set("User-Agent", c.s.userAgent())
  74347. var body io.Reader = nil
  74348. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  74349. if err != nil {
  74350. return nil, err
  74351. }
  74352. reqHeaders.Set("Content-Type", "application/json")
  74353. c.urlParams_.Set("alt", alt)
  74354. c.urlParams_.Set("prettyPrint", "false")
  74355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  74356. urls += "?" + c.urlParams_.Encode()
  74357. req, err := http.NewRequest("POST", urls, body)
  74358. if err != nil {
  74359. return nil, err
  74360. }
  74361. req.Header = reqHeaders
  74362. googleapi.Expand(req.URL, map[string]string{
  74363. "project": c.project,
  74364. "zone": c.zone,
  74365. "resource": c.resource,
  74366. })
  74367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74368. }
  74369. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  74370. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  74371. // code is an error. Response headers are in either
  74372. // *Policy.ServerResponse.Header or (if a response was returned at all)
  74373. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  74374. // check whether the returned error was because http.StatusNotModified
  74375. // was returned.
  74376. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  74377. gensupport.SetOptions(c.urlParams_, opts...)
  74378. res, err := c.doRequest("json")
  74379. if res != nil && res.StatusCode == http.StatusNotModified {
  74380. if res.Body != nil {
  74381. res.Body.Close()
  74382. }
  74383. return nil, &googleapi.Error{
  74384. Code: res.StatusCode,
  74385. Header: res.Header,
  74386. }
  74387. }
  74388. if err != nil {
  74389. return nil, err
  74390. }
  74391. defer googleapi.CloseBody(res)
  74392. if err := googleapi.CheckResponse(res); err != nil {
  74393. return nil, err
  74394. }
  74395. ret := &Policy{
  74396. ServerResponse: googleapi.ServerResponse{
  74397. Header: res.Header,
  74398. HTTPStatusCode: res.StatusCode,
  74399. },
  74400. }
  74401. target := &ret
  74402. if err := gensupport.DecodeResponse(target, res); err != nil {
  74403. return nil, err
  74404. }
  74405. return ret, nil
  74406. // {
  74407. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  74408. // "httpMethod": "POST",
  74409. // "id": "compute.nodeGroups.setIamPolicy",
  74410. // "parameterOrder": [
  74411. // "project",
  74412. // "zone",
  74413. // "resource"
  74414. // ],
  74415. // "parameters": {
  74416. // "project": {
  74417. // "description": "Project ID for this request.",
  74418. // "location": "path",
  74419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74420. // "required": true,
  74421. // "type": "string"
  74422. // },
  74423. // "resource": {
  74424. // "description": "Name or id of the resource for this request.",
  74425. // "location": "path",
  74426. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74427. // "required": true,
  74428. // "type": "string"
  74429. // },
  74430. // "zone": {
  74431. // "description": "The name of the zone for this request.",
  74432. // "location": "path",
  74433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74434. // "required": true,
  74435. // "type": "string"
  74436. // }
  74437. // },
  74438. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  74439. // "request": {
  74440. // "$ref": "ZoneSetPolicyRequest"
  74441. // },
  74442. // "response": {
  74443. // "$ref": "Policy"
  74444. // },
  74445. // "scopes": [
  74446. // "https://www.googleapis.com/auth/cloud-platform",
  74447. // "https://www.googleapis.com/auth/compute"
  74448. // ]
  74449. // }
  74450. }
  74451. // method id "compute.nodeGroups.setNodeTemplate":
  74452. type NodeGroupsSetNodeTemplateCall struct {
  74453. s *Service
  74454. project string
  74455. zone string
  74456. nodeGroup string
  74457. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  74458. urlParams_ gensupport.URLParams
  74459. ctx_ context.Context
  74460. header_ http.Header
  74461. }
  74462. // SetNodeTemplate: Updates the node template of the node group.
  74463. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  74464. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74465. c.project = project
  74466. c.zone = zone
  74467. c.nodeGroup = nodeGroup
  74468. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  74469. return c
  74470. }
  74471. // RequestId sets the optional parameter "requestId": An optional
  74472. // request ID to identify requests. Specify a unique request ID so that
  74473. // if you must retry your request, the server will know to ignore the
  74474. // request if it has already been completed.
  74475. //
  74476. // For example, consider a situation where you make an initial request
  74477. // and the request times out. If you make the request again with the
  74478. // same request ID, the server can check if original operation with the
  74479. // same request ID was received, and if so, will ignore the second
  74480. // request. This prevents clients from accidentally creating duplicate
  74481. // commitments.
  74482. //
  74483. // The request ID must be a valid UUID with the exception that zero UUID
  74484. // is not supported (00000000-0000-0000-0000-000000000000).
  74485. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  74486. c.urlParams_.Set("requestId", requestId)
  74487. return c
  74488. }
  74489. // Fields allows partial responses to be retrieved. See
  74490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74491. // for more information.
  74492. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  74493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74494. return c
  74495. }
  74496. // Context sets the context to be used in this call's Do method. Any
  74497. // pending HTTP request will be aborted if the provided context is
  74498. // canceled.
  74499. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  74500. c.ctx_ = ctx
  74501. return c
  74502. }
  74503. // Header returns an http.Header that can be modified by the caller to
  74504. // add HTTP headers to the request.
  74505. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  74506. if c.header_ == nil {
  74507. c.header_ = make(http.Header)
  74508. }
  74509. return c.header_
  74510. }
  74511. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  74512. reqHeaders := make(http.Header)
  74513. for k, v := range c.header_ {
  74514. reqHeaders[k] = v
  74515. }
  74516. reqHeaders.Set("User-Agent", c.s.userAgent())
  74517. var body io.Reader = nil
  74518. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  74519. if err != nil {
  74520. return nil, err
  74521. }
  74522. reqHeaders.Set("Content-Type", "application/json")
  74523. c.urlParams_.Set("alt", alt)
  74524. c.urlParams_.Set("prettyPrint", "false")
  74525. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  74526. urls += "?" + c.urlParams_.Encode()
  74527. req, err := http.NewRequest("POST", urls, body)
  74528. if err != nil {
  74529. return nil, err
  74530. }
  74531. req.Header = reqHeaders
  74532. googleapi.Expand(req.URL, map[string]string{
  74533. "project": c.project,
  74534. "zone": c.zone,
  74535. "nodeGroup": c.nodeGroup,
  74536. })
  74537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74538. }
  74539. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  74540. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74541. // status code is an error. Response headers are in either
  74542. // *Operation.ServerResponse.Header or (if a response was returned at
  74543. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74544. // to check whether the returned error was because
  74545. // http.StatusNotModified was returned.
  74546. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74547. gensupport.SetOptions(c.urlParams_, opts...)
  74548. res, err := c.doRequest("json")
  74549. if res != nil && res.StatusCode == http.StatusNotModified {
  74550. if res.Body != nil {
  74551. res.Body.Close()
  74552. }
  74553. return nil, &googleapi.Error{
  74554. Code: res.StatusCode,
  74555. Header: res.Header,
  74556. }
  74557. }
  74558. if err != nil {
  74559. return nil, err
  74560. }
  74561. defer googleapi.CloseBody(res)
  74562. if err := googleapi.CheckResponse(res); err != nil {
  74563. return nil, err
  74564. }
  74565. ret := &Operation{
  74566. ServerResponse: googleapi.ServerResponse{
  74567. Header: res.Header,
  74568. HTTPStatusCode: res.StatusCode,
  74569. },
  74570. }
  74571. target := &ret
  74572. if err := gensupport.DecodeResponse(target, res); err != nil {
  74573. return nil, err
  74574. }
  74575. return ret, nil
  74576. // {
  74577. // "description": "Updates the node template of the node group.",
  74578. // "httpMethod": "POST",
  74579. // "id": "compute.nodeGroups.setNodeTemplate",
  74580. // "parameterOrder": [
  74581. // "project",
  74582. // "zone",
  74583. // "nodeGroup"
  74584. // ],
  74585. // "parameters": {
  74586. // "nodeGroup": {
  74587. // "description": "Name of the NodeGroup resource to delete.",
  74588. // "location": "path",
  74589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74590. // "required": true,
  74591. // "type": "string"
  74592. // },
  74593. // "project": {
  74594. // "description": "Project ID for this request.",
  74595. // "location": "path",
  74596. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74597. // "required": true,
  74598. // "type": "string"
  74599. // },
  74600. // "requestId": {
  74601. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74602. // "location": "query",
  74603. // "type": "string"
  74604. // },
  74605. // "zone": {
  74606. // "description": "The name of the zone for this request.",
  74607. // "location": "path",
  74608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74609. // "required": true,
  74610. // "type": "string"
  74611. // }
  74612. // },
  74613. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  74614. // "request": {
  74615. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  74616. // },
  74617. // "response": {
  74618. // "$ref": "Operation"
  74619. // },
  74620. // "scopes": [
  74621. // "https://www.googleapis.com/auth/cloud-platform",
  74622. // "https://www.googleapis.com/auth/compute"
  74623. // ]
  74624. // }
  74625. }
  74626. // method id "compute.nodeGroups.testIamPermissions":
  74627. type NodeGroupsTestIamPermissionsCall struct {
  74628. s *Service
  74629. project string
  74630. zone string
  74631. resource string
  74632. testpermissionsrequest *TestPermissionsRequest
  74633. urlParams_ gensupport.URLParams
  74634. ctx_ context.Context
  74635. header_ http.Header
  74636. }
  74637. // TestIamPermissions: Returns permissions that a caller has on the
  74638. // specified resource.
  74639. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  74640. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74641. c.project = project
  74642. c.zone = zone
  74643. c.resource = resource
  74644. c.testpermissionsrequest = testpermissionsrequest
  74645. return c
  74646. }
  74647. // Fields allows partial responses to be retrieved. See
  74648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74649. // for more information.
  74650. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  74651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74652. return c
  74653. }
  74654. // Context sets the context to be used in this call's Do method. Any
  74655. // pending HTTP request will be aborted if the provided context is
  74656. // canceled.
  74657. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  74658. c.ctx_ = ctx
  74659. return c
  74660. }
  74661. // Header returns an http.Header that can be modified by the caller to
  74662. // add HTTP headers to the request.
  74663. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  74664. if c.header_ == nil {
  74665. c.header_ = make(http.Header)
  74666. }
  74667. return c.header_
  74668. }
  74669. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  74670. reqHeaders := make(http.Header)
  74671. for k, v := range c.header_ {
  74672. reqHeaders[k] = v
  74673. }
  74674. reqHeaders.Set("User-Agent", c.s.userAgent())
  74675. var body io.Reader = nil
  74676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  74677. if err != nil {
  74678. return nil, err
  74679. }
  74680. reqHeaders.Set("Content-Type", "application/json")
  74681. c.urlParams_.Set("alt", alt)
  74682. c.urlParams_.Set("prettyPrint", "false")
  74683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  74684. urls += "?" + c.urlParams_.Encode()
  74685. req, err := http.NewRequest("POST", urls, body)
  74686. if err != nil {
  74687. return nil, err
  74688. }
  74689. req.Header = reqHeaders
  74690. googleapi.Expand(req.URL, map[string]string{
  74691. "project": c.project,
  74692. "zone": c.zone,
  74693. "resource": c.resource,
  74694. })
  74695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74696. }
  74697. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  74698. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  74699. // non-2xx status code is an error. Response headers are in either
  74700. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  74701. // returned at all) in error.(*googleapi.Error).Header. Use
  74702. // googleapi.IsNotModified to check whether the returned error was
  74703. // because http.StatusNotModified was returned.
  74704. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  74705. gensupport.SetOptions(c.urlParams_, opts...)
  74706. res, err := c.doRequest("json")
  74707. if res != nil && res.StatusCode == http.StatusNotModified {
  74708. if res.Body != nil {
  74709. res.Body.Close()
  74710. }
  74711. return nil, &googleapi.Error{
  74712. Code: res.StatusCode,
  74713. Header: res.Header,
  74714. }
  74715. }
  74716. if err != nil {
  74717. return nil, err
  74718. }
  74719. defer googleapi.CloseBody(res)
  74720. if err := googleapi.CheckResponse(res); err != nil {
  74721. return nil, err
  74722. }
  74723. ret := &TestPermissionsResponse{
  74724. ServerResponse: googleapi.ServerResponse{
  74725. Header: res.Header,
  74726. HTTPStatusCode: res.StatusCode,
  74727. },
  74728. }
  74729. target := &ret
  74730. if err := gensupport.DecodeResponse(target, res); err != nil {
  74731. return nil, err
  74732. }
  74733. return ret, nil
  74734. // {
  74735. // "description": "Returns permissions that a caller has on the specified resource.",
  74736. // "httpMethod": "POST",
  74737. // "id": "compute.nodeGroups.testIamPermissions",
  74738. // "parameterOrder": [
  74739. // "project",
  74740. // "zone",
  74741. // "resource"
  74742. // ],
  74743. // "parameters": {
  74744. // "project": {
  74745. // "description": "Project ID for this request.",
  74746. // "location": "path",
  74747. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74748. // "required": true,
  74749. // "type": "string"
  74750. // },
  74751. // "resource": {
  74752. // "description": "Name or id of the resource for this request.",
  74753. // "location": "path",
  74754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74755. // "required": true,
  74756. // "type": "string"
  74757. // },
  74758. // "zone": {
  74759. // "description": "The name of the zone for this request.",
  74760. // "location": "path",
  74761. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74762. // "required": true,
  74763. // "type": "string"
  74764. // }
  74765. // },
  74766. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  74767. // "request": {
  74768. // "$ref": "TestPermissionsRequest"
  74769. // },
  74770. // "response": {
  74771. // "$ref": "TestPermissionsResponse"
  74772. // },
  74773. // "scopes": [
  74774. // "https://www.googleapis.com/auth/cloud-platform",
  74775. // "https://www.googleapis.com/auth/compute",
  74776. // "https://www.googleapis.com/auth/compute.readonly"
  74777. // ]
  74778. // }
  74779. }
  74780. // method id "compute.nodeTemplates.aggregatedList":
  74781. type NodeTemplatesAggregatedListCall struct {
  74782. s *Service
  74783. project string
  74784. urlParams_ gensupport.URLParams
  74785. ifNoneMatch_ string
  74786. ctx_ context.Context
  74787. header_ http.Header
  74788. }
  74789. // AggregatedList: Retrieves an aggregated list of node templates.
  74790. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  74791. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74792. c.project = project
  74793. return c
  74794. }
  74795. // Filter sets the optional parameter "filter": A filter expression that
  74796. // filters resources listed in the response. The expression must specify
  74797. // the field name, a comparison operator, and the value that you want to
  74798. // use for filtering. The value must be a string, a number, or a
  74799. // boolean. The comparison operator must be either =, !=, >, or <.
  74800. //
  74801. // For example, if you are filtering Compute Engine instances, you can
  74802. // exclude instances named example-instance by specifying name !=
  74803. // example-instance.
  74804. //
  74805. // You can also filter nested fields. For example, you could specify
  74806. // scheduling.automaticRestart = false to include instances only if they
  74807. // are not scheduled for automatic restarts. You can use filtering on
  74808. // nested fields to filter based on resource labels.
  74809. //
  74810. // To filter on multiple expressions, provide each separate expression
  74811. // within parentheses. For example, (scheduling.automaticRestart = true)
  74812. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74813. // AND expression. However, you can include AND and OR expressions
  74814. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74815. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74816. // true).
  74817. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  74818. c.urlParams_.Set("filter", filter)
  74819. return c
  74820. }
  74821. // MaxResults sets the optional parameter "maxResults": The maximum
  74822. // number of results per page that should be returned. If the number of
  74823. // available results is larger than maxResults, Compute Engine returns a
  74824. // nextPageToken that can be used to get the next page of results in
  74825. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74826. // (Default: 500)
  74827. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  74828. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74829. return c
  74830. }
  74831. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74832. // a certain order. By default, results are returned in alphanumerical
  74833. // order based on the resource name.
  74834. //
  74835. // You can also sort results in descending order based on the creation
  74836. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74837. // based on the creationTimestamp field in reverse chronological order
  74838. // (newest result first). Use this to sort resources like operations so
  74839. // that the newest operation is returned first.
  74840. //
  74841. // Currently, only sorting by name or creationTimestamp desc is
  74842. // supported.
  74843. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  74844. c.urlParams_.Set("orderBy", orderBy)
  74845. return c
  74846. }
  74847. // PageToken sets the optional parameter "pageToken": Specifies a page
  74848. // token to use. Set pageToken to the nextPageToken returned by a
  74849. // previous list request to get the next page of results.
  74850. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  74851. c.urlParams_.Set("pageToken", pageToken)
  74852. return c
  74853. }
  74854. // Fields allows partial responses to be retrieved. See
  74855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74856. // for more information.
  74857. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  74858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74859. return c
  74860. }
  74861. // IfNoneMatch sets the optional parameter which makes the operation
  74862. // fail if the object's ETag matches the given value. This is useful for
  74863. // getting updates only after the object has changed since the last
  74864. // request. Use googleapi.IsNotModified to check whether the response
  74865. // error from Do is the result of In-None-Match.
  74866. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  74867. c.ifNoneMatch_ = entityTag
  74868. return c
  74869. }
  74870. // Context sets the context to be used in this call's Do method. Any
  74871. // pending HTTP request will be aborted if the provided context is
  74872. // canceled.
  74873. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  74874. c.ctx_ = ctx
  74875. return c
  74876. }
  74877. // Header returns an http.Header that can be modified by the caller to
  74878. // add HTTP headers to the request.
  74879. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  74880. if c.header_ == nil {
  74881. c.header_ = make(http.Header)
  74882. }
  74883. return c.header_
  74884. }
  74885. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  74886. reqHeaders := make(http.Header)
  74887. for k, v := range c.header_ {
  74888. reqHeaders[k] = v
  74889. }
  74890. reqHeaders.Set("User-Agent", c.s.userAgent())
  74891. if c.ifNoneMatch_ != "" {
  74892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74893. }
  74894. var body io.Reader = nil
  74895. c.urlParams_.Set("alt", alt)
  74896. c.urlParams_.Set("prettyPrint", "false")
  74897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  74898. urls += "?" + c.urlParams_.Encode()
  74899. req, err := http.NewRequest("GET", urls, body)
  74900. if err != nil {
  74901. return nil, err
  74902. }
  74903. req.Header = reqHeaders
  74904. googleapi.Expand(req.URL, map[string]string{
  74905. "project": c.project,
  74906. })
  74907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74908. }
  74909. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  74910. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  74911. // Any non-2xx status code is an error. Response headers are in either
  74912. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  74913. // was returned at all) in error.(*googleapi.Error).Header. Use
  74914. // googleapi.IsNotModified to check whether the returned error was
  74915. // because http.StatusNotModified was returned.
  74916. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  74917. gensupport.SetOptions(c.urlParams_, opts...)
  74918. res, err := c.doRequest("json")
  74919. if res != nil && res.StatusCode == http.StatusNotModified {
  74920. if res.Body != nil {
  74921. res.Body.Close()
  74922. }
  74923. return nil, &googleapi.Error{
  74924. Code: res.StatusCode,
  74925. Header: res.Header,
  74926. }
  74927. }
  74928. if err != nil {
  74929. return nil, err
  74930. }
  74931. defer googleapi.CloseBody(res)
  74932. if err := googleapi.CheckResponse(res); err != nil {
  74933. return nil, err
  74934. }
  74935. ret := &NodeTemplateAggregatedList{
  74936. ServerResponse: googleapi.ServerResponse{
  74937. Header: res.Header,
  74938. HTTPStatusCode: res.StatusCode,
  74939. },
  74940. }
  74941. target := &ret
  74942. if err := gensupport.DecodeResponse(target, res); err != nil {
  74943. return nil, err
  74944. }
  74945. return ret, nil
  74946. // {
  74947. // "description": "Retrieves an aggregated list of node templates.",
  74948. // "httpMethod": "GET",
  74949. // "id": "compute.nodeTemplates.aggregatedList",
  74950. // "parameterOrder": [
  74951. // "project"
  74952. // ],
  74953. // "parameters": {
  74954. // "filter": {
  74955. // "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).",
  74956. // "location": "query",
  74957. // "type": "string"
  74958. // },
  74959. // "maxResults": {
  74960. // "default": "500",
  74961. // "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)",
  74962. // "format": "uint32",
  74963. // "location": "query",
  74964. // "minimum": "0",
  74965. // "type": "integer"
  74966. // },
  74967. // "orderBy": {
  74968. // "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.",
  74969. // "location": "query",
  74970. // "type": "string"
  74971. // },
  74972. // "pageToken": {
  74973. // "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.",
  74974. // "location": "query",
  74975. // "type": "string"
  74976. // },
  74977. // "project": {
  74978. // "description": "Project ID for this request.",
  74979. // "location": "path",
  74980. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74981. // "required": true,
  74982. // "type": "string"
  74983. // }
  74984. // },
  74985. // "path": "{project}/aggregated/nodeTemplates",
  74986. // "response": {
  74987. // "$ref": "NodeTemplateAggregatedList"
  74988. // },
  74989. // "scopes": [
  74990. // "https://www.googleapis.com/auth/cloud-platform",
  74991. // "https://www.googleapis.com/auth/compute",
  74992. // "https://www.googleapis.com/auth/compute.readonly"
  74993. // ]
  74994. // }
  74995. }
  74996. // Pages invokes f for each page of results.
  74997. // A non-nil error returned from f will halt the iteration.
  74998. // The provided context supersedes any context provided to the Context method.
  74999. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  75000. c.ctx_ = ctx
  75001. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75002. for {
  75003. x, err := c.Do()
  75004. if err != nil {
  75005. return err
  75006. }
  75007. if err := f(x); err != nil {
  75008. return err
  75009. }
  75010. if x.NextPageToken == "" {
  75011. return nil
  75012. }
  75013. c.PageToken(x.NextPageToken)
  75014. }
  75015. }
  75016. // method id "compute.nodeTemplates.delete":
  75017. type NodeTemplatesDeleteCall struct {
  75018. s *Service
  75019. project string
  75020. region string
  75021. nodeTemplate string
  75022. urlParams_ gensupport.URLParams
  75023. ctx_ context.Context
  75024. header_ http.Header
  75025. }
  75026. // Delete: Deletes the specified NodeTemplate resource.
  75027. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  75028. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75029. c.project = project
  75030. c.region = region
  75031. c.nodeTemplate = nodeTemplate
  75032. return c
  75033. }
  75034. // RequestId sets the optional parameter "requestId": An optional
  75035. // request ID to identify requests. Specify a unique request ID so that
  75036. // if you must retry your request, the server will know to ignore the
  75037. // request if it has already been completed.
  75038. //
  75039. // For example, consider a situation where you make an initial request
  75040. // and the request times out. If you make the request again with the
  75041. // same request ID, the server can check if original operation with the
  75042. // same request ID was received, and if so, will ignore the second
  75043. // request. This prevents clients from accidentally creating duplicate
  75044. // commitments.
  75045. //
  75046. // The request ID must be a valid UUID with the exception that zero UUID
  75047. // is not supported (00000000-0000-0000-0000-000000000000).
  75048. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  75049. c.urlParams_.Set("requestId", requestId)
  75050. return c
  75051. }
  75052. // Fields allows partial responses to be retrieved. See
  75053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75054. // for more information.
  75055. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  75056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75057. return c
  75058. }
  75059. // Context sets the context to be used in this call's Do method. Any
  75060. // pending HTTP request will be aborted if the provided context is
  75061. // canceled.
  75062. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  75063. c.ctx_ = ctx
  75064. return c
  75065. }
  75066. // Header returns an http.Header that can be modified by the caller to
  75067. // add HTTP headers to the request.
  75068. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  75069. if c.header_ == nil {
  75070. c.header_ = make(http.Header)
  75071. }
  75072. return c.header_
  75073. }
  75074. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  75075. reqHeaders := make(http.Header)
  75076. for k, v := range c.header_ {
  75077. reqHeaders[k] = v
  75078. }
  75079. reqHeaders.Set("User-Agent", c.s.userAgent())
  75080. var body io.Reader = nil
  75081. c.urlParams_.Set("alt", alt)
  75082. c.urlParams_.Set("prettyPrint", "false")
  75083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  75084. urls += "?" + c.urlParams_.Encode()
  75085. req, err := http.NewRequest("DELETE", urls, body)
  75086. if err != nil {
  75087. return nil, err
  75088. }
  75089. req.Header = reqHeaders
  75090. googleapi.Expand(req.URL, map[string]string{
  75091. "project": c.project,
  75092. "region": c.region,
  75093. "nodeTemplate": c.nodeTemplate,
  75094. })
  75095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75096. }
  75097. // Do executes the "compute.nodeTemplates.delete" call.
  75098. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75099. // status code is an error. Response headers are in either
  75100. // *Operation.ServerResponse.Header or (if a response was returned at
  75101. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75102. // to check whether the returned error was because
  75103. // http.StatusNotModified was returned.
  75104. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75105. gensupport.SetOptions(c.urlParams_, opts...)
  75106. res, err := c.doRequest("json")
  75107. if res != nil && res.StatusCode == http.StatusNotModified {
  75108. if res.Body != nil {
  75109. res.Body.Close()
  75110. }
  75111. return nil, &googleapi.Error{
  75112. Code: res.StatusCode,
  75113. Header: res.Header,
  75114. }
  75115. }
  75116. if err != nil {
  75117. return nil, err
  75118. }
  75119. defer googleapi.CloseBody(res)
  75120. if err := googleapi.CheckResponse(res); err != nil {
  75121. return nil, err
  75122. }
  75123. ret := &Operation{
  75124. ServerResponse: googleapi.ServerResponse{
  75125. Header: res.Header,
  75126. HTTPStatusCode: res.StatusCode,
  75127. },
  75128. }
  75129. target := &ret
  75130. if err := gensupport.DecodeResponse(target, res); err != nil {
  75131. return nil, err
  75132. }
  75133. return ret, nil
  75134. // {
  75135. // "description": "Deletes the specified NodeTemplate resource.",
  75136. // "httpMethod": "DELETE",
  75137. // "id": "compute.nodeTemplates.delete",
  75138. // "parameterOrder": [
  75139. // "project",
  75140. // "region",
  75141. // "nodeTemplate"
  75142. // ],
  75143. // "parameters": {
  75144. // "nodeTemplate": {
  75145. // "description": "Name of the NodeTemplate resource to delete.",
  75146. // "location": "path",
  75147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75148. // "required": true,
  75149. // "type": "string"
  75150. // },
  75151. // "project": {
  75152. // "description": "Project ID for this request.",
  75153. // "location": "path",
  75154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75155. // "required": true,
  75156. // "type": "string"
  75157. // },
  75158. // "region": {
  75159. // "description": "The name of the region for this request.",
  75160. // "location": "path",
  75161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75162. // "required": true,
  75163. // "type": "string"
  75164. // },
  75165. // "requestId": {
  75166. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75167. // "location": "query",
  75168. // "type": "string"
  75169. // }
  75170. // },
  75171. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  75172. // "response": {
  75173. // "$ref": "Operation"
  75174. // },
  75175. // "scopes": [
  75176. // "https://www.googleapis.com/auth/cloud-platform",
  75177. // "https://www.googleapis.com/auth/compute"
  75178. // ]
  75179. // }
  75180. }
  75181. // method id "compute.nodeTemplates.get":
  75182. type NodeTemplatesGetCall struct {
  75183. s *Service
  75184. project string
  75185. region string
  75186. nodeTemplate string
  75187. urlParams_ gensupport.URLParams
  75188. ifNoneMatch_ string
  75189. ctx_ context.Context
  75190. header_ http.Header
  75191. }
  75192. // Get: Returns the specified node template. Gets a list of available
  75193. // node templates by making a list() request.
  75194. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  75195. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75196. c.project = project
  75197. c.region = region
  75198. c.nodeTemplate = nodeTemplate
  75199. return c
  75200. }
  75201. // Fields allows partial responses to be retrieved. See
  75202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75203. // for more information.
  75204. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  75205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75206. return c
  75207. }
  75208. // IfNoneMatch sets the optional parameter which makes the operation
  75209. // fail if the object's ETag matches the given value. This is useful for
  75210. // getting updates only after the object has changed since the last
  75211. // request. Use googleapi.IsNotModified to check whether the response
  75212. // error from Do is the result of In-None-Match.
  75213. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  75214. c.ifNoneMatch_ = entityTag
  75215. return c
  75216. }
  75217. // Context sets the context to be used in this call's Do method. Any
  75218. // pending HTTP request will be aborted if the provided context is
  75219. // canceled.
  75220. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  75221. c.ctx_ = ctx
  75222. return c
  75223. }
  75224. // Header returns an http.Header that can be modified by the caller to
  75225. // add HTTP headers to the request.
  75226. func (c *NodeTemplatesGetCall) Header() http.Header {
  75227. if c.header_ == nil {
  75228. c.header_ = make(http.Header)
  75229. }
  75230. return c.header_
  75231. }
  75232. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  75233. reqHeaders := make(http.Header)
  75234. for k, v := range c.header_ {
  75235. reqHeaders[k] = v
  75236. }
  75237. reqHeaders.Set("User-Agent", c.s.userAgent())
  75238. if c.ifNoneMatch_ != "" {
  75239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75240. }
  75241. var body io.Reader = nil
  75242. c.urlParams_.Set("alt", alt)
  75243. c.urlParams_.Set("prettyPrint", "false")
  75244. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  75245. urls += "?" + c.urlParams_.Encode()
  75246. req, err := http.NewRequest("GET", urls, body)
  75247. if err != nil {
  75248. return nil, err
  75249. }
  75250. req.Header = reqHeaders
  75251. googleapi.Expand(req.URL, map[string]string{
  75252. "project": c.project,
  75253. "region": c.region,
  75254. "nodeTemplate": c.nodeTemplate,
  75255. })
  75256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75257. }
  75258. // Do executes the "compute.nodeTemplates.get" call.
  75259. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  75260. // status code is an error. Response headers are in either
  75261. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  75262. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75263. // to check whether the returned error was because
  75264. // http.StatusNotModified was returned.
  75265. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  75266. gensupport.SetOptions(c.urlParams_, opts...)
  75267. res, err := c.doRequest("json")
  75268. if res != nil && res.StatusCode == http.StatusNotModified {
  75269. if res.Body != nil {
  75270. res.Body.Close()
  75271. }
  75272. return nil, &googleapi.Error{
  75273. Code: res.StatusCode,
  75274. Header: res.Header,
  75275. }
  75276. }
  75277. if err != nil {
  75278. return nil, err
  75279. }
  75280. defer googleapi.CloseBody(res)
  75281. if err := googleapi.CheckResponse(res); err != nil {
  75282. return nil, err
  75283. }
  75284. ret := &NodeTemplate{
  75285. ServerResponse: googleapi.ServerResponse{
  75286. Header: res.Header,
  75287. HTTPStatusCode: res.StatusCode,
  75288. },
  75289. }
  75290. target := &ret
  75291. if err := gensupport.DecodeResponse(target, res); err != nil {
  75292. return nil, err
  75293. }
  75294. return ret, nil
  75295. // {
  75296. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  75297. // "httpMethod": "GET",
  75298. // "id": "compute.nodeTemplates.get",
  75299. // "parameterOrder": [
  75300. // "project",
  75301. // "region",
  75302. // "nodeTemplate"
  75303. // ],
  75304. // "parameters": {
  75305. // "nodeTemplate": {
  75306. // "description": "Name of the node template to return.",
  75307. // "location": "path",
  75308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75309. // "required": true,
  75310. // "type": "string"
  75311. // },
  75312. // "project": {
  75313. // "description": "Project ID for this request.",
  75314. // "location": "path",
  75315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75316. // "required": true,
  75317. // "type": "string"
  75318. // },
  75319. // "region": {
  75320. // "description": "The name of the region for this request.",
  75321. // "location": "path",
  75322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75323. // "required": true,
  75324. // "type": "string"
  75325. // }
  75326. // },
  75327. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  75328. // "response": {
  75329. // "$ref": "NodeTemplate"
  75330. // },
  75331. // "scopes": [
  75332. // "https://www.googleapis.com/auth/cloud-platform",
  75333. // "https://www.googleapis.com/auth/compute",
  75334. // "https://www.googleapis.com/auth/compute.readonly"
  75335. // ]
  75336. // }
  75337. }
  75338. // method id "compute.nodeTemplates.getIamPolicy":
  75339. type NodeTemplatesGetIamPolicyCall struct {
  75340. s *Service
  75341. project string
  75342. region string
  75343. resource string
  75344. urlParams_ gensupport.URLParams
  75345. ifNoneMatch_ string
  75346. ctx_ context.Context
  75347. header_ http.Header
  75348. }
  75349. // GetIamPolicy: Gets the access control policy for a resource. May be
  75350. // empty if no such policy or resource exists.
  75351. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  75352. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75353. c.project = project
  75354. c.region = region
  75355. c.resource = resource
  75356. return c
  75357. }
  75358. // Fields allows partial responses to be retrieved. See
  75359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75360. // for more information.
  75361. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  75362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75363. return c
  75364. }
  75365. // IfNoneMatch sets the optional parameter which makes the operation
  75366. // fail if the object's ETag matches the given value. This is useful for
  75367. // getting updates only after the object has changed since the last
  75368. // request. Use googleapi.IsNotModified to check whether the response
  75369. // error from Do is the result of In-None-Match.
  75370. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  75371. c.ifNoneMatch_ = entityTag
  75372. return c
  75373. }
  75374. // Context sets the context to be used in this call's Do method. Any
  75375. // pending HTTP request will be aborted if the provided context is
  75376. // canceled.
  75377. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  75378. c.ctx_ = ctx
  75379. return c
  75380. }
  75381. // Header returns an http.Header that can be modified by the caller to
  75382. // add HTTP headers to the request.
  75383. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  75384. if c.header_ == nil {
  75385. c.header_ = make(http.Header)
  75386. }
  75387. return c.header_
  75388. }
  75389. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  75390. reqHeaders := make(http.Header)
  75391. for k, v := range c.header_ {
  75392. reqHeaders[k] = v
  75393. }
  75394. reqHeaders.Set("User-Agent", c.s.userAgent())
  75395. if c.ifNoneMatch_ != "" {
  75396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75397. }
  75398. var body io.Reader = nil
  75399. c.urlParams_.Set("alt", alt)
  75400. c.urlParams_.Set("prettyPrint", "false")
  75401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  75402. urls += "?" + c.urlParams_.Encode()
  75403. req, err := http.NewRequest("GET", urls, body)
  75404. if err != nil {
  75405. return nil, err
  75406. }
  75407. req.Header = reqHeaders
  75408. googleapi.Expand(req.URL, map[string]string{
  75409. "project": c.project,
  75410. "region": c.region,
  75411. "resource": c.resource,
  75412. })
  75413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75414. }
  75415. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  75416. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  75417. // code is an error. Response headers are in either
  75418. // *Policy.ServerResponse.Header or (if a response was returned at all)
  75419. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75420. // check whether the returned error was because http.StatusNotModified
  75421. // was returned.
  75422. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  75423. gensupport.SetOptions(c.urlParams_, opts...)
  75424. res, err := c.doRequest("json")
  75425. if res != nil && res.StatusCode == http.StatusNotModified {
  75426. if res.Body != nil {
  75427. res.Body.Close()
  75428. }
  75429. return nil, &googleapi.Error{
  75430. Code: res.StatusCode,
  75431. Header: res.Header,
  75432. }
  75433. }
  75434. if err != nil {
  75435. return nil, err
  75436. }
  75437. defer googleapi.CloseBody(res)
  75438. if err := googleapi.CheckResponse(res); err != nil {
  75439. return nil, err
  75440. }
  75441. ret := &Policy{
  75442. ServerResponse: googleapi.ServerResponse{
  75443. Header: res.Header,
  75444. HTTPStatusCode: res.StatusCode,
  75445. },
  75446. }
  75447. target := &ret
  75448. if err := gensupport.DecodeResponse(target, res); err != nil {
  75449. return nil, err
  75450. }
  75451. return ret, nil
  75452. // {
  75453. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  75454. // "httpMethod": "GET",
  75455. // "id": "compute.nodeTemplates.getIamPolicy",
  75456. // "parameterOrder": [
  75457. // "project",
  75458. // "region",
  75459. // "resource"
  75460. // ],
  75461. // "parameters": {
  75462. // "project": {
  75463. // "description": "Project ID for this request.",
  75464. // "location": "path",
  75465. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75466. // "required": true,
  75467. // "type": "string"
  75468. // },
  75469. // "region": {
  75470. // "description": "The name of the region for this request.",
  75471. // "location": "path",
  75472. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75473. // "required": true,
  75474. // "type": "string"
  75475. // },
  75476. // "resource": {
  75477. // "description": "Name or id of the resource for this request.",
  75478. // "location": "path",
  75479. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75480. // "required": true,
  75481. // "type": "string"
  75482. // }
  75483. // },
  75484. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  75485. // "response": {
  75486. // "$ref": "Policy"
  75487. // },
  75488. // "scopes": [
  75489. // "https://www.googleapis.com/auth/cloud-platform",
  75490. // "https://www.googleapis.com/auth/compute",
  75491. // "https://www.googleapis.com/auth/compute.readonly"
  75492. // ]
  75493. // }
  75494. }
  75495. // method id "compute.nodeTemplates.insert":
  75496. type NodeTemplatesInsertCall struct {
  75497. s *Service
  75498. project string
  75499. region string
  75500. nodetemplate *NodeTemplate
  75501. urlParams_ gensupport.URLParams
  75502. ctx_ context.Context
  75503. header_ http.Header
  75504. }
  75505. // Insert: Creates a NodeTemplate resource in the specified project
  75506. // using the data included in the request.
  75507. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  75508. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75509. c.project = project
  75510. c.region = region
  75511. c.nodetemplate = nodetemplate
  75512. return c
  75513. }
  75514. // RequestId sets the optional parameter "requestId": An optional
  75515. // request ID to identify requests. Specify a unique request ID so that
  75516. // if you must retry your request, the server will know to ignore the
  75517. // request if it has already been completed.
  75518. //
  75519. // For example, consider a situation where you make an initial request
  75520. // and the request times out. If you make the request again with the
  75521. // same request ID, the server can check if original operation with the
  75522. // same request ID was received, and if so, will ignore the second
  75523. // request. This prevents clients from accidentally creating duplicate
  75524. // commitments.
  75525. //
  75526. // The request ID must be a valid UUID with the exception that zero UUID
  75527. // is not supported (00000000-0000-0000-0000-000000000000).
  75528. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  75529. c.urlParams_.Set("requestId", requestId)
  75530. return c
  75531. }
  75532. // Fields allows partial responses to be retrieved. See
  75533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75534. // for more information.
  75535. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  75536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75537. return c
  75538. }
  75539. // Context sets the context to be used in this call's Do method. Any
  75540. // pending HTTP request will be aborted if the provided context is
  75541. // canceled.
  75542. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  75543. c.ctx_ = ctx
  75544. return c
  75545. }
  75546. // Header returns an http.Header that can be modified by the caller to
  75547. // add HTTP headers to the request.
  75548. func (c *NodeTemplatesInsertCall) Header() http.Header {
  75549. if c.header_ == nil {
  75550. c.header_ = make(http.Header)
  75551. }
  75552. return c.header_
  75553. }
  75554. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  75555. reqHeaders := make(http.Header)
  75556. for k, v := range c.header_ {
  75557. reqHeaders[k] = v
  75558. }
  75559. reqHeaders.Set("User-Agent", c.s.userAgent())
  75560. var body io.Reader = nil
  75561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  75562. if err != nil {
  75563. return nil, err
  75564. }
  75565. reqHeaders.Set("Content-Type", "application/json")
  75566. c.urlParams_.Set("alt", alt)
  75567. c.urlParams_.Set("prettyPrint", "false")
  75568. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  75569. urls += "?" + c.urlParams_.Encode()
  75570. req, err := http.NewRequest("POST", urls, body)
  75571. if err != nil {
  75572. return nil, err
  75573. }
  75574. req.Header = reqHeaders
  75575. googleapi.Expand(req.URL, map[string]string{
  75576. "project": c.project,
  75577. "region": c.region,
  75578. })
  75579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75580. }
  75581. // Do executes the "compute.nodeTemplates.insert" call.
  75582. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75583. // status code is an error. Response headers are in either
  75584. // *Operation.ServerResponse.Header or (if a response was returned at
  75585. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75586. // to check whether the returned error was because
  75587. // http.StatusNotModified was returned.
  75588. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75589. gensupport.SetOptions(c.urlParams_, opts...)
  75590. res, err := c.doRequest("json")
  75591. if res != nil && res.StatusCode == http.StatusNotModified {
  75592. if res.Body != nil {
  75593. res.Body.Close()
  75594. }
  75595. return nil, &googleapi.Error{
  75596. Code: res.StatusCode,
  75597. Header: res.Header,
  75598. }
  75599. }
  75600. if err != nil {
  75601. return nil, err
  75602. }
  75603. defer googleapi.CloseBody(res)
  75604. if err := googleapi.CheckResponse(res); err != nil {
  75605. return nil, err
  75606. }
  75607. ret := &Operation{
  75608. ServerResponse: googleapi.ServerResponse{
  75609. Header: res.Header,
  75610. HTTPStatusCode: res.StatusCode,
  75611. },
  75612. }
  75613. target := &ret
  75614. if err := gensupport.DecodeResponse(target, res); err != nil {
  75615. return nil, err
  75616. }
  75617. return ret, nil
  75618. // {
  75619. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  75620. // "httpMethod": "POST",
  75621. // "id": "compute.nodeTemplates.insert",
  75622. // "parameterOrder": [
  75623. // "project",
  75624. // "region"
  75625. // ],
  75626. // "parameters": {
  75627. // "project": {
  75628. // "description": "Project ID for this request.",
  75629. // "location": "path",
  75630. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75631. // "required": true,
  75632. // "type": "string"
  75633. // },
  75634. // "region": {
  75635. // "description": "The name of the region for this request.",
  75636. // "location": "path",
  75637. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75638. // "required": true,
  75639. // "type": "string"
  75640. // },
  75641. // "requestId": {
  75642. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75643. // "location": "query",
  75644. // "type": "string"
  75645. // }
  75646. // },
  75647. // "path": "{project}/regions/{region}/nodeTemplates",
  75648. // "request": {
  75649. // "$ref": "NodeTemplate"
  75650. // },
  75651. // "response": {
  75652. // "$ref": "Operation"
  75653. // },
  75654. // "scopes": [
  75655. // "https://www.googleapis.com/auth/cloud-platform",
  75656. // "https://www.googleapis.com/auth/compute"
  75657. // ]
  75658. // }
  75659. }
  75660. // method id "compute.nodeTemplates.list":
  75661. type NodeTemplatesListCall struct {
  75662. s *Service
  75663. project string
  75664. region string
  75665. urlParams_ gensupport.URLParams
  75666. ifNoneMatch_ string
  75667. ctx_ context.Context
  75668. header_ http.Header
  75669. }
  75670. // List: Retrieves a list of node templates available to the specified
  75671. // project.
  75672. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  75673. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75674. c.project = project
  75675. c.region = region
  75676. return c
  75677. }
  75678. // Filter sets the optional parameter "filter": A filter expression that
  75679. // filters resources listed in the response. The expression must specify
  75680. // the field name, a comparison operator, and the value that you want to
  75681. // use for filtering. The value must be a string, a number, or a
  75682. // boolean. The comparison operator must be either =, !=, >, or <.
  75683. //
  75684. // For example, if you are filtering Compute Engine instances, you can
  75685. // exclude instances named example-instance by specifying name !=
  75686. // example-instance.
  75687. //
  75688. // You can also filter nested fields. For example, you could specify
  75689. // scheduling.automaticRestart = false to include instances only if they
  75690. // are not scheduled for automatic restarts. You can use filtering on
  75691. // nested fields to filter based on resource labels.
  75692. //
  75693. // To filter on multiple expressions, provide each separate expression
  75694. // within parentheses. For example, (scheduling.automaticRestart = true)
  75695. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75696. // AND expression. However, you can include AND and OR expressions
  75697. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75698. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75699. // true).
  75700. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  75701. c.urlParams_.Set("filter", filter)
  75702. return c
  75703. }
  75704. // MaxResults sets the optional parameter "maxResults": The maximum
  75705. // number of results per page that should be returned. If the number of
  75706. // available results is larger than maxResults, Compute Engine returns a
  75707. // nextPageToken that can be used to get the next page of results in
  75708. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75709. // (Default: 500)
  75710. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  75711. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75712. return c
  75713. }
  75714. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75715. // a certain order. By default, results are returned in alphanumerical
  75716. // order based on the resource name.
  75717. //
  75718. // You can also sort results in descending order based on the creation
  75719. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75720. // based on the creationTimestamp field in reverse chronological order
  75721. // (newest result first). Use this to sort resources like operations so
  75722. // that the newest operation is returned first.
  75723. //
  75724. // Currently, only sorting by name or creationTimestamp desc is
  75725. // supported.
  75726. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  75727. c.urlParams_.Set("orderBy", orderBy)
  75728. return c
  75729. }
  75730. // PageToken sets the optional parameter "pageToken": Specifies a page
  75731. // token to use. Set pageToken to the nextPageToken returned by a
  75732. // previous list request to get the next page of results.
  75733. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  75734. c.urlParams_.Set("pageToken", pageToken)
  75735. return c
  75736. }
  75737. // Fields allows partial responses to be retrieved. See
  75738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75739. // for more information.
  75740. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  75741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75742. return c
  75743. }
  75744. // IfNoneMatch sets the optional parameter which makes the operation
  75745. // fail if the object's ETag matches the given value. This is useful for
  75746. // getting updates only after the object has changed since the last
  75747. // request. Use googleapi.IsNotModified to check whether the response
  75748. // error from Do is the result of In-None-Match.
  75749. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  75750. c.ifNoneMatch_ = entityTag
  75751. return c
  75752. }
  75753. // Context sets the context to be used in this call's Do method. Any
  75754. // pending HTTP request will be aborted if the provided context is
  75755. // canceled.
  75756. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  75757. c.ctx_ = ctx
  75758. return c
  75759. }
  75760. // Header returns an http.Header that can be modified by the caller to
  75761. // add HTTP headers to the request.
  75762. func (c *NodeTemplatesListCall) Header() http.Header {
  75763. if c.header_ == nil {
  75764. c.header_ = make(http.Header)
  75765. }
  75766. return c.header_
  75767. }
  75768. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  75769. reqHeaders := make(http.Header)
  75770. for k, v := range c.header_ {
  75771. reqHeaders[k] = v
  75772. }
  75773. reqHeaders.Set("User-Agent", c.s.userAgent())
  75774. if c.ifNoneMatch_ != "" {
  75775. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75776. }
  75777. var body io.Reader = nil
  75778. c.urlParams_.Set("alt", alt)
  75779. c.urlParams_.Set("prettyPrint", "false")
  75780. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  75781. urls += "?" + c.urlParams_.Encode()
  75782. req, err := http.NewRequest("GET", urls, body)
  75783. if err != nil {
  75784. return nil, err
  75785. }
  75786. req.Header = reqHeaders
  75787. googleapi.Expand(req.URL, map[string]string{
  75788. "project": c.project,
  75789. "region": c.region,
  75790. })
  75791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75792. }
  75793. // Do executes the "compute.nodeTemplates.list" call.
  75794. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  75795. // non-2xx status code is an error. Response headers are in either
  75796. // *NodeTemplateList.ServerResponse.Header or (if a response was
  75797. // returned at all) in error.(*googleapi.Error).Header. Use
  75798. // googleapi.IsNotModified to check whether the returned error was
  75799. // because http.StatusNotModified was returned.
  75800. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  75801. gensupport.SetOptions(c.urlParams_, opts...)
  75802. res, err := c.doRequest("json")
  75803. if res != nil && res.StatusCode == http.StatusNotModified {
  75804. if res.Body != nil {
  75805. res.Body.Close()
  75806. }
  75807. return nil, &googleapi.Error{
  75808. Code: res.StatusCode,
  75809. Header: res.Header,
  75810. }
  75811. }
  75812. if err != nil {
  75813. return nil, err
  75814. }
  75815. defer googleapi.CloseBody(res)
  75816. if err := googleapi.CheckResponse(res); err != nil {
  75817. return nil, err
  75818. }
  75819. ret := &NodeTemplateList{
  75820. ServerResponse: googleapi.ServerResponse{
  75821. Header: res.Header,
  75822. HTTPStatusCode: res.StatusCode,
  75823. },
  75824. }
  75825. target := &ret
  75826. if err := gensupport.DecodeResponse(target, res); err != nil {
  75827. return nil, err
  75828. }
  75829. return ret, nil
  75830. // {
  75831. // "description": "Retrieves a list of node templates available to the specified project.",
  75832. // "httpMethod": "GET",
  75833. // "id": "compute.nodeTemplates.list",
  75834. // "parameterOrder": [
  75835. // "project",
  75836. // "region"
  75837. // ],
  75838. // "parameters": {
  75839. // "filter": {
  75840. // "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).",
  75841. // "location": "query",
  75842. // "type": "string"
  75843. // },
  75844. // "maxResults": {
  75845. // "default": "500",
  75846. // "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)",
  75847. // "format": "uint32",
  75848. // "location": "query",
  75849. // "minimum": "0",
  75850. // "type": "integer"
  75851. // },
  75852. // "orderBy": {
  75853. // "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.",
  75854. // "location": "query",
  75855. // "type": "string"
  75856. // },
  75857. // "pageToken": {
  75858. // "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.",
  75859. // "location": "query",
  75860. // "type": "string"
  75861. // },
  75862. // "project": {
  75863. // "description": "Project ID for this request.",
  75864. // "location": "path",
  75865. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75866. // "required": true,
  75867. // "type": "string"
  75868. // },
  75869. // "region": {
  75870. // "description": "The name of the region for this request.",
  75871. // "location": "path",
  75872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75873. // "required": true,
  75874. // "type": "string"
  75875. // }
  75876. // },
  75877. // "path": "{project}/regions/{region}/nodeTemplates",
  75878. // "response": {
  75879. // "$ref": "NodeTemplateList"
  75880. // },
  75881. // "scopes": [
  75882. // "https://www.googleapis.com/auth/cloud-platform",
  75883. // "https://www.googleapis.com/auth/compute",
  75884. // "https://www.googleapis.com/auth/compute.readonly"
  75885. // ]
  75886. // }
  75887. }
  75888. // Pages invokes f for each page of results.
  75889. // A non-nil error returned from f will halt the iteration.
  75890. // The provided context supersedes any context provided to the Context method.
  75891. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  75892. c.ctx_ = ctx
  75893. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75894. for {
  75895. x, err := c.Do()
  75896. if err != nil {
  75897. return err
  75898. }
  75899. if err := f(x); err != nil {
  75900. return err
  75901. }
  75902. if x.NextPageToken == "" {
  75903. return nil
  75904. }
  75905. c.PageToken(x.NextPageToken)
  75906. }
  75907. }
  75908. // method id "compute.nodeTemplates.setIamPolicy":
  75909. type NodeTemplatesSetIamPolicyCall struct {
  75910. s *Service
  75911. project string
  75912. region string
  75913. resource string
  75914. regionsetpolicyrequest *RegionSetPolicyRequest
  75915. urlParams_ gensupport.URLParams
  75916. ctx_ context.Context
  75917. header_ http.Header
  75918. }
  75919. // SetIamPolicy: Sets the access control policy on the specified
  75920. // resource. Replaces any existing policy.
  75921. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  75922. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75923. c.project = project
  75924. c.region = region
  75925. c.resource = resource
  75926. c.regionsetpolicyrequest = regionsetpolicyrequest
  75927. return c
  75928. }
  75929. // Fields allows partial responses to be retrieved. See
  75930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75931. // for more information.
  75932. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  75933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75934. return c
  75935. }
  75936. // Context sets the context to be used in this call's Do method. Any
  75937. // pending HTTP request will be aborted if the provided context is
  75938. // canceled.
  75939. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  75940. c.ctx_ = ctx
  75941. return c
  75942. }
  75943. // Header returns an http.Header that can be modified by the caller to
  75944. // add HTTP headers to the request.
  75945. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  75946. if c.header_ == nil {
  75947. c.header_ = make(http.Header)
  75948. }
  75949. return c.header_
  75950. }
  75951. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  75952. reqHeaders := make(http.Header)
  75953. for k, v := range c.header_ {
  75954. reqHeaders[k] = v
  75955. }
  75956. reqHeaders.Set("User-Agent", c.s.userAgent())
  75957. var body io.Reader = nil
  75958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  75959. if err != nil {
  75960. return nil, err
  75961. }
  75962. reqHeaders.Set("Content-Type", "application/json")
  75963. c.urlParams_.Set("alt", alt)
  75964. c.urlParams_.Set("prettyPrint", "false")
  75965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  75966. urls += "?" + c.urlParams_.Encode()
  75967. req, err := http.NewRequest("POST", urls, body)
  75968. if err != nil {
  75969. return nil, err
  75970. }
  75971. req.Header = reqHeaders
  75972. googleapi.Expand(req.URL, map[string]string{
  75973. "project": c.project,
  75974. "region": c.region,
  75975. "resource": c.resource,
  75976. })
  75977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75978. }
  75979. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  75980. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  75981. // code is an error. Response headers are in either
  75982. // *Policy.ServerResponse.Header or (if a response was returned at all)
  75983. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75984. // check whether the returned error was because http.StatusNotModified
  75985. // was returned.
  75986. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  75987. gensupport.SetOptions(c.urlParams_, opts...)
  75988. res, err := c.doRequest("json")
  75989. if res != nil && res.StatusCode == http.StatusNotModified {
  75990. if res.Body != nil {
  75991. res.Body.Close()
  75992. }
  75993. return nil, &googleapi.Error{
  75994. Code: res.StatusCode,
  75995. Header: res.Header,
  75996. }
  75997. }
  75998. if err != nil {
  75999. return nil, err
  76000. }
  76001. defer googleapi.CloseBody(res)
  76002. if err := googleapi.CheckResponse(res); err != nil {
  76003. return nil, err
  76004. }
  76005. ret := &Policy{
  76006. ServerResponse: googleapi.ServerResponse{
  76007. Header: res.Header,
  76008. HTTPStatusCode: res.StatusCode,
  76009. },
  76010. }
  76011. target := &ret
  76012. if err := gensupport.DecodeResponse(target, res); err != nil {
  76013. return nil, err
  76014. }
  76015. return ret, nil
  76016. // {
  76017. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  76018. // "httpMethod": "POST",
  76019. // "id": "compute.nodeTemplates.setIamPolicy",
  76020. // "parameterOrder": [
  76021. // "project",
  76022. // "region",
  76023. // "resource"
  76024. // ],
  76025. // "parameters": {
  76026. // "project": {
  76027. // "description": "Project ID for this request.",
  76028. // "location": "path",
  76029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76030. // "required": true,
  76031. // "type": "string"
  76032. // },
  76033. // "region": {
  76034. // "description": "The name of the region for this request.",
  76035. // "location": "path",
  76036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76037. // "required": true,
  76038. // "type": "string"
  76039. // },
  76040. // "resource": {
  76041. // "description": "Name or id of the resource for this request.",
  76042. // "location": "path",
  76043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76044. // "required": true,
  76045. // "type": "string"
  76046. // }
  76047. // },
  76048. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  76049. // "request": {
  76050. // "$ref": "RegionSetPolicyRequest"
  76051. // },
  76052. // "response": {
  76053. // "$ref": "Policy"
  76054. // },
  76055. // "scopes": [
  76056. // "https://www.googleapis.com/auth/cloud-platform",
  76057. // "https://www.googleapis.com/auth/compute"
  76058. // ]
  76059. // }
  76060. }
  76061. // method id "compute.nodeTemplates.testIamPermissions":
  76062. type NodeTemplatesTestIamPermissionsCall struct {
  76063. s *Service
  76064. project string
  76065. region string
  76066. resource string
  76067. testpermissionsrequest *TestPermissionsRequest
  76068. urlParams_ gensupport.URLParams
  76069. ctx_ context.Context
  76070. header_ http.Header
  76071. }
  76072. // TestIamPermissions: Returns permissions that a caller has on the
  76073. // specified resource.
  76074. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  76075. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76076. c.project = project
  76077. c.region = region
  76078. c.resource = resource
  76079. c.testpermissionsrequest = testpermissionsrequest
  76080. return c
  76081. }
  76082. // Fields allows partial responses to be retrieved. See
  76083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76084. // for more information.
  76085. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  76086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76087. return c
  76088. }
  76089. // Context sets the context to be used in this call's Do method. Any
  76090. // pending HTTP request will be aborted if the provided context is
  76091. // canceled.
  76092. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  76093. c.ctx_ = ctx
  76094. return c
  76095. }
  76096. // Header returns an http.Header that can be modified by the caller to
  76097. // add HTTP headers to the request.
  76098. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  76099. if c.header_ == nil {
  76100. c.header_ = make(http.Header)
  76101. }
  76102. return c.header_
  76103. }
  76104. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  76105. reqHeaders := make(http.Header)
  76106. for k, v := range c.header_ {
  76107. reqHeaders[k] = v
  76108. }
  76109. reqHeaders.Set("User-Agent", c.s.userAgent())
  76110. var body io.Reader = nil
  76111. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  76112. if err != nil {
  76113. return nil, err
  76114. }
  76115. reqHeaders.Set("Content-Type", "application/json")
  76116. c.urlParams_.Set("alt", alt)
  76117. c.urlParams_.Set("prettyPrint", "false")
  76118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  76119. urls += "?" + c.urlParams_.Encode()
  76120. req, err := http.NewRequest("POST", urls, body)
  76121. if err != nil {
  76122. return nil, err
  76123. }
  76124. req.Header = reqHeaders
  76125. googleapi.Expand(req.URL, map[string]string{
  76126. "project": c.project,
  76127. "region": c.region,
  76128. "resource": c.resource,
  76129. })
  76130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76131. }
  76132. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  76133. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  76134. // non-2xx status code is an error. Response headers are in either
  76135. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  76136. // returned at all) in error.(*googleapi.Error).Header. Use
  76137. // googleapi.IsNotModified to check whether the returned error was
  76138. // because http.StatusNotModified was returned.
  76139. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  76140. gensupport.SetOptions(c.urlParams_, opts...)
  76141. res, err := c.doRequest("json")
  76142. if res != nil && res.StatusCode == http.StatusNotModified {
  76143. if res.Body != nil {
  76144. res.Body.Close()
  76145. }
  76146. return nil, &googleapi.Error{
  76147. Code: res.StatusCode,
  76148. Header: res.Header,
  76149. }
  76150. }
  76151. if err != nil {
  76152. return nil, err
  76153. }
  76154. defer googleapi.CloseBody(res)
  76155. if err := googleapi.CheckResponse(res); err != nil {
  76156. return nil, err
  76157. }
  76158. ret := &TestPermissionsResponse{
  76159. ServerResponse: googleapi.ServerResponse{
  76160. Header: res.Header,
  76161. HTTPStatusCode: res.StatusCode,
  76162. },
  76163. }
  76164. target := &ret
  76165. if err := gensupport.DecodeResponse(target, res); err != nil {
  76166. return nil, err
  76167. }
  76168. return ret, nil
  76169. // {
  76170. // "description": "Returns permissions that a caller has on the specified resource.",
  76171. // "httpMethod": "POST",
  76172. // "id": "compute.nodeTemplates.testIamPermissions",
  76173. // "parameterOrder": [
  76174. // "project",
  76175. // "region",
  76176. // "resource"
  76177. // ],
  76178. // "parameters": {
  76179. // "project": {
  76180. // "description": "Project ID for this request.",
  76181. // "location": "path",
  76182. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76183. // "required": true,
  76184. // "type": "string"
  76185. // },
  76186. // "region": {
  76187. // "description": "The name of the region for this request.",
  76188. // "location": "path",
  76189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76190. // "required": true,
  76191. // "type": "string"
  76192. // },
  76193. // "resource": {
  76194. // "description": "Name or id of the resource for this request.",
  76195. // "location": "path",
  76196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76197. // "required": true,
  76198. // "type": "string"
  76199. // }
  76200. // },
  76201. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  76202. // "request": {
  76203. // "$ref": "TestPermissionsRequest"
  76204. // },
  76205. // "response": {
  76206. // "$ref": "TestPermissionsResponse"
  76207. // },
  76208. // "scopes": [
  76209. // "https://www.googleapis.com/auth/cloud-platform",
  76210. // "https://www.googleapis.com/auth/compute",
  76211. // "https://www.googleapis.com/auth/compute.readonly"
  76212. // ]
  76213. // }
  76214. }
  76215. // method id "compute.nodeTypes.aggregatedList":
  76216. type NodeTypesAggregatedListCall struct {
  76217. s *Service
  76218. project string
  76219. urlParams_ gensupport.URLParams
  76220. ifNoneMatch_ string
  76221. ctx_ context.Context
  76222. header_ http.Header
  76223. }
  76224. // AggregatedList: Retrieves an aggregated list of node types.
  76225. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  76226. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76227. c.project = project
  76228. return c
  76229. }
  76230. // Filter sets the optional parameter "filter": A filter expression that
  76231. // filters resources listed in the response. The expression must specify
  76232. // the field name, a comparison operator, and the value that you want to
  76233. // use for filtering. The value must be a string, a number, or a
  76234. // boolean. The comparison operator must be either =, !=, >, or <.
  76235. //
  76236. // For example, if you are filtering Compute Engine instances, you can
  76237. // exclude instances named example-instance by specifying name !=
  76238. // example-instance.
  76239. //
  76240. // You can also filter nested fields. For example, you could specify
  76241. // scheduling.automaticRestart = false to include instances only if they
  76242. // are not scheduled for automatic restarts. You can use filtering on
  76243. // nested fields to filter based on resource labels.
  76244. //
  76245. // To filter on multiple expressions, provide each separate expression
  76246. // within parentheses. For example, (scheduling.automaticRestart = true)
  76247. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76248. // AND expression. However, you can include AND and OR expressions
  76249. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76250. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76251. // true).
  76252. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  76253. c.urlParams_.Set("filter", filter)
  76254. return c
  76255. }
  76256. // MaxResults sets the optional parameter "maxResults": The maximum
  76257. // number of results per page that should be returned. If the number of
  76258. // available results is larger than maxResults, Compute Engine returns a
  76259. // nextPageToken that can be used to get the next page of results in
  76260. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76261. // (Default: 500)
  76262. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  76263. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76264. return c
  76265. }
  76266. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76267. // a certain order. By default, results are returned in alphanumerical
  76268. // order based on the resource name.
  76269. //
  76270. // You can also sort results in descending order based on the creation
  76271. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76272. // based on the creationTimestamp field in reverse chronological order
  76273. // (newest result first). Use this to sort resources like operations so
  76274. // that the newest operation is returned first.
  76275. //
  76276. // Currently, only sorting by name or creationTimestamp desc is
  76277. // supported.
  76278. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  76279. c.urlParams_.Set("orderBy", orderBy)
  76280. return c
  76281. }
  76282. // PageToken sets the optional parameter "pageToken": Specifies a page
  76283. // token to use. Set pageToken to the nextPageToken returned by a
  76284. // previous list request to get the next page of results.
  76285. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  76286. c.urlParams_.Set("pageToken", pageToken)
  76287. return c
  76288. }
  76289. // Fields allows partial responses to be retrieved. See
  76290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76291. // for more information.
  76292. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  76293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76294. return c
  76295. }
  76296. // IfNoneMatch sets the optional parameter which makes the operation
  76297. // fail if the object's ETag matches the given value. This is useful for
  76298. // getting updates only after the object has changed since the last
  76299. // request. Use googleapi.IsNotModified to check whether the response
  76300. // error from Do is the result of In-None-Match.
  76301. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  76302. c.ifNoneMatch_ = entityTag
  76303. return c
  76304. }
  76305. // Context sets the context to be used in this call's Do method. Any
  76306. // pending HTTP request will be aborted if the provided context is
  76307. // canceled.
  76308. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  76309. c.ctx_ = ctx
  76310. return c
  76311. }
  76312. // Header returns an http.Header that can be modified by the caller to
  76313. // add HTTP headers to the request.
  76314. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  76315. if c.header_ == nil {
  76316. c.header_ = make(http.Header)
  76317. }
  76318. return c.header_
  76319. }
  76320. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  76321. reqHeaders := make(http.Header)
  76322. for k, v := range c.header_ {
  76323. reqHeaders[k] = v
  76324. }
  76325. reqHeaders.Set("User-Agent", c.s.userAgent())
  76326. if c.ifNoneMatch_ != "" {
  76327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76328. }
  76329. var body io.Reader = nil
  76330. c.urlParams_.Set("alt", alt)
  76331. c.urlParams_.Set("prettyPrint", "false")
  76332. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  76333. urls += "?" + c.urlParams_.Encode()
  76334. req, err := http.NewRequest("GET", urls, body)
  76335. if err != nil {
  76336. return nil, err
  76337. }
  76338. req.Header = reqHeaders
  76339. googleapi.Expand(req.URL, map[string]string{
  76340. "project": c.project,
  76341. })
  76342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76343. }
  76344. // Do executes the "compute.nodeTypes.aggregatedList" call.
  76345. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  76346. // non-2xx status code is an error. Response headers are in either
  76347. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  76348. // returned at all) in error.(*googleapi.Error).Header. Use
  76349. // googleapi.IsNotModified to check whether the returned error was
  76350. // because http.StatusNotModified was returned.
  76351. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  76352. gensupport.SetOptions(c.urlParams_, opts...)
  76353. res, err := c.doRequest("json")
  76354. if res != nil && res.StatusCode == http.StatusNotModified {
  76355. if res.Body != nil {
  76356. res.Body.Close()
  76357. }
  76358. return nil, &googleapi.Error{
  76359. Code: res.StatusCode,
  76360. Header: res.Header,
  76361. }
  76362. }
  76363. if err != nil {
  76364. return nil, err
  76365. }
  76366. defer googleapi.CloseBody(res)
  76367. if err := googleapi.CheckResponse(res); err != nil {
  76368. return nil, err
  76369. }
  76370. ret := &NodeTypeAggregatedList{
  76371. ServerResponse: googleapi.ServerResponse{
  76372. Header: res.Header,
  76373. HTTPStatusCode: res.StatusCode,
  76374. },
  76375. }
  76376. target := &ret
  76377. if err := gensupport.DecodeResponse(target, res); err != nil {
  76378. return nil, err
  76379. }
  76380. return ret, nil
  76381. // {
  76382. // "description": "Retrieves an aggregated list of node types.",
  76383. // "httpMethod": "GET",
  76384. // "id": "compute.nodeTypes.aggregatedList",
  76385. // "parameterOrder": [
  76386. // "project"
  76387. // ],
  76388. // "parameters": {
  76389. // "filter": {
  76390. // "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).",
  76391. // "location": "query",
  76392. // "type": "string"
  76393. // },
  76394. // "maxResults": {
  76395. // "default": "500",
  76396. // "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)",
  76397. // "format": "uint32",
  76398. // "location": "query",
  76399. // "minimum": "0",
  76400. // "type": "integer"
  76401. // },
  76402. // "orderBy": {
  76403. // "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.",
  76404. // "location": "query",
  76405. // "type": "string"
  76406. // },
  76407. // "pageToken": {
  76408. // "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.",
  76409. // "location": "query",
  76410. // "type": "string"
  76411. // },
  76412. // "project": {
  76413. // "description": "Project ID for this request.",
  76414. // "location": "path",
  76415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76416. // "required": true,
  76417. // "type": "string"
  76418. // }
  76419. // },
  76420. // "path": "{project}/aggregated/nodeTypes",
  76421. // "response": {
  76422. // "$ref": "NodeTypeAggregatedList"
  76423. // },
  76424. // "scopes": [
  76425. // "https://www.googleapis.com/auth/cloud-platform",
  76426. // "https://www.googleapis.com/auth/compute",
  76427. // "https://www.googleapis.com/auth/compute.readonly"
  76428. // ]
  76429. // }
  76430. }
  76431. // Pages invokes f for each page of results.
  76432. // A non-nil error returned from f will halt the iteration.
  76433. // The provided context supersedes any context provided to the Context method.
  76434. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  76435. c.ctx_ = ctx
  76436. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76437. for {
  76438. x, err := c.Do()
  76439. if err != nil {
  76440. return err
  76441. }
  76442. if err := f(x); err != nil {
  76443. return err
  76444. }
  76445. if x.NextPageToken == "" {
  76446. return nil
  76447. }
  76448. c.PageToken(x.NextPageToken)
  76449. }
  76450. }
  76451. // method id "compute.nodeTypes.get":
  76452. type NodeTypesGetCall struct {
  76453. s *Service
  76454. project string
  76455. zone string
  76456. nodeType string
  76457. urlParams_ gensupport.URLParams
  76458. ifNoneMatch_ string
  76459. ctx_ context.Context
  76460. header_ http.Header
  76461. }
  76462. // Get: Returns the specified node type. Gets a list of available node
  76463. // types by making a list() request.
  76464. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  76465. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76466. c.project = project
  76467. c.zone = zone
  76468. c.nodeType = nodeType
  76469. return c
  76470. }
  76471. // Fields allows partial responses to be retrieved. See
  76472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76473. // for more information.
  76474. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  76475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76476. return c
  76477. }
  76478. // IfNoneMatch sets the optional parameter which makes the operation
  76479. // fail if the object's ETag matches the given value. This is useful for
  76480. // getting updates only after the object has changed since the last
  76481. // request. Use googleapi.IsNotModified to check whether the response
  76482. // error from Do is the result of In-None-Match.
  76483. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  76484. c.ifNoneMatch_ = entityTag
  76485. return c
  76486. }
  76487. // Context sets the context to be used in this call's Do method. Any
  76488. // pending HTTP request will be aborted if the provided context is
  76489. // canceled.
  76490. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  76491. c.ctx_ = ctx
  76492. return c
  76493. }
  76494. // Header returns an http.Header that can be modified by the caller to
  76495. // add HTTP headers to the request.
  76496. func (c *NodeTypesGetCall) Header() http.Header {
  76497. if c.header_ == nil {
  76498. c.header_ = make(http.Header)
  76499. }
  76500. return c.header_
  76501. }
  76502. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  76503. reqHeaders := make(http.Header)
  76504. for k, v := range c.header_ {
  76505. reqHeaders[k] = v
  76506. }
  76507. reqHeaders.Set("User-Agent", c.s.userAgent())
  76508. if c.ifNoneMatch_ != "" {
  76509. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76510. }
  76511. var body io.Reader = nil
  76512. c.urlParams_.Set("alt", alt)
  76513. c.urlParams_.Set("prettyPrint", "false")
  76514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  76515. urls += "?" + c.urlParams_.Encode()
  76516. req, err := http.NewRequest("GET", urls, body)
  76517. if err != nil {
  76518. return nil, err
  76519. }
  76520. req.Header = reqHeaders
  76521. googleapi.Expand(req.URL, map[string]string{
  76522. "project": c.project,
  76523. "zone": c.zone,
  76524. "nodeType": c.nodeType,
  76525. })
  76526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76527. }
  76528. // Do executes the "compute.nodeTypes.get" call.
  76529. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  76530. // code is an error. Response headers are in either
  76531. // *NodeType.ServerResponse.Header or (if a response was returned at
  76532. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76533. // to check whether the returned error was because
  76534. // http.StatusNotModified was returned.
  76535. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  76536. gensupport.SetOptions(c.urlParams_, opts...)
  76537. res, err := c.doRequest("json")
  76538. if res != nil && res.StatusCode == http.StatusNotModified {
  76539. if res.Body != nil {
  76540. res.Body.Close()
  76541. }
  76542. return nil, &googleapi.Error{
  76543. Code: res.StatusCode,
  76544. Header: res.Header,
  76545. }
  76546. }
  76547. if err != nil {
  76548. return nil, err
  76549. }
  76550. defer googleapi.CloseBody(res)
  76551. if err := googleapi.CheckResponse(res); err != nil {
  76552. return nil, err
  76553. }
  76554. ret := &NodeType{
  76555. ServerResponse: googleapi.ServerResponse{
  76556. Header: res.Header,
  76557. HTTPStatusCode: res.StatusCode,
  76558. },
  76559. }
  76560. target := &ret
  76561. if err := gensupport.DecodeResponse(target, res); err != nil {
  76562. return nil, err
  76563. }
  76564. return ret, nil
  76565. // {
  76566. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  76567. // "httpMethod": "GET",
  76568. // "id": "compute.nodeTypes.get",
  76569. // "parameterOrder": [
  76570. // "project",
  76571. // "zone",
  76572. // "nodeType"
  76573. // ],
  76574. // "parameters": {
  76575. // "nodeType": {
  76576. // "description": "Name of the node type to return.",
  76577. // "location": "path",
  76578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76579. // "required": true,
  76580. // "type": "string"
  76581. // },
  76582. // "project": {
  76583. // "description": "Project ID for this request.",
  76584. // "location": "path",
  76585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76586. // "required": true,
  76587. // "type": "string"
  76588. // },
  76589. // "zone": {
  76590. // "description": "The name of the zone for this request.",
  76591. // "location": "path",
  76592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76593. // "required": true,
  76594. // "type": "string"
  76595. // }
  76596. // },
  76597. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  76598. // "response": {
  76599. // "$ref": "NodeType"
  76600. // },
  76601. // "scopes": [
  76602. // "https://www.googleapis.com/auth/cloud-platform",
  76603. // "https://www.googleapis.com/auth/compute",
  76604. // "https://www.googleapis.com/auth/compute.readonly"
  76605. // ]
  76606. // }
  76607. }
  76608. // method id "compute.nodeTypes.list":
  76609. type NodeTypesListCall struct {
  76610. s *Service
  76611. project string
  76612. zone string
  76613. urlParams_ gensupport.URLParams
  76614. ifNoneMatch_ string
  76615. ctx_ context.Context
  76616. header_ http.Header
  76617. }
  76618. // List: Retrieves a list of node types available to the specified
  76619. // project.
  76620. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  76621. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76622. c.project = project
  76623. c.zone = zone
  76624. return c
  76625. }
  76626. // Filter sets the optional parameter "filter": A filter expression that
  76627. // filters resources listed in the response. The expression must specify
  76628. // the field name, a comparison operator, and the value that you want to
  76629. // use for filtering. The value must be a string, a number, or a
  76630. // boolean. The comparison operator must be either =, !=, >, or <.
  76631. //
  76632. // For example, if you are filtering Compute Engine instances, you can
  76633. // exclude instances named example-instance by specifying name !=
  76634. // example-instance.
  76635. //
  76636. // You can also filter nested fields. For example, you could specify
  76637. // scheduling.automaticRestart = false to include instances only if they
  76638. // are not scheduled for automatic restarts. You can use filtering on
  76639. // nested fields to filter based on resource labels.
  76640. //
  76641. // To filter on multiple expressions, provide each separate expression
  76642. // within parentheses. For example, (scheduling.automaticRestart = true)
  76643. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76644. // AND expression. However, you can include AND and OR expressions
  76645. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76646. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76647. // true).
  76648. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  76649. c.urlParams_.Set("filter", filter)
  76650. return c
  76651. }
  76652. // MaxResults sets the optional parameter "maxResults": The maximum
  76653. // number of results per page that should be returned. If the number of
  76654. // available results is larger than maxResults, Compute Engine returns a
  76655. // nextPageToken that can be used to get the next page of results in
  76656. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76657. // (Default: 500)
  76658. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  76659. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76660. return c
  76661. }
  76662. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76663. // a certain order. By default, results are returned in alphanumerical
  76664. // order based on the resource name.
  76665. //
  76666. // You can also sort results in descending order based on the creation
  76667. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76668. // based on the creationTimestamp field in reverse chronological order
  76669. // (newest result first). Use this to sort resources like operations so
  76670. // that the newest operation is returned first.
  76671. //
  76672. // Currently, only sorting by name or creationTimestamp desc is
  76673. // supported.
  76674. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  76675. c.urlParams_.Set("orderBy", orderBy)
  76676. return c
  76677. }
  76678. // PageToken sets the optional parameter "pageToken": Specifies a page
  76679. // token to use. Set pageToken to the nextPageToken returned by a
  76680. // previous list request to get the next page of results.
  76681. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  76682. c.urlParams_.Set("pageToken", pageToken)
  76683. return c
  76684. }
  76685. // Fields allows partial responses to be retrieved. See
  76686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76687. // for more information.
  76688. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  76689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76690. return c
  76691. }
  76692. // IfNoneMatch sets the optional parameter which makes the operation
  76693. // fail if the object's ETag matches the given value. This is useful for
  76694. // getting updates only after the object has changed since the last
  76695. // request. Use googleapi.IsNotModified to check whether the response
  76696. // error from Do is the result of In-None-Match.
  76697. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  76698. c.ifNoneMatch_ = entityTag
  76699. return c
  76700. }
  76701. // Context sets the context to be used in this call's Do method. Any
  76702. // pending HTTP request will be aborted if the provided context is
  76703. // canceled.
  76704. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  76705. c.ctx_ = ctx
  76706. return c
  76707. }
  76708. // Header returns an http.Header that can be modified by the caller to
  76709. // add HTTP headers to the request.
  76710. func (c *NodeTypesListCall) Header() http.Header {
  76711. if c.header_ == nil {
  76712. c.header_ = make(http.Header)
  76713. }
  76714. return c.header_
  76715. }
  76716. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  76717. reqHeaders := make(http.Header)
  76718. for k, v := range c.header_ {
  76719. reqHeaders[k] = v
  76720. }
  76721. reqHeaders.Set("User-Agent", c.s.userAgent())
  76722. if c.ifNoneMatch_ != "" {
  76723. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76724. }
  76725. var body io.Reader = nil
  76726. c.urlParams_.Set("alt", alt)
  76727. c.urlParams_.Set("prettyPrint", "false")
  76728. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  76729. urls += "?" + c.urlParams_.Encode()
  76730. req, err := http.NewRequest("GET", urls, body)
  76731. if err != nil {
  76732. return nil, err
  76733. }
  76734. req.Header = reqHeaders
  76735. googleapi.Expand(req.URL, map[string]string{
  76736. "project": c.project,
  76737. "zone": c.zone,
  76738. })
  76739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76740. }
  76741. // Do executes the "compute.nodeTypes.list" call.
  76742. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  76743. // status code is an error. Response headers are in either
  76744. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  76745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76746. // to check whether the returned error was because
  76747. // http.StatusNotModified was returned.
  76748. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  76749. gensupport.SetOptions(c.urlParams_, opts...)
  76750. res, err := c.doRequest("json")
  76751. if res != nil && res.StatusCode == http.StatusNotModified {
  76752. if res.Body != nil {
  76753. res.Body.Close()
  76754. }
  76755. return nil, &googleapi.Error{
  76756. Code: res.StatusCode,
  76757. Header: res.Header,
  76758. }
  76759. }
  76760. if err != nil {
  76761. return nil, err
  76762. }
  76763. defer googleapi.CloseBody(res)
  76764. if err := googleapi.CheckResponse(res); err != nil {
  76765. return nil, err
  76766. }
  76767. ret := &NodeTypeList{
  76768. ServerResponse: googleapi.ServerResponse{
  76769. Header: res.Header,
  76770. HTTPStatusCode: res.StatusCode,
  76771. },
  76772. }
  76773. target := &ret
  76774. if err := gensupport.DecodeResponse(target, res); err != nil {
  76775. return nil, err
  76776. }
  76777. return ret, nil
  76778. // {
  76779. // "description": "Retrieves a list of node types available to the specified project.",
  76780. // "httpMethod": "GET",
  76781. // "id": "compute.nodeTypes.list",
  76782. // "parameterOrder": [
  76783. // "project",
  76784. // "zone"
  76785. // ],
  76786. // "parameters": {
  76787. // "filter": {
  76788. // "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).",
  76789. // "location": "query",
  76790. // "type": "string"
  76791. // },
  76792. // "maxResults": {
  76793. // "default": "500",
  76794. // "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)",
  76795. // "format": "uint32",
  76796. // "location": "query",
  76797. // "minimum": "0",
  76798. // "type": "integer"
  76799. // },
  76800. // "orderBy": {
  76801. // "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.",
  76802. // "location": "query",
  76803. // "type": "string"
  76804. // },
  76805. // "pageToken": {
  76806. // "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.",
  76807. // "location": "query",
  76808. // "type": "string"
  76809. // },
  76810. // "project": {
  76811. // "description": "Project ID for this request.",
  76812. // "location": "path",
  76813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76814. // "required": true,
  76815. // "type": "string"
  76816. // },
  76817. // "zone": {
  76818. // "description": "The name of the zone for this request.",
  76819. // "location": "path",
  76820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76821. // "required": true,
  76822. // "type": "string"
  76823. // }
  76824. // },
  76825. // "path": "{project}/zones/{zone}/nodeTypes",
  76826. // "response": {
  76827. // "$ref": "NodeTypeList"
  76828. // },
  76829. // "scopes": [
  76830. // "https://www.googleapis.com/auth/cloud-platform",
  76831. // "https://www.googleapis.com/auth/compute",
  76832. // "https://www.googleapis.com/auth/compute.readonly"
  76833. // ]
  76834. // }
  76835. }
  76836. // Pages invokes f for each page of results.
  76837. // A non-nil error returned from f will halt the iteration.
  76838. // The provided context supersedes any context provided to the Context method.
  76839. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  76840. c.ctx_ = ctx
  76841. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76842. for {
  76843. x, err := c.Do()
  76844. if err != nil {
  76845. return err
  76846. }
  76847. if err := f(x); err != nil {
  76848. return err
  76849. }
  76850. if x.NextPageToken == "" {
  76851. return nil
  76852. }
  76853. c.PageToken(x.NextPageToken)
  76854. }
  76855. }
  76856. // method id "compute.projects.disableXpnHost":
  76857. type ProjectsDisableXpnHostCall struct {
  76858. s *Service
  76859. project string
  76860. urlParams_ gensupport.URLParams
  76861. ctx_ context.Context
  76862. header_ http.Header
  76863. }
  76864. // DisableXpnHost: Disable this project as a shared VPC host project.
  76865. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  76866. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76867. c.project = project
  76868. return c
  76869. }
  76870. // RequestId sets the optional parameter "requestId": An optional
  76871. // request ID to identify requests. Specify a unique request ID so that
  76872. // if you must retry your request, the server will know to ignore the
  76873. // request if it has already been completed.
  76874. //
  76875. // For example, consider a situation where you make an initial request
  76876. // and the request times out. If you make the request again with the
  76877. // same request ID, the server can check if original operation with the
  76878. // same request ID was received, and if so, will ignore the second
  76879. // request. This prevents clients from accidentally creating duplicate
  76880. // commitments.
  76881. //
  76882. // The request ID must be a valid UUID with the exception that zero UUID
  76883. // is not supported (00000000-0000-0000-0000-000000000000).
  76884. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  76885. c.urlParams_.Set("requestId", requestId)
  76886. return c
  76887. }
  76888. // Fields allows partial responses to be retrieved. See
  76889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76890. // for more information.
  76891. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  76892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76893. return c
  76894. }
  76895. // Context sets the context to be used in this call's Do method. Any
  76896. // pending HTTP request will be aborted if the provided context is
  76897. // canceled.
  76898. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  76899. c.ctx_ = ctx
  76900. return c
  76901. }
  76902. // Header returns an http.Header that can be modified by the caller to
  76903. // add HTTP headers to the request.
  76904. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  76905. if c.header_ == nil {
  76906. c.header_ = make(http.Header)
  76907. }
  76908. return c.header_
  76909. }
  76910. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  76911. reqHeaders := make(http.Header)
  76912. for k, v := range c.header_ {
  76913. reqHeaders[k] = v
  76914. }
  76915. reqHeaders.Set("User-Agent", c.s.userAgent())
  76916. var body io.Reader = nil
  76917. c.urlParams_.Set("alt", alt)
  76918. c.urlParams_.Set("prettyPrint", "false")
  76919. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  76920. urls += "?" + c.urlParams_.Encode()
  76921. req, err := http.NewRequest("POST", urls, body)
  76922. if err != nil {
  76923. return nil, err
  76924. }
  76925. req.Header = reqHeaders
  76926. googleapi.Expand(req.URL, map[string]string{
  76927. "project": c.project,
  76928. })
  76929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76930. }
  76931. // Do executes the "compute.projects.disableXpnHost" call.
  76932. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76933. // status code is an error. Response headers are in either
  76934. // *Operation.ServerResponse.Header or (if a response was returned at
  76935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76936. // to check whether the returned error was because
  76937. // http.StatusNotModified was returned.
  76938. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76939. gensupport.SetOptions(c.urlParams_, opts...)
  76940. res, err := c.doRequest("json")
  76941. if res != nil && res.StatusCode == http.StatusNotModified {
  76942. if res.Body != nil {
  76943. res.Body.Close()
  76944. }
  76945. return nil, &googleapi.Error{
  76946. Code: res.StatusCode,
  76947. Header: res.Header,
  76948. }
  76949. }
  76950. if err != nil {
  76951. return nil, err
  76952. }
  76953. defer googleapi.CloseBody(res)
  76954. if err := googleapi.CheckResponse(res); err != nil {
  76955. return nil, err
  76956. }
  76957. ret := &Operation{
  76958. ServerResponse: googleapi.ServerResponse{
  76959. Header: res.Header,
  76960. HTTPStatusCode: res.StatusCode,
  76961. },
  76962. }
  76963. target := &ret
  76964. if err := gensupport.DecodeResponse(target, res); err != nil {
  76965. return nil, err
  76966. }
  76967. return ret, nil
  76968. // {
  76969. // "description": "Disable this project as a shared VPC host project.",
  76970. // "httpMethod": "POST",
  76971. // "id": "compute.projects.disableXpnHost",
  76972. // "parameterOrder": [
  76973. // "project"
  76974. // ],
  76975. // "parameters": {
  76976. // "project": {
  76977. // "description": "Project ID for this request.",
  76978. // "location": "path",
  76979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76980. // "required": true,
  76981. // "type": "string"
  76982. // },
  76983. // "requestId": {
  76984. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76985. // "location": "query",
  76986. // "type": "string"
  76987. // }
  76988. // },
  76989. // "path": "{project}/disableXpnHost",
  76990. // "response": {
  76991. // "$ref": "Operation"
  76992. // },
  76993. // "scopes": [
  76994. // "https://www.googleapis.com/auth/cloud-platform",
  76995. // "https://www.googleapis.com/auth/compute"
  76996. // ]
  76997. // }
  76998. }
  76999. // method id "compute.projects.disableXpnResource":
  77000. type ProjectsDisableXpnResourceCall struct {
  77001. s *Service
  77002. project string
  77003. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  77004. urlParams_ gensupport.URLParams
  77005. ctx_ context.Context
  77006. header_ http.Header
  77007. }
  77008. // DisableXpnResource: Disable a serivce resource (a.k.a service
  77009. // project) associated with this host project.
  77010. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  77011. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77012. c.project = project
  77013. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  77014. return c
  77015. }
  77016. // RequestId sets the optional parameter "requestId": An optional
  77017. // request ID to identify requests. Specify a unique request ID so that
  77018. // if you must retry your request, the server will know to ignore the
  77019. // request if it has already been completed.
  77020. //
  77021. // For example, consider a situation where you make an initial request
  77022. // and the request times out. If you make the request again with the
  77023. // same request ID, the server can check if original operation with the
  77024. // same request ID was received, and if so, will ignore the second
  77025. // request. This prevents clients from accidentally creating duplicate
  77026. // commitments.
  77027. //
  77028. // The request ID must be a valid UUID with the exception that zero UUID
  77029. // is not supported (00000000-0000-0000-0000-000000000000).
  77030. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  77031. c.urlParams_.Set("requestId", requestId)
  77032. return c
  77033. }
  77034. // Fields allows partial responses to be retrieved. See
  77035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77036. // for more information.
  77037. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  77038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77039. return c
  77040. }
  77041. // Context sets the context to be used in this call's Do method. Any
  77042. // pending HTTP request will be aborted if the provided context is
  77043. // canceled.
  77044. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  77045. c.ctx_ = ctx
  77046. return c
  77047. }
  77048. // Header returns an http.Header that can be modified by the caller to
  77049. // add HTTP headers to the request.
  77050. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  77051. if c.header_ == nil {
  77052. c.header_ = make(http.Header)
  77053. }
  77054. return c.header_
  77055. }
  77056. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  77057. reqHeaders := make(http.Header)
  77058. for k, v := range c.header_ {
  77059. reqHeaders[k] = v
  77060. }
  77061. reqHeaders.Set("User-Agent", c.s.userAgent())
  77062. var body io.Reader = nil
  77063. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  77064. if err != nil {
  77065. return nil, err
  77066. }
  77067. reqHeaders.Set("Content-Type", "application/json")
  77068. c.urlParams_.Set("alt", alt)
  77069. c.urlParams_.Set("prettyPrint", "false")
  77070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  77071. urls += "?" + c.urlParams_.Encode()
  77072. req, err := http.NewRequest("POST", urls, body)
  77073. if err != nil {
  77074. return nil, err
  77075. }
  77076. req.Header = reqHeaders
  77077. googleapi.Expand(req.URL, map[string]string{
  77078. "project": c.project,
  77079. })
  77080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77081. }
  77082. // Do executes the "compute.projects.disableXpnResource" call.
  77083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77084. // status code is an error. Response headers are in either
  77085. // *Operation.ServerResponse.Header or (if a response was returned at
  77086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77087. // to check whether the returned error was because
  77088. // http.StatusNotModified was returned.
  77089. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77090. gensupport.SetOptions(c.urlParams_, opts...)
  77091. res, err := c.doRequest("json")
  77092. if res != nil && res.StatusCode == http.StatusNotModified {
  77093. if res.Body != nil {
  77094. res.Body.Close()
  77095. }
  77096. return nil, &googleapi.Error{
  77097. Code: res.StatusCode,
  77098. Header: res.Header,
  77099. }
  77100. }
  77101. if err != nil {
  77102. return nil, err
  77103. }
  77104. defer googleapi.CloseBody(res)
  77105. if err := googleapi.CheckResponse(res); err != nil {
  77106. return nil, err
  77107. }
  77108. ret := &Operation{
  77109. ServerResponse: googleapi.ServerResponse{
  77110. Header: res.Header,
  77111. HTTPStatusCode: res.StatusCode,
  77112. },
  77113. }
  77114. target := &ret
  77115. if err := gensupport.DecodeResponse(target, res); err != nil {
  77116. return nil, err
  77117. }
  77118. return ret, nil
  77119. // {
  77120. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  77121. // "httpMethod": "POST",
  77122. // "id": "compute.projects.disableXpnResource",
  77123. // "parameterOrder": [
  77124. // "project"
  77125. // ],
  77126. // "parameters": {
  77127. // "project": {
  77128. // "description": "Project ID for this request.",
  77129. // "location": "path",
  77130. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77131. // "required": true,
  77132. // "type": "string"
  77133. // },
  77134. // "requestId": {
  77135. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77136. // "location": "query",
  77137. // "type": "string"
  77138. // }
  77139. // },
  77140. // "path": "{project}/disableXpnResource",
  77141. // "request": {
  77142. // "$ref": "ProjectsDisableXpnResourceRequest"
  77143. // },
  77144. // "response": {
  77145. // "$ref": "Operation"
  77146. // },
  77147. // "scopes": [
  77148. // "https://www.googleapis.com/auth/cloud-platform",
  77149. // "https://www.googleapis.com/auth/compute"
  77150. // ]
  77151. // }
  77152. }
  77153. // method id "compute.projects.enableXpnHost":
  77154. type ProjectsEnableXpnHostCall struct {
  77155. s *Service
  77156. project string
  77157. urlParams_ gensupport.URLParams
  77158. ctx_ context.Context
  77159. header_ http.Header
  77160. }
  77161. // EnableXpnHost: Enable this project as a shared VPC host project.
  77162. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  77163. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77164. c.project = project
  77165. return c
  77166. }
  77167. // RequestId sets the optional parameter "requestId": An optional
  77168. // request ID to identify requests. Specify a unique request ID so that
  77169. // if you must retry your request, the server will know to ignore the
  77170. // request if it has already been completed.
  77171. //
  77172. // For example, consider a situation where you make an initial request
  77173. // and the request times out. If you make the request again with the
  77174. // same request ID, the server can check if original operation with the
  77175. // same request ID was received, and if so, will ignore the second
  77176. // request. This prevents clients from accidentally creating duplicate
  77177. // commitments.
  77178. //
  77179. // The request ID must be a valid UUID with the exception that zero UUID
  77180. // is not supported (00000000-0000-0000-0000-000000000000).
  77181. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  77182. c.urlParams_.Set("requestId", requestId)
  77183. return c
  77184. }
  77185. // Fields allows partial responses to be retrieved. See
  77186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77187. // for more information.
  77188. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  77189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77190. return c
  77191. }
  77192. // Context sets the context to be used in this call's Do method. Any
  77193. // pending HTTP request will be aborted if the provided context is
  77194. // canceled.
  77195. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  77196. c.ctx_ = ctx
  77197. return c
  77198. }
  77199. // Header returns an http.Header that can be modified by the caller to
  77200. // add HTTP headers to the request.
  77201. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  77202. if c.header_ == nil {
  77203. c.header_ = make(http.Header)
  77204. }
  77205. return c.header_
  77206. }
  77207. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  77208. reqHeaders := make(http.Header)
  77209. for k, v := range c.header_ {
  77210. reqHeaders[k] = v
  77211. }
  77212. reqHeaders.Set("User-Agent", c.s.userAgent())
  77213. var body io.Reader = nil
  77214. c.urlParams_.Set("alt", alt)
  77215. c.urlParams_.Set("prettyPrint", "false")
  77216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  77217. urls += "?" + c.urlParams_.Encode()
  77218. req, err := http.NewRequest("POST", urls, body)
  77219. if err != nil {
  77220. return nil, err
  77221. }
  77222. req.Header = reqHeaders
  77223. googleapi.Expand(req.URL, map[string]string{
  77224. "project": c.project,
  77225. })
  77226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77227. }
  77228. // Do executes the "compute.projects.enableXpnHost" call.
  77229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77230. // status code is an error. Response headers are in either
  77231. // *Operation.ServerResponse.Header or (if a response was returned at
  77232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77233. // to check whether the returned error was because
  77234. // http.StatusNotModified was returned.
  77235. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77236. gensupport.SetOptions(c.urlParams_, opts...)
  77237. res, err := c.doRequest("json")
  77238. if res != nil && res.StatusCode == http.StatusNotModified {
  77239. if res.Body != nil {
  77240. res.Body.Close()
  77241. }
  77242. return nil, &googleapi.Error{
  77243. Code: res.StatusCode,
  77244. Header: res.Header,
  77245. }
  77246. }
  77247. if err != nil {
  77248. return nil, err
  77249. }
  77250. defer googleapi.CloseBody(res)
  77251. if err := googleapi.CheckResponse(res); err != nil {
  77252. return nil, err
  77253. }
  77254. ret := &Operation{
  77255. ServerResponse: googleapi.ServerResponse{
  77256. Header: res.Header,
  77257. HTTPStatusCode: res.StatusCode,
  77258. },
  77259. }
  77260. target := &ret
  77261. if err := gensupport.DecodeResponse(target, res); err != nil {
  77262. return nil, err
  77263. }
  77264. return ret, nil
  77265. // {
  77266. // "description": "Enable this project as a shared VPC host project.",
  77267. // "httpMethod": "POST",
  77268. // "id": "compute.projects.enableXpnHost",
  77269. // "parameterOrder": [
  77270. // "project"
  77271. // ],
  77272. // "parameters": {
  77273. // "project": {
  77274. // "description": "Project ID for this request.",
  77275. // "location": "path",
  77276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77277. // "required": true,
  77278. // "type": "string"
  77279. // },
  77280. // "requestId": {
  77281. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77282. // "location": "query",
  77283. // "type": "string"
  77284. // }
  77285. // },
  77286. // "path": "{project}/enableXpnHost",
  77287. // "response": {
  77288. // "$ref": "Operation"
  77289. // },
  77290. // "scopes": [
  77291. // "https://www.googleapis.com/auth/cloud-platform",
  77292. // "https://www.googleapis.com/auth/compute"
  77293. // ]
  77294. // }
  77295. }
  77296. // method id "compute.projects.enableXpnResource":
  77297. type ProjectsEnableXpnResourceCall struct {
  77298. s *Service
  77299. project string
  77300. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  77301. urlParams_ gensupport.URLParams
  77302. ctx_ context.Context
  77303. header_ http.Header
  77304. }
  77305. // EnableXpnResource: Enable service resource (a.k.a service project)
  77306. // for a host project, so that subnets in the host project can be used
  77307. // by instances in the service project.
  77308. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  77309. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77310. c.project = project
  77311. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  77312. return c
  77313. }
  77314. // RequestId sets the optional parameter "requestId": An optional
  77315. // request ID to identify requests. Specify a unique request ID so that
  77316. // if you must retry your request, the server will know to ignore the
  77317. // request if it has already been completed.
  77318. //
  77319. // For example, consider a situation where you make an initial request
  77320. // and the request times out. If you make the request again with the
  77321. // same request ID, the server can check if original operation with the
  77322. // same request ID was received, and if so, will ignore the second
  77323. // request. This prevents clients from accidentally creating duplicate
  77324. // commitments.
  77325. //
  77326. // The request ID must be a valid UUID with the exception that zero UUID
  77327. // is not supported (00000000-0000-0000-0000-000000000000).
  77328. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  77329. c.urlParams_.Set("requestId", requestId)
  77330. return c
  77331. }
  77332. // Fields allows partial responses to be retrieved. See
  77333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77334. // for more information.
  77335. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  77336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77337. return c
  77338. }
  77339. // Context sets the context to be used in this call's Do method. Any
  77340. // pending HTTP request will be aborted if the provided context is
  77341. // canceled.
  77342. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  77343. c.ctx_ = ctx
  77344. return c
  77345. }
  77346. // Header returns an http.Header that can be modified by the caller to
  77347. // add HTTP headers to the request.
  77348. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  77349. if c.header_ == nil {
  77350. c.header_ = make(http.Header)
  77351. }
  77352. return c.header_
  77353. }
  77354. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  77355. reqHeaders := make(http.Header)
  77356. for k, v := range c.header_ {
  77357. reqHeaders[k] = v
  77358. }
  77359. reqHeaders.Set("User-Agent", c.s.userAgent())
  77360. var body io.Reader = nil
  77361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  77362. if err != nil {
  77363. return nil, err
  77364. }
  77365. reqHeaders.Set("Content-Type", "application/json")
  77366. c.urlParams_.Set("alt", alt)
  77367. c.urlParams_.Set("prettyPrint", "false")
  77368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  77369. urls += "?" + c.urlParams_.Encode()
  77370. req, err := http.NewRequest("POST", urls, body)
  77371. if err != nil {
  77372. return nil, err
  77373. }
  77374. req.Header = reqHeaders
  77375. googleapi.Expand(req.URL, map[string]string{
  77376. "project": c.project,
  77377. })
  77378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77379. }
  77380. // Do executes the "compute.projects.enableXpnResource" call.
  77381. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77382. // status code is an error. Response headers are in either
  77383. // *Operation.ServerResponse.Header or (if a response was returned at
  77384. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77385. // to check whether the returned error was because
  77386. // http.StatusNotModified was returned.
  77387. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77388. gensupport.SetOptions(c.urlParams_, opts...)
  77389. res, err := c.doRequest("json")
  77390. if res != nil && res.StatusCode == http.StatusNotModified {
  77391. if res.Body != nil {
  77392. res.Body.Close()
  77393. }
  77394. return nil, &googleapi.Error{
  77395. Code: res.StatusCode,
  77396. Header: res.Header,
  77397. }
  77398. }
  77399. if err != nil {
  77400. return nil, err
  77401. }
  77402. defer googleapi.CloseBody(res)
  77403. if err := googleapi.CheckResponse(res); err != nil {
  77404. return nil, err
  77405. }
  77406. ret := &Operation{
  77407. ServerResponse: googleapi.ServerResponse{
  77408. Header: res.Header,
  77409. HTTPStatusCode: res.StatusCode,
  77410. },
  77411. }
  77412. target := &ret
  77413. if err := gensupport.DecodeResponse(target, res); err != nil {
  77414. return nil, err
  77415. }
  77416. return ret, nil
  77417. // {
  77418. // "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.",
  77419. // "httpMethod": "POST",
  77420. // "id": "compute.projects.enableXpnResource",
  77421. // "parameterOrder": [
  77422. // "project"
  77423. // ],
  77424. // "parameters": {
  77425. // "project": {
  77426. // "description": "Project ID for this request.",
  77427. // "location": "path",
  77428. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77429. // "required": true,
  77430. // "type": "string"
  77431. // },
  77432. // "requestId": {
  77433. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77434. // "location": "query",
  77435. // "type": "string"
  77436. // }
  77437. // },
  77438. // "path": "{project}/enableXpnResource",
  77439. // "request": {
  77440. // "$ref": "ProjectsEnableXpnResourceRequest"
  77441. // },
  77442. // "response": {
  77443. // "$ref": "Operation"
  77444. // },
  77445. // "scopes": [
  77446. // "https://www.googleapis.com/auth/cloud-platform",
  77447. // "https://www.googleapis.com/auth/compute"
  77448. // ]
  77449. // }
  77450. }
  77451. // method id "compute.projects.get":
  77452. type ProjectsGetCall struct {
  77453. s *Service
  77454. project string
  77455. urlParams_ gensupport.URLParams
  77456. ifNoneMatch_ string
  77457. ctx_ context.Context
  77458. header_ http.Header
  77459. }
  77460. // Get: Returns the specified Project resource.
  77461. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  77462. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  77463. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77464. c.project = project
  77465. return c
  77466. }
  77467. // Fields allows partial responses to be retrieved. See
  77468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77469. // for more information.
  77470. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  77471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77472. return c
  77473. }
  77474. // IfNoneMatch sets the optional parameter which makes the operation
  77475. // fail if the object's ETag matches the given value. This is useful for
  77476. // getting updates only after the object has changed since the last
  77477. // request. Use googleapi.IsNotModified to check whether the response
  77478. // error from Do is the result of In-None-Match.
  77479. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  77480. c.ifNoneMatch_ = entityTag
  77481. return c
  77482. }
  77483. // Context sets the context to be used in this call's Do method. Any
  77484. // pending HTTP request will be aborted if the provided context is
  77485. // canceled.
  77486. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  77487. c.ctx_ = ctx
  77488. return c
  77489. }
  77490. // Header returns an http.Header that can be modified by the caller to
  77491. // add HTTP headers to the request.
  77492. func (c *ProjectsGetCall) Header() http.Header {
  77493. if c.header_ == nil {
  77494. c.header_ = make(http.Header)
  77495. }
  77496. return c.header_
  77497. }
  77498. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  77499. reqHeaders := make(http.Header)
  77500. for k, v := range c.header_ {
  77501. reqHeaders[k] = v
  77502. }
  77503. reqHeaders.Set("User-Agent", c.s.userAgent())
  77504. if c.ifNoneMatch_ != "" {
  77505. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77506. }
  77507. var body io.Reader = nil
  77508. c.urlParams_.Set("alt", alt)
  77509. c.urlParams_.Set("prettyPrint", "false")
  77510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  77511. urls += "?" + c.urlParams_.Encode()
  77512. req, err := http.NewRequest("GET", urls, body)
  77513. if err != nil {
  77514. return nil, err
  77515. }
  77516. req.Header = reqHeaders
  77517. googleapi.Expand(req.URL, map[string]string{
  77518. "project": c.project,
  77519. })
  77520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77521. }
  77522. // Do executes the "compute.projects.get" call.
  77523. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  77524. // code is an error. Response headers are in either
  77525. // *Project.ServerResponse.Header or (if a response was returned at all)
  77526. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77527. // check whether the returned error was because http.StatusNotModified
  77528. // was returned.
  77529. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  77530. gensupport.SetOptions(c.urlParams_, opts...)
  77531. res, err := c.doRequest("json")
  77532. if res != nil && res.StatusCode == http.StatusNotModified {
  77533. if res.Body != nil {
  77534. res.Body.Close()
  77535. }
  77536. return nil, &googleapi.Error{
  77537. Code: res.StatusCode,
  77538. Header: res.Header,
  77539. }
  77540. }
  77541. if err != nil {
  77542. return nil, err
  77543. }
  77544. defer googleapi.CloseBody(res)
  77545. if err := googleapi.CheckResponse(res); err != nil {
  77546. return nil, err
  77547. }
  77548. ret := &Project{
  77549. ServerResponse: googleapi.ServerResponse{
  77550. Header: res.Header,
  77551. HTTPStatusCode: res.StatusCode,
  77552. },
  77553. }
  77554. target := &ret
  77555. if err := gensupport.DecodeResponse(target, res); err != nil {
  77556. return nil, err
  77557. }
  77558. return ret, nil
  77559. // {
  77560. // "description": "Returns the specified Project resource.",
  77561. // "httpMethod": "GET",
  77562. // "id": "compute.projects.get",
  77563. // "parameterOrder": [
  77564. // "project"
  77565. // ],
  77566. // "parameters": {
  77567. // "project": {
  77568. // "description": "Project ID for this request.",
  77569. // "location": "path",
  77570. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77571. // "required": true,
  77572. // "type": "string"
  77573. // }
  77574. // },
  77575. // "path": "{project}",
  77576. // "response": {
  77577. // "$ref": "Project"
  77578. // },
  77579. // "scopes": [
  77580. // "https://www.googleapis.com/auth/cloud-platform",
  77581. // "https://www.googleapis.com/auth/compute",
  77582. // "https://www.googleapis.com/auth/compute.readonly"
  77583. // ]
  77584. // }
  77585. }
  77586. // method id "compute.projects.getXpnHost":
  77587. type ProjectsGetXpnHostCall struct {
  77588. s *Service
  77589. project string
  77590. urlParams_ gensupport.URLParams
  77591. ifNoneMatch_ string
  77592. ctx_ context.Context
  77593. header_ http.Header
  77594. }
  77595. // GetXpnHost: Gets the shared VPC host project that this project links
  77596. // to. May be empty if no link exists.
  77597. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  77598. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77599. c.project = project
  77600. return c
  77601. }
  77602. // Fields allows partial responses to be retrieved. See
  77603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77604. // for more information.
  77605. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  77606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77607. return c
  77608. }
  77609. // IfNoneMatch sets the optional parameter which makes the operation
  77610. // fail if the object's ETag matches the given value. This is useful for
  77611. // getting updates only after the object has changed since the last
  77612. // request. Use googleapi.IsNotModified to check whether the response
  77613. // error from Do is the result of In-None-Match.
  77614. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  77615. c.ifNoneMatch_ = entityTag
  77616. return c
  77617. }
  77618. // Context sets the context to be used in this call's Do method. Any
  77619. // pending HTTP request will be aborted if the provided context is
  77620. // canceled.
  77621. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  77622. c.ctx_ = ctx
  77623. return c
  77624. }
  77625. // Header returns an http.Header that can be modified by the caller to
  77626. // add HTTP headers to the request.
  77627. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  77628. if c.header_ == nil {
  77629. c.header_ = make(http.Header)
  77630. }
  77631. return c.header_
  77632. }
  77633. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  77634. reqHeaders := make(http.Header)
  77635. for k, v := range c.header_ {
  77636. reqHeaders[k] = v
  77637. }
  77638. reqHeaders.Set("User-Agent", c.s.userAgent())
  77639. if c.ifNoneMatch_ != "" {
  77640. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77641. }
  77642. var body io.Reader = nil
  77643. c.urlParams_.Set("alt", alt)
  77644. c.urlParams_.Set("prettyPrint", "false")
  77645. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  77646. urls += "?" + c.urlParams_.Encode()
  77647. req, err := http.NewRequest("GET", urls, body)
  77648. if err != nil {
  77649. return nil, err
  77650. }
  77651. req.Header = reqHeaders
  77652. googleapi.Expand(req.URL, map[string]string{
  77653. "project": c.project,
  77654. })
  77655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77656. }
  77657. // Do executes the "compute.projects.getXpnHost" call.
  77658. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  77659. // code is an error. Response headers are in either
  77660. // *Project.ServerResponse.Header or (if a response was returned at all)
  77661. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77662. // check whether the returned error was because http.StatusNotModified
  77663. // was returned.
  77664. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  77665. gensupport.SetOptions(c.urlParams_, opts...)
  77666. res, err := c.doRequest("json")
  77667. if res != nil && res.StatusCode == http.StatusNotModified {
  77668. if res.Body != nil {
  77669. res.Body.Close()
  77670. }
  77671. return nil, &googleapi.Error{
  77672. Code: res.StatusCode,
  77673. Header: res.Header,
  77674. }
  77675. }
  77676. if err != nil {
  77677. return nil, err
  77678. }
  77679. defer googleapi.CloseBody(res)
  77680. if err := googleapi.CheckResponse(res); err != nil {
  77681. return nil, err
  77682. }
  77683. ret := &Project{
  77684. ServerResponse: googleapi.ServerResponse{
  77685. Header: res.Header,
  77686. HTTPStatusCode: res.StatusCode,
  77687. },
  77688. }
  77689. target := &ret
  77690. if err := gensupport.DecodeResponse(target, res); err != nil {
  77691. return nil, err
  77692. }
  77693. return ret, nil
  77694. // {
  77695. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  77696. // "httpMethod": "GET",
  77697. // "id": "compute.projects.getXpnHost",
  77698. // "parameterOrder": [
  77699. // "project"
  77700. // ],
  77701. // "parameters": {
  77702. // "project": {
  77703. // "description": "Project ID for this request.",
  77704. // "location": "path",
  77705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77706. // "required": true,
  77707. // "type": "string"
  77708. // }
  77709. // },
  77710. // "path": "{project}/getXpnHost",
  77711. // "response": {
  77712. // "$ref": "Project"
  77713. // },
  77714. // "scopes": [
  77715. // "https://www.googleapis.com/auth/cloud-platform",
  77716. // "https://www.googleapis.com/auth/compute"
  77717. // ]
  77718. // }
  77719. }
  77720. // method id "compute.projects.getXpnResources":
  77721. type ProjectsGetXpnResourcesCall struct {
  77722. s *Service
  77723. project string
  77724. urlParams_ gensupport.URLParams
  77725. ifNoneMatch_ string
  77726. ctx_ context.Context
  77727. header_ http.Header
  77728. }
  77729. // GetXpnResources: Gets service resources (a.k.a service project)
  77730. // associated with this host project.
  77731. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  77732. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77733. c.project = project
  77734. return c
  77735. }
  77736. // Filter sets the optional parameter "filter": A filter expression that
  77737. // filters resources listed in the response. The expression must specify
  77738. // the field name, a comparison operator, and the value that you want to
  77739. // use for filtering. The value must be a string, a number, or a
  77740. // boolean. The comparison operator must be either =, !=, >, or <.
  77741. //
  77742. // For example, if you are filtering Compute Engine instances, you can
  77743. // exclude instances named example-instance by specifying name !=
  77744. // example-instance.
  77745. //
  77746. // You can also filter nested fields. For example, you could specify
  77747. // scheduling.automaticRestart = false to include instances only if they
  77748. // are not scheduled for automatic restarts. You can use filtering on
  77749. // nested fields to filter based on resource labels.
  77750. //
  77751. // To filter on multiple expressions, provide each separate expression
  77752. // within parentheses. For example, (scheduling.automaticRestart = true)
  77753. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77754. // AND expression. However, you can include AND and OR expressions
  77755. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77756. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77757. // true).
  77758. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  77759. c.urlParams_.Set("filter", filter)
  77760. return c
  77761. }
  77762. // MaxResults sets the optional parameter "maxResults": The maximum
  77763. // number of results per page that should be returned. If the number of
  77764. // available results is larger than maxResults, Compute Engine returns a
  77765. // nextPageToken that can be used to get the next page of results in
  77766. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77767. // (Default: 500)
  77768. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  77769. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77770. return c
  77771. }
  77772. // OrderBy sets the optional parameter "order_by": Sorts list results by
  77773. // a certain order. By default, results are returned in alphanumerical
  77774. // order based on the resource name.
  77775. //
  77776. // You can also sort results in descending order based on the creation
  77777. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77778. // based on the creationTimestamp field in reverse chronological order
  77779. // (newest result first). Use this to sort resources like operations so
  77780. // that the newest operation is returned first.
  77781. //
  77782. // Currently, only sorting by name or creationTimestamp desc is
  77783. // supported.
  77784. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  77785. c.urlParams_.Set("order_by", orderBy)
  77786. return c
  77787. }
  77788. // PageToken sets the optional parameter "pageToken": Specifies a page
  77789. // token to use. Set pageToken to the nextPageToken returned by a
  77790. // previous list request to get the next page of results.
  77791. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  77792. c.urlParams_.Set("pageToken", pageToken)
  77793. return c
  77794. }
  77795. // Fields allows partial responses to be retrieved. See
  77796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77797. // for more information.
  77798. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  77799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77800. return c
  77801. }
  77802. // IfNoneMatch sets the optional parameter which makes the operation
  77803. // fail if the object's ETag matches the given value. This is useful for
  77804. // getting updates only after the object has changed since the last
  77805. // request. Use googleapi.IsNotModified to check whether the response
  77806. // error from Do is the result of In-None-Match.
  77807. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  77808. c.ifNoneMatch_ = entityTag
  77809. return c
  77810. }
  77811. // Context sets the context to be used in this call's Do method. Any
  77812. // pending HTTP request will be aborted if the provided context is
  77813. // canceled.
  77814. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  77815. c.ctx_ = ctx
  77816. return c
  77817. }
  77818. // Header returns an http.Header that can be modified by the caller to
  77819. // add HTTP headers to the request.
  77820. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  77821. if c.header_ == nil {
  77822. c.header_ = make(http.Header)
  77823. }
  77824. return c.header_
  77825. }
  77826. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  77827. reqHeaders := make(http.Header)
  77828. for k, v := range c.header_ {
  77829. reqHeaders[k] = v
  77830. }
  77831. reqHeaders.Set("User-Agent", c.s.userAgent())
  77832. if c.ifNoneMatch_ != "" {
  77833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77834. }
  77835. var body io.Reader = nil
  77836. c.urlParams_.Set("alt", alt)
  77837. c.urlParams_.Set("prettyPrint", "false")
  77838. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  77839. urls += "?" + c.urlParams_.Encode()
  77840. req, err := http.NewRequest("GET", urls, body)
  77841. if err != nil {
  77842. return nil, err
  77843. }
  77844. req.Header = reqHeaders
  77845. googleapi.Expand(req.URL, map[string]string{
  77846. "project": c.project,
  77847. })
  77848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77849. }
  77850. // Do executes the "compute.projects.getXpnResources" call.
  77851. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  77852. // non-2xx status code is an error. Response headers are in either
  77853. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  77854. // returned at all) in error.(*googleapi.Error).Header. Use
  77855. // googleapi.IsNotModified to check whether the returned error was
  77856. // because http.StatusNotModified was returned.
  77857. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  77858. gensupport.SetOptions(c.urlParams_, opts...)
  77859. res, err := c.doRequest("json")
  77860. if res != nil && res.StatusCode == http.StatusNotModified {
  77861. if res.Body != nil {
  77862. res.Body.Close()
  77863. }
  77864. return nil, &googleapi.Error{
  77865. Code: res.StatusCode,
  77866. Header: res.Header,
  77867. }
  77868. }
  77869. if err != nil {
  77870. return nil, err
  77871. }
  77872. defer googleapi.CloseBody(res)
  77873. if err := googleapi.CheckResponse(res); err != nil {
  77874. return nil, err
  77875. }
  77876. ret := &ProjectsGetXpnResources{
  77877. ServerResponse: googleapi.ServerResponse{
  77878. Header: res.Header,
  77879. HTTPStatusCode: res.StatusCode,
  77880. },
  77881. }
  77882. target := &ret
  77883. if err := gensupport.DecodeResponse(target, res); err != nil {
  77884. return nil, err
  77885. }
  77886. return ret, nil
  77887. // {
  77888. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  77889. // "httpMethod": "GET",
  77890. // "id": "compute.projects.getXpnResources",
  77891. // "parameterOrder": [
  77892. // "project"
  77893. // ],
  77894. // "parameters": {
  77895. // "filter": {
  77896. // "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).",
  77897. // "location": "query",
  77898. // "type": "string"
  77899. // },
  77900. // "maxResults": {
  77901. // "default": "500",
  77902. // "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)",
  77903. // "format": "uint32",
  77904. // "location": "query",
  77905. // "minimum": "0",
  77906. // "type": "integer"
  77907. // },
  77908. // "order_by": {
  77909. // "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.",
  77910. // "location": "query",
  77911. // "type": "string"
  77912. // },
  77913. // "pageToken": {
  77914. // "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.",
  77915. // "location": "query",
  77916. // "type": "string"
  77917. // },
  77918. // "project": {
  77919. // "description": "Project ID for this request.",
  77920. // "location": "path",
  77921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77922. // "required": true,
  77923. // "type": "string"
  77924. // }
  77925. // },
  77926. // "path": "{project}/getXpnResources",
  77927. // "response": {
  77928. // "$ref": "ProjectsGetXpnResources"
  77929. // },
  77930. // "scopes": [
  77931. // "https://www.googleapis.com/auth/cloud-platform",
  77932. // "https://www.googleapis.com/auth/compute"
  77933. // ]
  77934. // }
  77935. }
  77936. // Pages invokes f for each page of results.
  77937. // A non-nil error returned from f will halt the iteration.
  77938. // The provided context supersedes any context provided to the Context method.
  77939. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  77940. c.ctx_ = ctx
  77941. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77942. for {
  77943. x, err := c.Do()
  77944. if err != nil {
  77945. return err
  77946. }
  77947. if err := f(x); err != nil {
  77948. return err
  77949. }
  77950. if x.NextPageToken == "" {
  77951. return nil
  77952. }
  77953. c.PageToken(x.NextPageToken)
  77954. }
  77955. }
  77956. // method id "compute.projects.listXpnHosts":
  77957. type ProjectsListXpnHostsCall struct {
  77958. s *Service
  77959. project string
  77960. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  77961. urlParams_ gensupport.URLParams
  77962. ctx_ context.Context
  77963. header_ http.Header
  77964. }
  77965. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  77966. // in an organization.
  77967. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  77968. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77969. c.project = project
  77970. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  77971. return c
  77972. }
  77973. // Filter sets the optional parameter "filter": A filter expression that
  77974. // filters resources listed in the response. The expression must specify
  77975. // the field name, a comparison operator, and the value that you want to
  77976. // use for filtering. The value must be a string, a number, or a
  77977. // boolean. The comparison operator must be either =, !=, >, or <.
  77978. //
  77979. // For example, if you are filtering Compute Engine instances, you can
  77980. // exclude instances named example-instance by specifying name !=
  77981. // example-instance.
  77982. //
  77983. // You can also filter nested fields. For example, you could specify
  77984. // scheduling.automaticRestart = false to include instances only if they
  77985. // are not scheduled for automatic restarts. You can use filtering on
  77986. // nested fields to filter based on resource labels.
  77987. //
  77988. // To filter on multiple expressions, provide each separate expression
  77989. // within parentheses. For example, (scheduling.automaticRestart = true)
  77990. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77991. // AND expression. However, you can include AND and OR expressions
  77992. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77993. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77994. // true).
  77995. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  77996. c.urlParams_.Set("filter", filter)
  77997. return c
  77998. }
  77999. // MaxResults sets the optional parameter "maxResults": The maximum
  78000. // number of results per page that should be returned. If the number of
  78001. // available results is larger than maxResults, Compute Engine returns a
  78002. // nextPageToken that can be used to get the next page of results in
  78003. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78004. // (Default: 500)
  78005. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  78006. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78007. return c
  78008. }
  78009. // OrderBy sets the optional parameter "order_by": Sorts list results by
  78010. // a certain order. By default, results are returned in alphanumerical
  78011. // order based on the resource name.
  78012. //
  78013. // You can also sort results in descending order based on the creation
  78014. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78015. // based on the creationTimestamp field in reverse chronological order
  78016. // (newest result first). Use this to sort resources like operations so
  78017. // that the newest operation is returned first.
  78018. //
  78019. // Currently, only sorting by name or creationTimestamp desc is
  78020. // supported.
  78021. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  78022. c.urlParams_.Set("order_by", orderBy)
  78023. return c
  78024. }
  78025. // PageToken sets the optional parameter "pageToken": Specifies a page
  78026. // token to use. Set pageToken to the nextPageToken returned by a
  78027. // previous list request to get the next page of results.
  78028. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  78029. c.urlParams_.Set("pageToken", pageToken)
  78030. return c
  78031. }
  78032. // Fields allows partial responses to be retrieved. See
  78033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78034. // for more information.
  78035. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  78036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78037. return c
  78038. }
  78039. // Context sets the context to be used in this call's Do method. Any
  78040. // pending HTTP request will be aborted if the provided context is
  78041. // canceled.
  78042. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  78043. c.ctx_ = ctx
  78044. return c
  78045. }
  78046. // Header returns an http.Header that can be modified by the caller to
  78047. // add HTTP headers to the request.
  78048. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  78049. if c.header_ == nil {
  78050. c.header_ = make(http.Header)
  78051. }
  78052. return c.header_
  78053. }
  78054. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  78055. reqHeaders := make(http.Header)
  78056. for k, v := range c.header_ {
  78057. reqHeaders[k] = v
  78058. }
  78059. reqHeaders.Set("User-Agent", c.s.userAgent())
  78060. var body io.Reader = nil
  78061. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  78062. if err != nil {
  78063. return nil, err
  78064. }
  78065. reqHeaders.Set("Content-Type", "application/json")
  78066. c.urlParams_.Set("alt", alt)
  78067. c.urlParams_.Set("prettyPrint", "false")
  78068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  78069. urls += "?" + c.urlParams_.Encode()
  78070. req, err := http.NewRequest("POST", urls, body)
  78071. if err != nil {
  78072. return nil, err
  78073. }
  78074. req.Header = reqHeaders
  78075. googleapi.Expand(req.URL, map[string]string{
  78076. "project": c.project,
  78077. })
  78078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78079. }
  78080. // Do executes the "compute.projects.listXpnHosts" call.
  78081. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  78082. // status code is an error. Response headers are in either
  78083. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  78084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78085. // to check whether the returned error was because
  78086. // http.StatusNotModified was returned.
  78087. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  78088. gensupport.SetOptions(c.urlParams_, opts...)
  78089. res, err := c.doRequest("json")
  78090. if res != nil && res.StatusCode == http.StatusNotModified {
  78091. if res.Body != nil {
  78092. res.Body.Close()
  78093. }
  78094. return nil, &googleapi.Error{
  78095. Code: res.StatusCode,
  78096. Header: res.Header,
  78097. }
  78098. }
  78099. if err != nil {
  78100. return nil, err
  78101. }
  78102. defer googleapi.CloseBody(res)
  78103. if err := googleapi.CheckResponse(res); err != nil {
  78104. return nil, err
  78105. }
  78106. ret := &XpnHostList{
  78107. ServerResponse: googleapi.ServerResponse{
  78108. Header: res.Header,
  78109. HTTPStatusCode: res.StatusCode,
  78110. },
  78111. }
  78112. target := &ret
  78113. if err := gensupport.DecodeResponse(target, res); err != nil {
  78114. return nil, err
  78115. }
  78116. return ret, nil
  78117. // {
  78118. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  78119. // "httpMethod": "POST",
  78120. // "id": "compute.projects.listXpnHosts",
  78121. // "parameterOrder": [
  78122. // "project"
  78123. // ],
  78124. // "parameters": {
  78125. // "filter": {
  78126. // "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).",
  78127. // "location": "query",
  78128. // "type": "string"
  78129. // },
  78130. // "maxResults": {
  78131. // "default": "500",
  78132. // "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)",
  78133. // "format": "uint32",
  78134. // "location": "query",
  78135. // "minimum": "0",
  78136. // "type": "integer"
  78137. // },
  78138. // "order_by": {
  78139. // "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.",
  78140. // "location": "query",
  78141. // "type": "string"
  78142. // },
  78143. // "pageToken": {
  78144. // "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.",
  78145. // "location": "query",
  78146. // "type": "string"
  78147. // },
  78148. // "project": {
  78149. // "description": "Project ID for this request.",
  78150. // "location": "path",
  78151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78152. // "required": true,
  78153. // "type": "string"
  78154. // }
  78155. // },
  78156. // "path": "{project}/listXpnHosts",
  78157. // "request": {
  78158. // "$ref": "ProjectsListXpnHostsRequest"
  78159. // },
  78160. // "response": {
  78161. // "$ref": "XpnHostList"
  78162. // },
  78163. // "scopes": [
  78164. // "https://www.googleapis.com/auth/cloud-platform",
  78165. // "https://www.googleapis.com/auth/compute"
  78166. // ]
  78167. // }
  78168. }
  78169. // Pages invokes f for each page of results.
  78170. // A non-nil error returned from f will halt the iteration.
  78171. // The provided context supersedes any context provided to the Context method.
  78172. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  78173. c.ctx_ = ctx
  78174. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78175. for {
  78176. x, err := c.Do()
  78177. if err != nil {
  78178. return err
  78179. }
  78180. if err := f(x); err != nil {
  78181. return err
  78182. }
  78183. if x.NextPageToken == "" {
  78184. return nil
  78185. }
  78186. c.PageToken(x.NextPageToken)
  78187. }
  78188. }
  78189. // method id "compute.projects.moveDisk":
  78190. type ProjectsMoveDiskCall struct {
  78191. s *Service
  78192. project string
  78193. diskmoverequest *DiskMoveRequest
  78194. urlParams_ gensupport.URLParams
  78195. ctx_ context.Context
  78196. header_ http.Header
  78197. }
  78198. // MoveDisk: Moves a persistent disk from one zone to another.
  78199. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  78200. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78201. c.project = project
  78202. c.diskmoverequest = diskmoverequest
  78203. return c
  78204. }
  78205. // RequestId sets the optional parameter "requestId": An optional
  78206. // request ID to identify requests. Specify a unique request ID so that
  78207. // if you must retry your request, the server will know to ignore the
  78208. // request if it has already been completed.
  78209. //
  78210. // For example, consider a situation where you make an initial request
  78211. // and the request times out. If you make the request again with the
  78212. // same request ID, the server can check if original operation with the
  78213. // same request ID was received, and if so, will ignore the second
  78214. // request. This prevents clients from accidentally creating duplicate
  78215. // commitments.
  78216. //
  78217. // The request ID must be a valid UUID with the exception that zero UUID
  78218. // is not supported (00000000-0000-0000-0000-000000000000).
  78219. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  78220. c.urlParams_.Set("requestId", requestId)
  78221. return c
  78222. }
  78223. // Fields allows partial responses to be retrieved. See
  78224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78225. // for more information.
  78226. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  78227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78228. return c
  78229. }
  78230. // Context sets the context to be used in this call's Do method. Any
  78231. // pending HTTP request will be aborted if the provided context is
  78232. // canceled.
  78233. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  78234. c.ctx_ = ctx
  78235. return c
  78236. }
  78237. // Header returns an http.Header that can be modified by the caller to
  78238. // add HTTP headers to the request.
  78239. func (c *ProjectsMoveDiskCall) Header() http.Header {
  78240. if c.header_ == nil {
  78241. c.header_ = make(http.Header)
  78242. }
  78243. return c.header_
  78244. }
  78245. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  78246. reqHeaders := make(http.Header)
  78247. for k, v := range c.header_ {
  78248. reqHeaders[k] = v
  78249. }
  78250. reqHeaders.Set("User-Agent", c.s.userAgent())
  78251. var body io.Reader = nil
  78252. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  78253. if err != nil {
  78254. return nil, err
  78255. }
  78256. reqHeaders.Set("Content-Type", "application/json")
  78257. c.urlParams_.Set("alt", alt)
  78258. c.urlParams_.Set("prettyPrint", "false")
  78259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  78260. urls += "?" + c.urlParams_.Encode()
  78261. req, err := http.NewRequest("POST", urls, body)
  78262. if err != nil {
  78263. return nil, err
  78264. }
  78265. req.Header = reqHeaders
  78266. googleapi.Expand(req.URL, map[string]string{
  78267. "project": c.project,
  78268. })
  78269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78270. }
  78271. // Do executes the "compute.projects.moveDisk" call.
  78272. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78273. // status code is an error. Response headers are in either
  78274. // *Operation.ServerResponse.Header or (if a response was returned at
  78275. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78276. // to check whether the returned error was because
  78277. // http.StatusNotModified was returned.
  78278. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78279. gensupport.SetOptions(c.urlParams_, opts...)
  78280. res, err := c.doRequest("json")
  78281. if res != nil && res.StatusCode == http.StatusNotModified {
  78282. if res.Body != nil {
  78283. res.Body.Close()
  78284. }
  78285. return nil, &googleapi.Error{
  78286. Code: res.StatusCode,
  78287. Header: res.Header,
  78288. }
  78289. }
  78290. if err != nil {
  78291. return nil, err
  78292. }
  78293. defer googleapi.CloseBody(res)
  78294. if err := googleapi.CheckResponse(res); err != nil {
  78295. return nil, err
  78296. }
  78297. ret := &Operation{
  78298. ServerResponse: googleapi.ServerResponse{
  78299. Header: res.Header,
  78300. HTTPStatusCode: res.StatusCode,
  78301. },
  78302. }
  78303. target := &ret
  78304. if err := gensupport.DecodeResponse(target, res); err != nil {
  78305. return nil, err
  78306. }
  78307. return ret, nil
  78308. // {
  78309. // "description": "Moves a persistent disk from one zone to another.",
  78310. // "httpMethod": "POST",
  78311. // "id": "compute.projects.moveDisk",
  78312. // "parameterOrder": [
  78313. // "project"
  78314. // ],
  78315. // "parameters": {
  78316. // "project": {
  78317. // "description": "Project ID for this request.",
  78318. // "location": "path",
  78319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78320. // "required": true,
  78321. // "type": "string"
  78322. // },
  78323. // "requestId": {
  78324. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78325. // "location": "query",
  78326. // "type": "string"
  78327. // }
  78328. // },
  78329. // "path": "{project}/moveDisk",
  78330. // "request": {
  78331. // "$ref": "DiskMoveRequest"
  78332. // },
  78333. // "response": {
  78334. // "$ref": "Operation"
  78335. // },
  78336. // "scopes": [
  78337. // "https://www.googleapis.com/auth/cloud-platform",
  78338. // "https://www.googleapis.com/auth/compute"
  78339. // ]
  78340. // }
  78341. }
  78342. // method id "compute.projects.moveInstance":
  78343. type ProjectsMoveInstanceCall struct {
  78344. s *Service
  78345. project string
  78346. instancemoverequest *InstanceMoveRequest
  78347. urlParams_ gensupport.URLParams
  78348. ctx_ context.Context
  78349. header_ http.Header
  78350. }
  78351. // MoveInstance: Moves an instance and its attached persistent disks
  78352. // from one zone to another.
  78353. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  78354. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78355. c.project = project
  78356. c.instancemoverequest = instancemoverequest
  78357. return c
  78358. }
  78359. // RequestId sets the optional parameter "requestId": An optional
  78360. // request ID to identify requests. Specify a unique request ID so that
  78361. // if you must retry your request, the server will know to ignore the
  78362. // request if it has already been completed.
  78363. //
  78364. // For example, consider a situation where you make an initial request
  78365. // and the request times out. If you make the request again with the
  78366. // same request ID, the server can check if original operation with the
  78367. // same request ID was received, and if so, will ignore the second
  78368. // request. This prevents clients from accidentally creating duplicate
  78369. // commitments.
  78370. //
  78371. // The request ID must be a valid UUID with the exception that zero UUID
  78372. // is not supported (00000000-0000-0000-0000-000000000000).
  78373. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  78374. c.urlParams_.Set("requestId", requestId)
  78375. return c
  78376. }
  78377. // Fields allows partial responses to be retrieved. See
  78378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78379. // for more information.
  78380. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  78381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78382. return c
  78383. }
  78384. // Context sets the context to be used in this call's Do method. Any
  78385. // pending HTTP request will be aborted if the provided context is
  78386. // canceled.
  78387. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  78388. c.ctx_ = ctx
  78389. return c
  78390. }
  78391. // Header returns an http.Header that can be modified by the caller to
  78392. // add HTTP headers to the request.
  78393. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  78394. if c.header_ == nil {
  78395. c.header_ = make(http.Header)
  78396. }
  78397. return c.header_
  78398. }
  78399. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  78400. reqHeaders := make(http.Header)
  78401. for k, v := range c.header_ {
  78402. reqHeaders[k] = v
  78403. }
  78404. reqHeaders.Set("User-Agent", c.s.userAgent())
  78405. var body io.Reader = nil
  78406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  78407. if err != nil {
  78408. return nil, err
  78409. }
  78410. reqHeaders.Set("Content-Type", "application/json")
  78411. c.urlParams_.Set("alt", alt)
  78412. c.urlParams_.Set("prettyPrint", "false")
  78413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  78414. urls += "?" + c.urlParams_.Encode()
  78415. req, err := http.NewRequest("POST", urls, body)
  78416. if err != nil {
  78417. return nil, err
  78418. }
  78419. req.Header = reqHeaders
  78420. googleapi.Expand(req.URL, map[string]string{
  78421. "project": c.project,
  78422. })
  78423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78424. }
  78425. // Do executes the "compute.projects.moveInstance" call.
  78426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78427. // status code is an error. Response headers are in either
  78428. // *Operation.ServerResponse.Header or (if a response was returned at
  78429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78430. // to check whether the returned error was because
  78431. // http.StatusNotModified was returned.
  78432. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78433. gensupport.SetOptions(c.urlParams_, opts...)
  78434. res, err := c.doRequest("json")
  78435. if res != nil && res.StatusCode == http.StatusNotModified {
  78436. if res.Body != nil {
  78437. res.Body.Close()
  78438. }
  78439. return nil, &googleapi.Error{
  78440. Code: res.StatusCode,
  78441. Header: res.Header,
  78442. }
  78443. }
  78444. if err != nil {
  78445. return nil, err
  78446. }
  78447. defer googleapi.CloseBody(res)
  78448. if err := googleapi.CheckResponse(res); err != nil {
  78449. return nil, err
  78450. }
  78451. ret := &Operation{
  78452. ServerResponse: googleapi.ServerResponse{
  78453. Header: res.Header,
  78454. HTTPStatusCode: res.StatusCode,
  78455. },
  78456. }
  78457. target := &ret
  78458. if err := gensupport.DecodeResponse(target, res); err != nil {
  78459. return nil, err
  78460. }
  78461. return ret, nil
  78462. // {
  78463. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  78464. // "httpMethod": "POST",
  78465. // "id": "compute.projects.moveInstance",
  78466. // "parameterOrder": [
  78467. // "project"
  78468. // ],
  78469. // "parameters": {
  78470. // "project": {
  78471. // "description": "Project ID for this request.",
  78472. // "location": "path",
  78473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78474. // "required": true,
  78475. // "type": "string"
  78476. // },
  78477. // "requestId": {
  78478. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78479. // "location": "query",
  78480. // "type": "string"
  78481. // }
  78482. // },
  78483. // "path": "{project}/moveInstance",
  78484. // "request": {
  78485. // "$ref": "InstanceMoveRequest"
  78486. // },
  78487. // "response": {
  78488. // "$ref": "Operation"
  78489. // },
  78490. // "scopes": [
  78491. // "https://www.googleapis.com/auth/cloud-platform",
  78492. // "https://www.googleapis.com/auth/compute"
  78493. // ]
  78494. // }
  78495. }
  78496. // method id "compute.projects.setCommonInstanceMetadata":
  78497. type ProjectsSetCommonInstanceMetadataCall struct {
  78498. s *Service
  78499. project string
  78500. metadata *Metadata
  78501. urlParams_ gensupport.URLParams
  78502. ctx_ context.Context
  78503. header_ http.Header
  78504. }
  78505. // SetCommonInstanceMetadata: Sets metadata common to all instances
  78506. // within the specified project using the data included in the request.
  78507. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  78508. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  78509. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78510. c.project = project
  78511. c.metadata = metadata
  78512. return c
  78513. }
  78514. // RequestId sets the optional parameter "requestId": An optional
  78515. // request ID to identify requests. Specify a unique request ID so that
  78516. // if you must retry your request, the server will know to ignore the
  78517. // request if it has already been completed.
  78518. //
  78519. // For example, consider a situation where you make an initial request
  78520. // and the request times out. If you make the request again with the
  78521. // same request ID, the server can check if original operation with the
  78522. // same request ID was received, and if so, will ignore the second
  78523. // request. This prevents clients from accidentally creating duplicate
  78524. // commitments.
  78525. //
  78526. // The request ID must be a valid UUID with the exception that zero UUID
  78527. // is not supported (00000000-0000-0000-0000-000000000000).
  78528. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  78529. c.urlParams_.Set("requestId", requestId)
  78530. return c
  78531. }
  78532. // Fields allows partial responses to be retrieved. See
  78533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78534. // for more information.
  78535. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  78536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78537. return c
  78538. }
  78539. // Context sets the context to be used in this call's Do method. Any
  78540. // pending HTTP request will be aborted if the provided context is
  78541. // canceled.
  78542. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  78543. c.ctx_ = ctx
  78544. return c
  78545. }
  78546. // Header returns an http.Header that can be modified by the caller to
  78547. // add HTTP headers to the request.
  78548. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  78549. if c.header_ == nil {
  78550. c.header_ = make(http.Header)
  78551. }
  78552. return c.header_
  78553. }
  78554. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  78555. reqHeaders := make(http.Header)
  78556. for k, v := range c.header_ {
  78557. reqHeaders[k] = v
  78558. }
  78559. reqHeaders.Set("User-Agent", c.s.userAgent())
  78560. var body io.Reader = nil
  78561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  78562. if err != nil {
  78563. return nil, err
  78564. }
  78565. reqHeaders.Set("Content-Type", "application/json")
  78566. c.urlParams_.Set("alt", alt)
  78567. c.urlParams_.Set("prettyPrint", "false")
  78568. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  78569. urls += "?" + c.urlParams_.Encode()
  78570. req, err := http.NewRequest("POST", urls, body)
  78571. if err != nil {
  78572. return nil, err
  78573. }
  78574. req.Header = reqHeaders
  78575. googleapi.Expand(req.URL, map[string]string{
  78576. "project": c.project,
  78577. })
  78578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78579. }
  78580. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  78581. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78582. // status code is an error. Response headers are in either
  78583. // *Operation.ServerResponse.Header or (if a response was returned at
  78584. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78585. // to check whether the returned error was because
  78586. // http.StatusNotModified was returned.
  78587. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78588. gensupport.SetOptions(c.urlParams_, opts...)
  78589. res, err := c.doRequest("json")
  78590. if res != nil && res.StatusCode == http.StatusNotModified {
  78591. if res.Body != nil {
  78592. res.Body.Close()
  78593. }
  78594. return nil, &googleapi.Error{
  78595. Code: res.StatusCode,
  78596. Header: res.Header,
  78597. }
  78598. }
  78599. if err != nil {
  78600. return nil, err
  78601. }
  78602. defer googleapi.CloseBody(res)
  78603. if err := googleapi.CheckResponse(res); err != nil {
  78604. return nil, err
  78605. }
  78606. ret := &Operation{
  78607. ServerResponse: googleapi.ServerResponse{
  78608. Header: res.Header,
  78609. HTTPStatusCode: res.StatusCode,
  78610. },
  78611. }
  78612. target := &ret
  78613. if err := gensupport.DecodeResponse(target, res); err != nil {
  78614. return nil, err
  78615. }
  78616. return ret, nil
  78617. // {
  78618. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  78619. // "httpMethod": "POST",
  78620. // "id": "compute.projects.setCommonInstanceMetadata",
  78621. // "parameterOrder": [
  78622. // "project"
  78623. // ],
  78624. // "parameters": {
  78625. // "project": {
  78626. // "description": "Project ID for this request.",
  78627. // "location": "path",
  78628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78629. // "required": true,
  78630. // "type": "string"
  78631. // },
  78632. // "requestId": {
  78633. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78634. // "location": "query",
  78635. // "type": "string"
  78636. // }
  78637. // },
  78638. // "path": "{project}/setCommonInstanceMetadata",
  78639. // "request": {
  78640. // "$ref": "Metadata"
  78641. // },
  78642. // "response": {
  78643. // "$ref": "Operation"
  78644. // },
  78645. // "scopes": [
  78646. // "https://www.googleapis.com/auth/cloud-platform",
  78647. // "https://www.googleapis.com/auth/compute"
  78648. // ]
  78649. // }
  78650. }
  78651. // method id "compute.projects.setDefaultNetworkTier":
  78652. type ProjectsSetDefaultNetworkTierCall struct {
  78653. s *Service
  78654. project string
  78655. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  78656. urlParams_ gensupport.URLParams
  78657. ctx_ context.Context
  78658. header_ http.Header
  78659. }
  78660. // SetDefaultNetworkTier: Sets the default network tier of the project.
  78661. // The default network tier is used when an
  78662. // address/forwardingRule/instance is created without specifying the
  78663. // network tier field.
  78664. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  78665. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78666. c.project = project
  78667. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  78668. return c
  78669. }
  78670. // RequestId sets the optional parameter "requestId": An optional
  78671. // request ID to identify requests. Specify a unique request ID so that
  78672. // if you must retry your request, the server will know to ignore the
  78673. // request if it has already been completed.
  78674. //
  78675. // For example, consider a situation where you make an initial request
  78676. // and the request times out. If you make the request again with the
  78677. // same request ID, the server can check if original operation with the
  78678. // same request ID was received, and if so, will ignore the second
  78679. // request. This prevents clients from accidentally creating duplicate
  78680. // commitments.
  78681. //
  78682. // The request ID must be a valid UUID with the exception that zero UUID
  78683. // is not supported (00000000-0000-0000-0000-000000000000).
  78684. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  78685. c.urlParams_.Set("requestId", requestId)
  78686. return c
  78687. }
  78688. // Fields allows partial responses to be retrieved. See
  78689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78690. // for more information.
  78691. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  78692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78693. return c
  78694. }
  78695. // Context sets the context to be used in this call's Do method. Any
  78696. // pending HTTP request will be aborted if the provided context is
  78697. // canceled.
  78698. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  78699. c.ctx_ = ctx
  78700. return c
  78701. }
  78702. // Header returns an http.Header that can be modified by the caller to
  78703. // add HTTP headers to the request.
  78704. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  78705. if c.header_ == nil {
  78706. c.header_ = make(http.Header)
  78707. }
  78708. return c.header_
  78709. }
  78710. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  78711. reqHeaders := make(http.Header)
  78712. for k, v := range c.header_ {
  78713. reqHeaders[k] = v
  78714. }
  78715. reqHeaders.Set("User-Agent", c.s.userAgent())
  78716. var body io.Reader = nil
  78717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  78718. if err != nil {
  78719. return nil, err
  78720. }
  78721. reqHeaders.Set("Content-Type", "application/json")
  78722. c.urlParams_.Set("alt", alt)
  78723. c.urlParams_.Set("prettyPrint", "false")
  78724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  78725. urls += "?" + c.urlParams_.Encode()
  78726. req, err := http.NewRequest("POST", urls, body)
  78727. if err != nil {
  78728. return nil, err
  78729. }
  78730. req.Header = reqHeaders
  78731. googleapi.Expand(req.URL, map[string]string{
  78732. "project": c.project,
  78733. })
  78734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78735. }
  78736. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  78737. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78738. // status code is an error. Response headers are in either
  78739. // *Operation.ServerResponse.Header or (if a response was returned at
  78740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78741. // to check whether the returned error was because
  78742. // http.StatusNotModified was returned.
  78743. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78744. gensupport.SetOptions(c.urlParams_, opts...)
  78745. res, err := c.doRequest("json")
  78746. if res != nil && res.StatusCode == http.StatusNotModified {
  78747. if res.Body != nil {
  78748. res.Body.Close()
  78749. }
  78750. return nil, &googleapi.Error{
  78751. Code: res.StatusCode,
  78752. Header: res.Header,
  78753. }
  78754. }
  78755. if err != nil {
  78756. return nil, err
  78757. }
  78758. defer googleapi.CloseBody(res)
  78759. if err := googleapi.CheckResponse(res); err != nil {
  78760. return nil, err
  78761. }
  78762. ret := &Operation{
  78763. ServerResponse: googleapi.ServerResponse{
  78764. Header: res.Header,
  78765. HTTPStatusCode: res.StatusCode,
  78766. },
  78767. }
  78768. target := &ret
  78769. if err := gensupport.DecodeResponse(target, res); err != nil {
  78770. return nil, err
  78771. }
  78772. return ret, nil
  78773. // {
  78774. // "description": "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.",
  78775. // "httpMethod": "POST",
  78776. // "id": "compute.projects.setDefaultNetworkTier",
  78777. // "parameterOrder": [
  78778. // "project"
  78779. // ],
  78780. // "parameters": {
  78781. // "project": {
  78782. // "description": "Project ID for this request.",
  78783. // "location": "path",
  78784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78785. // "required": true,
  78786. // "type": "string"
  78787. // },
  78788. // "requestId": {
  78789. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78790. // "location": "query",
  78791. // "type": "string"
  78792. // }
  78793. // },
  78794. // "path": "{project}/setDefaultNetworkTier",
  78795. // "request": {
  78796. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  78797. // },
  78798. // "response": {
  78799. // "$ref": "Operation"
  78800. // },
  78801. // "scopes": [
  78802. // "https://www.googleapis.com/auth/cloud-platform",
  78803. // "https://www.googleapis.com/auth/compute"
  78804. // ]
  78805. // }
  78806. }
  78807. // method id "compute.projects.setUsageExportBucket":
  78808. type ProjectsSetUsageExportBucketCall struct {
  78809. s *Service
  78810. project string
  78811. usageexportlocation *UsageExportLocation
  78812. urlParams_ gensupport.URLParams
  78813. ctx_ context.Context
  78814. header_ http.Header
  78815. }
  78816. // SetUsageExportBucket: Enables the usage export feature and sets the
  78817. // usage export bucket where reports are stored. If you provide an empty
  78818. // request body using this method, the usage export feature will be
  78819. // disabled.
  78820. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  78821. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  78822. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78823. c.project = project
  78824. c.usageexportlocation = usageexportlocation
  78825. return c
  78826. }
  78827. // RequestId sets the optional parameter "requestId": An optional
  78828. // request ID to identify requests. Specify a unique request ID so that
  78829. // if you must retry your request, the server will know to ignore the
  78830. // request if it has already been completed.
  78831. //
  78832. // For example, consider a situation where you make an initial request
  78833. // and the request times out. If you make the request again with the
  78834. // same request ID, the server can check if original operation with the
  78835. // same request ID was received, and if so, will ignore the second
  78836. // request. This prevents clients from accidentally creating duplicate
  78837. // commitments.
  78838. //
  78839. // The request ID must be a valid UUID with the exception that zero UUID
  78840. // is not supported (00000000-0000-0000-0000-000000000000).
  78841. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  78842. c.urlParams_.Set("requestId", requestId)
  78843. return c
  78844. }
  78845. // Fields allows partial responses to be retrieved. See
  78846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78847. // for more information.
  78848. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  78849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78850. return c
  78851. }
  78852. // Context sets the context to be used in this call's Do method. Any
  78853. // pending HTTP request will be aborted if the provided context is
  78854. // canceled.
  78855. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  78856. c.ctx_ = ctx
  78857. return c
  78858. }
  78859. // Header returns an http.Header that can be modified by the caller to
  78860. // add HTTP headers to the request.
  78861. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  78862. if c.header_ == nil {
  78863. c.header_ = make(http.Header)
  78864. }
  78865. return c.header_
  78866. }
  78867. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  78868. reqHeaders := make(http.Header)
  78869. for k, v := range c.header_ {
  78870. reqHeaders[k] = v
  78871. }
  78872. reqHeaders.Set("User-Agent", c.s.userAgent())
  78873. var body io.Reader = nil
  78874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  78875. if err != nil {
  78876. return nil, err
  78877. }
  78878. reqHeaders.Set("Content-Type", "application/json")
  78879. c.urlParams_.Set("alt", alt)
  78880. c.urlParams_.Set("prettyPrint", "false")
  78881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  78882. urls += "?" + c.urlParams_.Encode()
  78883. req, err := http.NewRequest("POST", urls, body)
  78884. if err != nil {
  78885. return nil, err
  78886. }
  78887. req.Header = reqHeaders
  78888. googleapi.Expand(req.URL, map[string]string{
  78889. "project": c.project,
  78890. })
  78891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78892. }
  78893. // Do executes the "compute.projects.setUsageExportBucket" call.
  78894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78895. // status code is an error. Response headers are in either
  78896. // *Operation.ServerResponse.Header or (if a response was returned at
  78897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78898. // to check whether the returned error was because
  78899. // http.StatusNotModified was returned.
  78900. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78901. gensupport.SetOptions(c.urlParams_, opts...)
  78902. res, err := c.doRequest("json")
  78903. if res != nil && res.StatusCode == http.StatusNotModified {
  78904. if res.Body != nil {
  78905. res.Body.Close()
  78906. }
  78907. return nil, &googleapi.Error{
  78908. Code: res.StatusCode,
  78909. Header: res.Header,
  78910. }
  78911. }
  78912. if err != nil {
  78913. return nil, err
  78914. }
  78915. defer googleapi.CloseBody(res)
  78916. if err := googleapi.CheckResponse(res); err != nil {
  78917. return nil, err
  78918. }
  78919. ret := &Operation{
  78920. ServerResponse: googleapi.ServerResponse{
  78921. Header: res.Header,
  78922. HTTPStatusCode: res.StatusCode,
  78923. },
  78924. }
  78925. target := &ret
  78926. if err := gensupport.DecodeResponse(target, res); err != nil {
  78927. return nil, err
  78928. }
  78929. return ret, nil
  78930. // {
  78931. // "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.",
  78932. // "httpMethod": "POST",
  78933. // "id": "compute.projects.setUsageExportBucket",
  78934. // "parameterOrder": [
  78935. // "project"
  78936. // ],
  78937. // "parameters": {
  78938. // "project": {
  78939. // "description": "Project ID for this request.",
  78940. // "location": "path",
  78941. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78942. // "required": true,
  78943. // "type": "string"
  78944. // },
  78945. // "requestId": {
  78946. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78947. // "location": "query",
  78948. // "type": "string"
  78949. // }
  78950. // },
  78951. // "path": "{project}/setUsageExportBucket",
  78952. // "request": {
  78953. // "$ref": "UsageExportLocation"
  78954. // },
  78955. // "response": {
  78956. // "$ref": "Operation"
  78957. // },
  78958. // "scopes": [
  78959. // "https://www.googleapis.com/auth/cloud-platform",
  78960. // "https://www.googleapis.com/auth/compute",
  78961. // "https://www.googleapis.com/auth/devstorage.full_control",
  78962. // "https://www.googleapis.com/auth/devstorage.read_only",
  78963. // "https://www.googleapis.com/auth/devstorage.read_write"
  78964. // ]
  78965. // }
  78966. }
  78967. // method id "compute.regionAutoscalers.delete":
  78968. type RegionAutoscalersDeleteCall struct {
  78969. s *Service
  78970. project string
  78971. region string
  78972. autoscaler string
  78973. urlParams_ gensupport.URLParams
  78974. ctx_ context.Context
  78975. header_ http.Header
  78976. }
  78977. // Delete: Deletes the specified autoscaler.
  78978. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  78979. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78980. c.project = project
  78981. c.region = region
  78982. c.autoscaler = autoscaler
  78983. return c
  78984. }
  78985. // RequestId sets the optional parameter "requestId": An optional
  78986. // request ID to identify requests. Specify a unique request ID so that
  78987. // if you must retry your request, the server will know to ignore the
  78988. // request if it has already been completed.
  78989. //
  78990. // For example, consider a situation where you make an initial request
  78991. // and the request times out. If you make the request again with the
  78992. // same request ID, the server can check if original operation with the
  78993. // same request ID was received, and if so, will ignore the second
  78994. // request. This prevents clients from accidentally creating duplicate
  78995. // commitments.
  78996. //
  78997. // The request ID must be a valid UUID with the exception that zero UUID
  78998. // is not supported (00000000-0000-0000-0000-000000000000).
  78999. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  79000. c.urlParams_.Set("requestId", requestId)
  79001. return c
  79002. }
  79003. // Fields allows partial responses to be retrieved. See
  79004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79005. // for more information.
  79006. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  79007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79008. return c
  79009. }
  79010. // Context sets the context to be used in this call's Do method. Any
  79011. // pending HTTP request will be aborted if the provided context is
  79012. // canceled.
  79013. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  79014. c.ctx_ = ctx
  79015. return c
  79016. }
  79017. // Header returns an http.Header that can be modified by the caller to
  79018. // add HTTP headers to the request.
  79019. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  79020. if c.header_ == nil {
  79021. c.header_ = make(http.Header)
  79022. }
  79023. return c.header_
  79024. }
  79025. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  79026. reqHeaders := make(http.Header)
  79027. for k, v := range c.header_ {
  79028. reqHeaders[k] = v
  79029. }
  79030. reqHeaders.Set("User-Agent", c.s.userAgent())
  79031. var body io.Reader = nil
  79032. c.urlParams_.Set("alt", alt)
  79033. c.urlParams_.Set("prettyPrint", "false")
  79034. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  79035. urls += "?" + c.urlParams_.Encode()
  79036. req, err := http.NewRequest("DELETE", urls, body)
  79037. if err != nil {
  79038. return nil, err
  79039. }
  79040. req.Header = reqHeaders
  79041. googleapi.Expand(req.URL, map[string]string{
  79042. "project": c.project,
  79043. "region": c.region,
  79044. "autoscaler": c.autoscaler,
  79045. })
  79046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79047. }
  79048. // Do executes the "compute.regionAutoscalers.delete" call.
  79049. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79050. // status code is an error. Response headers are in either
  79051. // *Operation.ServerResponse.Header or (if a response was returned at
  79052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79053. // to check whether the returned error was because
  79054. // http.StatusNotModified was returned.
  79055. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79056. gensupport.SetOptions(c.urlParams_, opts...)
  79057. res, err := c.doRequest("json")
  79058. if res != nil && res.StatusCode == http.StatusNotModified {
  79059. if res.Body != nil {
  79060. res.Body.Close()
  79061. }
  79062. return nil, &googleapi.Error{
  79063. Code: res.StatusCode,
  79064. Header: res.Header,
  79065. }
  79066. }
  79067. if err != nil {
  79068. return nil, err
  79069. }
  79070. defer googleapi.CloseBody(res)
  79071. if err := googleapi.CheckResponse(res); err != nil {
  79072. return nil, err
  79073. }
  79074. ret := &Operation{
  79075. ServerResponse: googleapi.ServerResponse{
  79076. Header: res.Header,
  79077. HTTPStatusCode: res.StatusCode,
  79078. },
  79079. }
  79080. target := &ret
  79081. if err := gensupport.DecodeResponse(target, res); err != nil {
  79082. return nil, err
  79083. }
  79084. return ret, nil
  79085. // {
  79086. // "description": "Deletes the specified autoscaler.",
  79087. // "httpMethod": "DELETE",
  79088. // "id": "compute.regionAutoscalers.delete",
  79089. // "parameterOrder": [
  79090. // "project",
  79091. // "region",
  79092. // "autoscaler"
  79093. // ],
  79094. // "parameters": {
  79095. // "autoscaler": {
  79096. // "description": "Name of the autoscaler to delete.",
  79097. // "location": "path",
  79098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79099. // "required": true,
  79100. // "type": "string"
  79101. // },
  79102. // "project": {
  79103. // "description": "Project ID for this request.",
  79104. // "location": "path",
  79105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79106. // "required": true,
  79107. // "type": "string"
  79108. // },
  79109. // "region": {
  79110. // "description": "Name of the region scoping this request.",
  79111. // "location": "path",
  79112. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79113. // "required": true,
  79114. // "type": "string"
  79115. // },
  79116. // "requestId": {
  79117. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79118. // "location": "query",
  79119. // "type": "string"
  79120. // }
  79121. // },
  79122. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  79123. // "response": {
  79124. // "$ref": "Operation"
  79125. // },
  79126. // "scopes": [
  79127. // "https://www.googleapis.com/auth/cloud-platform",
  79128. // "https://www.googleapis.com/auth/compute"
  79129. // ]
  79130. // }
  79131. }
  79132. // method id "compute.regionAutoscalers.get":
  79133. type RegionAutoscalersGetCall struct {
  79134. s *Service
  79135. project string
  79136. region string
  79137. autoscaler string
  79138. urlParams_ gensupport.URLParams
  79139. ifNoneMatch_ string
  79140. ctx_ context.Context
  79141. header_ http.Header
  79142. }
  79143. // Get: Returns the specified autoscaler.
  79144. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  79145. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79146. c.project = project
  79147. c.region = region
  79148. c.autoscaler = autoscaler
  79149. return c
  79150. }
  79151. // Fields allows partial responses to be retrieved. See
  79152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79153. // for more information.
  79154. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  79155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79156. return c
  79157. }
  79158. // IfNoneMatch sets the optional parameter which makes the operation
  79159. // fail if the object's ETag matches the given value. This is useful for
  79160. // getting updates only after the object has changed since the last
  79161. // request. Use googleapi.IsNotModified to check whether the response
  79162. // error from Do is the result of In-None-Match.
  79163. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  79164. c.ifNoneMatch_ = entityTag
  79165. return c
  79166. }
  79167. // Context sets the context to be used in this call's Do method. Any
  79168. // pending HTTP request will be aborted if the provided context is
  79169. // canceled.
  79170. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  79171. c.ctx_ = ctx
  79172. return c
  79173. }
  79174. // Header returns an http.Header that can be modified by the caller to
  79175. // add HTTP headers to the request.
  79176. func (c *RegionAutoscalersGetCall) Header() http.Header {
  79177. if c.header_ == nil {
  79178. c.header_ = make(http.Header)
  79179. }
  79180. return c.header_
  79181. }
  79182. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  79183. reqHeaders := make(http.Header)
  79184. for k, v := range c.header_ {
  79185. reqHeaders[k] = v
  79186. }
  79187. reqHeaders.Set("User-Agent", c.s.userAgent())
  79188. if c.ifNoneMatch_ != "" {
  79189. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79190. }
  79191. var body io.Reader = nil
  79192. c.urlParams_.Set("alt", alt)
  79193. c.urlParams_.Set("prettyPrint", "false")
  79194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  79195. urls += "?" + c.urlParams_.Encode()
  79196. req, err := http.NewRequest("GET", urls, body)
  79197. if err != nil {
  79198. return nil, err
  79199. }
  79200. req.Header = reqHeaders
  79201. googleapi.Expand(req.URL, map[string]string{
  79202. "project": c.project,
  79203. "region": c.region,
  79204. "autoscaler": c.autoscaler,
  79205. })
  79206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79207. }
  79208. // Do executes the "compute.regionAutoscalers.get" call.
  79209. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  79210. // status code is an error. Response headers are in either
  79211. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  79212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79213. // to check whether the returned error was because
  79214. // http.StatusNotModified was returned.
  79215. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  79216. gensupport.SetOptions(c.urlParams_, opts...)
  79217. res, err := c.doRequest("json")
  79218. if res != nil && res.StatusCode == http.StatusNotModified {
  79219. if res.Body != nil {
  79220. res.Body.Close()
  79221. }
  79222. return nil, &googleapi.Error{
  79223. Code: res.StatusCode,
  79224. Header: res.Header,
  79225. }
  79226. }
  79227. if err != nil {
  79228. return nil, err
  79229. }
  79230. defer googleapi.CloseBody(res)
  79231. if err := googleapi.CheckResponse(res); err != nil {
  79232. return nil, err
  79233. }
  79234. ret := &Autoscaler{
  79235. ServerResponse: googleapi.ServerResponse{
  79236. Header: res.Header,
  79237. HTTPStatusCode: res.StatusCode,
  79238. },
  79239. }
  79240. target := &ret
  79241. if err := gensupport.DecodeResponse(target, res); err != nil {
  79242. return nil, err
  79243. }
  79244. return ret, nil
  79245. // {
  79246. // "description": "Returns the specified autoscaler.",
  79247. // "httpMethod": "GET",
  79248. // "id": "compute.regionAutoscalers.get",
  79249. // "parameterOrder": [
  79250. // "project",
  79251. // "region",
  79252. // "autoscaler"
  79253. // ],
  79254. // "parameters": {
  79255. // "autoscaler": {
  79256. // "description": "Name of the autoscaler to return.",
  79257. // "location": "path",
  79258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79259. // "required": true,
  79260. // "type": "string"
  79261. // },
  79262. // "project": {
  79263. // "description": "Project ID for this request.",
  79264. // "location": "path",
  79265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79266. // "required": true,
  79267. // "type": "string"
  79268. // },
  79269. // "region": {
  79270. // "description": "Name of the region scoping this request.",
  79271. // "location": "path",
  79272. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79273. // "required": true,
  79274. // "type": "string"
  79275. // }
  79276. // },
  79277. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  79278. // "response": {
  79279. // "$ref": "Autoscaler"
  79280. // },
  79281. // "scopes": [
  79282. // "https://www.googleapis.com/auth/cloud-platform",
  79283. // "https://www.googleapis.com/auth/compute",
  79284. // "https://www.googleapis.com/auth/compute.readonly"
  79285. // ]
  79286. // }
  79287. }
  79288. // method id "compute.regionAutoscalers.insert":
  79289. type RegionAutoscalersInsertCall struct {
  79290. s *Service
  79291. project string
  79292. region string
  79293. autoscaler *Autoscaler
  79294. urlParams_ gensupport.URLParams
  79295. ctx_ context.Context
  79296. header_ http.Header
  79297. }
  79298. // Insert: Creates an autoscaler in the specified project using the data
  79299. // included in the request.
  79300. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  79301. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79302. c.project = project
  79303. c.region = region
  79304. c.autoscaler = autoscaler
  79305. return c
  79306. }
  79307. // RequestId sets the optional parameter "requestId": An optional
  79308. // request ID to identify requests. Specify a unique request ID so that
  79309. // if you must retry your request, the server will know to ignore the
  79310. // request if it has already been completed.
  79311. //
  79312. // For example, consider a situation where you make an initial request
  79313. // and the request times out. If you make the request again with the
  79314. // same request ID, the server can check if original operation with the
  79315. // same request ID was received, and if so, will ignore the second
  79316. // request. This prevents clients from accidentally creating duplicate
  79317. // commitments.
  79318. //
  79319. // The request ID must be a valid UUID with the exception that zero UUID
  79320. // is not supported (00000000-0000-0000-0000-000000000000).
  79321. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  79322. c.urlParams_.Set("requestId", requestId)
  79323. return c
  79324. }
  79325. // Fields allows partial responses to be retrieved. See
  79326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79327. // for more information.
  79328. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  79329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79330. return c
  79331. }
  79332. // Context sets the context to be used in this call's Do method. Any
  79333. // pending HTTP request will be aborted if the provided context is
  79334. // canceled.
  79335. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  79336. c.ctx_ = ctx
  79337. return c
  79338. }
  79339. // Header returns an http.Header that can be modified by the caller to
  79340. // add HTTP headers to the request.
  79341. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  79342. if c.header_ == nil {
  79343. c.header_ = make(http.Header)
  79344. }
  79345. return c.header_
  79346. }
  79347. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  79348. reqHeaders := make(http.Header)
  79349. for k, v := range c.header_ {
  79350. reqHeaders[k] = v
  79351. }
  79352. reqHeaders.Set("User-Agent", c.s.userAgent())
  79353. var body io.Reader = nil
  79354. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  79355. if err != nil {
  79356. return nil, err
  79357. }
  79358. reqHeaders.Set("Content-Type", "application/json")
  79359. c.urlParams_.Set("alt", alt)
  79360. c.urlParams_.Set("prettyPrint", "false")
  79361. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  79362. urls += "?" + c.urlParams_.Encode()
  79363. req, err := http.NewRequest("POST", urls, body)
  79364. if err != nil {
  79365. return nil, err
  79366. }
  79367. req.Header = reqHeaders
  79368. googleapi.Expand(req.URL, map[string]string{
  79369. "project": c.project,
  79370. "region": c.region,
  79371. })
  79372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79373. }
  79374. // Do executes the "compute.regionAutoscalers.insert" call.
  79375. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79376. // status code is an error. Response headers are in either
  79377. // *Operation.ServerResponse.Header or (if a response was returned at
  79378. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79379. // to check whether the returned error was because
  79380. // http.StatusNotModified was returned.
  79381. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79382. gensupport.SetOptions(c.urlParams_, opts...)
  79383. res, err := c.doRequest("json")
  79384. if res != nil && res.StatusCode == http.StatusNotModified {
  79385. if res.Body != nil {
  79386. res.Body.Close()
  79387. }
  79388. return nil, &googleapi.Error{
  79389. Code: res.StatusCode,
  79390. Header: res.Header,
  79391. }
  79392. }
  79393. if err != nil {
  79394. return nil, err
  79395. }
  79396. defer googleapi.CloseBody(res)
  79397. if err := googleapi.CheckResponse(res); err != nil {
  79398. return nil, err
  79399. }
  79400. ret := &Operation{
  79401. ServerResponse: googleapi.ServerResponse{
  79402. Header: res.Header,
  79403. HTTPStatusCode: res.StatusCode,
  79404. },
  79405. }
  79406. target := &ret
  79407. if err := gensupport.DecodeResponse(target, res); err != nil {
  79408. return nil, err
  79409. }
  79410. return ret, nil
  79411. // {
  79412. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  79413. // "httpMethod": "POST",
  79414. // "id": "compute.regionAutoscalers.insert",
  79415. // "parameterOrder": [
  79416. // "project",
  79417. // "region"
  79418. // ],
  79419. // "parameters": {
  79420. // "project": {
  79421. // "description": "Project ID for this request.",
  79422. // "location": "path",
  79423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79424. // "required": true,
  79425. // "type": "string"
  79426. // },
  79427. // "region": {
  79428. // "description": "Name of the region scoping this request.",
  79429. // "location": "path",
  79430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79431. // "required": true,
  79432. // "type": "string"
  79433. // },
  79434. // "requestId": {
  79435. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79436. // "location": "query",
  79437. // "type": "string"
  79438. // }
  79439. // },
  79440. // "path": "{project}/regions/{region}/autoscalers",
  79441. // "request": {
  79442. // "$ref": "Autoscaler"
  79443. // },
  79444. // "response": {
  79445. // "$ref": "Operation"
  79446. // },
  79447. // "scopes": [
  79448. // "https://www.googleapis.com/auth/cloud-platform",
  79449. // "https://www.googleapis.com/auth/compute"
  79450. // ]
  79451. // }
  79452. }
  79453. // method id "compute.regionAutoscalers.list":
  79454. type RegionAutoscalersListCall struct {
  79455. s *Service
  79456. project string
  79457. region string
  79458. urlParams_ gensupport.URLParams
  79459. ifNoneMatch_ string
  79460. ctx_ context.Context
  79461. header_ http.Header
  79462. }
  79463. // List: Retrieves a list of autoscalers contained within the specified
  79464. // region.
  79465. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  79466. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79467. c.project = project
  79468. c.region = region
  79469. return c
  79470. }
  79471. // Filter sets the optional parameter "filter": A filter expression that
  79472. // filters resources listed in the response. The expression must specify
  79473. // the field name, a comparison operator, and the value that you want to
  79474. // use for filtering. The value must be a string, a number, or a
  79475. // boolean. The comparison operator must be either =, !=, >, or <.
  79476. //
  79477. // For example, if you are filtering Compute Engine instances, you can
  79478. // exclude instances named example-instance by specifying name !=
  79479. // example-instance.
  79480. //
  79481. // You can also filter nested fields. For example, you could specify
  79482. // scheduling.automaticRestart = false to include instances only if they
  79483. // are not scheduled for automatic restarts. You can use filtering on
  79484. // nested fields to filter based on resource labels.
  79485. //
  79486. // To filter on multiple expressions, provide each separate expression
  79487. // within parentheses. For example, (scheduling.automaticRestart = true)
  79488. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79489. // AND expression. However, you can include AND and OR expressions
  79490. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79491. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79492. // true).
  79493. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  79494. c.urlParams_.Set("filter", filter)
  79495. return c
  79496. }
  79497. // MaxResults sets the optional parameter "maxResults": The maximum
  79498. // number of results per page that should be returned. If the number of
  79499. // available results is larger than maxResults, Compute Engine returns a
  79500. // nextPageToken that can be used to get the next page of results in
  79501. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79502. // (Default: 500)
  79503. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  79504. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79505. return c
  79506. }
  79507. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79508. // a certain order. By default, results are returned in alphanumerical
  79509. // order based on the resource name.
  79510. //
  79511. // You can also sort results in descending order based on the creation
  79512. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79513. // based on the creationTimestamp field in reverse chronological order
  79514. // (newest result first). Use this to sort resources like operations so
  79515. // that the newest operation is returned first.
  79516. //
  79517. // Currently, only sorting by name or creationTimestamp desc is
  79518. // supported.
  79519. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  79520. c.urlParams_.Set("orderBy", orderBy)
  79521. return c
  79522. }
  79523. // PageToken sets the optional parameter "pageToken": Specifies a page
  79524. // token to use. Set pageToken to the nextPageToken returned by a
  79525. // previous list request to get the next page of results.
  79526. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  79527. c.urlParams_.Set("pageToken", pageToken)
  79528. return c
  79529. }
  79530. // Fields allows partial responses to be retrieved. See
  79531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79532. // for more information.
  79533. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  79534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79535. return c
  79536. }
  79537. // IfNoneMatch sets the optional parameter which makes the operation
  79538. // fail if the object's ETag matches the given value. This is useful for
  79539. // getting updates only after the object has changed since the last
  79540. // request. Use googleapi.IsNotModified to check whether the response
  79541. // error from Do is the result of In-None-Match.
  79542. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  79543. c.ifNoneMatch_ = entityTag
  79544. return c
  79545. }
  79546. // Context sets the context to be used in this call's Do method. Any
  79547. // pending HTTP request will be aborted if the provided context is
  79548. // canceled.
  79549. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  79550. c.ctx_ = ctx
  79551. return c
  79552. }
  79553. // Header returns an http.Header that can be modified by the caller to
  79554. // add HTTP headers to the request.
  79555. func (c *RegionAutoscalersListCall) Header() http.Header {
  79556. if c.header_ == nil {
  79557. c.header_ = make(http.Header)
  79558. }
  79559. return c.header_
  79560. }
  79561. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  79562. reqHeaders := make(http.Header)
  79563. for k, v := range c.header_ {
  79564. reqHeaders[k] = v
  79565. }
  79566. reqHeaders.Set("User-Agent", c.s.userAgent())
  79567. if c.ifNoneMatch_ != "" {
  79568. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79569. }
  79570. var body io.Reader = nil
  79571. c.urlParams_.Set("alt", alt)
  79572. c.urlParams_.Set("prettyPrint", "false")
  79573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  79574. urls += "?" + c.urlParams_.Encode()
  79575. req, err := http.NewRequest("GET", urls, body)
  79576. if err != nil {
  79577. return nil, err
  79578. }
  79579. req.Header = reqHeaders
  79580. googleapi.Expand(req.URL, map[string]string{
  79581. "project": c.project,
  79582. "region": c.region,
  79583. })
  79584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79585. }
  79586. // Do executes the "compute.regionAutoscalers.list" call.
  79587. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  79588. // non-2xx status code is an error. Response headers are in either
  79589. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  79590. // returned at all) in error.(*googleapi.Error).Header. Use
  79591. // googleapi.IsNotModified to check whether the returned error was
  79592. // because http.StatusNotModified was returned.
  79593. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  79594. gensupport.SetOptions(c.urlParams_, opts...)
  79595. res, err := c.doRequest("json")
  79596. if res != nil && res.StatusCode == http.StatusNotModified {
  79597. if res.Body != nil {
  79598. res.Body.Close()
  79599. }
  79600. return nil, &googleapi.Error{
  79601. Code: res.StatusCode,
  79602. Header: res.Header,
  79603. }
  79604. }
  79605. if err != nil {
  79606. return nil, err
  79607. }
  79608. defer googleapi.CloseBody(res)
  79609. if err := googleapi.CheckResponse(res); err != nil {
  79610. return nil, err
  79611. }
  79612. ret := &RegionAutoscalerList{
  79613. ServerResponse: googleapi.ServerResponse{
  79614. Header: res.Header,
  79615. HTTPStatusCode: res.StatusCode,
  79616. },
  79617. }
  79618. target := &ret
  79619. if err := gensupport.DecodeResponse(target, res); err != nil {
  79620. return nil, err
  79621. }
  79622. return ret, nil
  79623. // {
  79624. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  79625. // "httpMethod": "GET",
  79626. // "id": "compute.regionAutoscalers.list",
  79627. // "parameterOrder": [
  79628. // "project",
  79629. // "region"
  79630. // ],
  79631. // "parameters": {
  79632. // "filter": {
  79633. // "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).",
  79634. // "location": "query",
  79635. // "type": "string"
  79636. // },
  79637. // "maxResults": {
  79638. // "default": "500",
  79639. // "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)",
  79640. // "format": "uint32",
  79641. // "location": "query",
  79642. // "minimum": "0",
  79643. // "type": "integer"
  79644. // },
  79645. // "orderBy": {
  79646. // "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.",
  79647. // "location": "query",
  79648. // "type": "string"
  79649. // },
  79650. // "pageToken": {
  79651. // "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.",
  79652. // "location": "query",
  79653. // "type": "string"
  79654. // },
  79655. // "project": {
  79656. // "description": "Project ID for this request.",
  79657. // "location": "path",
  79658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79659. // "required": true,
  79660. // "type": "string"
  79661. // },
  79662. // "region": {
  79663. // "description": "Name of the region scoping this request.",
  79664. // "location": "path",
  79665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79666. // "required": true,
  79667. // "type": "string"
  79668. // }
  79669. // },
  79670. // "path": "{project}/regions/{region}/autoscalers",
  79671. // "response": {
  79672. // "$ref": "RegionAutoscalerList"
  79673. // },
  79674. // "scopes": [
  79675. // "https://www.googleapis.com/auth/cloud-platform",
  79676. // "https://www.googleapis.com/auth/compute",
  79677. // "https://www.googleapis.com/auth/compute.readonly"
  79678. // ]
  79679. // }
  79680. }
  79681. // Pages invokes f for each page of results.
  79682. // A non-nil error returned from f will halt the iteration.
  79683. // The provided context supersedes any context provided to the Context method.
  79684. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  79685. c.ctx_ = ctx
  79686. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79687. for {
  79688. x, err := c.Do()
  79689. if err != nil {
  79690. return err
  79691. }
  79692. if err := f(x); err != nil {
  79693. return err
  79694. }
  79695. if x.NextPageToken == "" {
  79696. return nil
  79697. }
  79698. c.PageToken(x.NextPageToken)
  79699. }
  79700. }
  79701. // method id "compute.regionAutoscalers.patch":
  79702. type RegionAutoscalersPatchCall struct {
  79703. s *Service
  79704. project string
  79705. region string
  79706. autoscaler *Autoscaler
  79707. urlParams_ gensupport.URLParams
  79708. ctx_ context.Context
  79709. header_ http.Header
  79710. }
  79711. // Patch: Updates an autoscaler in the specified project using the data
  79712. // included in the request. This method supports PATCH semantics and
  79713. // uses the JSON merge patch format and processing rules.
  79714. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  79715. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79716. c.project = project
  79717. c.region = region
  79718. c.autoscaler = autoscaler
  79719. return c
  79720. }
  79721. // Autoscaler sets the optional parameter "autoscaler": Name of the
  79722. // autoscaler to patch.
  79723. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  79724. c.urlParams_.Set("autoscaler", autoscaler)
  79725. return c
  79726. }
  79727. // RequestId sets the optional parameter "requestId": An optional
  79728. // request ID to identify requests. Specify a unique request ID so that
  79729. // if you must retry your request, the server will know to ignore the
  79730. // request if it has already been completed.
  79731. //
  79732. // For example, consider a situation where you make an initial request
  79733. // and the request times out. If you make the request again with the
  79734. // same request ID, the server can check if original operation with the
  79735. // same request ID was received, and if so, will ignore the second
  79736. // request. This prevents clients from accidentally creating duplicate
  79737. // commitments.
  79738. //
  79739. // The request ID must be a valid UUID with the exception that zero UUID
  79740. // is not supported (00000000-0000-0000-0000-000000000000).
  79741. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  79742. c.urlParams_.Set("requestId", requestId)
  79743. return c
  79744. }
  79745. // Fields allows partial responses to be retrieved. See
  79746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79747. // for more information.
  79748. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  79749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79750. return c
  79751. }
  79752. // Context sets the context to be used in this call's Do method. Any
  79753. // pending HTTP request will be aborted if the provided context is
  79754. // canceled.
  79755. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  79756. c.ctx_ = ctx
  79757. return c
  79758. }
  79759. // Header returns an http.Header that can be modified by the caller to
  79760. // add HTTP headers to the request.
  79761. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  79762. if c.header_ == nil {
  79763. c.header_ = make(http.Header)
  79764. }
  79765. return c.header_
  79766. }
  79767. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  79768. reqHeaders := make(http.Header)
  79769. for k, v := range c.header_ {
  79770. reqHeaders[k] = v
  79771. }
  79772. reqHeaders.Set("User-Agent", c.s.userAgent())
  79773. var body io.Reader = nil
  79774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  79775. if err != nil {
  79776. return nil, err
  79777. }
  79778. reqHeaders.Set("Content-Type", "application/json")
  79779. c.urlParams_.Set("alt", alt)
  79780. c.urlParams_.Set("prettyPrint", "false")
  79781. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  79782. urls += "?" + c.urlParams_.Encode()
  79783. req, err := http.NewRequest("PATCH", urls, body)
  79784. if err != nil {
  79785. return nil, err
  79786. }
  79787. req.Header = reqHeaders
  79788. googleapi.Expand(req.URL, map[string]string{
  79789. "project": c.project,
  79790. "region": c.region,
  79791. })
  79792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79793. }
  79794. // Do executes the "compute.regionAutoscalers.patch" call.
  79795. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79796. // status code is an error. Response headers are in either
  79797. // *Operation.ServerResponse.Header or (if a response was returned at
  79798. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79799. // to check whether the returned error was because
  79800. // http.StatusNotModified was returned.
  79801. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79802. gensupport.SetOptions(c.urlParams_, opts...)
  79803. res, err := c.doRequest("json")
  79804. if res != nil && res.StatusCode == http.StatusNotModified {
  79805. if res.Body != nil {
  79806. res.Body.Close()
  79807. }
  79808. return nil, &googleapi.Error{
  79809. Code: res.StatusCode,
  79810. Header: res.Header,
  79811. }
  79812. }
  79813. if err != nil {
  79814. return nil, err
  79815. }
  79816. defer googleapi.CloseBody(res)
  79817. if err := googleapi.CheckResponse(res); err != nil {
  79818. return nil, err
  79819. }
  79820. ret := &Operation{
  79821. ServerResponse: googleapi.ServerResponse{
  79822. Header: res.Header,
  79823. HTTPStatusCode: res.StatusCode,
  79824. },
  79825. }
  79826. target := &ret
  79827. if err := gensupport.DecodeResponse(target, res); err != nil {
  79828. return nil, err
  79829. }
  79830. return ret, nil
  79831. // {
  79832. // "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.",
  79833. // "httpMethod": "PATCH",
  79834. // "id": "compute.regionAutoscalers.patch",
  79835. // "parameterOrder": [
  79836. // "project",
  79837. // "region"
  79838. // ],
  79839. // "parameters": {
  79840. // "autoscaler": {
  79841. // "description": "Name of the autoscaler to patch.",
  79842. // "location": "query",
  79843. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79844. // "type": "string"
  79845. // },
  79846. // "project": {
  79847. // "description": "Project ID for this request.",
  79848. // "location": "path",
  79849. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79850. // "required": true,
  79851. // "type": "string"
  79852. // },
  79853. // "region": {
  79854. // "description": "Name of the region scoping this request.",
  79855. // "location": "path",
  79856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79857. // "required": true,
  79858. // "type": "string"
  79859. // },
  79860. // "requestId": {
  79861. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79862. // "location": "query",
  79863. // "type": "string"
  79864. // }
  79865. // },
  79866. // "path": "{project}/regions/{region}/autoscalers",
  79867. // "request": {
  79868. // "$ref": "Autoscaler"
  79869. // },
  79870. // "response": {
  79871. // "$ref": "Operation"
  79872. // },
  79873. // "scopes": [
  79874. // "https://www.googleapis.com/auth/cloud-platform",
  79875. // "https://www.googleapis.com/auth/compute"
  79876. // ]
  79877. // }
  79878. }
  79879. // method id "compute.regionAutoscalers.testIamPermissions":
  79880. type RegionAutoscalersTestIamPermissionsCall struct {
  79881. s *Service
  79882. project string
  79883. region string
  79884. resource string
  79885. testpermissionsrequest *TestPermissionsRequest
  79886. urlParams_ gensupport.URLParams
  79887. ctx_ context.Context
  79888. header_ http.Header
  79889. }
  79890. // TestIamPermissions: Returns permissions that a caller has on the
  79891. // specified resource.
  79892. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  79893. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79894. c.project = project
  79895. c.region = region
  79896. c.resource = resource
  79897. c.testpermissionsrequest = testpermissionsrequest
  79898. return c
  79899. }
  79900. // Fields allows partial responses to be retrieved. See
  79901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79902. // for more information.
  79903. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  79904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79905. return c
  79906. }
  79907. // Context sets the context to be used in this call's Do method. Any
  79908. // pending HTTP request will be aborted if the provided context is
  79909. // canceled.
  79910. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  79911. c.ctx_ = ctx
  79912. return c
  79913. }
  79914. // Header returns an http.Header that can be modified by the caller to
  79915. // add HTTP headers to the request.
  79916. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  79917. if c.header_ == nil {
  79918. c.header_ = make(http.Header)
  79919. }
  79920. return c.header_
  79921. }
  79922. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  79923. reqHeaders := make(http.Header)
  79924. for k, v := range c.header_ {
  79925. reqHeaders[k] = v
  79926. }
  79927. reqHeaders.Set("User-Agent", c.s.userAgent())
  79928. var body io.Reader = nil
  79929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  79930. if err != nil {
  79931. return nil, err
  79932. }
  79933. reqHeaders.Set("Content-Type", "application/json")
  79934. c.urlParams_.Set("alt", alt)
  79935. c.urlParams_.Set("prettyPrint", "false")
  79936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  79937. urls += "?" + c.urlParams_.Encode()
  79938. req, err := http.NewRequest("POST", urls, body)
  79939. if err != nil {
  79940. return nil, err
  79941. }
  79942. req.Header = reqHeaders
  79943. googleapi.Expand(req.URL, map[string]string{
  79944. "project": c.project,
  79945. "region": c.region,
  79946. "resource": c.resource,
  79947. })
  79948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79949. }
  79950. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  79951. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  79952. // non-2xx status code is an error. Response headers are in either
  79953. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  79954. // returned at all) in error.(*googleapi.Error).Header. Use
  79955. // googleapi.IsNotModified to check whether the returned error was
  79956. // because http.StatusNotModified was returned.
  79957. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  79958. gensupport.SetOptions(c.urlParams_, opts...)
  79959. res, err := c.doRequest("json")
  79960. if res != nil && res.StatusCode == http.StatusNotModified {
  79961. if res.Body != nil {
  79962. res.Body.Close()
  79963. }
  79964. return nil, &googleapi.Error{
  79965. Code: res.StatusCode,
  79966. Header: res.Header,
  79967. }
  79968. }
  79969. if err != nil {
  79970. return nil, err
  79971. }
  79972. defer googleapi.CloseBody(res)
  79973. if err := googleapi.CheckResponse(res); err != nil {
  79974. return nil, err
  79975. }
  79976. ret := &TestPermissionsResponse{
  79977. ServerResponse: googleapi.ServerResponse{
  79978. Header: res.Header,
  79979. HTTPStatusCode: res.StatusCode,
  79980. },
  79981. }
  79982. target := &ret
  79983. if err := gensupport.DecodeResponse(target, res); err != nil {
  79984. return nil, err
  79985. }
  79986. return ret, nil
  79987. // {
  79988. // "description": "Returns permissions that a caller has on the specified resource.",
  79989. // "httpMethod": "POST",
  79990. // "id": "compute.regionAutoscalers.testIamPermissions",
  79991. // "parameterOrder": [
  79992. // "project",
  79993. // "region",
  79994. // "resource"
  79995. // ],
  79996. // "parameters": {
  79997. // "project": {
  79998. // "description": "Project ID for this request.",
  79999. // "location": "path",
  80000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80001. // "required": true,
  80002. // "type": "string"
  80003. // },
  80004. // "region": {
  80005. // "description": "The name of the region for this request.",
  80006. // "location": "path",
  80007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80008. // "required": true,
  80009. // "type": "string"
  80010. // },
  80011. // "resource": {
  80012. // "description": "Name or id of the resource for this request.",
  80013. // "location": "path",
  80014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80015. // "required": true,
  80016. // "type": "string"
  80017. // }
  80018. // },
  80019. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  80020. // "request": {
  80021. // "$ref": "TestPermissionsRequest"
  80022. // },
  80023. // "response": {
  80024. // "$ref": "TestPermissionsResponse"
  80025. // },
  80026. // "scopes": [
  80027. // "https://www.googleapis.com/auth/cloud-platform",
  80028. // "https://www.googleapis.com/auth/compute",
  80029. // "https://www.googleapis.com/auth/compute.readonly"
  80030. // ]
  80031. // }
  80032. }
  80033. // method id "compute.regionAutoscalers.update":
  80034. type RegionAutoscalersUpdateCall struct {
  80035. s *Service
  80036. project string
  80037. region string
  80038. autoscaler *Autoscaler
  80039. urlParams_ gensupport.URLParams
  80040. ctx_ context.Context
  80041. header_ http.Header
  80042. }
  80043. // Update: Updates an autoscaler in the specified project using the data
  80044. // included in the request.
  80045. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  80046. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80047. c.project = project
  80048. c.region = region
  80049. c.autoscaler = autoscaler
  80050. return c
  80051. }
  80052. // Autoscaler sets the optional parameter "autoscaler": Name of the
  80053. // autoscaler to update.
  80054. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  80055. c.urlParams_.Set("autoscaler", autoscaler)
  80056. return c
  80057. }
  80058. // RequestId sets the optional parameter "requestId": An optional
  80059. // request ID to identify requests. Specify a unique request ID so that
  80060. // if you must retry your request, the server will know to ignore the
  80061. // request if it has already been completed.
  80062. //
  80063. // For example, consider a situation where you make an initial request
  80064. // and the request times out. If you make the request again with the
  80065. // same request ID, the server can check if original operation with the
  80066. // same request ID was received, and if so, will ignore the second
  80067. // request. This prevents clients from accidentally creating duplicate
  80068. // commitments.
  80069. //
  80070. // The request ID must be a valid UUID with the exception that zero UUID
  80071. // is not supported (00000000-0000-0000-0000-000000000000).
  80072. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  80073. c.urlParams_.Set("requestId", requestId)
  80074. return c
  80075. }
  80076. // Fields allows partial responses to be retrieved. See
  80077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80078. // for more information.
  80079. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  80080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80081. return c
  80082. }
  80083. // Context sets the context to be used in this call's Do method. Any
  80084. // pending HTTP request will be aborted if the provided context is
  80085. // canceled.
  80086. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  80087. c.ctx_ = ctx
  80088. return c
  80089. }
  80090. // Header returns an http.Header that can be modified by the caller to
  80091. // add HTTP headers to the request.
  80092. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  80093. if c.header_ == nil {
  80094. c.header_ = make(http.Header)
  80095. }
  80096. return c.header_
  80097. }
  80098. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  80099. reqHeaders := make(http.Header)
  80100. for k, v := range c.header_ {
  80101. reqHeaders[k] = v
  80102. }
  80103. reqHeaders.Set("User-Agent", c.s.userAgent())
  80104. var body io.Reader = nil
  80105. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  80106. if err != nil {
  80107. return nil, err
  80108. }
  80109. reqHeaders.Set("Content-Type", "application/json")
  80110. c.urlParams_.Set("alt", alt)
  80111. c.urlParams_.Set("prettyPrint", "false")
  80112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  80113. urls += "?" + c.urlParams_.Encode()
  80114. req, err := http.NewRequest("PUT", urls, body)
  80115. if err != nil {
  80116. return nil, err
  80117. }
  80118. req.Header = reqHeaders
  80119. googleapi.Expand(req.URL, map[string]string{
  80120. "project": c.project,
  80121. "region": c.region,
  80122. })
  80123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80124. }
  80125. // Do executes the "compute.regionAutoscalers.update" call.
  80126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80127. // status code is an error. Response headers are in either
  80128. // *Operation.ServerResponse.Header or (if a response was returned at
  80129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80130. // to check whether the returned error was because
  80131. // http.StatusNotModified was returned.
  80132. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80133. gensupport.SetOptions(c.urlParams_, opts...)
  80134. res, err := c.doRequest("json")
  80135. if res != nil && res.StatusCode == http.StatusNotModified {
  80136. if res.Body != nil {
  80137. res.Body.Close()
  80138. }
  80139. return nil, &googleapi.Error{
  80140. Code: res.StatusCode,
  80141. Header: res.Header,
  80142. }
  80143. }
  80144. if err != nil {
  80145. return nil, err
  80146. }
  80147. defer googleapi.CloseBody(res)
  80148. if err := googleapi.CheckResponse(res); err != nil {
  80149. return nil, err
  80150. }
  80151. ret := &Operation{
  80152. ServerResponse: googleapi.ServerResponse{
  80153. Header: res.Header,
  80154. HTTPStatusCode: res.StatusCode,
  80155. },
  80156. }
  80157. target := &ret
  80158. if err := gensupport.DecodeResponse(target, res); err != nil {
  80159. return nil, err
  80160. }
  80161. return ret, nil
  80162. // {
  80163. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  80164. // "httpMethod": "PUT",
  80165. // "id": "compute.regionAutoscalers.update",
  80166. // "parameterOrder": [
  80167. // "project",
  80168. // "region"
  80169. // ],
  80170. // "parameters": {
  80171. // "autoscaler": {
  80172. // "description": "Name of the autoscaler to update.",
  80173. // "location": "query",
  80174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80175. // "type": "string"
  80176. // },
  80177. // "project": {
  80178. // "description": "Project ID for this request.",
  80179. // "location": "path",
  80180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80181. // "required": true,
  80182. // "type": "string"
  80183. // },
  80184. // "region": {
  80185. // "description": "Name of the region scoping this request.",
  80186. // "location": "path",
  80187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80188. // "required": true,
  80189. // "type": "string"
  80190. // },
  80191. // "requestId": {
  80192. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80193. // "location": "query",
  80194. // "type": "string"
  80195. // }
  80196. // },
  80197. // "path": "{project}/regions/{region}/autoscalers",
  80198. // "request": {
  80199. // "$ref": "Autoscaler"
  80200. // },
  80201. // "response": {
  80202. // "$ref": "Operation"
  80203. // },
  80204. // "scopes": [
  80205. // "https://www.googleapis.com/auth/cloud-platform",
  80206. // "https://www.googleapis.com/auth/compute"
  80207. // ]
  80208. // }
  80209. }
  80210. // method id "compute.regionBackendServices.delete":
  80211. type RegionBackendServicesDeleteCall struct {
  80212. s *Service
  80213. project string
  80214. region string
  80215. backendService string
  80216. urlParams_ gensupport.URLParams
  80217. ctx_ context.Context
  80218. header_ http.Header
  80219. }
  80220. // Delete: Deletes the specified regional BackendService resource.
  80221. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  80222. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80223. c.project = project
  80224. c.region = region
  80225. c.backendService = backendService
  80226. return c
  80227. }
  80228. // RequestId sets the optional parameter "requestId": An optional
  80229. // request ID to identify requests. Specify a unique request ID so that
  80230. // if you must retry your request, the server will know to ignore the
  80231. // request if it has already been completed.
  80232. //
  80233. // For example, consider a situation where you make an initial request
  80234. // and the request times out. If you make the request again with the
  80235. // same request ID, the server can check if original operation with the
  80236. // same request ID was received, and if so, will ignore the second
  80237. // request. This prevents clients from accidentally creating duplicate
  80238. // commitments.
  80239. //
  80240. // The request ID must be a valid UUID with the exception that zero UUID
  80241. // is not supported (00000000-0000-0000-0000-000000000000).
  80242. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  80243. c.urlParams_.Set("requestId", requestId)
  80244. return c
  80245. }
  80246. // Fields allows partial responses to be retrieved. See
  80247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80248. // for more information.
  80249. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  80250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80251. return c
  80252. }
  80253. // Context sets the context to be used in this call's Do method. Any
  80254. // pending HTTP request will be aborted if the provided context is
  80255. // canceled.
  80256. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  80257. c.ctx_ = ctx
  80258. return c
  80259. }
  80260. // Header returns an http.Header that can be modified by the caller to
  80261. // add HTTP headers to the request.
  80262. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  80263. if c.header_ == nil {
  80264. c.header_ = make(http.Header)
  80265. }
  80266. return c.header_
  80267. }
  80268. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  80269. reqHeaders := make(http.Header)
  80270. for k, v := range c.header_ {
  80271. reqHeaders[k] = v
  80272. }
  80273. reqHeaders.Set("User-Agent", c.s.userAgent())
  80274. var body io.Reader = nil
  80275. c.urlParams_.Set("alt", alt)
  80276. c.urlParams_.Set("prettyPrint", "false")
  80277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  80278. urls += "?" + c.urlParams_.Encode()
  80279. req, err := http.NewRequest("DELETE", urls, body)
  80280. if err != nil {
  80281. return nil, err
  80282. }
  80283. req.Header = reqHeaders
  80284. googleapi.Expand(req.URL, map[string]string{
  80285. "project": c.project,
  80286. "region": c.region,
  80287. "backendService": c.backendService,
  80288. })
  80289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80290. }
  80291. // Do executes the "compute.regionBackendServices.delete" call.
  80292. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80293. // status code is an error. Response headers are in either
  80294. // *Operation.ServerResponse.Header or (if a response was returned at
  80295. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80296. // to check whether the returned error was because
  80297. // http.StatusNotModified was returned.
  80298. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80299. gensupport.SetOptions(c.urlParams_, opts...)
  80300. res, err := c.doRequest("json")
  80301. if res != nil && res.StatusCode == http.StatusNotModified {
  80302. if res.Body != nil {
  80303. res.Body.Close()
  80304. }
  80305. return nil, &googleapi.Error{
  80306. Code: res.StatusCode,
  80307. Header: res.Header,
  80308. }
  80309. }
  80310. if err != nil {
  80311. return nil, err
  80312. }
  80313. defer googleapi.CloseBody(res)
  80314. if err := googleapi.CheckResponse(res); err != nil {
  80315. return nil, err
  80316. }
  80317. ret := &Operation{
  80318. ServerResponse: googleapi.ServerResponse{
  80319. Header: res.Header,
  80320. HTTPStatusCode: res.StatusCode,
  80321. },
  80322. }
  80323. target := &ret
  80324. if err := gensupport.DecodeResponse(target, res); err != nil {
  80325. return nil, err
  80326. }
  80327. return ret, nil
  80328. // {
  80329. // "description": "Deletes the specified regional BackendService resource.",
  80330. // "httpMethod": "DELETE",
  80331. // "id": "compute.regionBackendServices.delete",
  80332. // "parameterOrder": [
  80333. // "project",
  80334. // "region",
  80335. // "backendService"
  80336. // ],
  80337. // "parameters": {
  80338. // "backendService": {
  80339. // "description": "Name of the BackendService resource to delete.",
  80340. // "location": "path",
  80341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80342. // "required": true,
  80343. // "type": "string"
  80344. // },
  80345. // "project": {
  80346. // "description": "Project ID for this request.",
  80347. // "location": "path",
  80348. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80349. // "required": true,
  80350. // "type": "string"
  80351. // },
  80352. // "region": {
  80353. // "description": "Name of the region scoping this request.",
  80354. // "location": "path",
  80355. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80356. // "required": true,
  80357. // "type": "string"
  80358. // },
  80359. // "requestId": {
  80360. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80361. // "location": "query",
  80362. // "type": "string"
  80363. // }
  80364. // },
  80365. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  80366. // "response": {
  80367. // "$ref": "Operation"
  80368. // },
  80369. // "scopes": [
  80370. // "https://www.googleapis.com/auth/cloud-platform",
  80371. // "https://www.googleapis.com/auth/compute"
  80372. // ]
  80373. // }
  80374. }
  80375. // method id "compute.regionBackendServices.get":
  80376. type RegionBackendServicesGetCall struct {
  80377. s *Service
  80378. project string
  80379. region string
  80380. backendService string
  80381. urlParams_ gensupport.URLParams
  80382. ifNoneMatch_ string
  80383. ctx_ context.Context
  80384. header_ http.Header
  80385. }
  80386. // Get: Returns the specified regional BackendService resource.
  80387. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  80388. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80389. c.project = project
  80390. c.region = region
  80391. c.backendService = backendService
  80392. return c
  80393. }
  80394. // Fields allows partial responses to be retrieved. See
  80395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80396. // for more information.
  80397. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  80398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80399. return c
  80400. }
  80401. // IfNoneMatch sets the optional parameter which makes the operation
  80402. // fail if the object's ETag matches the given value. This is useful for
  80403. // getting updates only after the object has changed since the last
  80404. // request. Use googleapi.IsNotModified to check whether the response
  80405. // error from Do is the result of In-None-Match.
  80406. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  80407. c.ifNoneMatch_ = entityTag
  80408. return c
  80409. }
  80410. // Context sets the context to be used in this call's Do method. Any
  80411. // pending HTTP request will be aborted if the provided context is
  80412. // canceled.
  80413. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  80414. c.ctx_ = ctx
  80415. return c
  80416. }
  80417. // Header returns an http.Header that can be modified by the caller to
  80418. // add HTTP headers to the request.
  80419. func (c *RegionBackendServicesGetCall) Header() http.Header {
  80420. if c.header_ == nil {
  80421. c.header_ = make(http.Header)
  80422. }
  80423. return c.header_
  80424. }
  80425. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  80426. reqHeaders := make(http.Header)
  80427. for k, v := range c.header_ {
  80428. reqHeaders[k] = v
  80429. }
  80430. reqHeaders.Set("User-Agent", c.s.userAgent())
  80431. if c.ifNoneMatch_ != "" {
  80432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80433. }
  80434. var body io.Reader = nil
  80435. c.urlParams_.Set("alt", alt)
  80436. c.urlParams_.Set("prettyPrint", "false")
  80437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  80438. urls += "?" + c.urlParams_.Encode()
  80439. req, err := http.NewRequest("GET", urls, body)
  80440. if err != nil {
  80441. return nil, err
  80442. }
  80443. req.Header = reqHeaders
  80444. googleapi.Expand(req.URL, map[string]string{
  80445. "project": c.project,
  80446. "region": c.region,
  80447. "backendService": c.backendService,
  80448. })
  80449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80450. }
  80451. // Do executes the "compute.regionBackendServices.get" call.
  80452. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  80453. // status code is an error. Response headers are in either
  80454. // *BackendService.ServerResponse.Header or (if a response was returned
  80455. // at all) in error.(*googleapi.Error).Header. Use
  80456. // googleapi.IsNotModified to check whether the returned error was
  80457. // because http.StatusNotModified was returned.
  80458. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  80459. gensupport.SetOptions(c.urlParams_, opts...)
  80460. res, err := c.doRequest("json")
  80461. if res != nil && res.StatusCode == http.StatusNotModified {
  80462. if res.Body != nil {
  80463. res.Body.Close()
  80464. }
  80465. return nil, &googleapi.Error{
  80466. Code: res.StatusCode,
  80467. Header: res.Header,
  80468. }
  80469. }
  80470. if err != nil {
  80471. return nil, err
  80472. }
  80473. defer googleapi.CloseBody(res)
  80474. if err := googleapi.CheckResponse(res); err != nil {
  80475. return nil, err
  80476. }
  80477. ret := &BackendService{
  80478. ServerResponse: googleapi.ServerResponse{
  80479. Header: res.Header,
  80480. HTTPStatusCode: res.StatusCode,
  80481. },
  80482. }
  80483. target := &ret
  80484. if err := gensupport.DecodeResponse(target, res); err != nil {
  80485. return nil, err
  80486. }
  80487. return ret, nil
  80488. // {
  80489. // "description": "Returns the specified regional BackendService resource.",
  80490. // "httpMethod": "GET",
  80491. // "id": "compute.regionBackendServices.get",
  80492. // "parameterOrder": [
  80493. // "project",
  80494. // "region",
  80495. // "backendService"
  80496. // ],
  80497. // "parameters": {
  80498. // "backendService": {
  80499. // "description": "Name of the BackendService resource to return.",
  80500. // "location": "path",
  80501. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80502. // "required": true,
  80503. // "type": "string"
  80504. // },
  80505. // "project": {
  80506. // "description": "Project ID for this request.",
  80507. // "location": "path",
  80508. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80509. // "required": true,
  80510. // "type": "string"
  80511. // },
  80512. // "region": {
  80513. // "description": "Name of the region scoping this request.",
  80514. // "location": "path",
  80515. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80516. // "required": true,
  80517. // "type": "string"
  80518. // }
  80519. // },
  80520. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  80521. // "response": {
  80522. // "$ref": "BackendService"
  80523. // },
  80524. // "scopes": [
  80525. // "https://www.googleapis.com/auth/cloud-platform",
  80526. // "https://www.googleapis.com/auth/compute",
  80527. // "https://www.googleapis.com/auth/compute.readonly"
  80528. // ]
  80529. // }
  80530. }
  80531. // method id "compute.regionBackendServices.getHealth":
  80532. type RegionBackendServicesGetHealthCall struct {
  80533. s *Service
  80534. project string
  80535. region string
  80536. backendService string
  80537. resourcegroupreference *ResourceGroupReference
  80538. urlParams_ gensupport.URLParams
  80539. ctx_ context.Context
  80540. header_ http.Header
  80541. }
  80542. // GetHealth: Gets the most recent health check results for this
  80543. // regional BackendService.
  80544. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  80545. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80546. c.project = project
  80547. c.region = region
  80548. c.backendService = backendService
  80549. c.resourcegroupreference = resourcegroupreference
  80550. return c
  80551. }
  80552. // Fields allows partial responses to be retrieved. See
  80553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80554. // for more information.
  80555. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  80556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80557. return c
  80558. }
  80559. // Context sets the context to be used in this call's Do method. Any
  80560. // pending HTTP request will be aborted if the provided context is
  80561. // canceled.
  80562. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  80563. c.ctx_ = ctx
  80564. return c
  80565. }
  80566. // Header returns an http.Header that can be modified by the caller to
  80567. // add HTTP headers to the request.
  80568. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  80569. if c.header_ == nil {
  80570. c.header_ = make(http.Header)
  80571. }
  80572. return c.header_
  80573. }
  80574. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  80575. reqHeaders := make(http.Header)
  80576. for k, v := range c.header_ {
  80577. reqHeaders[k] = v
  80578. }
  80579. reqHeaders.Set("User-Agent", c.s.userAgent())
  80580. var body io.Reader = nil
  80581. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  80582. if err != nil {
  80583. return nil, err
  80584. }
  80585. reqHeaders.Set("Content-Type", "application/json")
  80586. c.urlParams_.Set("alt", alt)
  80587. c.urlParams_.Set("prettyPrint", "false")
  80588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  80589. urls += "?" + c.urlParams_.Encode()
  80590. req, err := http.NewRequest("POST", urls, body)
  80591. if err != nil {
  80592. return nil, err
  80593. }
  80594. req.Header = reqHeaders
  80595. googleapi.Expand(req.URL, map[string]string{
  80596. "project": c.project,
  80597. "region": c.region,
  80598. "backendService": c.backendService,
  80599. })
  80600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80601. }
  80602. // Do executes the "compute.regionBackendServices.getHealth" call.
  80603. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  80604. // Any non-2xx status code is an error. Response headers are in either
  80605. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  80606. // was returned at all) in error.(*googleapi.Error).Header. Use
  80607. // googleapi.IsNotModified to check whether the returned error was
  80608. // because http.StatusNotModified was returned.
  80609. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  80610. gensupport.SetOptions(c.urlParams_, opts...)
  80611. res, err := c.doRequest("json")
  80612. if res != nil && res.StatusCode == http.StatusNotModified {
  80613. if res.Body != nil {
  80614. res.Body.Close()
  80615. }
  80616. return nil, &googleapi.Error{
  80617. Code: res.StatusCode,
  80618. Header: res.Header,
  80619. }
  80620. }
  80621. if err != nil {
  80622. return nil, err
  80623. }
  80624. defer googleapi.CloseBody(res)
  80625. if err := googleapi.CheckResponse(res); err != nil {
  80626. return nil, err
  80627. }
  80628. ret := &BackendServiceGroupHealth{
  80629. ServerResponse: googleapi.ServerResponse{
  80630. Header: res.Header,
  80631. HTTPStatusCode: res.StatusCode,
  80632. },
  80633. }
  80634. target := &ret
  80635. if err := gensupport.DecodeResponse(target, res); err != nil {
  80636. return nil, err
  80637. }
  80638. return ret, nil
  80639. // {
  80640. // "description": "Gets the most recent health check results for this regional BackendService.",
  80641. // "httpMethod": "POST",
  80642. // "id": "compute.regionBackendServices.getHealth",
  80643. // "parameterOrder": [
  80644. // "project",
  80645. // "region",
  80646. // "backendService"
  80647. // ],
  80648. // "parameters": {
  80649. // "backendService": {
  80650. // "description": "Name of the BackendService resource for which to get health.",
  80651. // "location": "path",
  80652. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80653. // "required": true,
  80654. // "type": "string"
  80655. // },
  80656. // "project": {
  80657. // "location": "path",
  80658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80659. // "required": true,
  80660. // "type": "string"
  80661. // },
  80662. // "region": {
  80663. // "description": "Name of the region scoping this request.",
  80664. // "location": "path",
  80665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80666. // "required": true,
  80667. // "type": "string"
  80668. // }
  80669. // },
  80670. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  80671. // "request": {
  80672. // "$ref": "ResourceGroupReference"
  80673. // },
  80674. // "response": {
  80675. // "$ref": "BackendServiceGroupHealth"
  80676. // },
  80677. // "scopes": [
  80678. // "https://www.googleapis.com/auth/cloud-platform",
  80679. // "https://www.googleapis.com/auth/compute",
  80680. // "https://www.googleapis.com/auth/compute.readonly"
  80681. // ]
  80682. // }
  80683. }
  80684. // method id "compute.regionBackendServices.insert":
  80685. type RegionBackendServicesInsertCall struct {
  80686. s *Service
  80687. project string
  80688. region string
  80689. backendservice *BackendService
  80690. urlParams_ gensupport.URLParams
  80691. ctx_ context.Context
  80692. header_ http.Header
  80693. }
  80694. // Insert: Creates a regional BackendService resource in the specified
  80695. // project using the data included in the request. There are several
  80696. // restrictions and guidelines to keep in mind when creating a regional
  80697. // backend service. Read Restrictions and Guidelines for more
  80698. // information.
  80699. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  80700. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80701. c.project = project
  80702. c.region = region
  80703. c.backendservice = backendservice
  80704. return c
  80705. }
  80706. // RequestId sets the optional parameter "requestId": An optional
  80707. // request ID to identify requests. Specify a unique request ID so that
  80708. // if you must retry your request, the server will know to ignore the
  80709. // request if it has already been completed.
  80710. //
  80711. // For example, consider a situation where you make an initial request
  80712. // and the request times out. If you make the request again with the
  80713. // same request ID, the server can check if original operation with the
  80714. // same request ID was received, and if so, will ignore the second
  80715. // request. This prevents clients from accidentally creating duplicate
  80716. // commitments.
  80717. //
  80718. // The request ID must be a valid UUID with the exception that zero UUID
  80719. // is not supported (00000000-0000-0000-0000-000000000000).
  80720. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  80721. c.urlParams_.Set("requestId", requestId)
  80722. return c
  80723. }
  80724. // Fields allows partial responses to be retrieved. See
  80725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80726. // for more information.
  80727. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  80728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80729. return c
  80730. }
  80731. // Context sets the context to be used in this call's Do method. Any
  80732. // pending HTTP request will be aborted if the provided context is
  80733. // canceled.
  80734. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  80735. c.ctx_ = ctx
  80736. return c
  80737. }
  80738. // Header returns an http.Header that can be modified by the caller to
  80739. // add HTTP headers to the request.
  80740. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  80741. if c.header_ == nil {
  80742. c.header_ = make(http.Header)
  80743. }
  80744. return c.header_
  80745. }
  80746. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  80747. reqHeaders := make(http.Header)
  80748. for k, v := range c.header_ {
  80749. reqHeaders[k] = v
  80750. }
  80751. reqHeaders.Set("User-Agent", c.s.userAgent())
  80752. var body io.Reader = nil
  80753. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  80754. if err != nil {
  80755. return nil, err
  80756. }
  80757. reqHeaders.Set("Content-Type", "application/json")
  80758. c.urlParams_.Set("alt", alt)
  80759. c.urlParams_.Set("prettyPrint", "false")
  80760. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  80761. urls += "?" + c.urlParams_.Encode()
  80762. req, err := http.NewRequest("POST", urls, body)
  80763. if err != nil {
  80764. return nil, err
  80765. }
  80766. req.Header = reqHeaders
  80767. googleapi.Expand(req.URL, map[string]string{
  80768. "project": c.project,
  80769. "region": c.region,
  80770. })
  80771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80772. }
  80773. // Do executes the "compute.regionBackendServices.insert" call.
  80774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80775. // status code is an error. Response headers are in either
  80776. // *Operation.ServerResponse.Header or (if a response was returned at
  80777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80778. // to check whether the returned error was because
  80779. // http.StatusNotModified was returned.
  80780. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80781. gensupport.SetOptions(c.urlParams_, opts...)
  80782. res, err := c.doRequest("json")
  80783. if res != nil && res.StatusCode == http.StatusNotModified {
  80784. if res.Body != nil {
  80785. res.Body.Close()
  80786. }
  80787. return nil, &googleapi.Error{
  80788. Code: res.StatusCode,
  80789. Header: res.Header,
  80790. }
  80791. }
  80792. if err != nil {
  80793. return nil, err
  80794. }
  80795. defer googleapi.CloseBody(res)
  80796. if err := googleapi.CheckResponse(res); err != nil {
  80797. return nil, err
  80798. }
  80799. ret := &Operation{
  80800. ServerResponse: googleapi.ServerResponse{
  80801. Header: res.Header,
  80802. HTTPStatusCode: res.StatusCode,
  80803. },
  80804. }
  80805. target := &ret
  80806. if err := gensupport.DecodeResponse(target, res); err != nil {
  80807. return nil, err
  80808. }
  80809. return ret, nil
  80810. // {
  80811. // "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.",
  80812. // "httpMethod": "POST",
  80813. // "id": "compute.regionBackendServices.insert",
  80814. // "parameterOrder": [
  80815. // "project",
  80816. // "region"
  80817. // ],
  80818. // "parameters": {
  80819. // "project": {
  80820. // "description": "Project ID for this request.",
  80821. // "location": "path",
  80822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80823. // "required": true,
  80824. // "type": "string"
  80825. // },
  80826. // "region": {
  80827. // "description": "Name of the region scoping this request.",
  80828. // "location": "path",
  80829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80830. // "required": true,
  80831. // "type": "string"
  80832. // },
  80833. // "requestId": {
  80834. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80835. // "location": "query",
  80836. // "type": "string"
  80837. // }
  80838. // },
  80839. // "path": "{project}/regions/{region}/backendServices",
  80840. // "request": {
  80841. // "$ref": "BackendService"
  80842. // },
  80843. // "response": {
  80844. // "$ref": "Operation"
  80845. // },
  80846. // "scopes": [
  80847. // "https://www.googleapis.com/auth/cloud-platform",
  80848. // "https://www.googleapis.com/auth/compute"
  80849. // ]
  80850. // }
  80851. }
  80852. // method id "compute.regionBackendServices.list":
  80853. type RegionBackendServicesListCall struct {
  80854. s *Service
  80855. project string
  80856. region string
  80857. urlParams_ gensupport.URLParams
  80858. ifNoneMatch_ string
  80859. ctx_ context.Context
  80860. header_ http.Header
  80861. }
  80862. // List: Retrieves the list of regional BackendService resources
  80863. // available to the specified project in the given region.
  80864. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  80865. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80866. c.project = project
  80867. c.region = region
  80868. return c
  80869. }
  80870. // Filter sets the optional parameter "filter": A filter expression that
  80871. // filters resources listed in the response. The expression must specify
  80872. // the field name, a comparison operator, and the value that you want to
  80873. // use for filtering. The value must be a string, a number, or a
  80874. // boolean. The comparison operator must be either =, !=, >, or <.
  80875. //
  80876. // For example, if you are filtering Compute Engine instances, you can
  80877. // exclude instances named example-instance by specifying name !=
  80878. // example-instance.
  80879. //
  80880. // You can also filter nested fields. For example, you could specify
  80881. // scheduling.automaticRestart = false to include instances only if they
  80882. // are not scheduled for automatic restarts. You can use filtering on
  80883. // nested fields to filter based on resource labels.
  80884. //
  80885. // To filter on multiple expressions, provide each separate expression
  80886. // within parentheses. For example, (scheduling.automaticRestart = true)
  80887. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80888. // AND expression. However, you can include AND and OR expressions
  80889. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80890. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80891. // true).
  80892. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  80893. c.urlParams_.Set("filter", filter)
  80894. return c
  80895. }
  80896. // MaxResults sets the optional parameter "maxResults": The maximum
  80897. // number of results per page that should be returned. If the number of
  80898. // available results is larger than maxResults, Compute Engine returns a
  80899. // nextPageToken that can be used to get the next page of results in
  80900. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80901. // (Default: 500)
  80902. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  80903. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80904. return c
  80905. }
  80906. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80907. // a certain order. By default, results are returned in alphanumerical
  80908. // order based on the resource name.
  80909. //
  80910. // You can also sort results in descending order based on the creation
  80911. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80912. // based on the creationTimestamp field in reverse chronological order
  80913. // (newest result first). Use this to sort resources like operations so
  80914. // that the newest operation is returned first.
  80915. //
  80916. // Currently, only sorting by name or creationTimestamp desc is
  80917. // supported.
  80918. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  80919. c.urlParams_.Set("orderBy", orderBy)
  80920. return c
  80921. }
  80922. // PageToken sets the optional parameter "pageToken": Specifies a page
  80923. // token to use. Set pageToken to the nextPageToken returned by a
  80924. // previous list request to get the next page of results.
  80925. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  80926. c.urlParams_.Set("pageToken", pageToken)
  80927. return c
  80928. }
  80929. // Fields allows partial responses to be retrieved. See
  80930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80931. // for more information.
  80932. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  80933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80934. return c
  80935. }
  80936. // IfNoneMatch sets the optional parameter which makes the operation
  80937. // fail if the object's ETag matches the given value. This is useful for
  80938. // getting updates only after the object has changed since the last
  80939. // request. Use googleapi.IsNotModified to check whether the response
  80940. // error from Do is the result of In-None-Match.
  80941. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  80942. c.ifNoneMatch_ = entityTag
  80943. return c
  80944. }
  80945. // Context sets the context to be used in this call's Do method. Any
  80946. // pending HTTP request will be aborted if the provided context is
  80947. // canceled.
  80948. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  80949. c.ctx_ = ctx
  80950. return c
  80951. }
  80952. // Header returns an http.Header that can be modified by the caller to
  80953. // add HTTP headers to the request.
  80954. func (c *RegionBackendServicesListCall) Header() http.Header {
  80955. if c.header_ == nil {
  80956. c.header_ = make(http.Header)
  80957. }
  80958. return c.header_
  80959. }
  80960. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  80961. reqHeaders := make(http.Header)
  80962. for k, v := range c.header_ {
  80963. reqHeaders[k] = v
  80964. }
  80965. reqHeaders.Set("User-Agent", c.s.userAgent())
  80966. if c.ifNoneMatch_ != "" {
  80967. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80968. }
  80969. var body io.Reader = nil
  80970. c.urlParams_.Set("alt", alt)
  80971. c.urlParams_.Set("prettyPrint", "false")
  80972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  80973. urls += "?" + c.urlParams_.Encode()
  80974. req, err := http.NewRequest("GET", urls, body)
  80975. if err != nil {
  80976. return nil, err
  80977. }
  80978. req.Header = reqHeaders
  80979. googleapi.Expand(req.URL, map[string]string{
  80980. "project": c.project,
  80981. "region": c.region,
  80982. })
  80983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80984. }
  80985. // Do executes the "compute.regionBackendServices.list" call.
  80986. // Exactly one of *BackendServiceList or error will be non-nil. Any
  80987. // non-2xx status code is an error. Response headers are in either
  80988. // *BackendServiceList.ServerResponse.Header or (if a response was
  80989. // returned at all) in error.(*googleapi.Error).Header. Use
  80990. // googleapi.IsNotModified to check whether the returned error was
  80991. // because http.StatusNotModified was returned.
  80992. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  80993. gensupport.SetOptions(c.urlParams_, opts...)
  80994. res, err := c.doRequest("json")
  80995. if res != nil && res.StatusCode == http.StatusNotModified {
  80996. if res.Body != nil {
  80997. res.Body.Close()
  80998. }
  80999. return nil, &googleapi.Error{
  81000. Code: res.StatusCode,
  81001. Header: res.Header,
  81002. }
  81003. }
  81004. if err != nil {
  81005. return nil, err
  81006. }
  81007. defer googleapi.CloseBody(res)
  81008. if err := googleapi.CheckResponse(res); err != nil {
  81009. return nil, err
  81010. }
  81011. ret := &BackendServiceList{
  81012. ServerResponse: googleapi.ServerResponse{
  81013. Header: res.Header,
  81014. HTTPStatusCode: res.StatusCode,
  81015. },
  81016. }
  81017. target := &ret
  81018. if err := gensupport.DecodeResponse(target, res); err != nil {
  81019. return nil, err
  81020. }
  81021. return ret, nil
  81022. // {
  81023. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  81024. // "httpMethod": "GET",
  81025. // "id": "compute.regionBackendServices.list",
  81026. // "parameterOrder": [
  81027. // "project",
  81028. // "region"
  81029. // ],
  81030. // "parameters": {
  81031. // "filter": {
  81032. // "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).",
  81033. // "location": "query",
  81034. // "type": "string"
  81035. // },
  81036. // "maxResults": {
  81037. // "default": "500",
  81038. // "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)",
  81039. // "format": "uint32",
  81040. // "location": "query",
  81041. // "minimum": "0",
  81042. // "type": "integer"
  81043. // },
  81044. // "orderBy": {
  81045. // "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.",
  81046. // "location": "query",
  81047. // "type": "string"
  81048. // },
  81049. // "pageToken": {
  81050. // "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.",
  81051. // "location": "query",
  81052. // "type": "string"
  81053. // },
  81054. // "project": {
  81055. // "description": "Project ID for this request.",
  81056. // "location": "path",
  81057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81058. // "required": true,
  81059. // "type": "string"
  81060. // },
  81061. // "region": {
  81062. // "description": "Name of the region scoping this request.",
  81063. // "location": "path",
  81064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81065. // "required": true,
  81066. // "type": "string"
  81067. // }
  81068. // },
  81069. // "path": "{project}/regions/{region}/backendServices",
  81070. // "response": {
  81071. // "$ref": "BackendServiceList"
  81072. // },
  81073. // "scopes": [
  81074. // "https://www.googleapis.com/auth/cloud-platform",
  81075. // "https://www.googleapis.com/auth/compute",
  81076. // "https://www.googleapis.com/auth/compute.readonly"
  81077. // ]
  81078. // }
  81079. }
  81080. // Pages invokes f for each page of results.
  81081. // A non-nil error returned from f will halt the iteration.
  81082. // The provided context supersedes any context provided to the Context method.
  81083. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  81084. c.ctx_ = ctx
  81085. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81086. for {
  81087. x, err := c.Do()
  81088. if err != nil {
  81089. return err
  81090. }
  81091. if err := f(x); err != nil {
  81092. return err
  81093. }
  81094. if x.NextPageToken == "" {
  81095. return nil
  81096. }
  81097. c.PageToken(x.NextPageToken)
  81098. }
  81099. }
  81100. // method id "compute.regionBackendServices.patch":
  81101. type RegionBackendServicesPatchCall struct {
  81102. s *Service
  81103. project string
  81104. region string
  81105. backendService string
  81106. backendservice *BackendService
  81107. urlParams_ gensupport.URLParams
  81108. ctx_ context.Context
  81109. header_ http.Header
  81110. }
  81111. // Patch: Updates the specified regional BackendService resource with
  81112. // the data included in the request. There are several restrictions and
  81113. // guidelines to keep in mind when updating a backend service. Read
  81114. // Restrictions and Guidelines for more information. This method
  81115. // supports PATCH semantics and uses the JSON merge patch format and
  81116. // processing rules.
  81117. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  81118. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81119. c.project = project
  81120. c.region = region
  81121. c.backendService = backendService
  81122. c.backendservice = backendservice
  81123. return c
  81124. }
  81125. // RequestId sets the optional parameter "requestId": An optional
  81126. // request ID to identify requests. Specify a unique request ID so that
  81127. // if you must retry your request, the server will know to ignore the
  81128. // request if it has already been completed.
  81129. //
  81130. // For example, consider a situation where you make an initial request
  81131. // and the request times out. If you make the request again with the
  81132. // same request ID, the server can check if original operation with the
  81133. // same request ID was received, and if so, will ignore the second
  81134. // request. This prevents clients from accidentally creating duplicate
  81135. // commitments.
  81136. //
  81137. // The request ID must be a valid UUID with the exception that zero UUID
  81138. // is not supported (00000000-0000-0000-0000-000000000000).
  81139. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  81140. c.urlParams_.Set("requestId", requestId)
  81141. return c
  81142. }
  81143. // Fields allows partial responses to be retrieved. See
  81144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81145. // for more information.
  81146. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  81147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81148. return c
  81149. }
  81150. // Context sets the context to be used in this call's Do method. Any
  81151. // pending HTTP request will be aborted if the provided context is
  81152. // canceled.
  81153. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  81154. c.ctx_ = ctx
  81155. return c
  81156. }
  81157. // Header returns an http.Header that can be modified by the caller to
  81158. // add HTTP headers to the request.
  81159. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  81160. if c.header_ == nil {
  81161. c.header_ = make(http.Header)
  81162. }
  81163. return c.header_
  81164. }
  81165. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  81166. reqHeaders := make(http.Header)
  81167. for k, v := range c.header_ {
  81168. reqHeaders[k] = v
  81169. }
  81170. reqHeaders.Set("User-Agent", c.s.userAgent())
  81171. var body io.Reader = nil
  81172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  81173. if err != nil {
  81174. return nil, err
  81175. }
  81176. reqHeaders.Set("Content-Type", "application/json")
  81177. c.urlParams_.Set("alt", alt)
  81178. c.urlParams_.Set("prettyPrint", "false")
  81179. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  81180. urls += "?" + c.urlParams_.Encode()
  81181. req, err := http.NewRequest("PATCH", urls, body)
  81182. if err != nil {
  81183. return nil, err
  81184. }
  81185. req.Header = reqHeaders
  81186. googleapi.Expand(req.URL, map[string]string{
  81187. "project": c.project,
  81188. "region": c.region,
  81189. "backendService": c.backendService,
  81190. })
  81191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81192. }
  81193. // Do executes the "compute.regionBackendServices.patch" call.
  81194. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81195. // status code is an error. Response headers are in either
  81196. // *Operation.ServerResponse.Header or (if a response was returned at
  81197. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81198. // to check whether the returned error was because
  81199. // http.StatusNotModified was returned.
  81200. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81201. gensupport.SetOptions(c.urlParams_, opts...)
  81202. res, err := c.doRequest("json")
  81203. if res != nil && res.StatusCode == http.StatusNotModified {
  81204. if res.Body != nil {
  81205. res.Body.Close()
  81206. }
  81207. return nil, &googleapi.Error{
  81208. Code: res.StatusCode,
  81209. Header: res.Header,
  81210. }
  81211. }
  81212. if err != nil {
  81213. return nil, err
  81214. }
  81215. defer googleapi.CloseBody(res)
  81216. if err := googleapi.CheckResponse(res); err != nil {
  81217. return nil, err
  81218. }
  81219. ret := &Operation{
  81220. ServerResponse: googleapi.ServerResponse{
  81221. Header: res.Header,
  81222. HTTPStatusCode: res.StatusCode,
  81223. },
  81224. }
  81225. target := &ret
  81226. if err := gensupport.DecodeResponse(target, res); err != nil {
  81227. return nil, err
  81228. }
  81229. return ret, nil
  81230. // {
  81231. // "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.",
  81232. // "httpMethod": "PATCH",
  81233. // "id": "compute.regionBackendServices.patch",
  81234. // "parameterOrder": [
  81235. // "project",
  81236. // "region",
  81237. // "backendService"
  81238. // ],
  81239. // "parameters": {
  81240. // "backendService": {
  81241. // "description": "Name of the BackendService resource to patch.",
  81242. // "location": "path",
  81243. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81244. // "required": true,
  81245. // "type": "string"
  81246. // },
  81247. // "project": {
  81248. // "description": "Project ID for this request.",
  81249. // "location": "path",
  81250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81251. // "required": true,
  81252. // "type": "string"
  81253. // },
  81254. // "region": {
  81255. // "description": "Name of the region scoping this request.",
  81256. // "location": "path",
  81257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81258. // "required": true,
  81259. // "type": "string"
  81260. // },
  81261. // "requestId": {
  81262. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81263. // "location": "query",
  81264. // "type": "string"
  81265. // }
  81266. // },
  81267. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  81268. // "request": {
  81269. // "$ref": "BackendService"
  81270. // },
  81271. // "response": {
  81272. // "$ref": "Operation"
  81273. // },
  81274. // "scopes": [
  81275. // "https://www.googleapis.com/auth/cloud-platform",
  81276. // "https://www.googleapis.com/auth/compute"
  81277. // ]
  81278. // }
  81279. }
  81280. // method id "compute.regionBackendServices.testIamPermissions":
  81281. type RegionBackendServicesTestIamPermissionsCall struct {
  81282. s *Service
  81283. project string
  81284. region string
  81285. resource string
  81286. testpermissionsrequest *TestPermissionsRequest
  81287. urlParams_ gensupport.URLParams
  81288. ctx_ context.Context
  81289. header_ http.Header
  81290. }
  81291. // TestIamPermissions: Returns permissions that a caller has on the
  81292. // specified resource.
  81293. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  81294. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81295. c.project = project
  81296. c.region = region
  81297. c.resource = resource
  81298. c.testpermissionsrequest = testpermissionsrequest
  81299. return c
  81300. }
  81301. // Fields allows partial responses to be retrieved. See
  81302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81303. // for more information.
  81304. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  81305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81306. return c
  81307. }
  81308. // Context sets the context to be used in this call's Do method. Any
  81309. // pending HTTP request will be aborted if the provided context is
  81310. // canceled.
  81311. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  81312. c.ctx_ = ctx
  81313. return c
  81314. }
  81315. // Header returns an http.Header that can be modified by the caller to
  81316. // add HTTP headers to the request.
  81317. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  81318. if c.header_ == nil {
  81319. c.header_ = make(http.Header)
  81320. }
  81321. return c.header_
  81322. }
  81323. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  81324. reqHeaders := make(http.Header)
  81325. for k, v := range c.header_ {
  81326. reqHeaders[k] = v
  81327. }
  81328. reqHeaders.Set("User-Agent", c.s.userAgent())
  81329. var body io.Reader = nil
  81330. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  81331. if err != nil {
  81332. return nil, err
  81333. }
  81334. reqHeaders.Set("Content-Type", "application/json")
  81335. c.urlParams_.Set("alt", alt)
  81336. c.urlParams_.Set("prettyPrint", "false")
  81337. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  81338. urls += "?" + c.urlParams_.Encode()
  81339. req, err := http.NewRequest("POST", urls, body)
  81340. if err != nil {
  81341. return nil, err
  81342. }
  81343. req.Header = reqHeaders
  81344. googleapi.Expand(req.URL, map[string]string{
  81345. "project": c.project,
  81346. "region": c.region,
  81347. "resource": c.resource,
  81348. })
  81349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81350. }
  81351. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  81352. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81353. // non-2xx status code is an error. Response headers are in either
  81354. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81355. // returned at all) in error.(*googleapi.Error).Header. Use
  81356. // googleapi.IsNotModified to check whether the returned error was
  81357. // because http.StatusNotModified was returned.
  81358. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81359. gensupport.SetOptions(c.urlParams_, opts...)
  81360. res, err := c.doRequest("json")
  81361. if res != nil && res.StatusCode == http.StatusNotModified {
  81362. if res.Body != nil {
  81363. res.Body.Close()
  81364. }
  81365. return nil, &googleapi.Error{
  81366. Code: res.StatusCode,
  81367. Header: res.Header,
  81368. }
  81369. }
  81370. if err != nil {
  81371. return nil, err
  81372. }
  81373. defer googleapi.CloseBody(res)
  81374. if err := googleapi.CheckResponse(res); err != nil {
  81375. return nil, err
  81376. }
  81377. ret := &TestPermissionsResponse{
  81378. ServerResponse: googleapi.ServerResponse{
  81379. Header: res.Header,
  81380. HTTPStatusCode: res.StatusCode,
  81381. },
  81382. }
  81383. target := &ret
  81384. if err := gensupport.DecodeResponse(target, res); err != nil {
  81385. return nil, err
  81386. }
  81387. return ret, nil
  81388. // {
  81389. // "description": "Returns permissions that a caller has on the specified resource.",
  81390. // "httpMethod": "POST",
  81391. // "id": "compute.regionBackendServices.testIamPermissions",
  81392. // "parameterOrder": [
  81393. // "project",
  81394. // "region",
  81395. // "resource"
  81396. // ],
  81397. // "parameters": {
  81398. // "project": {
  81399. // "description": "Project ID for this request.",
  81400. // "location": "path",
  81401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81402. // "required": true,
  81403. // "type": "string"
  81404. // },
  81405. // "region": {
  81406. // "description": "The name of the region for this request.",
  81407. // "location": "path",
  81408. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81409. // "required": true,
  81410. // "type": "string"
  81411. // },
  81412. // "resource": {
  81413. // "description": "Name or id of the resource for this request.",
  81414. // "location": "path",
  81415. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81416. // "required": true,
  81417. // "type": "string"
  81418. // }
  81419. // },
  81420. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  81421. // "request": {
  81422. // "$ref": "TestPermissionsRequest"
  81423. // },
  81424. // "response": {
  81425. // "$ref": "TestPermissionsResponse"
  81426. // },
  81427. // "scopes": [
  81428. // "https://www.googleapis.com/auth/cloud-platform",
  81429. // "https://www.googleapis.com/auth/compute",
  81430. // "https://www.googleapis.com/auth/compute.readonly"
  81431. // ]
  81432. // }
  81433. }
  81434. // method id "compute.regionBackendServices.update":
  81435. type RegionBackendServicesUpdateCall struct {
  81436. s *Service
  81437. project string
  81438. region string
  81439. backendService string
  81440. backendservice *BackendService
  81441. urlParams_ gensupport.URLParams
  81442. ctx_ context.Context
  81443. header_ http.Header
  81444. }
  81445. // Update: Updates the specified regional BackendService resource with
  81446. // the data included in the request. There are several restrictions and
  81447. // guidelines to keep in mind when updating a backend service. Read
  81448. // Restrictions and Guidelines for more information.
  81449. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  81450. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81451. c.project = project
  81452. c.region = region
  81453. c.backendService = backendService
  81454. c.backendservice = backendservice
  81455. return c
  81456. }
  81457. // RequestId sets the optional parameter "requestId": An optional
  81458. // request ID to identify requests. Specify a unique request ID so that
  81459. // if you must retry your request, the server will know to ignore the
  81460. // request if it has already been completed.
  81461. //
  81462. // For example, consider a situation where you make an initial request
  81463. // and the request times out. If you make the request again with the
  81464. // same request ID, the server can check if original operation with the
  81465. // same request ID was received, and if so, will ignore the second
  81466. // request. This prevents clients from accidentally creating duplicate
  81467. // commitments.
  81468. //
  81469. // The request ID must be a valid UUID with the exception that zero UUID
  81470. // is not supported (00000000-0000-0000-0000-000000000000).
  81471. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  81472. c.urlParams_.Set("requestId", requestId)
  81473. return c
  81474. }
  81475. // Fields allows partial responses to be retrieved. See
  81476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81477. // for more information.
  81478. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  81479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81480. return c
  81481. }
  81482. // Context sets the context to be used in this call's Do method. Any
  81483. // pending HTTP request will be aborted if the provided context is
  81484. // canceled.
  81485. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  81486. c.ctx_ = ctx
  81487. return c
  81488. }
  81489. // Header returns an http.Header that can be modified by the caller to
  81490. // add HTTP headers to the request.
  81491. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  81492. if c.header_ == nil {
  81493. c.header_ = make(http.Header)
  81494. }
  81495. return c.header_
  81496. }
  81497. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  81498. reqHeaders := make(http.Header)
  81499. for k, v := range c.header_ {
  81500. reqHeaders[k] = v
  81501. }
  81502. reqHeaders.Set("User-Agent", c.s.userAgent())
  81503. var body io.Reader = nil
  81504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  81505. if err != nil {
  81506. return nil, err
  81507. }
  81508. reqHeaders.Set("Content-Type", "application/json")
  81509. c.urlParams_.Set("alt", alt)
  81510. c.urlParams_.Set("prettyPrint", "false")
  81511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  81512. urls += "?" + c.urlParams_.Encode()
  81513. req, err := http.NewRequest("PUT", urls, body)
  81514. if err != nil {
  81515. return nil, err
  81516. }
  81517. req.Header = reqHeaders
  81518. googleapi.Expand(req.URL, map[string]string{
  81519. "project": c.project,
  81520. "region": c.region,
  81521. "backendService": c.backendService,
  81522. })
  81523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81524. }
  81525. // Do executes the "compute.regionBackendServices.update" call.
  81526. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81527. // status code is an error. Response headers are in either
  81528. // *Operation.ServerResponse.Header or (if a response was returned at
  81529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81530. // to check whether the returned error was because
  81531. // http.StatusNotModified was returned.
  81532. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81533. gensupport.SetOptions(c.urlParams_, opts...)
  81534. res, err := c.doRequest("json")
  81535. if res != nil && res.StatusCode == http.StatusNotModified {
  81536. if res.Body != nil {
  81537. res.Body.Close()
  81538. }
  81539. return nil, &googleapi.Error{
  81540. Code: res.StatusCode,
  81541. Header: res.Header,
  81542. }
  81543. }
  81544. if err != nil {
  81545. return nil, err
  81546. }
  81547. defer googleapi.CloseBody(res)
  81548. if err := googleapi.CheckResponse(res); err != nil {
  81549. return nil, err
  81550. }
  81551. ret := &Operation{
  81552. ServerResponse: googleapi.ServerResponse{
  81553. Header: res.Header,
  81554. HTTPStatusCode: res.StatusCode,
  81555. },
  81556. }
  81557. target := &ret
  81558. if err := gensupport.DecodeResponse(target, res); err != nil {
  81559. return nil, err
  81560. }
  81561. return ret, nil
  81562. // {
  81563. // "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.",
  81564. // "httpMethod": "PUT",
  81565. // "id": "compute.regionBackendServices.update",
  81566. // "parameterOrder": [
  81567. // "project",
  81568. // "region",
  81569. // "backendService"
  81570. // ],
  81571. // "parameters": {
  81572. // "backendService": {
  81573. // "description": "Name of the BackendService resource to update.",
  81574. // "location": "path",
  81575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81576. // "required": true,
  81577. // "type": "string"
  81578. // },
  81579. // "project": {
  81580. // "description": "Project ID for this request.",
  81581. // "location": "path",
  81582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81583. // "required": true,
  81584. // "type": "string"
  81585. // },
  81586. // "region": {
  81587. // "description": "Name of the region scoping this request.",
  81588. // "location": "path",
  81589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81590. // "required": true,
  81591. // "type": "string"
  81592. // },
  81593. // "requestId": {
  81594. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81595. // "location": "query",
  81596. // "type": "string"
  81597. // }
  81598. // },
  81599. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  81600. // "request": {
  81601. // "$ref": "BackendService"
  81602. // },
  81603. // "response": {
  81604. // "$ref": "Operation"
  81605. // },
  81606. // "scopes": [
  81607. // "https://www.googleapis.com/auth/cloud-platform",
  81608. // "https://www.googleapis.com/auth/compute"
  81609. // ]
  81610. // }
  81611. }
  81612. // method id "compute.regionCommitments.aggregatedList":
  81613. type RegionCommitmentsAggregatedListCall struct {
  81614. s *Service
  81615. project string
  81616. urlParams_ gensupport.URLParams
  81617. ifNoneMatch_ string
  81618. ctx_ context.Context
  81619. header_ http.Header
  81620. }
  81621. // AggregatedList: Retrieves an aggregated list of commitments.
  81622. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  81623. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81624. c.project = project
  81625. return c
  81626. }
  81627. // Filter sets the optional parameter "filter": A filter expression that
  81628. // filters resources listed in the response. The expression must specify
  81629. // the field name, a comparison operator, and the value that you want to
  81630. // use for filtering. The value must be a string, a number, or a
  81631. // boolean. The comparison operator must be either =, !=, >, or <.
  81632. //
  81633. // For example, if you are filtering Compute Engine instances, you can
  81634. // exclude instances named example-instance by specifying name !=
  81635. // example-instance.
  81636. //
  81637. // You can also filter nested fields. For example, you could specify
  81638. // scheduling.automaticRestart = false to include instances only if they
  81639. // are not scheduled for automatic restarts. You can use filtering on
  81640. // nested fields to filter based on resource labels.
  81641. //
  81642. // To filter on multiple expressions, provide each separate expression
  81643. // within parentheses. For example, (scheduling.automaticRestart = true)
  81644. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81645. // AND expression. However, you can include AND and OR expressions
  81646. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81647. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81648. // true).
  81649. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  81650. c.urlParams_.Set("filter", filter)
  81651. return c
  81652. }
  81653. // MaxResults sets the optional parameter "maxResults": The maximum
  81654. // number of results per page that should be returned. If the number of
  81655. // available results is larger than maxResults, Compute Engine returns a
  81656. // nextPageToken that can be used to get the next page of results in
  81657. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81658. // (Default: 500)
  81659. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  81660. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81661. return c
  81662. }
  81663. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81664. // a certain order. By default, results are returned in alphanumerical
  81665. // order based on the resource name.
  81666. //
  81667. // You can also sort results in descending order based on the creation
  81668. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81669. // based on the creationTimestamp field in reverse chronological order
  81670. // (newest result first). Use this to sort resources like operations so
  81671. // that the newest operation is returned first.
  81672. //
  81673. // Currently, only sorting by name or creationTimestamp desc is
  81674. // supported.
  81675. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  81676. c.urlParams_.Set("orderBy", orderBy)
  81677. return c
  81678. }
  81679. // PageToken sets the optional parameter "pageToken": Specifies a page
  81680. // token to use. Set pageToken to the nextPageToken returned by a
  81681. // previous list request to get the next page of results.
  81682. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  81683. c.urlParams_.Set("pageToken", pageToken)
  81684. return c
  81685. }
  81686. // Fields allows partial responses to be retrieved. See
  81687. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81688. // for more information.
  81689. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  81690. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81691. return c
  81692. }
  81693. // IfNoneMatch sets the optional parameter which makes the operation
  81694. // fail if the object's ETag matches the given value. This is useful for
  81695. // getting updates only after the object has changed since the last
  81696. // request. Use googleapi.IsNotModified to check whether the response
  81697. // error from Do is the result of In-None-Match.
  81698. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  81699. c.ifNoneMatch_ = entityTag
  81700. return c
  81701. }
  81702. // Context sets the context to be used in this call's Do method. Any
  81703. // pending HTTP request will be aborted if the provided context is
  81704. // canceled.
  81705. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  81706. c.ctx_ = ctx
  81707. return c
  81708. }
  81709. // Header returns an http.Header that can be modified by the caller to
  81710. // add HTTP headers to the request.
  81711. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  81712. if c.header_ == nil {
  81713. c.header_ = make(http.Header)
  81714. }
  81715. return c.header_
  81716. }
  81717. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  81718. reqHeaders := make(http.Header)
  81719. for k, v := range c.header_ {
  81720. reqHeaders[k] = v
  81721. }
  81722. reqHeaders.Set("User-Agent", c.s.userAgent())
  81723. if c.ifNoneMatch_ != "" {
  81724. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81725. }
  81726. var body io.Reader = nil
  81727. c.urlParams_.Set("alt", alt)
  81728. c.urlParams_.Set("prettyPrint", "false")
  81729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  81730. urls += "?" + c.urlParams_.Encode()
  81731. req, err := http.NewRequest("GET", urls, body)
  81732. if err != nil {
  81733. return nil, err
  81734. }
  81735. req.Header = reqHeaders
  81736. googleapi.Expand(req.URL, map[string]string{
  81737. "project": c.project,
  81738. })
  81739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81740. }
  81741. // Do executes the "compute.regionCommitments.aggregatedList" call.
  81742. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  81743. // Any non-2xx status code is an error. Response headers are in either
  81744. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  81745. // returned at all) in error.(*googleapi.Error).Header. Use
  81746. // googleapi.IsNotModified to check whether the returned error was
  81747. // because http.StatusNotModified was returned.
  81748. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  81749. gensupport.SetOptions(c.urlParams_, opts...)
  81750. res, err := c.doRequest("json")
  81751. if res != nil && res.StatusCode == http.StatusNotModified {
  81752. if res.Body != nil {
  81753. res.Body.Close()
  81754. }
  81755. return nil, &googleapi.Error{
  81756. Code: res.StatusCode,
  81757. Header: res.Header,
  81758. }
  81759. }
  81760. if err != nil {
  81761. return nil, err
  81762. }
  81763. defer googleapi.CloseBody(res)
  81764. if err := googleapi.CheckResponse(res); err != nil {
  81765. return nil, err
  81766. }
  81767. ret := &CommitmentAggregatedList{
  81768. ServerResponse: googleapi.ServerResponse{
  81769. Header: res.Header,
  81770. HTTPStatusCode: res.StatusCode,
  81771. },
  81772. }
  81773. target := &ret
  81774. if err := gensupport.DecodeResponse(target, res); err != nil {
  81775. return nil, err
  81776. }
  81777. return ret, nil
  81778. // {
  81779. // "description": "Retrieves an aggregated list of commitments.",
  81780. // "httpMethod": "GET",
  81781. // "id": "compute.regionCommitments.aggregatedList",
  81782. // "parameterOrder": [
  81783. // "project"
  81784. // ],
  81785. // "parameters": {
  81786. // "filter": {
  81787. // "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).",
  81788. // "location": "query",
  81789. // "type": "string"
  81790. // },
  81791. // "maxResults": {
  81792. // "default": "500",
  81793. // "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)",
  81794. // "format": "uint32",
  81795. // "location": "query",
  81796. // "minimum": "0",
  81797. // "type": "integer"
  81798. // },
  81799. // "orderBy": {
  81800. // "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.",
  81801. // "location": "query",
  81802. // "type": "string"
  81803. // },
  81804. // "pageToken": {
  81805. // "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.",
  81806. // "location": "query",
  81807. // "type": "string"
  81808. // },
  81809. // "project": {
  81810. // "description": "Project ID for this request.",
  81811. // "location": "path",
  81812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81813. // "required": true,
  81814. // "type": "string"
  81815. // }
  81816. // },
  81817. // "path": "{project}/aggregated/commitments",
  81818. // "response": {
  81819. // "$ref": "CommitmentAggregatedList"
  81820. // },
  81821. // "scopes": [
  81822. // "https://www.googleapis.com/auth/cloud-platform",
  81823. // "https://www.googleapis.com/auth/compute",
  81824. // "https://www.googleapis.com/auth/compute.readonly"
  81825. // ]
  81826. // }
  81827. }
  81828. // Pages invokes f for each page of results.
  81829. // A non-nil error returned from f will halt the iteration.
  81830. // The provided context supersedes any context provided to the Context method.
  81831. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  81832. c.ctx_ = ctx
  81833. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81834. for {
  81835. x, err := c.Do()
  81836. if err != nil {
  81837. return err
  81838. }
  81839. if err := f(x); err != nil {
  81840. return err
  81841. }
  81842. if x.NextPageToken == "" {
  81843. return nil
  81844. }
  81845. c.PageToken(x.NextPageToken)
  81846. }
  81847. }
  81848. // method id "compute.regionCommitments.get":
  81849. type RegionCommitmentsGetCall struct {
  81850. s *Service
  81851. project string
  81852. region string
  81853. commitment string
  81854. urlParams_ gensupport.URLParams
  81855. ifNoneMatch_ string
  81856. ctx_ context.Context
  81857. header_ http.Header
  81858. }
  81859. // Get: Returns the specified commitment resource. Gets a list of
  81860. // available commitments by making a list() request.
  81861. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  81862. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81863. c.project = project
  81864. c.region = region
  81865. c.commitment = commitment
  81866. return c
  81867. }
  81868. // Fields allows partial responses to be retrieved. See
  81869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81870. // for more information.
  81871. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  81872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81873. return c
  81874. }
  81875. // IfNoneMatch sets the optional parameter which makes the operation
  81876. // fail if the object's ETag matches the given value. This is useful for
  81877. // getting updates only after the object has changed since the last
  81878. // request. Use googleapi.IsNotModified to check whether the response
  81879. // error from Do is the result of In-None-Match.
  81880. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  81881. c.ifNoneMatch_ = entityTag
  81882. return c
  81883. }
  81884. // Context sets the context to be used in this call's Do method. Any
  81885. // pending HTTP request will be aborted if the provided context is
  81886. // canceled.
  81887. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  81888. c.ctx_ = ctx
  81889. return c
  81890. }
  81891. // Header returns an http.Header that can be modified by the caller to
  81892. // add HTTP headers to the request.
  81893. func (c *RegionCommitmentsGetCall) Header() http.Header {
  81894. if c.header_ == nil {
  81895. c.header_ = make(http.Header)
  81896. }
  81897. return c.header_
  81898. }
  81899. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  81900. reqHeaders := make(http.Header)
  81901. for k, v := range c.header_ {
  81902. reqHeaders[k] = v
  81903. }
  81904. reqHeaders.Set("User-Agent", c.s.userAgent())
  81905. if c.ifNoneMatch_ != "" {
  81906. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81907. }
  81908. var body io.Reader = nil
  81909. c.urlParams_.Set("alt", alt)
  81910. c.urlParams_.Set("prettyPrint", "false")
  81911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  81912. urls += "?" + c.urlParams_.Encode()
  81913. req, err := http.NewRequest("GET", urls, body)
  81914. if err != nil {
  81915. return nil, err
  81916. }
  81917. req.Header = reqHeaders
  81918. googleapi.Expand(req.URL, map[string]string{
  81919. "project": c.project,
  81920. "region": c.region,
  81921. "commitment": c.commitment,
  81922. })
  81923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81924. }
  81925. // Do executes the "compute.regionCommitments.get" call.
  81926. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  81927. // status code is an error. Response headers are in either
  81928. // *Commitment.ServerResponse.Header or (if a response was returned at
  81929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81930. // to check whether the returned error was because
  81931. // http.StatusNotModified was returned.
  81932. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  81933. gensupport.SetOptions(c.urlParams_, opts...)
  81934. res, err := c.doRequest("json")
  81935. if res != nil && res.StatusCode == http.StatusNotModified {
  81936. if res.Body != nil {
  81937. res.Body.Close()
  81938. }
  81939. return nil, &googleapi.Error{
  81940. Code: res.StatusCode,
  81941. Header: res.Header,
  81942. }
  81943. }
  81944. if err != nil {
  81945. return nil, err
  81946. }
  81947. defer googleapi.CloseBody(res)
  81948. if err := googleapi.CheckResponse(res); err != nil {
  81949. return nil, err
  81950. }
  81951. ret := &Commitment{
  81952. ServerResponse: googleapi.ServerResponse{
  81953. Header: res.Header,
  81954. HTTPStatusCode: res.StatusCode,
  81955. },
  81956. }
  81957. target := &ret
  81958. if err := gensupport.DecodeResponse(target, res); err != nil {
  81959. return nil, err
  81960. }
  81961. return ret, nil
  81962. // {
  81963. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  81964. // "httpMethod": "GET",
  81965. // "id": "compute.regionCommitments.get",
  81966. // "parameterOrder": [
  81967. // "project",
  81968. // "region",
  81969. // "commitment"
  81970. // ],
  81971. // "parameters": {
  81972. // "commitment": {
  81973. // "description": "Name of the commitment to return.",
  81974. // "location": "path",
  81975. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81976. // "required": true,
  81977. // "type": "string"
  81978. // },
  81979. // "project": {
  81980. // "description": "Project ID for this request.",
  81981. // "location": "path",
  81982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81983. // "required": true,
  81984. // "type": "string"
  81985. // },
  81986. // "region": {
  81987. // "description": "Name of the region for this request.",
  81988. // "location": "path",
  81989. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81990. // "required": true,
  81991. // "type": "string"
  81992. // }
  81993. // },
  81994. // "path": "{project}/regions/{region}/commitments/{commitment}",
  81995. // "response": {
  81996. // "$ref": "Commitment"
  81997. // },
  81998. // "scopes": [
  81999. // "https://www.googleapis.com/auth/cloud-platform",
  82000. // "https://www.googleapis.com/auth/compute",
  82001. // "https://www.googleapis.com/auth/compute.readonly"
  82002. // ]
  82003. // }
  82004. }
  82005. // method id "compute.regionCommitments.insert":
  82006. type RegionCommitmentsInsertCall struct {
  82007. s *Service
  82008. project string
  82009. region string
  82010. commitment *Commitment
  82011. urlParams_ gensupport.URLParams
  82012. ctx_ context.Context
  82013. header_ http.Header
  82014. }
  82015. // Insert: Creates a commitment in the specified project using the data
  82016. // included in the request.
  82017. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  82018. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82019. c.project = project
  82020. c.region = region
  82021. c.commitment = commitment
  82022. return c
  82023. }
  82024. // RequestId sets the optional parameter "requestId": An optional
  82025. // request ID to identify requests. Specify a unique request ID so that
  82026. // if you must retry your request, the server will know to ignore the
  82027. // request if it has already been completed.
  82028. //
  82029. // For example, consider a situation where you make an initial request
  82030. // and the request times out. If you make the request again with the
  82031. // same request ID, the server can check if original operation with the
  82032. // same request ID was received, and if so, will ignore the second
  82033. // request. This prevents clients from accidentally creating duplicate
  82034. // commitments.
  82035. //
  82036. // The request ID must be a valid UUID with the exception that zero UUID
  82037. // is not supported (00000000-0000-0000-0000-000000000000).
  82038. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  82039. c.urlParams_.Set("requestId", requestId)
  82040. return c
  82041. }
  82042. // Fields allows partial responses to be retrieved. See
  82043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82044. // for more information.
  82045. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  82046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82047. return c
  82048. }
  82049. // Context sets the context to be used in this call's Do method. Any
  82050. // pending HTTP request will be aborted if the provided context is
  82051. // canceled.
  82052. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  82053. c.ctx_ = ctx
  82054. return c
  82055. }
  82056. // Header returns an http.Header that can be modified by the caller to
  82057. // add HTTP headers to the request.
  82058. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  82059. if c.header_ == nil {
  82060. c.header_ = make(http.Header)
  82061. }
  82062. return c.header_
  82063. }
  82064. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  82065. reqHeaders := make(http.Header)
  82066. for k, v := range c.header_ {
  82067. reqHeaders[k] = v
  82068. }
  82069. reqHeaders.Set("User-Agent", c.s.userAgent())
  82070. var body io.Reader = nil
  82071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  82072. if err != nil {
  82073. return nil, err
  82074. }
  82075. reqHeaders.Set("Content-Type", "application/json")
  82076. c.urlParams_.Set("alt", alt)
  82077. c.urlParams_.Set("prettyPrint", "false")
  82078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  82079. urls += "?" + c.urlParams_.Encode()
  82080. req, err := http.NewRequest("POST", urls, body)
  82081. if err != nil {
  82082. return nil, err
  82083. }
  82084. req.Header = reqHeaders
  82085. googleapi.Expand(req.URL, map[string]string{
  82086. "project": c.project,
  82087. "region": c.region,
  82088. })
  82089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82090. }
  82091. // Do executes the "compute.regionCommitments.insert" call.
  82092. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82093. // status code is an error. Response headers are in either
  82094. // *Operation.ServerResponse.Header or (if a response was returned at
  82095. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82096. // to check whether the returned error was because
  82097. // http.StatusNotModified was returned.
  82098. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82099. gensupport.SetOptions(c.urlParams_, opts...)
  82100. res, err := c.doRequest("json")
  82101. if res != nil && res.StatusCode == http.StatusNotModified {
  82102. if res.Body != nil {
  82103. res.Body.Close()
  82104. }
  82105. return nil, &googleapi.Error{
  82106. Code: res.StatusCode,
  82107. Header: res.Header,
  82108. }
  82109. }
  82110. if err != nil {
  82111. return nil, err
  82112. }
  82113. defer googleapi.CloseBody(res)
  82114. if err := googleapi.CheckResponse(res); err != nil {
  82115. return nil, err
  82116. }
  82117. ret := &Operation{
  82118. ServerResponse: googleapi.ServerResponse{
  82119. Header: res.Header,
  82120. HTTPStatusCode: res.StatusCode,
  82121. },
  82122. }
  82123. target := &ret
  82124. if err := gensupport.DecodeResponse(target, res); err != nil {
  82125. return nil, err
  82126. }
  82127. return ret, nil
  82128. // {
  82129. // "description": "Creates a commitment in the specified project using the data included in the request.",
  82130. // "httpMethod": "POST",
  82131. // "id": "compute.regionCommitments.insert",
  82132. // "parameterOrder": [
  82133. // "project",
  82134. // "region"
  82135. // ],
  82136. // "parameters": {
  82137. // "project": {
  82138. // "description": "Project ID for this request.",
  82139. // "location": "path",
  82140. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82141. // "required": true,
  82142. // "type": "string"
  82143. // },
  82144. // "region": {
  82145. // "description": "Name of the region for this request.",
  82146. // "location": "path",
  82147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82148. // "required": true,
  82149. // "type": "string"
  82150. // },
  82151. // "requestId": {
  82152. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82153. // "location": "query",
  82154. // "type": "string"
  82155. // }
  82156. // },
  82157. // "path": "{project}/regions/{region}/commitments",
  82158. // "request": {
  82159. // "$ref": "Commitment"
  82160. // },
  82161. // "response": {
  82162. // "$ref": "Operation"
  82163. // },
  82164. // "scopes": [
  82165. // "https://www.googleapis.com/auth/cloud-platform",
  82166. // "https://www.googleapis.com/auth/compute"
  82167. // ]
  82168. // }
  82169. }
  82170. // method id "compute.regionCommitments.list":
  82171. type RegionCommitmentsListCall struct {
  82172. s *Service
  82173. project string
  82174. region string
  82175. urlParams_ gensupport.URLParams
  82176. ifNoneMatch_ string
  82177. ctx_ context.Context
  82178. header_ http.Header
  82179. }
  82180. // List: Retrieves a list of commitments contained within the specified
  82181. // region.
  82182. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  82183. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82184. c.project = project
  82185. c.region = region
  82186. return c
  82187. }
  82188. // Filter sets the optional parameter "filter": A filter expression that
  82189. // filters resources listed in the response. The expression must specify
  82190. // the field name, a comparison operator, and the value that you want to
  82191. // use for filtering. The value must be a string, a number, or a
  82192. // boolean. The comparison operator must be either =, !=, >, or <.
  82193. //
  82194. // For example, if you are filtering Compute Engine instances, you can
  82195. // exclude instances named example-instance by specifying name !=
  82196. // example-instance.
  82197. //
  82198. // You can also filter nested fields. For example, you could specify
  82199. // scheduling.automaticRestart = false to include instances only if they
  82200. // are not scheduled for automatic restarts. You can use filtering on
  82201. // nested fields to filter based on resource labels.
  82202. //
  82203. // To filter on multiple expressions, provide each separate expression
  82204. // within parentheses. For example, (scheduling.automaticRestart = true)
  82205. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82206. // AND expression. However, you can include AND and OR expressions
  82207. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82208. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82209. // true).
  82210. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  82211. c.urlParams_.Set("filter", filter)
  82212. return c
  82213. }
  82214. // MaxResults sets the optional parameter "maxResults": The maximum
  82215. // number of results per page that should be returned. If the number of
  82216. // available results is larger than maxResults, Compute Engine returns a
  82217. // nextPageToken that can be used to get the next page of results in
  82218. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82219. // (Default: 500)
  82220. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  82221. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82222. return c
  82223. }
  82224. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82225. // a certain order. By default, results are returned in alphanumerical
  82226. // order based on the resource name.
  82227. //
  82228. // You can also sort results in descending order based on the creation
  82229. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82230. // based on the creationTimestamp field in reverse chronological order
  82231. // (newest result first). Use this to sort resources like operations so
  82232. // that the newest operation is returned first.
  82233. //
  82234. // Currently, only sorting by name or creationTimestamp desc is
  82235. // supported.
  82236. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  82237. c.urlParams_.Set("orderBy", orderBy)
  82238. return c
  82239. }
  82240. // PageToken sets the optional parameter "pageToken": Specifies a page
  82241. // token to use. Set pageToken to the nextPageToken returned by a
  82242. // previous list request to get the next page of results.
  82243. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  82244. c.urlParams_.Set("pageToken", pageToken)
  82245. return c
  82246. }
  82247. // Fields allows partial responses to be retrieved. See
  82248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82249. // for more information.
  82250. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  82251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82252. return c
  82253. }
  82254. // IfNoneMatch sets the optional parameter which makes the operation
  82255. // fail if the object's ETag matches the given value. This is useful for
  82256. // getting updates only after the object has changed since the last
  82257. // request. Use googleapi.IsNotModified to check whether the response
  82258. // error from Do is the result of In-None-Match.
  82259. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  82260. c.ifNoneMatch_ = entityTag
  82261. return c
  82262. }
  82263. // Context sets the context to be used in this call's Do method. Any
  82264. // pending HTTP request will be aborted if the provided context is
  82265. // canceled.
  82266. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  82267. c.ctx_ = ctx
  82268. return c
  82269. }
  82270. // Header returns an http.Header that can be modified by the caller to
  82271. // add HTTP headers to the request.
  82272. func (c *RegionCommitmentsListCall) Header() http.Header {
  82273. if c.header_ == nil {
  82274. c.header_ = make(http.Header)
  82275. }
  82276. return c.header_
  82277. }
  82278. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  82279. reqHeaders := make(http.Header)
  82280. for k, v := range c.header_ {
  82281. reqHeaders[k] = v
  82282. }
  82283. reqHeaders.Set("User-Agent", c.s.userAgent())
  82284. if c.ifNoneMatch_ != "" {
  82285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82286. }
  82287. var body io.Reader = nil
  82288. c.urlParams_.Set("alt", alt)
  82289. c.urlParams_.Set("prettyPrint", "false")
  82290. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  82291. urls += "?" + c.urlParams_.Encode()
  82292. req, err := http.NewRequest("GET", urls, body)
  82293. if err != nil {
  82294. return nil, err
  82295. }
  82296. req.Header = reqHeaders
  82297. googleapi.Expand(req.URL, map[string]string{
  82298. "project": c.project,
  82299. "region": c.region,
  82300. })
  82301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82302. }
  82303. // Do executes the "compute.regionCommitments.list" call.
  82304. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  82305. // status code is an error. Response headers are in either
  82306. // *CommitmentList.ServerResponse.Header or (if a response was returned
  82307. // at all) in error.(*googleapi.Error).Header. Use
  82308. // googleapi.IsNotModified to check whether the returned error was
  82309. // because http.StatusNotModified was returned.
  82310. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  82311. gensupport.SetOptions(c.urlParams_, opts...)
  82312. res, err := c.doRequest("json")
  82313. if res != nil && res.StatusCode == http.StatusNotModified {
  82314. if res.Body != nil {
  82315. res.Body.Close()
  82316. }
  82317. return nil, &googleapi.Error{
  82318. Code: res.StatusCode,
  82319. Header: res.Header,
  82320. }
  82321. }
  82322. if err != nil {
  82323. return nil, err
  82324. }
  82325. defer googleapi.CloseBody(res)
  82326. if err := googleapi.CheckResponse(res); err != nil {
  82327. return nil, err
  82328. }
  82329. ret := &CommitmentList{
  82330. ServerResponse: googleapi.ServerResponse{
  82331. Header: res.Header,
  82332. HTTPStatusCode: res.StatusCode,
  82333. },
  82334. }
  82335. target := &ret
  82336. if err := gensupport.DecodeResponse(target, res); err != nil {
  82337. return nil, err
  82338. }
  82339. return ret, nil
  82340. // {
  82341. // "description": "Retrieves a list of commitments contained within the specified region.",
  82342. // "httpMethod": "GET",
  82343. // "id": "compute.regionCommitments.list",
  82344. // "parameterOrder": [
  82345. // "project",
  82346. // "region"
  82347. // ],
  82348. // "parameters": {
  82349. // "filter": {
  82350. // "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).",
  82351. // "location": "query",
  82352. // "type": "string"
  82353. // },
  82354. // "maxResults": {
  82355. // "default": "500",
  82356. // "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)",
  82357. // "format": "uint32",
  82358. // "location": "query",
  82359. // "minimum": "0",
  82360. // "type": "integer"
  82361. // },
  82362. // "orderBy": {
  82363. // "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.",
  82364. // "location": "query",
  82365. // "type": "string"
  82366. // },
  82367. // "pageToken": {
  82368. // "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.",
  82369. // "location": "query",
  82370. // "type": "string"
  82371. // },
  82372. // "project": {
  82373. // "description": "Project ID for this request.",
  82374. // "location": "path",
  82375. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82376. // "required": true,
  82377. // "type": "string"
  82378. // },
  82379. // "region": {
  82380. // "description": "Name of the region for this request.",
  82381. // "location": "path",
  82382. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82383. // "required": true,
  82384. // "type": "string"
  82385. // }
  82386. // },
  82387. // "path": "{project}/regions/{region}/commitments",
  82388. // "response": {
  82389. // "$ref": "CommitmentList"
  82390. // },
  82391. // "scopes": [
  82392. // "https://www.googleapis.com/auth/cloud-platform",
  82393. // "https://www.googleapis.com/auth/compute",
  82394. // "https://www.googleapis.com/auth/compute.readonly"
  82395. // ]
  82396. // }
  82397. }
  82398. // Pages invokes f for each page of results.
  82399. // A non-nil error returned from f will halt the iteration.
  82400. // The provided context supersedes any context provided to the Context method.
  82401. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  82402. c.ctx_ = ctx
  82403. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82404. for {
  82405. x, err := c.Do()
  82406. if err != nil {
  82407. return err
  82408. }
  82409. if err := f(x); err != nil {
  82410. return err
  82411. }
  82412. if x.NextPageToken == "" {
  82413. return nil
  82414. }
  82415. c.PageToken(x.NextPageToken)
  82416. }
  82417. }
  82418. // method id "compute.regionDiskTypes.get":
  82419. type RegionDiskTypesGetCall struct {
  82420. s *Service
  82421. project string
  82422. region string
  82423. diskType string
  82424. urlParams_ gensupport.URLParams
  82425. ifNoneMatch_ string
  82426. ctx_ context.Context
  82427. header_ http.Header
  82428. }
  82429. // Get: Returns the specified regional disk type. Gets a list of
  82430. // available disk types by making a list() request.
  82431. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  82432. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82433. c.project = project
  82434. c.region = region
  82435. c.diskType = diskType
  82436. return c
  82437. }
  82438. // Fields allows partial responses to be retrieved. See
  82439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82440. // for more information.
  82441. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  82442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82443. return c
  82444. }
  82445. // IfNoneMatch sets the optional parameter which makes the operation
  82446. // fail if the object's ETag matches the given value. This is useful for
  82447. // getting updates only after the object has changed since the last
  82448. // request. Use googleapi.IsNotModified to check whether the response
  82449. // error from Do is the result of In-None-Match.
  82450. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  82451. c.ifNoneMatch_ = entityTag
  82452. return c
  82453. }
  82454. // Context sets the context to be used in this call's Do method. Any
  82455. // pending HTTP request will be aborted if the provided context is
  82456. // canceled.
  82457. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  82458. c.ctx_ = ctx
  82459. return c
  82460. }
  82461. // Header returns an http.Header that can be modified by the caller to
  82462. // add HTTP headers to the request.
  82463. func (c *RegionDiskTypesGetCall) Header() http.Header {
  82464. if c.header_ == nil {
  82465. c.header_ = make(http.Header)
  82466. }
  82467. return c.header_
  82468. }
  82469. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  82470. reqHeaders := make(http.Header)
  82471. for k, v := range c.header_ {
  82472. reqHeaders[k] = v
  82473. }
  82474. reqHeaders.Set("User-Agent", c.s.userAgent())
  82475. if c.ifNoneMatch_ != "" {
  82476. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82477. }
  82478. var body io.Reader = nil
  82479. c.urlParams_.Set("alt", alt)
  82480. c.urlParams_.Set("prettyPrint", "false")
  82481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  82482. urls += "?" + c.urlParams_.Encode()
  82483. req, err := http.NewRequest("GET", urls, body)
  82484. if err != nil {
  82485. return nil, err
  82486. }
  82487. req.Header = reqHeaders
  82488. googleapi.Expand(req.URL, map[string]string{
  82489. "project": c.project,
  82490. "region": c.region,
  82491. "diskType": c.diskType,
  82492. })
  82493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82494. }
  82495. // Do executes the "compute.regionDiskTypes.get" call.
  82496. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  82497. // code is an error. Response headers are in either
  82498. // *DiskType.ServerResponse.Header or (if a response was returned at
  82499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82500. // to check whether the returned error was because
  82501. // http.StatusNotModified was returned.
  82502. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  82503. gensupport.SetOptions(c.urlParams_, opts...)
  82504. res, err := c.doRequest("json")
  82505. if res != nil && res.StatusCode == http.StatusNotModified {
  82506. if res.Body != nil {
  82507. res.Body.Close()
  82508. }
  82509. return nil, &googleapi.Error{
  82510. Code: res.StatusCode,
  82511. Header: res.Header,
  82512. }
  82513. }
  82514. if err != nil {
  82515. return nil, err
  82516. }
  82517. defer googleapi.CloseBody(res)
  82518. if err := googleapi.CheckResponse(res); err != nil {
  82519. return nil, err
  82520. }
  82521. ret := &DiskType{
  82522. ServerResponse: googleapi.ServerResponse{
  82523. Header: res.Header,
  82524. HTTPStatusCode: res.StatusCode,
  82525. },
  82526. }
  82527. target := &ret
  82528. if err := gensupport.DecodeResponse(target, res); err != nil {
  82529. return nil, err
  82530. }
  82531. return ret, nil
  82532. // {
  82533. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  82534. // "httpMethod": "GET",
  82535. // "id": "compute.regionDiskTypes.get",
  82536. // "parameterOrder": [
  82537. // "project",
  82538. // "region",
  82539. // "diskType"
  82540. // ],
  82541. // "parameters": {
  82542. // "diskType": {
  82543. // "description": "Name of the disk type to return.",
  82544. // "location": "path",
  82545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82546. // "required": true,
  82547. // "type": "string"
  82548. // },
  82549. // "project": {
  82550. // "description": "Project ID for this request.",
  82551. // "location": "path",
  82552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82553. // "required": true,
  82554. // "type": "string"
  82555. // },
  82556. // "region": {
  82557. // "description": "The name of the region for this request.",
  82558. // "location": "path",
  82559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82560. // "required": true,
  82561. // "type": "string"
  82562. // }
  82563. // },
  82564. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  82565. // "response": {
  82566. // "$ref": "DiskType"
  82567. // },
  82568. // "scopes": [
  82569. // "https://www.googleapis.com/auth/cloud-platform",
  82570. // "https://www.googleapis.com/auth/compute",
  82571. // "https://www.googleapis.com/auth/compute.readonly"
  82572. // ]
  82573. // }
  82574. }
  82575. // method id "compute.regionDiskTypes.list":
  82576. type RegionDiskTypesListCall struct {
  82577. s *Service
  82578. project string
  82579. region string
  82580. urlParams_ gensupport.URLParams
  82581. ifNoneMatch_ string
  82582. ctx_ context.Context
  82583. header_ http.Header
  82584. }
  82585. // List: Retrieves a list of regional disk types available to the
  82586. // specified project.
  82587. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  82588. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82589. c.project = project
  82590. c.region = region
  82591. return c
  82592. }
  82593. // Filter sets the optional parameter "filter": A filter expression that
  82594. // filters resources listed in the response. The expression must specify
  82595. // the field name, a comparison operator, and the value that you want to
  82596. // use for filtering. The value must be a string, a number, or a
  82597. // boolean. The comparison operator must be either =, !=, >, or <.
  82598. //
  82599. // For example, if you are filtering Compute Engine instances, you can
  82600. // exclude instances named example-instance by specifying name !=
  82601. // example-instance.
  82602. //
  82603. // You can also filter nested fields. For example, you could specify
  82604. // scheduling.automaticRestart = false to include instances only if they
  82605. // are not scheduled for automatic restarts. You can use filtering on
  82606. // nested fields to filter based on resource labels.
  82607. //
  82608. // To filter on multiple expressions, provide each separate expression
  82609. // within parentheses. For example, (scheduling.automaticRestart = true)
  82610. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82611. // AND expression. However, you can include AND and OR expressions
  82612. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82613. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82614. // true).
  82615. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  82616. c.urlParams_.Set("filter", filter)
  82617. return c
  82618. }
  82619. // MaxResults sets the optional parameter "maxResults": The maximum
  82620. // number of results per page that should be returned. If the number of
  82621. // available results is larger than maxResults, Compute Engine returns a
  82622. // nextPageToken that can be used to get the next page of results in
  82623. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82624. // (Default: 500)
  82625. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  82626. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82627. return c
  82628. }
  82629. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82630. // a certain order. By default, results are returned in alphanumerical
  82631. // order based on the resource name.
  82632. //
  82633. // You can also sort results in descending order based on the creation
  82634. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82635. // based on the creationTimestamp field in reverse chronological order
  82636. // (newest result first). Use this to sort resources like operations so
  82637. // that the newest operation is returned first.
  82638. //
  82639. // Currently, only sorting by name or creationTimestamp desc is
  82640. // supported.
  82641. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  82642. c.urlParams_.Set("orderBy", orderBy)
  82643. return c
  82644. }
  82645. // PageToken sets the optional parameter "pageToken": Specifies a page
  82646. // token to use. Set pageToken to the nextPageToken returned by a
  82647. // previous list request to get the next page of results.
  82648. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  82649. c.urlParams_.Set("pageToken", pageToken)
  82650. return c
  82651. }
  82652. // Fields allows partial responses to be retrieved. See
  82653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82654. // for more information.
  82655. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  82656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82657. return c
  82658. }
  82659. // IfNoneMatch sets the optional parameter which makes the operation
  82660. // fail if the object's ETag matches the given value. This is useful for
  82661. // getting updates only after the object has changed since the last
  82662. // request. Use googleapi.IsNotModified to check whether the response
  82663. // error from Do is the result of In-None-Match.
  82664. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  82665. c.ifNoneMatch_ = entityTag
  82666. return c
  82667. }
  82668. // Context sets the context to be used in this call's Do method. Any
  82669. // pending HTTP request will be aborted if the provided context is
  82670. // canceled.
  82671. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  82672. c.ctx_ = ctx
  82673. return c
  82674. }
  82675. // Header returns an http.Header that can be modified by the caller to
  82676. // add HTTP headers to the request.
  82677. func (c *RegionDiskTypesListCall) Header() http.Header {
  82678. if c.header_ == nil {
  82679. c.header_ = make(http.Header)
  82680. }
  82681. return c.header_
  82682. }
  82683. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  82684. reqHeaders := make(http.Header)
  82685. for k, v := range c.header_ {
  82686. reqHeaders[k] = v
  82687. }
  82688. reqHeaders.Set("User-Agent", c.s.userAgent())
  82689. if c.ifNoneMatch_ != "" {
  82690. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82691. }
  82692. var body io.Reader = nil
  82693. c.urlParams_.Set("alt", alt)
  82694. c.urlParams_.Set("prettyPrint", "false")
  82695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  82696. urls += "?" + c.urlParams_.Encode()
  82697. req, err := http.NewRequest("GET", urls, body)
  82698. if err != nil {
  82699. return nil, err
  82700. }
  82701. req.Header = reqHeaders
  82702. googleapi.Expand(req.URL, map[string]string{
  82703. "project": c.project,
  82704. "region": c.region,
  82705. })
  82706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82707. }
  82708. // Do executes the "compute.regionDiskTypes.list" call.
  82709. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  82710. // non-2xx status code is an error. Response headers are in either
  82711. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  82712. // returned at all) in error.(*googleapi.Error).Header. Use
  82713. // googleapi.IsNotModified to check whether the returned error was
  82714. // because http.StatusNotModified was returned.
  82715. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  82716. gensupport.SetOptions(c.urlParams_, opts...)
  82717. res, err := c.doRequest("json")
  82718. if res != nil && res.StatusCode == http.StatusNotModified {
  82719. if res.Body != nil {
  82720. res.Body.Close()
  82721. }
  82722. return nil, &googleapi.Error{
  82723. Code: res.StatusCode,
  82724. Header: res.Header,
  82725. }
  82726. }
  82727. if err != nil {
  82728. return nil, err
  82729. }
  82730. defer googleapi.CloseBody(res)
  82731. if err := googleapi.CheckResponse(res); err != nil {
  82732. return nil, err
  82733. }
  82734. ret := &RegionDiskTypeList{
  82735. ServerResponse: googleapi.ServerResponse{
  82736. Header: res.Header,
  82737. HTTPStatusCode: res.StatusCode,
  82738. },
  82739. }
  82740. target := &ret
  82741. if err := gensupport.DecodeResponse(target, res); err != nil {
  82742. return nil, err
  82743. }
  82744. return ret, nil
  82745. // {
  82746. // "description": "Retrieves a list of regional disk types available to the specified project.",
  82747. // "httpMethod": "GET",
  82748. // "id": "compute.regionDiskTypes.list",
  82749. // "parameterOrder": [
  82750. // "project",
  82751. // "region"
  82752. // ],
  82753. // "parameters": {
  82754. // "filter": {
  82755. // "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).",
  82756. // "location": "query",
  82757. // "type": "string"
  82758. // },
  82759. // "maxResults": {
  82760. // "default": "500",
  82761. // "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)",
  82762. // "format": "uint32",
  82763. // "location": "query",
  82764. // "minimum": "0",
  82765. // "type": "integer"
  82766. // },
  82767. // "orderBy": {
  82768. // "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.",
  82769. // "location": "query",
  82770. // "type": "string"
  82771. // },
  82772. // "pageToken": {
  82773. // "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.",
  82774. // "location": "query",
  82775. // "type": "string"
  82776. // },
  82777. // "project": {
  82778. // "description": "Project ID for this request.",
  82779. // "location": "path",
  82780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82781. // "required": true,
  82782. // "type": "string"
  82783. // },
  82784. // "region": {
  82785. // "description": "The name of the region for this request.",
  82786. // "location": "path",
  82787. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82788. // "required": true,
  82789. // "type": "string"
  82790. // }
  82791. // },
  82792. // "path": "{project}/regions/{region}/diskTypes",
  82793. // "response": {
  82794. // "$ref": "RegionDiskTypeList"
  82795. // },
  82796. // "scopes": [
  82797. // "https://www.googleapis.com/auth/cloud-platform",
  82798. // "https://www.googleapis.com/auth/compute",
  82799. // "https://www.googleapis.com/auth/compute.readonly"
  82800. // ]
  82801. // }
  82802. }
  82803. // Pages invokes f for each page of results.
  82804. // A non-nil error returned from f will halt the iteration.
  82805. // The provided context supersedes any context provided to the Context method.
  82806. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  82807. c.ctx_ = ctx
  82808. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82809. for {
  82810. x, err := c.Do()
  82811. if err != nil {
  82812. return err
  82813. }
  82814. if err := f(x); err != nil {
  82815. return err
  82816. }
  82817. if x.NextPageToken == "" {
  82818. return nil
  82819. }
  82820. c.PageToken(x.NextPageToken)
  82821. }
  82822. }
  82823. // method id "compute.regionDisks.addResourcePolicies":
  82824. type RegionDisksAddResourcePoliciesCall struct {
  82825. s *Service
  82826. project string
  82827. region string
  82828. disk string
  82829. regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
  82830. urlParams_ gensupport.URLParams
  82831. ctx_ context.Context
  82832. header_ http.Header
  82833. }
  82834. // AddResourcePolicies: Adds existing resource policies to a regional
  82835. // disk. You can only add one policy which will be applied to this disk
  82836. // for scheduling snapshot creation.
  82837. func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
  82838. c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82839. c.project = project
  82840. c.region = region
  82841. c.disk = disk
  82842. c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
  82843. return c
  82844. }
  82845. // RequestId sets the optional parameter "requestId": An optional
  82846. // request ID to identify requests. Specify a unique request ID so that
  82847. // if you must retry your request, the server will know to ignore the
  82848. // request if it has already been completed.
  82849. //
  82850. // For example, consider a situation where you make an initial request
  82851. // and the request times out. If you make the request again with the
  82852. // same request ID, the server can check if original operation with the
  82853. // same request ID was received, and if so, will ignore the second
  82854. // request. This prevents clients from accidentally creating duplicate
  82855. // commitments.
  82856. //
  82857. // The request ID must be a valid UUID with the exception that zero UUID
  82858. // is not supported (00000000-0000-0000-0000-000000000000).
  82859. func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
  82860. c.urlParams_.Set("requestId", requestId)
  82861. return c
  82862. }
  82863. // Fields allows partial responses to be retrieved. See
  82864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82865. // for more information.
  82866. func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
  82867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82868. return c
  82869. }
  82870. // Context sets the context to be used in this call's Do method. Any
  82871. // pending HTTP request will be aborted if the provided context is
  82872. // canceled.
  82873. func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
  82874. c.ctx_ = ctx
  82875. return c
  82876. }
  82877. // Header returns an http.Header that can be modified by the caller to
  82878. // add HTTP headers to the request.
  82879. func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header {
  82880. if c.header_ == nil {
  82881. c.header_ = make(http.Header)
  82882. }
  82883. return c.header_
  82884. }
  82885. func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  82886. reqHeaders := make(http.Header)
  82887. for k, v := range c.header_ {
  82888. reqHeaders[k] = v
  82889. }
  82890. reqHeaders.Set("User-Agent", c.s.userAgent())
  82891. var body io.Reader = nil
  82892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
  82893. if err != nil {
  82894. return nil, err
  82895. }
  82896. reqHeaders.Set("Content-Type", "application/json")
  82897. c.urlParams_.Set("alt", alt)
  82898. c.urlParams_.Set("prettyPrint", "false")
  82899. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/addResourcePolicies")
  82900. urls += "?" + c.urlParams_.Encode()
  82901. req, err := http.NewRequest("POST", urls, body)
  82902. if err != nil {
  82903. return nil, err
  82904. }
  82905. req.Header = reqHeaders
  82906. googleapi.Expand(req.URL, map[string]string{
  82907. "project": c.project,
  82908. "region": c.region,
  82909. "disk": c.disk,
  82910. })
  82911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82912. }
  82913. // Do executes the "compute.regionDisks.addResourcePolicies" call.
  82914. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82915. // status code is an error. Response headers are in either
  82916. // *Operation.ServerResponse.Header or (if a response was returned at
  82917. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82918. // to check whether the returned error was because
  82919. // http.StatusNotModified was returned.
  82920. func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82921. gensupport.SetOptions(c.urlParams_, opts...)
  82922. res, err := c.doRequest("json")
  82923. if res != nil && res.StatusCode == http.StatusNotModified {
  82924. if res.Body != nil {
  82925. res.Body.Close()
  82926. }
  82927. return nil, &googleapi.Error{
  82928. Code: res.StatusCode,
  82929. Header: res.Header,
  82930. }
  82931. }
  82932. if err != nil {
  82933. return nil, err
  82934. }
  82935. defer googleapi.CloseBody(res)
  82936. if err := googleapi.CheckResponse(res); err != nil {
  82937. return nil, err
  82938. }
  82939. ret := &Operation{
  82940. ServerResponse: googleapi.ServerResponse{
  82941. Header: res.Header,
  82942. HTTPStatusCode: res.StatusCode,
  82943. },
  82944. }
  82945. target := &ret
  82946. if err := gensupport.DecodeResponse(target, res); err != nil {
  82947. return nil, err
  82948. }
  82949. return ret, nil
  82950. // {
  82951. // "description": "Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
  82952. // "httpMethod": "POST",
  82953. // "id": "compute.regionDisks.addResourcePolicies",
  82954. // "parameterOrder": [
  82955. // "project",
  82956. // "region",
  82957. // "disk"
  82958. // ],
  82959. // "parameters": {
  82960. // "disk": {
  82961. // "description": "The disk name for this request.",
  82962. // "location": "path",
  82963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82964. // "required": true,
  82965. // "type": "string"
  82966. // },
  82967. // "project": {
  82968. // "description": "Project ID for this request.",
  82969. // "location": "path",
  82970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82971. // "required": true,
  82972. // "type": "string"
  82973. // },
  82974. // "region": {
  82975. // "description": "The name of the region for this request.",
  82976. // "location": "path",
  82977. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82978. // "required": true,
  82979. // "type": "string"
  82980. // },
  82981. // "requestId": {
  82982. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82983. // "location": "query",
  82984. // "type": "string"
  82985. // }
  82986. // },
  82987. // "path": "{project}/regions/{region}/disks/{disk}/addResourcePolicies",
  82988. // "request": {
  82989. // "$ref": "RegionDisksAddResourcePoliciesRequest"
  82990. // },
  82991. // "response": {
  82992. // "$ref": "Operation"
  82993. // },
  82994. // "scopes": [
  82995. // "https://www.googleapis.com/auth/cloud-platform",
  82996. // "https://www.googleapis.com/auth/compute"
  82997. // ]
  82998. // }
  82999. }
  83000. // method id "compute.regionDisks.createSnapshot":
  83001. type RegionDisksCreateSnapshotCall struct {
  83002. s *Service
  83003. project string
  83004. region string
  83005. disk string
  83006. snapshot *Snapshot
  83007. urlParams_ gensupport.URLParams
  83008. ctx_ context.Context
  83009. header_ http.Header
  83010. }
  83011. // CreateSnapshot: Creates a snapshot of this regional disk.
  83012. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  83013. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83014. c.project = project
  83015. c.region = region
  83016. c.disk = disk
  83017. c.snapshot = snapshot
  83018. return c
  83019. }
  83020. // RequestId sets the optional parameter "requestId": An optional
  83021. // request ID to identify requests. Specify a unique request ID so that
  83022. // if you must retry your request, the server will know to ignore the
  83023. // request if it has already been completed.
  83024. //
  83025. // For example, consider a situation where you make an initial request
  83026. // and the request times out. If you make the request again with the
  83027. // same request ID, the server can check if original operation with the
  83028. // same request ID was received, and if so, will ignore the second
  83029. // request. This prevents clients from accidentally creating duplicate
  83030. // commitments.
  83031. //
  83032. // The request ID must be a valid UUID with the exception that zero UUID
  83033. // is not supported (00000000-0000-0000-0000-000000000000).
  83034. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  83035. c.urlParams_.Set("requestId", requestId)
  83036. return c
  83037. }
  83038. // Fields allows partial responses to be retrieved. See
  83039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83040. // for more information.
  83041. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  83042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83043. return c
  83044. }
  83045. // Context sets the context to be used in this call's Do method. Any
  83046. // pending HTTP request will be aborted if the provided context is
  83047. // canceled.
  83048. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  83049. c.ctx_ = ctx
  83050. return c
  83051. }
  83052. // Header returns an http.Header that can be modified by the caller to
  83053. // add HTTP headers to the request.
  83054. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  83055. if c.header_ == nil {
  83056. c.header_ = make(http.Header)
  83057. }
  83058. return c.header_
  83059. }
  83060. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  83061. reqHeaders := make(http.Header)
  83062. for k, v := range c.header_ {
  83063. reqHeaders[k] = v
  83064. }
  83065. reqHeaders.Set("User-Agent", c.s.userAgent())
  83066. var body io.Reader = nil
  83067. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  83068. if err != nil {
  83069. return nil, err
  83070. }
  83071. reqHeaders.Set("Content-Type", "application/json")
  83072. c.urlParams_.Set("alt", alt)
  83073. c.urlParams_.Set("prettyPrint", "false")
  83074. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  83075. urls += "?" + c.urlParams_.Encode()
  83076. req, err := http.NewRequest("POST", urls, body)
  83077. if err != nil {
  83078. return nil, err
  83079. }
  83080. req.Header = reqHeaders
  83081. googleapi.Expand(req.URL, map[string]string{
  83082. "project": c.project,
  83083. "region": c.region,
  83084. "disk": c.disk,
  83085. })
  83086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83087. }
  83088. // Do executes the "compute.regionDisks.createSnapshot" call.
  83089. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83090. // status code is an error. Response headers are in either
  83091. // *Operation.ServerResponse.Header or (if a response was returned at
  83092. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83093. // to check whether the returned error was because
  83094. // http.StatusNotModified was returned.
  83095. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83096. gensupport.SetOptions(c.urlParams_, opts...)
  83097. res, err := c.doRequest("json")
  83098. if res != nil && res.StatusCode == http.StatusNotModified {
  83099. if res.Body != nil {
  83100. res.Body.Close()
  83101. }
  83102. return nil, &googleapi.Error{
  83103. Code: res.StatusCode,
  83104. Header: res.Header,
  83105. }
  83106. }
  83107. if err != nil {
  83108. return nil, err
  83109. }
  83110. defer googleapi.CloseBody(res)
  83111. if err := googleapi.CheckResponse(res); err != nil {
  83112. return nil, err
  83113. }
  83114. ret := &Operation{
  83115. ServerResponse: googleapi.ServerResponse{
  83116. Header: res.Header,
  83117. HTTPStatusCode: res.StatusCode,
  83118. },
  83119. }
  83120. target := &ret
  83121. if err := gensupport.DecodeResponse(target, res); err != nil {
  83122. return nil, err
  83123. }
  83124. return ret, nil
  83125. // {
  83126. // "description": "Creates a snapshot of this regional disk.",
  83127. // "httpMethod": "POST",
  83128. // "id": "compute.regionDisks.createSnapshot",
  83129. // "parameterOrder": [
  83130. // "project",
  83131. // "region",
  83132. // "disk"
  83133. // ],
  83134. // "parameters": {
  83135. // "disk": {
  83136. // "description": "Name of the regional persistent disk to snapshot.",
  83137. // "location": "path",
  83138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83139. // "required": true,
  83140. // "type": "string"
  83141. // },
  83142. // "project": {
  83143. // "description": "Project ID for this request.",
  83144. // "location": "path",
  83145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83146. // "required": true,
  83147. // "type": "string"
  83148. // },
  83149. // "region": {
  83150. // "description": "Name of the region for this request.",
  83151. // "location": "path",
  83152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83153. // "required": true,
  83154. // "type": "string"
  83155. // },
  83156. // "requestId": {
  83157. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83158. // "location": "query",
  83159. // "type": "string"
  83160. // }
  83161. // },
  83162. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  83163. // "request": {
  83164. // "$ref": "Snapshot"
  83165. // },
  83166. // "response": {
  83167. // "$ref": "Operation"
  83168. // },
  83169. // "scopes": [
  83170. // "https://www.googleapis.com/auth/cloud-platform",
  83171. // "https://www.googleapis.com/auth/compute"
  83172. // ]
  83173. // }
  83174. }
  83175. // method id "compute.regionDisks.delete":
  83176. type RegionDisksDeleteCall struct {
  83177. s *Service
  83178. project string
  83179. region string
  83180. disk string
  83181. urlParams_ gensupport.URLParams
  83182. ctx_ context.Context
  83183. header_ http.Header
  83184. }
  83185. // Delete: Deletes the specified regional persistent disk. Deleting a
  83186. // regional disk removes all the replicas of its data permanently and is
  83187. // irreversible. However, deleting a disk does not delete any snapshots
  83188. // previously made from the disk. You must separately delete snapshots.
  83189. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  83190. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83191. c.project = project
  83192. c.region = region
  83193. c.disk = disk
  83194. return c
  83195. }
  83196. // RequestId sets the optional parameter "requestId": An optional
  83197. // request ID to identify requests. Specify a unique request ID so that
  83198. // if you must retry your request, the server will know to ignore the
  83199. // request if it has already been completed.
  83200. //
  83201. // For example, consider a situation where you make an initial request
  83202. // and the request times out. If you make the request again with the
  83203. // same request ID, the server can check if original operation with the
  83204. // same request ID was received, and if so, will ignore the second
  83205. // request. This prevents clients from accidentally creating duplicate
  83206. // commitments.
  83207. //
  83208. // The request ID must be a valid UUID with the exception that zero UUID
  83209. // is not supported (00000000-0000-0000-0000-000000000000).
  83210. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  83211. c.urlParams_.Set("requestId", requestId)
  83212. return c
  83213. }
  83214. // Fields allows partial responses to be retrieved. See
  83215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83216. // for more information.
  83217. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  83218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83219. return c
  83220. }
  83221. // Context sets the context to be used in this call's Do method. Any
  83222. // pending HTTP request will be aborted if the provided context is
  83223. // canceled.
  83224. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  83225. c.ctx_ = ctx
  83226. return c
  83227. }
  83228. // Header returns an http.Header that can be modified by the caller to
  83229. // add HTTP headers to the request.
  83230. func (c *RegionDisksDeleteCall) Header() http.Header {
  83231. if c.header_ == nil {
  83232. c.header_ = make(http.Header)
  83233. }
  83234. return c.header_
  83235. }
  83236. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  83237. reqHeaders := make(http.Header)
  83238. for k, v := range c.header_ {
  83239. reqHeaders[k] = v
  83240. }
  83241. reqHeaders.Set("User-Agent", c.s.userAgent())
  83242. var body io.Reader = nil
  83243. c.urlParams_.Set("alt", alt)
  83244. c.urlParams_.Set("prettyPrint", "false")
  83245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  83246. urls += "?" + c.urlParams_.Encode()
  83247. req, err := http.NewRequest("DELETE", urls, body)
  83248. if err != nil {
  83249. return nil, err
  83250. }
  83251. req.Header = reqHeaders
  83252. googleapi.Expand(req.URL, map[string]string{
  83253. "project": c.project,
  83254. "region": c.region,
  83255. "disk": c.disk,
  83256. })
  83257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83258. }
  83259. // Do executes the "compute.regionDisks.delete" call.
  83260. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83261. // status code is an error. Response headers are in either
  83262. // *Operation.ServerResponse.Header or (if a response was returned at
  83263. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83264. // to check whether the returned error was because
  83265. // http.StatusNotModified was returned.
  83266. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83267. gensupport.SetOptions(c.urlParams_, opts...)
  83268. res, err := c.doRequest("json")
  83269. if res != nil && res.StatusCode == http.StatusNotModified {
  83270. if res.Body != nil {
  83271. res.Body.Close()
  83272. }
  83273. return nil, &googleapi.Error{
  83274. Code: res.StatusCode,
  83275. Header: res.Header,
  83276. }
  83277. }
  83278. if err != nil {
  83279. return nil, err
  83280. }
  83281. defer googleapi.CloseBody(res)
  83282. if err := googleapi.CheckResponse(res); err != nil {
  83283. return nil, err
  83284. }
  83285. ret := &Operation{
  83286. ServerResponse: googleapi.ServerResponse{
  83287. Header: res.Header,
  83288. HTTPStatusCode: res.StatusCode,
  83289. },
  83290. }
  83291. target := &ret
  83292. if err := gensupport.DecodeResponse(target, res); err != nil {
  83293. return nil, err
  83294. }
  83295. return ret, nil
  83296. // {
  83297. // "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.",
  83298. // "httpMethod": "DELETE",
  83299. // "id": "compute.regionDisks.delete",
  83300. // "parameterOrder": [
  83301. // "project",
  83302. // "region",
  83303. // "disk"
  83304. // ],
  83305. // "parameters": {
  83306. // "disk": {
  83307. // "description": "Name of the regional persistent disk to delete.",
  83308. // "location": "path",
  83309. // "required": true,
  83310. // "type": "string"
  83311. // },
  83312. // "project": {
  83313. // "description": "Project ID for this request.",
  83314. // "location": "path",
  83315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83316. // "required": true,
  83317. // "type": "string"
  83318. // },
  83319. // "region": {
  83320. // "description": "Name of the region for this request.",
  83321. // "location": "path",
  83322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83323. // "required": true,
  83324. // "type": "string"
  83325. // },
  83326. // "requestId": {
  83327. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83328. // "location": "query",
  83329. // "type": "string"
  83330. // }
  83331. // },
  83332. // "path": "{project}/regions/{region}/disks/{disk}",
  83333. // "response": {
  83334. // "$ref": "Operation"
  83335. // },
  83336. // "scopes": [
  83337. // "https://www.googleapis.com/auth/cloud-platform",
  83338. // "https://www.googleapis.com/auth/compute"
  83339. // ]
  83340. // }
  83341. }
  83342. // method id "compute.regionDisks.get":
  83343. type RegionDisksGetCall struct {
  83344. s *Service
  83345. project string
  83346. region string
  83347. disk string
  83348. urlParams_ gensupport.URLParams
  83349. ifNoneMatch_ string
  83350. ctx_ context.Context
  83351. header_ http.Header
  83352. }
  83353. // Get: Returns a specified regional persistent disk.
  83354. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  83355. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83356. c.project = project
  83357. c.region = region
  83358. c.disk = disk
  83359. return c
  83360. }
  83361. // Fields allows partial responses to be retrieved. See
  83362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83363. // for more information.
  83364. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  83365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83366. return c
  83367. }
  83368. // IfNoneMatch sets the optional parameter which makes the operation
  83369. // fail if the object's ETag matches the given value. This is useful for
  83370. // getting updates only after the object has changed since the last
  83371. // request. Use googleapi.IsNotModified to check whether the response
  83372. // error from Do is the result of In-None-Match.
  83373. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  83374. c.ifNoneMatch_ = entityTag
  83375. return c
  83376. }
  83377. // Context sets the context to be used in this call's Do method. Any
  83378. // pending HTTP request will be aborted if the provided context is
  83379. // canceled.
  83380. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  83381. c.ctx_ = ctx
  83382. return c
  83383. }
  83384. // Header returns an http.Header that can be modified by the caller to
  83385. // add HTTP headers to the request.
  83386. func (c *RegionDisksGetCall) Header() http.Header {
  83387. if c.header_ == nil {
  83388. c.header_ = make(http.Header)
  83389. }
  83390. return c.header_
  83391. }
  83392. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  83393. reqHeaders := make(http.Header)
  83394. for k, v := range c.header_ {
  83395. reqHeaders[k] = v
  83396. }
  83397. reqHeaders.Set("User-Agent", c.s.userAgent())
  83398. if c.ifNoneMatch_ != "" {
  83399. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83400. }
  83401. var body io.Reader = nil
  83402. c.urlParams_.Set("alt", alt)
  83403. c.urlParams_.Set("prettyPrint", "false")
  83404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  83405. urls += "?" + c.urlParams_.Encode()
  83406. req, err := http.NewRequest("GET", urls, body)
  83407. if err != nil {
  83408. return nil, err
  83409. }
  83410. req.Header = reqHeaders
  83411. googleapi.Expand(req.URL, map[string]string{
  83412. "project": c.project,
  83413. "region": c.region,
  83414. "disk": c.disk,
  83415. })
  83416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83417. }
  83418. // Do executes the "compute.regionDisks.get" call.
  83419. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  83420. // code is an error. Response headers are in either
  83421. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  83422. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  83423. // whether the returned error was because http.StatusNotModified was
  83424. // returned.
  83425. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  83426. gensupport.SetOptions(c.urlParams_, opts...)
  83427. res, err := c.doRequest("json")
  83428. if res != nil && res.StatusCode == http.StatusNotModified {
  83429. if res.Body != nil {
  83430. res.Body.Close()
  83431. }
  83432. return nil, &googleapi.Error{
  83433. Code: res.StatusCode,
  83434. Header: res.Header,
  83435. }
  83436. }
  83437. if err != nil {
  83438. return nil, err
  83439. }
  83440. defer googleapi.CloseBody(res)
  83441. if err := googleapi.CheckResponse(res); err != nil {
  83442. return nil, err
  83443. }
  83444. ret := &Disk{
  83445. ServerResponse: googleapi.ServerResponse{
  83446. Header: res.Header,
  83447. HTTPStatusCode: res.StatusCode,
  83448. },
  83449. }
  83450. target := &ret
  83451. if err := gensupport.DecodeResponse(target, res); err != nil {
  83452. return nil, err
  83453. }
  83454. return ret, nil
  83455. // {
  83456. // "description": "Returns a specified regional persistent disk.",
  83457. // "httpMethod": "GET",
  83458. // "id": "compute.regionDisks.get",
  83459. // "parameterOrder": [
  83460. // "project",
  83461. // "region",
  83462. // "disk"
  83463. // ],
  83464. // "parameters": {
  83465. // "disk": {
  83466. // "description": "Name of the regional persistent disk to return.",
  83467. // "location": "path",
  83468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83469. // "required": true,
  83470. // "type": "string"
  83471. // },
  83472. // "project": {
  83473. // "description": "Project ID for this request.",
  83474. // "location": "path",
  83475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83476. // "required": true,
  83477. // "type": "string"
  83478. // },
  83479. // "region": {
  83480. // "description": "Name of the region for this request.",
  83481. // "location": "path",
  83482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83483. // "required": true,
  83484. // "type": "string"
  83485. // }
  83486. // },
  83487. // "path": "{project}/regions/{region}/disks/{disk}",
  83488. // "response": {
  83489. // "$ref": "Disk"
  83490. // },
  83491. // "scopes": [
  83492. // "https://www.googleapis.com/auth/cloud-platform",
  83493. // "https://www.googleapis.com/auth/compute",
  83494. // "https://www.googleapis.com/auth/compute.readonly"
  83495. // ]
  83496. // }
  83497. }
  83498. // method id "compute.regionDisks.insert":
  83499. type RegionDisksInsertCall struct {
  83500. s *Service
  83501. project string
  83502. region string
  83503. disk *Disk
  83504. urlParams_ gensupport.URLParams
  83505. ctx_ context.Context
  83506. header_ http.Header
  83507. }
  83508. // Insert: Creates a persistent regional disk in the specified project
  83509. // using the data included in the request.
  83510. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  83511. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83512. c.project = project
  83513. c.region = region
  83514. c.disk = disk
  83515. return c
  83516. }
  83517. // RequestId sets the optional parameter "requestId": An optional
  83518. // request ID to identify requests. Specify a unique request ID so that
  83519. // if you must retry your request, the server will know to ignore the
  83520. // request if it has already been completed.
  83521. //
  83522. // For example, consider a situation where you make an initial request
  83523. // and the request times out. If you make the request again with the
  83524. // same request ID, the server can check if original operation with the
  83525. // same request ID was received, and if so, will ignore the second
  83526. // request. This prevents clients from accidentally creating duplicate
  83527. // commitments.
  83528. //
  83529. // The request ID must be a valid UUID with the exception that zero UUID
  83530. // is not supported (00000000-0000-0000-0000-000000000000).
  83531. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  83532. c.urlParams_.Set("requestId", requestId)
  83533. return c
  83534. }
  83535. // SourceImage sets the optional parameter "sourceImage": Source image
  83536. // to restore onto a disk.
  83537. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  83538. c.urlParams_.Set("sourceImage", sourceImage)
  83539. return c
  83540. }
  83541. // Fields allows partial responses to be retrieved. See
  83542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83543. // for more information.
  83544. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  83545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83546. return c
  83547. }
  83548. // Context sets the context to be used in this call's Do method. Any
  83549. // pending HTTP request will be aborted if the provided context is
  83550. // canceled.
  83551. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  83552. c.ctx_ = ctx
  83553. return c
  83554. }
  83555. // Header returns an http.Header that can be modified by the caller to
  83556. // add HTTP headers to the request.
  83557. func (c *RegionDisksInsertCall) Header() http.Header {
  83558. if c.header_ == nil {
  83559. c.header_ = make(http.Header)
  83560. }
  83561. return c.header_
  83562. }
  83563. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  83564. reqHeaders := make(http.Header)
  83565. for k, v := range c.header_ {
  83566. reqHeaders[k] = v
  83567. }
  83568. reqHeaders.Set("User-Agent", c.s.userAgent())
  83569. var body io.Reader = nil
  83570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  83571. if err != nil {
  83572. return nil, err
  83573. }
  83574. reqHeaders.Set("Content-Type", "application/json")
  83575. c.urlParams_.Set("alt", alt)
  83576. c.urlParams_.Set("prettyPrint", "false")
  83577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  83578. urls += "?" + c.urlParams_.Encode()
  83579. req, err := http.NewRequest("POST", urls, body)
  83580. if err != nil {
  83581. return nil, err
  83582. }
  83583. req.Header = reqHeaders
  83584. googleapi.Expand(req.URL, map[string]string{
  83585. "project": c.project,
  83586. "region": c.region,
  83587. })
  83588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83589. }
  83590. // Do executes the "compute.regionDisks.insert" call.
  83591. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83592. // status code is an error. Response headers are in either
  83593. // *Operation.ServerResponse.Header or (if a response was returned at
  83594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83595. // to check whether the returned error was because
  83596. // http.StatusNotModified was returned.
  83597. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83598. gensupport.SetOptions(c.urlParams_, opts...)
  83599. res, err := c.doRequest("json")
  83600. if res != nil && res.StatusCode == http.StatusNotModified {
  83601. if res.Body != nil {
  83602. res.Body.Close()
  83603. }
  83604. return nil, &googleapi.Error{
  83605. Code: res.StatusCode,
  83606. Header: res.Header,
  83607. }
  83608. }
  83609. if err != nil {
  83610. return nil, err
  83611. }
  83612. defer googleapi.CloseBody(res)
  83613. if err := googleapi.CheckResponse(res); err != nil {
  83614. return nil, err
  83615. }
  83616. ret := &Operation{
  83617. ServerResponse: googleapi.ServerResponse{
  83618. Header: res.Header,
  83619. HTTPStatusCode: res.StatusCode,
  83620. },
  83621. }
  83622. target := &ret
  83623. if err := gensupport.DecodeResponse(target, res); err != nil {
  83624. return nil, err
  83625. }
  83626. return ret, nil
  83627. // {
  83628. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  83629. // "httpMethod": "POST",
  83630. // "id": "compute.regionDisks.insert",
  83631. // "parameterOrder": [
  83632. // "project",
  83633. // "region"
  83634. // ],
  83635. // "parameters": {
  83636. // "project": {
  83637. // "description": "Project ID for this request.",
  83638. // "location": "path",
  83639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83640. // "required": true,
  83641. // "type": "string"
  83642. // },
  83643. // "region": {
  83644. // "description": "Name of the region for this request.",
  83645. // "location": "path",
  83646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83647. // "required": true,
  83648. // "type": "string"
  83649. // },
  83650. // "requestId": {
  83651. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83652. // "location": "query",
  83653. // "type": "string"
  83654. // },
  83655. // "sourceImage": {
  83656. // "description": "Optional. Source image to restore onto a disk.",
  83657. // "location": "query",
  83658. // "type": "string"
  83659. // }
  83660. // },
  83661. // "path": "{project}/regions/{region}/disks",
  83662. // "request": {
  83663. // "$ref": "Disk"
  83664. // },
  83665. // "response": {
  83666. // "$ref": "Operation"
  83667. // },
  83668. // "scopes": [
  83669. // "https://www.googleapis.com/auth/cloud-platform",
  83670. // "https://www.googleapis.com/auth/compute"
  83671. // ]
  83672. // }
  83673. }
  83674. // method id "compute.regionDisks.list":
  83675. type RegionDisksListCall struct {
  83676. s *Service
  83677. project string
  83678. region string
  83679. urlParams_ gensupport.URLParams
  83680. ifNoneMatch_ string
  83681. ctx_ context.Context
  83682. header_ http.Header
  83683. }
  83684. // List: Retrieves the list of persistent disks contained within the
  83685. // specified region.
  83686. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  83687. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83688. c.project = project
  83689. c.region = region
  83690. return c
  83691. }
  83692. // Filter sets the optional parameter "filter": A filter expression that
  83693. // filters resources listed in the response. The expression must specify
  83694. // the field name, a comparison operator, and the value that you want to
  83695. // use for filtering. The value must be a string, a number, or a
  83696. // boolean. The comparison operator must be either =, !=, >, or <.
  83697. //
  83698. // For example, if you are filtering Compute Engine instances, you can
  83699. // exclude instances named example-instance by specifying name !=
  83700. // example-instance.
  83701. //
  83702. // You can also filter nested fields. For example, you could specify
  83703. // scheduling.automaticRestart = false to include instances only if they
  83704. // are not scheduled for automatic restarts. You can use filtering on
  83705. // nested fields to filter based on resource labels.
  83706. //
  83707. // To filter on multiple expressions, provide each separate expression
  83708. // within parentheses. For example, (scheduling.automaticRestart = true)
  83709. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83710. // AND expression. However, you can include AND and OR expressions
  83711. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83712. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83713. // true).
  83714. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  83715. c.urlParams_.Set("filter", filter)
  83716. return c
  83717. }
  83718. // MaxResults sets the optional parameter "maxResults": The maximum
  83719. // number of results per page that should be returned. If the number of
  83720. // available results is larger than maxResults, Compute Engine returns a
  83721. // nextPageToken that can be used to get the next page of results in
  83722. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83723. // (Default: 500)
  83724. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  83725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83726. return c
  83727. }
  83728. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83729. // a certain order. By default, results are returned in alphanumerical
  83730. // order based on the resource name.
  83731. //
  83732. // You can also sort results in descending order based on the creation
  83733. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83734. // based on the creationTimestamp field in reverse chronological order
  83735. // (newest result first). Use this to sort resources like operations so
  83736. // that the newest operation is returned first.
  83737. //
  83738. // Currently, only sorting by name or creationTimestamp desc is
  83739. // supported.
  83740. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  83741. c.urlParams_.Set("orderBy", orderBy)
  83742. return c
  83743. }
  83744. // PageToken sets the optional parameter "pageToken": Specifies a page
  83745. // token to use. Set pageToken to the nextPageToken returned by a
  83746. // previous list request to get the next page of results.
  83747. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  83748. c.urlParams_.Set("pageToken", pageToken)
  83749. return c
  83750. }
  83751. // Fields allows partial responses to be retrieved. See
  83752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83753. // for more information.
  83754. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  83755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83756. return c
  83757. }
  83758. // IfNoneMatch sets the optional parameter which makes the operation
  83759. // fail if the object's ETag matches the given value. This is useful for
  83760. // getting updates only after the object has changed since the last
  83761. // request. Use googleapi.IsNotModified to check whether the response
  83762. // error from Do is the result of In-None-Match.
  83763. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  83764. c.ifNoneMatch_ = entityTag
  83765. return c
  83766. }
  83767. // Context sets the context to be used in this call's Do method. Any
  83768. // pending HTTP request will be aborted if the provided context is
  83769. // canceled.
  83770. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  83771. c.ctx_ = ctx
  83772. return c
  83773. }
  83774. // Header returns an http.Header that can be modified by the caller to
  83775. // add HTTP headers to the request.
  83776. func (c *RegionDisksListCall) Header() http.Header {
  83777. if c.header_ == nil {
  83778. c.header_ = make(http.Header)
  83779. }
  83780. return c.header_
  83781. }
  83782. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  83783. reqHeaders := make(http.Header)
  83784. for k, v := range c.header_ {
  83785. reqHeaders[k] = v
  83786. }
  83787. reqHeaders.Set("User-Agent", c.s.userAgent())
  83788. if c.ifNoneMatch_ != "" {
  83789. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83790. }
  83791. var body io.Reader = nil
  83792. c.urlParams_.Set("alt", alt)
  83793. c.urlParams_.Set("prettyPrint", "false")
  83794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  83795. urls += "?" + c.urlParams_.Encode()
  83796. req, err := http.NewRequest("GET", urls, body)
  83797. if err != nil {
  83798. return nil, err
  83799. }
  83800. req.Header = reqHeaders
  83801. googleapi.Expand(req.URL, map[string]string{
  83802. "project": c.project,
  83803. "region": c.region,
  83804. })
  83805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83806. }
  83807. // Do executes the "compute.regionDisks.list" call.
  83808. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  83809. // code is an error. Response headers are in either
  83810. // *DiskList.ServerResponse.Header or (if a response was returned at
  83811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83812. // to check whether the returned error was because
  83813. // http.StatusNotModified was returned.
  83814. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  83815. gensupport.SetOptions(c.urlParams_, opts...)
  83816. res, err := c.doRequest("json")
  83817. if res != nil && res.StatusCode == http.StatusNotModified {
  83818. if res.Body != nil {
  83819. res.Body.Close()
  83820. }
  83821. return nil, &googleapi.Error{
  83822. Code: res.StatusCode,
  83823. Header: res.Header,
  83824. }
  83825. }
  83826. if err != nil {
  83827. return nil, err
  83828. }
  83829. defer googleapi.CloseBody(res)
  83830. if err := googleapi.CheckResponse(res); err != nil {
  83831. return nil, err
  83832. }
  83833. ret := &DiskList{
  83834. ServerResponse: googleapi.ServerResponse{
  83835. Header: res.Header,
  83836. HTTPStatusCode: res.StatusCode,
  83837. },
  83838. }
  83839. target := &ret
  83840. if err := gensupport.DecodeResponse(target, res); err != nil {
  83841. return nil, err
  83842. }
  83843. return ret, nil
  83844. // {
  83845. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  83846. // "httpMethod": "GET",
  83847. // "id": "compute.regionDisks.list",
  83848. // "parameterOrder": [
  83849. // "project",
  83850. // "region"
  83851. // ],
  83852. // "parameters": {
  83853. // "filter": {
  83854. // "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).",
  83855. // "location": "query",
  83856. // "type": "string"
  83857. // },
  83858. // "maxResults": {
  83859. // "default": "500",
  83860. // "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)",
  83861. // "format": "uint32",
  83862. // "location": "query",
  83863. // "minimum": "0",
  83864. // "type": "integer"
  83865. // },
  83866. // "orderBy": {
  83867. // "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.",
  83868. // "location": "query",
  83869. // "type": "string"
  83870. // },
  83871. // "pageToken": {
  83872. // "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.",
  83873. // "location": "query",
  83874. // "type": "string"
  83875. // },
  83876. // "project": {
  83877. // "description": "Project ID for this request.",
  83878. // "location": "path",
  83879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83880. // "required": true,
  83881. // "type": "string"
  83882. // },
  83883. // "region": {
  83884. // "description": "Name of the region for this request.",
  83885. // "location": "path",
  83886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83887. // "required": true,
  83888. // "type": "string"
  83889. // }
  83890. // },
  83891. // "path": "{project}/regions/{region}/disks",
  83892. // "response": {
  83893. // "$ref": "DiskList"
  83894. // },
  83895. // "scopes": [
  83896. // "https://www.googleapis.com/auth/cloud-platform",
  83897. // "https://www.googleapis.com/auth/compute",
  83898. // "https://www.googleapis.com/auth/compute.readonly"
  83899. // ]
  83900. // }
  83901. }
  83902. // Pages invokes f for each page of results.
  83903. // A non-nil error returned from f will halt the iteration.
  83904. // The provided context supersedes any context provided to the Context method.
  83905. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  83906. c.ctx_ = ctx
  83907. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83908. for {
  83909. x, err := c.Do()
  83910. if err != nil {
  83911. return err
  83912. }
  83913. if err := f(x); err != nil {
  83914. return err
  83915. }
  83916. if x.NextPageToken == "" {
  83917. return nil
  83918. }
  83919. c.PageToken(x.NextPageToken)
  83920. }
  83921. }
  83922. // method id "compute.regionDisks.removeResourcePolicies":
  83923. type RegionDisksRemoveResourcePoliciesCall struct {
  83924. s *Service
  83925. project string
  83926. region string
  83927. disk string
  83928. regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
  83929. urlParams_ gensupport.URLParams
  83930. ctx_ context.Context
  83931. header_ http.Header
  83932. }
  83933. // RemoveResourcePolicies: Removes resource policies from a regional
  83934. // disk.
  83935. func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
  83936. c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83937. c.project = project
  83938. c.region = region
  83939. c.disk = disk
  83940. c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
  83941. return c
  83942. }
  83943. // RequestId sets the optional parameter "requestId": An optional
  83944. // request ID to identify requests. Specify a unique request ID so that
  83945. // if you must retry your request, the server will know to ignore the
  83946. // request if it has already been completed.
  83947. //
  83948. // For example, consider a situation where you make an initial request
  83949. // and the request times out. If you make the request again with the
  83950. // same request ID, the server can check if original operation with the
  83951. // same request ID was received, and if so, will ignore the second
  83952. // request. This prevents clients from accidentally creating duplicate
  83953. // commitments.
  83954. //
  83955. // The request ID must be a valid UUID with the exception that zero UUID
  83956. // is not supported (00000000-0000-0000-0000-000000000000).
  83957. func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
  83958. c.urlParams_.Set("requestId", requestId)
  83959. return c
  83960. }
  83961. // Fields allows partial responses to be retrieved. See
  83962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83963. // for more information.
  83964. func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
  83965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83966. return c
  83967. }
  83968. // Context sets the context to be used in this call's Do method. Any
  83969. // pending HTTP request will be aborted if the provided context is
  83970. // canceled.
  83971. func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
  83972. c.ctx_ = ctx
  83973. return c
  83974. }
  83975. // Header returns an http.Header that can be modified by the caller to
  83976. // add HTTP headers to the request.
  83977. func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
  83978. if c.header_ == nil {
  83979. c.header_ = make(http.Header)
  83980. }
  83981. return c.header_
  83982. }
  83983. func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  83984. reqHeaders := make(http.Header)
  83985. for k, v := range c.header_ {
  83986. reqHeaders[k] = v
  83987. }
  83988. reqHeaders.Set("User-Agent", c.s.userAgent())
  83989. var body io.Reader = nil
  83990. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
  83991. if err != nil {
  83992. return nil, err
  83993. }
  83994. reqHeaders.Set("Content-Type", "application/json")
  83995. c.urlParams_.Set("alt", alt)
  83996. c.urlParams_.Set("prettyPrint", "false")
  83997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
  83998. urls += "?" + c.urlParams_.Encode()
  83999. req, err := http.NewRequest("POST", urls, body)
  84000. if err != nil {
  84001. return nil, err
  84002. }
  84003. req.Header = reqHeaders
  84004. googleapi.Expand(req.URL, map[string]string{
  84005. "project": c.project,
  84006. "region": c.region,
  84007. "disk": c.disk,
  84008. })
  84009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84010. }
  84011. // Do executes the "compute.regionDisks.removeResourcePolicies" call.
  84012. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84013. // status code is an error. Response headers are in either
  84014. // *Operation.ServerResponse.Header or (if a response was returned at
  84015. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84016. // to check whether the returned error was because
  84017. // http.StatusNotModified was returned.
  84018. func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84019. gensupport.SetOptions(c.urlParams_, opts...)
  84020. res, err := c.doRequest("json")
  84021. if res != nil && res.StatusCode == http.StatusNotModified {
  84022. if res.Body != nil {
  84023. res.Body.Close()
  84024. }
  84025. return nil, &googleapi.Error{
  84026. Code: res.StatusCode,
  84027. Header: res.Header,
  84028. }
  84029. }
  84030. if err != nil {
  84031. return nil, err
  84032. }
  84033. defer googleapi.CloseBody(res)
  84034. if err := googleapi.CheckResponse(res); err != nil {
  84035. return nil, err
  84036. }
  84037. ret := &Operation{
  84038. ServerResponse: googleapi.ServerResponse{
  84039. Header: res.Header,
  84040. HTTPStatusCode: res.StatusCode,
  84041. },
  84042. }
  84043. target := &ret
  84044. if err := gensupport.DecodeResponse(target, res); err != nil {
  84045. return nil, err
  84046. }
  84047. return ret, nil
  84048. // {
  84049. // "description": "Removes resource policies from a regional disk.",
  84050. // "httpMethod": "POST",
  84051. // "id": "compute.regionDisks.removeResourcePolicies",
  84052. // "parameterOrder": [
  84053. // "project",
  84054. // "region",
  84055. // "disk"
  84056. // ],
  84057. // "parameters": {
  84058. // "disk": {
  84059. // "description": "The disk name for this request.",
  84060. // "location": "path",
  84061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84062. // "required": true,
  84063. // "type": "string"
  84064. // },
  84065. // "project": {
  84066. // "description": "Project ID for this request.",
  84067. // "location": "path",
  84068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84069. // "required": true,
  84070. // "type": "string"
  84071. // },
  84072. // "region": {
  84073. // "description": "The name of the region for this request.",
  84074. // "location": "path",
  84075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84076. // "required": true,
  84077. // "type": "string"
  84078. // },
  84079. // "requestId": {
  84080. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84081. // "location": "query",
  84082. // "type": "string"
  84083. // }
  84084. // },
  84085. // "path": "{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
  84086. // "request": {
  84087. // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
  84088. // },
  84089. // "response": {
  84090. // "$ref": "Operation"
  84091. // },
  84092. // "scopes": [
  84093. // "https://www.googleapis.com/auth/cloud-platform",
  84094. // "https://www.googleapis.com/auth/compute"
  84095. // ]
  84096. // }
  84097. }
  84098. // method id "compute.regionDisks.resize":
  84099. type RegionDisksResizeCall struct {
  84100. s *Service
  84101. project string
  84102. region string
  84103. disk string
  84104. regiondisksresizerequest *RegionDisksResizeRequest
  84105. urlParams_ gensupport.URLParams
  84106. ctx_ context.Context
  84107. header_ http.Header
  84108. }
  84109. // Resize: Resizes the specified regional persistent disk.
  84110. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  84111. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84112. c.project = project
  84113. c.region = region
  84114. c.disk = disk
  84115. c.regiondisksresizerequest = regiondisksresizerequest
  84116. return c
  84117. }
  84118. // RequestId sets the optional parameter "requestId": An optional
  84119. // request ID to identify requests. Specify a unique request ID so that
  84120. // if you must retry your request, the server will know to ignore the
  84121. // request if it has already been completed.
  84122. //
  84123. // For example, consider a situation where you make an initial request
  84124. // and the request times out. If you make the request again with the
  84125. // same request ID, the server can check if original operation with the
  84126. // same request ID was received, and if so, will ignore the second
  84127. // request. This prevents clients from accidentally creating duplicate
  84128. // commitments.
  84129. //
  84130. // The request ID must be a valid UUID with the exception that zero UUID
  84131. // is not supported (00000000-0000-0000-0000-000000000000).
  84132. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  84133. c.urlParams_.Set("requestId", requestId)
  84134. return c
  84135. }
  84136. // Fields allows partial responses to be retrieved. See
  84137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84138. // for more information.
  84139. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  84140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84141. return c
  84142. }
  84143. // Context sets the context to be used in this call's Do method. Any
  84144. // pending HTTP request will be aborted if the provided context is
  84145. // canceled.
  84146. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  84147. c.ctx_ = ctx
  84148. return c
  84149. }
  84150. // Header returns an http.Header that can be modified by the caller to
  84151. // add HTTP headers to the request.
  84152. func (c *RegionDisksResizeCall) Header() http.Header {
  84153. if c.header_ == nil {
  84154. c.header_ = make(http.Header)
  84155. }
  84156. return c.header_
  84157. }
  84158. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  84159. reqHeaders := make(http.Header)
  84160. for k, v := range c.header_ {
  84161. reqHeaders[k] = v
  84162. }
  84163. reqHeaders.Set("User-Agent", c.s.userAgent())
  84164. var body io.Reader = nil
  84165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  84166. if err != nil {
  84167. return nil, err
  84168. }
  84169. reqHeaders.Set("Content-Type", "application/json")
  84170. c.urlParams_.Set("alt", alt)
  84171. c.urlParams_.Set("prettyPrint", "false")
  84172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  84173. urls += "?" + c.urlParams_.Encode()
  84174. req, err := http.NewRequest("POST", urls, body)
  84175. if err != nil {
  84176. return nil, err
  84177. }
  84178. req.Header = reqHeaders
  84179. googleapi.Expand(req.URL, map[string]string{
  84180. "project": c.project,
  84181. "region": c.region,
  84182. "disk": c.disk,
  84183. })
  84184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84185. }
  84186. // Do executes the "compute.regionDisks.resize" call.
  84187. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84188. // status code is an error. Response headers are in either
  84189. // *Operation.ServerResponse.Header or (if a response was returned at
  84190. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84191. // to check whether the returned error was because
  84192. // http.StatusNotModified was returned.
  84193. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84194. gensupport.SetOptions(c.urlParams_, opts...)
  84195. res, err := c.doRequest("json")
  84196. if res != nil && res.StatusCode == http.StatusNotModified {
  84197. if res.Body != nil {
  84198. res.Body.Close()
  84199. }
  84200. return nil, &googleapi.Error{
  84201. Code: res.StatusCode,
  84202. Header: res.Header,
  84203. }
  84204. }
  84205. if err != nil {
  84206. return nil, err
  84207. }
  84208. defer googleapi.CloseBody(res)
  84209. if err := googleapi.CheckResponse(res); err != nil {
  84210. return nil, err
  84211. }
  84212. ret := &Operation{
  84213. ServerResponse: googleapi.ServerResponse{
  84214. Header: res.Header,
  84215. HTTPStatusCode: res.StatusCode,
  84216. },
  84217. }
  84218. target := &ret
  84219. if err := gensupport.DecodeResponse(target, res); err != nil {
  84220. return nil, err
  84221. }
  84222. return ret, nil
  84223. // {
  84224. // "description": "Resizes the specified regional persistent disk.",
  84225. // "httpMethod": "POST",
  84226. // "id": "compute.regionDisks.resize",
  84227. // "parameterOrder": [
  84228. // "project",
  84229. // "region",
  84230. // "disk"
  84231. // ],
  84232. // "parameters": {
  84233. // "disk": {
  84234. // "description": "Name of the regional persistent disk.",
  84235. // "location": "path",
  84236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84237. // "required": true,
  84238. // "type": "string"
  84239. // },
  84240. // "project": {
  84241. // "description": "The project ID for this request.",
  84242. // "location": "path",
  84243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84244. // "required": true,
  84245. // "type": "string"
  84246. // },
  84247. // "region": {
  84248. // "description": "Name of the region for this request.",
  84249. // "location": "path",
  84250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84251. // "required": true,
  84252. // "type": "string"
  84253. // },
  84254. // "requestId": {
  84255. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84256. // "location": "query",
  84257. // "type": "string"
  84258. // }
  84259. // },
  84260. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  84261. // "request": {
  84262. // "$ref": "RegionDisksResizeRequest"
  84263. // },
  84264. // "response": {
  84265. // "$ref": "Operation"
  84266. // },
  84267. // "scopes": [
  84268. // "https://www.googleapis.com/auth/cloud-platform",
  84269. // "https://www.googleapis.com/auth/compute"
  84270. // ]
  84271. // }
  84272. }
  84273. // method id "compute.regionDisks.setLabels":
  84274. type RegionDisksSetLabelsCall struct {
  84275. s *Service
  84276. project string
  84277. region string
  84278. resource string
  84279. regionsetlabelsrequest *RegionSetLabelsRequest
  84280. urlParams_ gensupport.URLParams
  84281. ctx_ context.Context
  84282. header_ http.Header
  84283. }
  84284. // SetLabels: Sets the labels on the target regional disk.
  84285. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  84286. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84287. c.project = project
  84288. c.region = region
  84289. c.resource = resource
  84290. c.regionsetlabelsrequest = regionsetlabelsrequest
  84291. return c
  84292. }
  84293. // RequestId sets the optional parameter "requestId": An optional
  84294. // request ID to identify requests. Specify a unique request ID so that
  84295. // if you must retry your request, the server will know to ignore the
  84296. // request if it has already been completed.
  84297. //
  84298. // For example, consider a situation where you make an initial request
  84299. // and the request times out. If you make the request again with the
  84300. // same request ID, the server can check if original operation with the
  84301. // same request ID was received, and if so, will ignore the second
  84302. // request. This prevents clients from accidentally creating duplicate
  84303. // commitments.
  84304. //
  84305. // The request ID must be a valid UUID with the exception that zero UUID
  84306. // is not supported (00000000-0000-0000-0000-000000000000).
  84307. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  84308. c.urlParams_.Set("requestId", requestId)
  84309. return c
  84310. }
  84311. // Fields allows partial responses to be retrieved. See
  84312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84313. // for more information.
  84314. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  84315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84316. return c
  84317. }
  84318. // Context sets the context to be used in this call's Do method. Any
  84319. // pending HTTP request will be aborted if the provided context is
  84320. // canceled.
  84321. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  84322. c.ctx_ = ctx
  84323. return c
  84324. }
  84325. // Header returns an http.Header that can be modified by the caller to
  84326. // add HTTP headers to the request.
  84327. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  84328. if c.header_ == nil {
  84329. c.header_ = make(http.Header)
  84330. }
  84331. return c.header_
  84332. }
  84333. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  84334. reqHeaders := make(http.Header)
  84335. for k, v := range c.header_ {
  84336. reqHeaders[k] = v
  84337. }
  84338. reqHeaders.Set("User-Agent", c.s.userAgent())
  84339. var body io.Reader = nil
  84340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  84341. if err != nil {
  84342. return nil, err
  84343. }
  84344. reqHeaders.Set("Content-Type", "application/json")
  84345. c.urlParams_.Set("alt", alt)
  84346. c.urlParams_.Set("prettyPrint", "false")
  84347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  84348. urls += "?" + c.urlParams_.Encode()
  84349. req, err := http.NewRequest("POST", urls, body)
  84350. if err != nil {
  84351. return nil, err
  84352. }
  84353. req.Header = reqHeaders
  84354. googleapi.Expand(req.URL, map[string]string{
  84355. "project": c.project,
  84356. "region": c.region,
  84357. "resource": c.resource,
  84358. })
  84359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84360. }
  84361. // Do executes the "compute.regionDisks.setLabels" call.
  84362. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84363. // status code is an error. Response headers are in either
  84364. // *Operation.ServerResponse.Header or (if a response was returned at
  84365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84366. // to check whether the returned error was because
  84367. // http.StatusNotModified was returned.
  84368. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84369. gensupport.SetOptions(c.urlParams_, opts...)
  84370. res, err := c.doRequest("json")
  84371. if res != nil && res.StatusCode == http.StatusNotModified {
  84372. if res.Body != nil {
  84373. res.Body.Close()
  84374. }
  84375. return nil, &googleapi.Error{
  84376. Code: res.StatusCode,
  84377. Header: res.Header,
  84378. }
  84379. }
  84380. if err != nil {
  84381. return nil, err
  84382. }
  84383. defer googleapi.CloseBody(res)
  84384. if err := googleapi.CheckResponse(res); err != nil {
  84385. return nil, err
  84386. }
  84387. ret := &Operation{
  84388. ServerResponse: googleapi.ServerResponse{
  84389. Header: res.Header,
  84390. HTTPStatusCode: res.StatusCode,
  84391. },
  84392. }
  84393. target := &ret
  84394. if err := gensupport.DecodeResponse(target, res); err != nil {
  84395. return nil, err
  84396. }
  84397. return ret, nil
  84398. // {
  84399. // "description": "Sets the labels on the target regional disk.",
  84400. // "httpMethod": "POST",
  84401. // "id": "compute.regionDisks.setLabels",
  84402. // "parameterOrder": [
  84403. // "project",
  84404. // "region",
  84405. // "resource"
  84406. // ],
  84407. // "parameters": {
  84408. // "project": {
  84409. // "description": "Project ID for this request.",
  84410. // "location": "path",
  84411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84412. // "required": true,
  84413. // "type": "string"
  84414. // },
  84415. // "region": {
  84416. // "description": "The region for this request.",
  84417. // "location": "path",
  84418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84419. // "required": true,
  84420. // "type": "string"
  84421. // },
  84422. // "requestId": {
  84423. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84424. // "location": "query",
  84425. // "type": "string"
  84426. // },
  84427. // "resource": {
  84428. // "description": "Name or id of the resource for this request.",
  84429. // "location": "path",
  84430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84431. // "required": true,
  84432. // "type": "string"
  84433. // }
  84434. // },
  84435. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  84436. // "request": {
  84437. // "$ref": "RegionSetLabelsRequest"
  84438. // },
  84439. // "response": {
  84440. // "$ref": "Operation"
  84441. // },
  84442. // "scopes": [
  84443. // "https://www.googleapis.com/auth/cloud-platform",
  84444. // "https://www.googleapis.com/auth/compute"
  84445. // ]
  84446. // }
  84447. }
  84448. // method id "compute.regionDisks.testIamPermissions":
  84449. type RegionDisksTestIamPermissionsCall struct {
  84450. s *Service
  84451. project string
  84452. region string
  84453. resource string
  84454. testpermissionsrequest *TestPermissionsRequest
  84455. urlParams_ gensupport.URLParams
  84456. ctx_ context.Context
  84457. header_ http.Header
  84458. }
  84459. // TestIamPermissions: Returns permissions that a caller has on the
  84460. // specified resource.
  84461. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  84462. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84463. c.project = project
  84464. c.region = region
  84465. c.resource = resource
  84466. c.testpermissionsrequest = testpermissionsrequest
  84467. return c
  84468. }
  84469. // Fields allows partial responses to be retrieved. See
  84470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84471. // for more information.
  84472. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  84473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84474. return c
  84475. }
  84476. // Context sets the context to be used in this call's Do method. Any
  84477. // pending HTTP request will be aborted if the provided context is
  84478. // canceled.
  84479. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  84480. c.ctx_ = ctx
  84481. return c
  84482. }
  84483. // Header returns an http.Header that can be modified by the caller to
  84484. // add HTTP headers to the request.
  84485. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  84486. if c.header_ == nil {
  84487. c.header_ = make(http.Header)
  84488. }
  84489. return c.header_
  84490. }
  84491. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84492. reqHeaders := make(http.Header)
  84493. for k, v := range c.header_ {
  84494. reqHeaders[k] = v
  84495. }
  84496. reqHeaders.Set("User-Agent", c.s.userAgent())
  84497. var body io.Reader = nil
  84498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84499. if err != nil {
  84500. return nil, err
  84501. }
  84502. reqHeaders.Set("Content-Type", "application/json")
  84503. c.urlParams_.Set("alt", alt)
  84504. c.urlParams_.Set("prettyPrint", "false")
  84505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  84506. urls += "?" + c.urlParams_.Encode()
  84507. req, err := http.NewRequest("POST", urls, body)
  84508. if err != nil {
  84509. return nil, err
  84510. }
  84511. req.Header = reqHeaders
  84512. googleapi.Expand(req.URL, map[string]string{
  84513. "project": c.project,
  84514. "region": c.region,
  84515. "resource": c.resource,
  84516. })
  84517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84518. }
  84519. // Do executes the "compute.regionDisks.testIamPermissions" call.
  84520. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84521. // non-2xx status code is an error. Response headers are in either
  84522. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84523. // returned at all) in error.(*googleapi.Error).Header. Use
  84524. // googleapi.IsNotModified to check whether the returned error was
  84525. // because http.StatusNotModified was returned.
  84526. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84527. gensupport.SetOptions(c.urlParams_, opts...)
  84528. res, err := c.doRequest("json")
  84529. if res != nil && res.StatusCode == http.StatusNotModified {
  84530. if res.Body != nil {
  84531. res.Body.Close()
  84532. }
  84533. return nil, &googleapi.Error{
  84534. Code: res.StatusCode,
  84535. Header: res.Header,
  84536. }
  84537. }
  84538. if err != nil {
  84539. return nil, err
  84540. }
  84541. defer googleapi.CloseBody(res)
  84542. if err := googleapi.CheckResponse(res); err != nil {
  84543. return nil, err
  84544. }
  84545. ret := &TestPermissionsResponse{
  84546. ServerResponse: googleapi.ServerResponse{
  84547. Header: res.Header,
  84548. HTTPStatusCode: res.StatusCode,
  84549. },
  84550. }
  84551. target := &ret
  84552. if err := gensupport.DecodeResponse(target, res); err != nil {
  84553. return nil, err
  84554. }
  84555. return ret, nil
  84556. // {
  84557. // "description": "Returns permissions that a caller has on the specified resource.",
  84558. // "httpMethod": "POST",
  84559. // "id": "compute.regionDisks.testIamPermissions",
  84560. // "parameterOrder": [
  84561. // "project",
  84562. // "region",
  84563. // "resource"
  84564. // ],
  84565. // "parameters": {
  84566. // "project": {
  84567. // "description": "Project ID for this request.",
  84568. // "location": "path",
  84569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84570. // "required": true,
  84571. // "type": "string"
  84572. // },
  84573. // "region": {
  84574. // "description": "The name of the region for this request.",
  84575. // "location": "path",
  84576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84577. // "required": true,
  84578. // "type": "string"
  84579. // },
  84580. // "resource": {
  84581. // "description": "Name or id of the resource for this request.",
  84582. // "location": "path",
  84583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84584. // "required": true,
  84585. // "type": "string"
  84586. // }
  84587. // },
  84588. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  84589. // "request": {
  84590. // "$ref": "TestPermissionsRequest"
  84591. // },
  84592. // "response": {
  84593. // "$ref": "TestPermissionsResponse"
  84594. // },
  84595. // "scopes": [
  84596. // "https://www.googleapis.com/auth/cloud-platform",
  84597. // "https://www.googleapis.com/auth/compute",
  84598. // "https://www.googleapis.com/auth/compute.readonly"
  84599. // ]
  84600. // }
  84601. }
  84602. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  84603. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  84604. s *Service
  84605. project string
  84606. region string
  84607. instanceGroupManager string
  84608. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  84609. urlParams_ gensupport.URLParams
  84610. ctx_ context.Context
  84611. header_ http.Header
  84612. }
  84613. // AbandonInstances: Flags the specified instances to be immediately
  84614. // removed from the managed instance group. Abandoning an instance does
  84615. // not delete the instance, but it does remove the instance from any
  84616. // target pools that are applied by the managed instance group. This
  84617. // method reduces the targetSize of the managed instance group by the
  84618. // number of instances that you abandon. This operation is marked as
  84619. // DONE when the action is scheduled even if the instances have not yet
  84620. // been removed from the group. You must separately verify the status of
  84621. // the abandoning action with the listmanagedinstances method.
  84622. //
  84623. // If the group is part of a backend service that has enabled connection
  84624. // draining, it can take up to 60 seconds after the connection draining
  84625. // duration has elapsed before the VM instance is removed or
  84626. // deleted.
  84627. //
  84628. // You can specify a maximum of 1000 instances with this method per
  84629. // request.
  84630. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  84631. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84632. c.project = project
  84633. c.region = region
  84634. c.instanceGroupManager = instanceGroupManager
  84635. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  84636. return c
  84637. }
  84638. // RequestId sets the optional parameter "requestId": An optional
  84639. // request ID to identify requests. Specify a unique request ID so that
  84640. // if you must retry your request, the server will know to ignore the
  84641. // request if it has already been completed.
  84642. //
  84643. // For example, consider a situation where you make an initial request
  84644. // and the request times out. If you make the request again with the
  84645. // same request ID, the server can check if original operation with the
  84646. // same request ID was received, and if so, will ignore the second
  84647. // request. This prevents clients from accidentally creating duplicate
  84648. // commitments.
  84649. //
  84650. // The request ID must be a valid UUID with the exception that zero UUID
  84651. // is not supported (00000000-0000-0000-0000-000000000000).
  84652. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  84653. c.urlParams_.Set("requestId", requestId)
  84654. return c
  84655. }
  84656. // Fields allows partial responses to be retrieved. See
  84657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84658. // for more information.
  84659. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  84660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84661. return c
  84662. }
  84663. // Context sets the context to be used in this call's Do method. Any
  84664. // pending HTTP request will be aborted if the provided context is
  84665. // canceled.
  84666. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  84667. c.ctx_ = ctx
  84668. return c
  84669. }
  84670. // Header returns an http.Header that can be modified by the caller to
  84671. // add HTTP headers to the request.
  84672. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  84673. if c.header_ == nil {
  84674. c.header_ = make(http.Header)
  84675. }
  84676. return c.header_
  84677. }
  84678. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  84679. reqHeaders := make(http.Header)
  84680. for k, v := range c.header_ {
  84681. reqHeaders[k] = v
  84682. }
  84683. reqHeaders.Set("User-Agent", c.s.userAgent())
  84684. var body io.Reader = nil
  84685. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  84686. if err != nil {
  84687. return nil, err
  84688. }
  84689. reqHeaders.Set("Content-Type", "application/json")
  84690. c.urlParams_.Set("alt", alt)
  84691. c.urlParams_.Set("prettyPrint", "false")
  84692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  84693. urls += "?" + c.urlParams_.Encode()
  84694. req, err := http.NewRequest("POST", urls, body)
  84695. if err != nil {
  84696. return nil, err
  84697. }
  84698. req.Header = reqHeaders
  84699. googleapi.Expand(req.URL, map[string]string{
  84700. "project": c.project,
  84701. "region": c.region,
  84702. "instanceGroupManager": c.instanceGroupManager,
  84703. })
  84704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84705. }
  84706. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  84707. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84708. // status code is an error. Response headers are in either
  84709. // *Operation.ServerResponse.Header or (if a response was returned at
  84710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84711. // to check whether the returned error was because
  84712. // http.StatusNotModified was returned.
  84713. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84714. gensupport.SetOptions(c.urlParams_, opts...)
  84715. res, err := c.doRequest("json")
  84716. if res != nil && res.StatusCode == http.StatusNotModified {
  84717. if res.Body != nil {
  84718. res.Body.Close()
  84719. }
  84720. return nil, &googleapi.Error{
  84721. Code: res.StatusCode,
  84722. Header: res.Header,
  84723. }
  84724. }
  84725. if err != nil {
  84726. return nil, err
  84727. }
  84728. defer googleapi.CloseBody(res)
  84729. if err := googleapi.CheckResponse(res); err != nil {
  84730. return nil, err
  84731. }
  84732. ret := &Operation{
  84733. ServerResponse: googleapi.ServerResponse{
  84734. Header: res.Header,
  84735. HTTPStatusCode: res.StatusCode,
  84736. },
  84737. }
  84738. target := &ret
  84739. if err := gensupport.DecodeResponse(target, res); err != nil {
  84740. return nil, err
  84741. }
  84742. return ret, nil
  84743. // {
  84744. // "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.",
  84745. // "httpMethod": "POST",
  84746. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  84747. // "parameterOrder": [
  84748. // "project",
  84749. // "region",
  84750. // "instanceGroupManager"
  84751. // ],
  84752. // "parameters": {
  84753. // "instanceGroupManager": {
  84754. // "description": "Name of the managed instance group.",
  84755. // "location": "path",
  84756. // "required": true,
  84757. // "type": "string"
  84758. // },
  84759. // "project": {
  84760. // "description": "Project ID for this request.",
  84761. // "location": "path",
  84762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84763. // "required": true,
  84764. // "type": "string"
  84765. // },
  84766. // "region": {
  84767. // "description": "Name of the region scoping this request.",
  84768. // "location": "path",
  84769. // "required": true,
  84770. // "type": "string"
  84771. // },
  84772. // "requestId": {
  84773. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84774. // "location": "query",
  84775. // "type": "string"
  84776. // }
  84777. // },
  84778. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  84779. // "request": {
  84780. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  84781. // },
  84782. // "response": {
  84783. // "$ref": "Operation"
  84784. // },
  84785. // "scopes": [
  84786. // "https://www.googleapis.com/auth/cloud-platform",
  84787. // "https://www.googleapis.com/auth/compute"
  84788. // ]
  84789. // }
  84790. }
  84791. // method id "compute.regionInstanceGroupManagers.delete":
  84792. type RegionInstanceGroupManagersDeleteCall struct {
  84793. s *Service
  84794. project string
  84795. region string
  84796. instanceGroupManager string
  84797. urlParams_ gensupport.URLParams
  84798. ctx_ context.Context
  84799. header_ http.Header
  84800. }
  84801. // Delete: Deletes the specified managed instance group and all of the
  84802. // instances in that group.
  84803. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  84804. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84805. c.project = project
  84806. c.region = region
  84807. c.instanceGroupManager = instanceGroupManager
  84808. return c
  84809. }
  84810. // RequestId sets the optional parameter "requestId": An optional
  84811. // request ID to identify requests. Specify a unique request ID so that
  84812. // if you must retry your request, the server will know to ignore the
  84813. // request if it has already been completed.
  84814. //
  84815. // For example, consider a situation where you make an initial request
  84816. // and the request times out. If you make the request again with the
  84817. // same request ID, the server can check if original operation with the
  84818. // same request ID was received, and if so, will ignore the second
  84819. // request. This prevents clients from accidentally creating duplicate
  84820. // commitments.
  84821. //
  84822. // The request ID must be a valid UUID with the exception that zero UUID
  84823. // is not supported (00000000-0000-0000-0000-000000000000).
  84824. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  84825. c.urlParams_.Set("requestId", requestId)
  84826. return c
  84827. }
  84828. // Fields allows partial responses to be retrieved. See
  84829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84830. // for more information.
  84831. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  84832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84833. return c
  84834. }
  84835. // Context sets the context to be used in this call's Do method. Any
  84836. // pending HTTP request will be aborted if the provided context is
  84837. // canceled.
  84838. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  84839. c.ctx_ = ctx
  84840. return c
  84841. }
  84842. // Header returns an http.Header that can be modified by the caller to
  84843. // add HTTP headers to the request.
  84844. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  84845. if c.header_ == nil {
  84846. c.header_ = make(http.Header)
  84847. }
  84848. return c.header_
  84849. }
  84850. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  84851. reqHeaders := make(http.Header)
  84852. for k, v := range c.header_ {
  84853. reqHeaders[k] = v
  84854. }
  84855. reqHeaders.Set("User-Agent", c.s.userAgent())
  84856. var body io.Reader = nil
  84857. c.urlParams_.Set("alt", alt)
  84858. c.urlParams_.Set("prettyPrint", "false")
  84859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  84860. urls += "?" + c.urlParams_.Encode()
  84861. req, err := http.NewRequest("DELETE", urls, body)
  84862. if err != nil {
  84863. return nil, err
  84864. }
  84865. req.Header = reqHeaders
  84866. googleapi.Expand(req.URL, map[string]string{
  84867. "project": c.project,
  84868. "region": c.region,
  84869. "instanceGroupManager": c.instanceGroupManager,
  84870. })
  84871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84872. }
  84873. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  84874. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84875. // status code is an error. Response headers are in either
  84876. // *Operation.ServerResponse.Header or (if a response was returned at
  84877. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84878. // to check whether the returned error was because
  84879. // http.StatusNotModified was returned.
  84880. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84881. gensupport.SetOptions(c.urlParams_, opts...)
  84882. res, err := c.doRequest("json")
  84883. if res != nil && res.StatusCode == http.StatusNotModified {
  84884. if res.Body != nil {
  84885. res.Body.Close()
  84886. }
  84887. return nil, &googleapi.Error{
  84888. Code: res.StatusCode,
  84889. Header: res.Header,
  84890. }
  84891. }
  84892. if err != nil {
  84893. return nil, err
  84894. }
  84895. defer googleapi.CloseBody(res)
  84896. if err := googleapi.CheckResponse(res); err != nil {
  84897. return nil, err
  84898. }
  84899. ret := &Operation{
  84900. ServerResponse: googleapi.ServerResponse{
  84901. Header: res.Header,
  84902. HTTPStatusCode: res.StatusCode,
  84903. },
  84904. }
  84905. target := &ret
  84906. if err := gensupport.DecodeResponse(target, res); err != nil {
  84907. return nil, err
  84908. }
  84909. return ret, nil
  84910. // {
  84911. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  84912. // "httpMethod": "DELETE",
  84913. // "id": "compute.regionInstanceGroupManagers.delete",
  84914. // "parameterOrder": [
  84915. // "project",
  84916. // "region",
  84917. // "instanceGroupManager"
  84918. // ],
  84919. // "parameters": {
  84920. // "instanceGroupManager": {
  84921. // "description": "Name of the managed instance group to delete.",
  84922. // "location": "path",
  84923. // "required": true,
  84924. // "type": "string"
  84925. // },
  84926. // "project": {
  84927. // "description": "Project ID for this request.",
  84928. // "location": "path",
  84929. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84930. // "required": true,
  84931. // "type": "string"
  84932. // },
  84933. // "region": {
  84934. // "description": "Name of the region scoping this request.",
  84935. // "location": "path",
  84936. // "required": true,
  84937. // "type": "string"
  84938. // },
  84939. // "requestId": {
  84940. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84941. // "location": "query",
  84942. // "type": "string"
  84943. // }
  84944. // },
  84945. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  84946. // "response": {
  84947. // "$ref": "Operation"
  84948. // },
  84949. // "scopes": [
  84950. // "https://www.googleapis.com/auth/cloud-platform",
  84951. // "https://www.googleapis.com/auth/compute"
  84952. // ]
  84953. // }
  84954. }
  84955. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  84956. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  84957. s *Service
  84958. project string
  84959. region string
  84960. instanceGroupManager string
  84961. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  84962. urlParams_ gensupport.URLParams
  84963. ctx_ context.Context
  84964. header_ http.Header
  84965. }
  84966. // DeleteInstances: Flags the specified instances in the managed
  84967. // instance group to be immediately deleted. The instances are also
  84968. // removed from any target pools of which they were a member. This
  84969. // method reduces the targetSize of the managed instance group by the
  84970. // number of instances that you delete. The deleteInstances operation is
  84971. // marked DONE if the deleteInstances request is successful. The
  84972. // underlying actions take additional time. You must separately verify
  84973. // the status of the deleting action with the listmanagedinstances
  84974. // method.
  84975. //
  84976. // If the group is part of a backend service that has enabled connection
  84977. // draining, it can take up to 60 seconds after the connection draining
  84978. // duration has elapsed before the VM instance is removed or
  84979. // deleted.
  84980. //
  84981. // You can specify a maximum of 1000 instances with this method per
  84982. // request.
  84983. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  84984. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84985. c.project = project
  84986. c.region = region
  84987. c.instanceGroupManager = instanceGroupManager
  84988. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  84989. return c
  84990. }
  84991. // RequestId sets the optional parameter "requestId": An optional
  84992. // request ID to identify requests. Specify a unique request ID so that
  84993. // if you must retry your request, the server will know to ignore the
  84994. // request if it has already been completed.
  84995. //
  84996. // For example, consider a situation where you make an initial request
  84997. // and the request times out. If you make the request again with the
  84998. // same request ID, the server can check if original operation with the
  84999. // same request ID was received, and if so, will ignore the second
  85000. // request. This prevents clients from accidentally creating duplicate
  85001. // commitments.
  85002. //
  85003. // The request ID must be a valid UUID with the exception that zero UUID
  85004. // is not supported (00000000-0000-0000-0000-000000000000).
  85005. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  85006. c.urlParams_.Set("requestId", requestId)
  85007. return c
  85008. }
  85009. // Fields allows partial responses to be retrieved. See
  85010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85011. // for more information.
  85012. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  85013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85014. return c
  85015. }
  85016. // Context sets the context to be used in this call's Do method. Any
  85017. // pending HTTP request will be aborted if the provided context is
  85018. // canceled.
  85019. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  85020. c.ctx_ = ctx
  85021. return c
  85022. }
  85023. // Header returns an http.Header that can be modified by the caller to
  85024. // add HTTP headers to the request.
  85025. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  85026. if c.header_ == nil {
  85027. c.header_ = make(http.Header)
  85028. }
  85029. return c.header_
  85030. }
  85031. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  85032. reqHeaders := make(http.Header)
  85033. for k, v := range c.header_ {
  85034. reqHeaders[k] = v
  85035. }
  85036. reqHeaders.Set("User-Agent", c.s.userAgent())
  85037. var body io.Reader = nil
  85038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  85039. if err != nil {
  85040. return nil, err
  85041. }
  85042. reqHeaders.Set("Content-Type", "application/json")
  85043. c.urlParams_.Set("alt", alt)
  85044. c.urlParams_.Set("prettyPrint", "false")
  85045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  85046. urls += "?" + c.urlParams_.Encode()
  85047. req, err := http.NewRequest("POST", urls, body)
  85048. if err != nil {
  85049. return nil, err
  85050. }
  85051. req.Header = reqHeaders
  85052. googleapi.Expand(req.URL, map[string]string{
  85053. "project": c.project,
  85054. "region": c.region,
  85055. "instanceGroupManager": c.instanceGroupManager,
  85056. })
  85057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85058. }
  85059. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  85060. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85061. // status code is an error. Response headers are in either
  85062. // *Operation.ServerResponse.Header or (if a response was returned at
  85063. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85064. // to check whether the returned error was because
  85065. // http.StatusNotModified was returned.
  85066. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85067. gensupport.SetOptions(c.urlParams_, opts...)
  85068. res, err := c.doRequest("json")
  85069. if res != nil && res.StatusCode == http.StatusNotModified {
  85070. if res.Body != nil {
  85071. res.Body.Close()
  85072. }
  85073. return nil, &googleapi.Error{
  85074. Code: res.StatusCode,
  85075. Header: res.Header,
  85076. }
  85077. }
  85078. if err != nil {
  85079. return nil, err
  85080. }
  85081. defer googleapi.CloseBody(res)
  85082. if err := googleapi.CheckResponse(res); err != nil {
  85083. return nil, err
  85084. }
  85085. ret := &Operation{
  85086. ServerResponse: googleapi.ServerResponse{
  85087. Header: res.Header,
  85088. HTTPStatusCode: res.StatusCode,
  85089. },
  85090. }
  85091. target := &ret
  85092. if err := gensupport.DecodeResponse(target, res); err != nil {
  85093. return nil, err
  85094. }
  85095. return ret, nil
  85096. // {
  85097. // "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.",
  85098. // "httpMethod": "POST",
  85099. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  85100. // "parameterOrder": [
  85101. // "project",
  85102. // "region",
  85103. // "instanceGroupManager"
  85104. // ],
  85105. // "parameters": {
  85106. // "instanceGroupManager": {
  85107. // "description": "Name of the managed instance group.",
  85108. // "location": "path",
  85109. // "required": true,
  85110. // "type": "string"
  85111. // },
  85112. // "project": {
  85113. // "description": "Project ID for this request.",
  85114. // "location": "path",
  85115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85116. // "required": true,
  85117. // "type": "string"
  85118. // },
  85119. // "region": {
  85120. // "description": "Name of the region scoping this request.",
  85121. // "location": "path",
  85122. // "required": true,
  85123. // "type": "string"
  85124. // },
  85125. // "requestId": {
  85126. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85127. // "location": "query",
  85128. // "type": "string"
  85129. // }
  85130. // },
  85131. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  85132. // "request": {
  85133. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  85134. // },
  85135. // "response": {
  85136. // "$ref": "Operation"
  85137. // },
  85138. // "scopes": [
  85139. // "https://www.googleapis.com/auth/cloud-platform",
  85140. // "https://www.googleapis.com/auth/compute"
  85141. // ]
  85142. // }
  85143. }
  85144. // method id "compute.regionInstanceGroupManagers.get":
  85145. type RegionInstanceGroupManagersGetCall struct {
  85146. s *Service
  85147. project string
  85148. region string
  85149. instanceGroupManager string
  85150. urlParams_ gensupport.URLParams
  85151. ifNoneMatch_ string
  85152. ctx_ context.Context
  85153. header_ http.Header
  85154. }
  85155. // Get: Returns all of the details about the specified managed instance
  85156. // group.
  85157. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  85158. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85159. c.project = project
  85160. c.region = region
  85161. c.instanceGroupManager = instanceGroupManager
  85162. return c
  85163. }
  85164. // Fields allows partial responses to be retrieved. See
  85165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85166. // for more information.
  85167. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  85168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85169. return c
  85170. }
  85171. // IfNoneMatch sets the optional parameter which makes the operation
  85172. // fail if the object's ETag matches the given value. This is useful for
  85173. // getting updates only after the object has changed since the last
  85174. // request. Use googleapi.IsNotModified to check whether the response
  85175. // error from Do is the result of In-None-Match.
  85176. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  85177. c.ifNoneMatch_ = entityTag
  85178. return c
  85179. }
  85180. // Context sets the context to be used in this call's Do method. Any
  85181. // pending HTTP request will be aborted if the provided context is
  85182. // canceled.
  85183. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  85184. c.ctx_ = ctx
  85185. return c
  85186. }
  85187. // Header returns an http.Header that can be modified by the caller to
  85188. // add HTTP headers to the request.
  85189. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  85190. if c.header_ == nil {
  85191. c.header_ = make(http.Header)
  85192. }
  85193. return c.header_
  85194. }
  85195. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  85196. reqHeaders := make(http.Header)
  85197. for k, v := range c.header_ {
  85198. reqHeaders[k] = v
  85199. }
  85200. reqHeaders.Set("User-Agent", c.s.userAgent())
  85201. if c.ifNoneMatch_ != "" {
  85202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85203. }
  85204. var body io.Reader = nil
  85205. c.urlParams_.Set("alt", alt)
  85206. c.urlParams_.Set("prettyPrint", "false")
  85207. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  85208. urls += "?" + c.urlParams_.Encode()
  85209. req, err := http.NewRequest("GET", urls, body)
  85210. if err != nil {
  85211. return nil, err
  85212. }
  85213. req.Header = reqHeaders
  85214. googleapi.Expand(req.URL, map[string]string{
  85215. "project": c.project,
  85216. "region": c.region,
  85217. "instanceGroupManager": c.instanceGroupManager,
  85218. })
  85219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85220. }
  85221. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  85222. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  85223. // non-2xx status code is an error. Response headers are in either
  85224. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  85225. // returned at all) in error.(*googleapi.Error).Header. Use
  85226. // googleapi.IsNotModified to check whether the returned error was
  85227. // because http.StatusNotModified was returned.
  85228. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  85229. gensupport.SetOptions(c.urlParams_, opts...)
  85230. res, err := c.doRequest("json")
  85231. if res != nil && res.StatusCode == http.StatusNotModified {
  85232. if res.Body != nil {
  85233. res.Body.Close()
  85234. }
  85235. return nil, &googleapi.Error{
  85236. Code: res.StatusCode,
  85237. Header: res.Header,
  85238. }
  85239. }
  85240. if err != nil {
  85241. return nil, err
  85242. }
  85243. defer googleapi.CloseBody(res)
  85244. if err := googleapi.CheckResponse(res); err != nil {
  85245. return nil, err
  85246. }
  85247. ret := &InstanceGroupManager{
  85248. ServerResponse: googleapi.ServerResponse{
  85249. Header: res.Header,
  85250. HTTPStatusCode: res.StatusCode,
  85251. },
  85252. }
  85253. target := &ret
  85254. if err := gensupport.DecodeResponse(target, res); err != nil {
  85255. return nil, err
  85256. }
  85257. return ret, nil
  85258. // {
  85259. // "description": "Returns all of the details about the specified managed instance group.",
  85260. // "httpMethod": "GET",
  85261. // "id": "compute.regionInstanceGroupManagers.get",
  85262. // "parameterOrder": [
  85263. // "project",
  85264. // "region",
  85265. // "instanceGroupManager"
  85266. // ],
  85267. // "parameters": {
  85268. // "instanceGroupManager": {
  85269. // "description": "Name of the managed instance group to return.",
  85270. // "location": "path",
  85271. // "required": true,
  85272. // "type": "string"
  85273. // },
  85274. // "project": {
  85275. // "description": "Project ID for this request.",
  85276. // "location": "path",
  85277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85278. // "required": true,
  85279. // "type": "string"
  85280. // },
  85281. // "region": {
  85282. // "description": "Name of the region scoping this request.",
  85283. // "location": "path",
  85284. // "required": true,
  85285. // "type": "string"
  85286. // }
  85287. // },
  85288. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  85289. // "response": {
  85290. // "$ref": "InstanceGroupManager"
  85291. // },
  85292. // "scopes": [
  85293. // "https://www.googleapis.com/auth/cloud-platform",
  85294. // "https://www.googleapis.com/auth/compute",
  85295. // "https://www.googleapis.com/auth/compute.readonly"
  85296. // ]
  85297. // }
  85298. }
  85299. // method id "compute.regionInstanceGroupManagers.insert":
  85300. type RegionInstanceGroupManagersInsertCall struct {
  85301. s *Service
  85302. project string
  85303. region string
  85304. instancegroupmanager *InstanceGroupManager
  85305. urlParams_ gensupport.URLParams
  85306. ctx_ context.Context
  85307. header_ http.Header
  85308. }
  85309. // Insert: Creates a managed instance group using the information that
  85310. // you specify in the request. After the group is created, instances in
  85311. // the group are created using the specified instance template. This
  85312. // operation is marked as DONE when the group is created even if the
  85313. // instances in the group have not yet been created. You must separately
  85314. // verify the status of the individual instances with the
  85315. // listmanagedinstances method.
  85316. //
  85317. // A regional managed instance group can contain up to 2000 instances.
  85318. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  85319. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85320. c.project = project
  85321. c.region = region
  85322. c.instancegroupmanager = instancegroupmanager
  85323. return c
  85324. }
  85325. // RequestId sets the optional parameter "requestId": An optional
  85326. // request ID to identify requests. Specify a unique request ID so that
  85327. // if you must retry your request, the server will know to ignore the
  85328. // request if it has already been completed.
  85329. //
  85330. // For example, consider a situation where you make an initial request
  85331. // and the request times out. If you make the request again with the
  85332. // same request ID, the server can check if original operation with the
  85333. // same request ID was received, and if so, will ignore the second
  85334. // request. This prevents clients from accidentally creating duplicate
  85335. // commitments.
  85336. //
  85337. // The request ID must be a valid UUID with the exception that zero UUID
  85338. // is not supported (00000000-0000-0000-0000-000000000000).
  85339. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  85340. c.urlParams_.Set("requestId", requestId)
  85341. return c
  85342. }
  85343. // Fields allows partial responses to be retrieved. See
  85344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85345. // for more information.
  85346. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  85347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85348. return c
  85349. }
  85350. // Context sets the context to be used in this call's Do method. Any
  85351. // pending HTTP request will be aborted if the provided context is
  85352. // canceled.
  85353. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  85354. c.ctx_ = ctx
  85355. return c
  85356. }
  85357. // Header returns an http.Header that can be modified by the caller to
  85358. // add HTTP headers to the request.
  85359. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  85360. if c.header_ == nil {
  85361. c.header_ = make(http.Header)
  85362. }
  85363. return c.header_
  85364. }
  85365. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  85366. reqHeaders := make(http.Header)
  85367. for k, v := range c.header_ {
  85368. reqHeaders[k] = v
  85369. }
  85370. reqHeaders.Set("User-Agent", c.s.userAgent())
  85371. var body io.Reader = nil
  85372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  85373. if err != nil {
  85374. return nil, err
  85375. }
  85376. reqHeaders.Set("Content-Type", "application/json")
  85377. c.urlParams_.Set("alt", alt)
  85378. c.urlParams_.Set("prettyPrint", "false")
  85379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  85380. urls += "?" + c.urlParams_.Encode()
  85381. req, err := http.NewRequest("POST", urls, body)
  85382. if err != nil {
  85383. return nil, err
  85384. }
  85385. req.Header = reqHeaders
  85386. googleapi.Expand(req.URL, map[string]string{
  85387. "project": c.project,
  85388. "region": c.region,
  85389. })
  85390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85391. }
  85392. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  85393. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85394. // status code is an error. Response headers are in either
  85395. // *Operation.ServerResponse.Header or (if a response was returned at
  85396. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85397. // to check whether the returned error was because
  85398. // http.StatusNotModified was returned.
  85399. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85400. gensupport.SetOptions(c.urlParams_, opts...)
  85401. res, err := c.doRequest("json")
  85402. if res != nil && res.StatusCode == http.StatusNotModified {
  85403. if res.Body != nil {
  85404. res.Body.Close()
  85405. }
  85406. return nil, &googleapi.Error{
  85407. Code: res.StatusCode,
  85408. Header: res.Header,
  85409. }
  85410. }
  85411. if err != nil {
  85412. return nil, err
  85413. }
  85414. defer googleapi.CloseBody(res)
  85415. if err := googleapi.CheckResponse(res); err != nil {
  85416. return nil, err
  85417. }
  85418. ret := &Operation{
  85419. ServerResponse: googleapi.ServerResponse{
  85420. Header: res.Header,
  85421. HTTPStatusCode: res.StatusCode,
  85422. },
  85423. }
  85424. target := &ret
  85425. if err := gensupport.DecodeResponse(target, res); err != nil {
  85426. return nil, err
  85427. }
  85428. return ret, nil
  85429. // {
  85430. // "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.",
  85431. // "httpMethod": "POST",
  85432. // "id": "compute.regionInstanceGroupManagers.insert",
  85433. // "parameterOrder": [
  85434. // "project",
  85435. // "region"
  85436. // ],
  85437. // "parameters": {
  85438. // "project": {
  85439. // "description": "Project ID for this request.",
  85440. // "location": "path",
  85441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85442. // "required": true,
  85443. // "type": "string"
  85444. // },
  85445. // "region": {
  85446. // "description": "Name of the region scoping this request.",
  85447. // "location": "path",
  85448. // "required": true,
  85449. // "type": "string"
  85450. // },
  85451. // "requestId": {
  85452. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85453. // "location": "query",
  85454. // "type": "string"
  85455. // }
  85456. // },
  85457. // "path": "{project}/regions/{region}/instanceGroupManagers",
  85458. // "request": {
  85459. // "$ref": "InstanceGroupManager"
  85460. // },
  85461. // "response": {
  85462. // "$ref": "Operation"
  85463. // },
  85464. // "scopes": [
  85465. // "https://www.googleapis.com/auth/cloud-platform",
  85466. // "https://www.googleapis.com/auth/compute"
  85467. // ]
  85468. // }
  85469. }
  85470. // method id "compute.regionInstanceGroupManagers.list":
  85471. type RegionInstanceGroupManagersListCall struct {
  85472. s *Service
  85473. project string
  85474. region string
  85475. urlParams_ gensupport.URLParams
  85476. ifNoneMatch_ string
  85477. ctx_ context.Context
  85478. header_ http.Header
  85479. }
  85480. // List: Retrieves the list of managed instance groups that are
  85481. // contained within the specified region.
  85482. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  85483. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85484. c.project = project
  85485. c.region = region
  85486. return c
  85487. }
  85488. // Filter sets the optional parameter "filter": A filter expression that
  85489. // filters resources listed in the response. The expression must specify
  85490. // the field name, a comparison operator, and the value that you want to
  85491. // use for filtering. The value must be a string, a number, or a
  85492. // boolean. The comparison operator must be either =, !=, >, or <.
  85493. //
  85494. // For example, if you are filtering Compute Engine instances, you can
  85495. // exclude instances named example-instance by specifying name !=
  85496. // example-instance.
  85497. //
  85498. // You can also filter nested fields. For example, you could specify
  85499. // scheduling.automaticRestart = false to include instances only if they
  85500. // are not scheduled for automatic restarts. You can use filtering on
  85501. // nested fields to filter based on resource labels.
  85502. //
  85503. // To filter on multiple expressions, provide each separate expression
  85504. // within parentheses. For example, (scheduling.automaticRestart = true)
  85505. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85506. // AND expression. However, you can include AND and OR expressions
  85507. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85508. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85509. // true).
  85510. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  85511. c.urlParams_.Set("filter", filter)
  85512. return c
  85513. }
  85514. // MaxResults sets the optional parameter "maxResults": The maximum
  85515. // number of results per page that should be returned. If the number of
  85516. // available results is larger than maxResults, Compute Engine returns a
  85517. // nextPageToken that can be used to get the next page of results in
  85518. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85519. // (Default: 500)
  85520. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  85521. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85522. return c
  85523. }
  85524. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85525. // a certain order. By default, results are returned in alphanumerical
  85526. // order based on the resource name.
  85527. //
  85528. // You can also sort results in descending order based on the creation
  85529. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85530. // based on the creationTimestamp field in reverse chronological order
  85531. // (newest result first). Use this to sort resources like operations so
  85532. // that the newest operation is returned first.
  85533. //
  85534. // Currently, only sorting by name or creationTimestamp desc is
  85535. // supported.
  85536. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  85537. c.urlParams_.Set("orderBy", orderBy)
  85538. return c
  85539. }
  85540. // PageToken sets the optional parameter "pageToken": Specifies a page
  85541. // token to use. Set pageToken to the nextPageToken returned by a
  85542. // previous list request to get the next page of results.
  85543. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  85544. c.urlParams_.Set("pageToken", pageToken)
  85545. return c
  85546. }
  85547. // Fields allows partial responses to be retrieved. See
  85548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85549. // for more information.
  85550. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  85551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85552. return c
  85553. }
  85554. // IfNoneMatch sets the optional parameter which makes the operation
  85555. // fail if the object's ETag matches the given value. This is useful for
  85556. // getting updates only after the object has changed since the last
  85557. // request. Use googleapi.IsNotModified to check whether the response
  85558. // error from Do is the result of In-None-Match.
  85559. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  85560. c.ifNoneMatch_ = entityTag
  85561. return c
  85562. }
  85563. // Context sets the context to be used in this call's Do method. Any
  85564. // pending HTTP request will be aborted if the provided context is
  85565. // canceled.
  85566. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  85567. c.ctx_ = ctx
  85568. return c
  85569. }
  85570. // Header returns an http.Header that can be modified by the caller to
  85571. // add HTTP headers to the request.
  85572. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  85573. if c.header_ == nil {
  85574. c.header_ = make(http.Header)
  85575. }
  85576. return c.header_
  85577. }
  85578. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  85579. reqHeaders := make(http.Header)
  85580. for k, v := range c.header_ {
  85581. reqHeaders[k] = v
  85582. }
  85583. reqHeaders.Set("User-Agent", c.s.userAgent())
  85584. if c.ifNoneMatch_ != "" {
  85585. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85586. }
  85587. var body io.Reader = nil
  85588. c.urlParams_.Set("alt", alt)
  85589. c.urlParams_.Set("prettyPrint", "false")
  85590. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  85591. urls += "?" + c.urlParams_.Encode()
  85592. req, err := http.NewRequest("GET", urls, body)
  85593. if err != nil {
  85594. return nil, err
  85595. }
  85596. req.Header = reqHeaders
  85597. googleapi.Expand(req.URL, map[string]string{
  85598. "project": c.project,
  85599. "region": c.region,
  85600. })
  85601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85602. }
  85603. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  85604. // Exactly one of *RegionInstanceGroupManagerList or error will be
  85605. // non-nil. Any non-2xx status code is an error. Response headers are in
  85606. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  85607. // response was returned at all) in error.(*googleapi.Error).Header. Use
  85608. // googleapi.IsNotModified to check whether the returned error was
  85609. // because http.StatusNotModified was returned.
  85610. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  85611. gensupport.SetOptions(c.urlParams_, opts...)
  85612. res, err := c.doRequest("json")
  85613. if res != nil && res.StatusCode == http.StatusNotModified {
  85614. if res.Body != nil {
  85615. res.Body.Close()
  85616. }
  85617. return nil, &googleapi.Error{
  85618. Code: res.StatusCode,
  85619. Header: res.Header,
  85620. }
  85621. }
  85622. if err != nil {
  85623. return nil, err
  85624. }
  85625. defer googleapi.CloseBody(res)
  85626. if err := googleapi.CheckResponse(res); err != nil {
  85627. return nil, err
  85628. }
  85629. ret := &RegionInstanceGroupManagerList{
  85630. ServerResponse: googleapi.ServerResponse{
  85631. Header: res.Header,
  85632. HTTPStatusCode: res.StatusCode,
  85633. },
  85634. }
  85635. target := &ret
  85636. if err := gensupport.DecodeResponse(target, res); err != nil {
  85637. return nil, err
  85638. }
  85639. return ret, nil
  85640. // {
  85641. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  85642. // "httpMethod": "GET",
  85643. // "id": "compute.regionInstanceGroupManagers.list",
  85644. // "parameterOrder": [
  85645. // "project",
  85646. // "region"
  85647. // ],
  85648. // "parameters": {
  85649. // "filter": {
  85650. // "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).",
  85651. // "location": "query",
  85652. // "type": "string"
  85653. // },
  85654. // "maxResults": {
  85655. // "default": "500",
  85656. // "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)",
  85657. // "format": "uint32",
  85658. // "location": "query",
  85659. // "minimum": "0",
  85660. // "type": "integer"
  85661. // },
  85662. // "orderBy": {
  85663. // "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.",
  85664. // "location": "query",
  85665. // "type": "string"
  85666. // },
  85667. // "pageToken": {
  85668. // "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.",
  85669. // "location": "query",
  85670. // "type": "string"
  85671. // },
  85672. // "project": {
  85673. // "description": "Project ID for this request.",
  85674. // "location": "path",
  85675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85676. // "required": true,
  85677. // "type": "string"
  85678. // },
  85679. // "region": {
  85680. // "description": "Name of the region scoping this request.",
  85681. // "location": "path",
  85682. // "required": true,
  85683. // "type": "string"
  85684. // }
  85685. // },
  85686. // "path": "{project}/regions/{region}/instanceGroupManagers",
  85687. // "response": {
  85688. // "$ref": "RegionInstanceGroupManagerList"
  85689. // },
  85690. // "scopes": [
  85691. // "https://www.googleapis.com/auth/cloud-platform",
  85692. // "https://www.googleapis.com/auth/compute",
  85693. // "https://www.googleapis.com/auth/compute.readonly"
  85694. // ]
  85695. // }
  85696. }
  85697. // Pages invokes f for each page of results.
  85698. // A non-nil error returned from f will halt the iteration.
  85699. // The provided context supersedes any context provided to the Context method.
  85700. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  85701. c.ctx_ = ctx
  85702. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85703. for {
  85704. x, err := c.Do()
  85705. if err != nil {
  85706. return err
  85707. }
  85708. if err := f(x); err != nil {
  85709. return err
  85710. }
  85711. if x.NextPageToken == "" {
  85712. return nil
  85713. }
  85714. c.PageToken(x.NextPageToken)
  85715. }
  85716. }
  85717. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  85718. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  85719. s *Service
  85720. project string
  85721. region string
  85722. instanceGroupManager string
  85723. urlParams_ gensupport.URLParams
  85724. ctx_ context.Context
  85725. header_ http.Header
  85726. }
  85727. // ListManagedInstances: Lists the instances in the managed instance
  85728. // group and instances that are scheduled to be created. The list
  85729. // includes any current actions that the group has scheduled for its
  85730. // instances.
  85731. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  85732. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85733. c.project = project
  85734. c.region = region
  85735. c.instanceGroupManager = instanceGroupManager
  85736. return c
  85737. }
  85738. // Filter sets the optional parameter "filter": A filter expression that
  85739. // filters resources listed in the response. The expression must specify
  85740. // the field name, a comparison operator, and the value that you want to
  85741. // use for filtering. The value must be a string, a number, or a
  85742. // boolean. The comparison operator must be either =, !=, >, or <.
  85743. //
  85744. // For example, if you are filtering Compute Engine instances, you can
  85745. // exclude instances named example-instance by specifying name !=
  85746. // example-instance.
  85747. //
  85748. // You can also filter nested fields. For example, you could specify
  85749. // scheduling.automaticRestart = false to include instances only if they
  85750. // are not scheduled for automatic restarts. You can use filtering on
  85751. // nested fields to filter based on resource labels.
  85752. //
  85753. // To filter on multiple expressions, provide each separate expression
  85754. // within parentheses. For example, (scheduling.automaticRestart = true)
  85755. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85756. // AND expression. However, you can include AND and OR expressions
  85757. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85758. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85759. // true).
  85760. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  85761. c.urlParams_.Set("filter", filter)
  85762. return c
  85763. }
  85764. // MaxResults sets the optional parameter "maxResults": The maximum
  85765. // number of results per page that should be returned. If the number of
  85766. // available results is larger than maxResults, Compute Engine returns a
  85767. // nextPageToken that can be used to get the next page of results in
  85768. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85769. // (Default: 500)
  85770. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  85771. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85772. return c
  85773. }
  85774. // OrderBy sets the optional parameter "order_by": Sorts list results by
  85775. // a certain order. By default, results are returned in alphanumerical
  85776. // order based on the resource name.
  85777. //
  85778. // You can also sort results in descending order based on the creation
  85779. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85780. // based on the creationTimestamp field in reverse chronological order
  85781. // (newest result first). Use this to sort resources like operations so
  85782. // that the newest operation is returned first.
  85783. //
  85784. // Currently, only sorting by name or creationTimestamp desc is
  85785. // supported.
  85786. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  85787. c.urlParams_.Set("order_by", orderBy)
  85788. return c
  85789. }
  85790. // PageToken sets the optional parameter "pageToken": Specifies a page
  85791. // token to use. Set pageToken to the nextPageToken returned by a
  85792. // previous list request to get the next page of results.
  85793. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  85794. c.urlParams_.Set("pageToken", pageToken)
  85795. return c
  85796. }
  85797. // Fields allows partial responses to be retrieved. See
  85798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85799. // for more information.
  85800. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  85801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85802. return c
  85803. }
  85804. // Context sets the context to be used in this call's Do method. Any
  85805. // pending HTTP request will be aborted if the provided context is
  85806. // canceled.
  85807. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  85808. c.ctx_ = ctx
  85809. return c
  85810. }
  85811. // Header returns an http.Header that can be modified by the caller to
  85812. // add HTTP headers to the request.
  85813. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  85814. if c.header_ == nil {
  85815. c.header_ = make(http.Header)
  85816. }
  85817. return c.header_
  85818. }
  85819. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  85820. reqHeaders := make(http.Header)
  85821. for k, v := range c.header_ {
  85822. reqHeaders[k] = v
  85823. }
  85824. reqHeaders.Set("User-Agent", c.s.userAgent())
  85825. var body io.Reader = nil
  85826. c.urlParams_.Set("alt", alt)
  85827. c.urlParams_.Set("prettyPrint", "false")
  85828. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  85829. urls += "?" + c.urlParams_.Encode()
  85830. req, err := http.NewRequest("POST", urls, body)
  85831. if err != nil {
  85832. return nil, err
  85833. }
  85834. req.Header = reqHeaders
  85835. googleapi.Expand(req.URL, map[string]string{
  85836. "project": c.project,
  85837. "region": c.region,
  85838. "instanceGroupManager": c.instanceGroupManager,
  85839. })
  85840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85841. }
  85842. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  85843. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  85844. // error will be non-nil. Any non-2xx status code is an error. Response
  85845. // headers are in either
  85846. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  85847. // r or (if a response was returned at all) in
  85848. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  85849. // whether the returned error was because http.StatusNotModified was
  85850. // returned.
  85851. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  85852. gensupport.SetOptions(c.urlParams_, opts...)
  85853. res, err := c.doRequest("json")
  85854. if res != nil && res.StatusCode == http.StatusNotModified {
  85855. if res.Body != nil {
  85856. res.Body.Close()
  85857. }
  85858. return nil, &googleapi.Error{
  85859. Code: res.StatusCode,
  85860. Header: res.Header,
  85861. }
  85862. }
  85863. if err != nil {
  85864. return nil, err
  85865. }
  85866. defer googleapi.CloseBody(res)
  85867. if err := googleapi.CheckResponse(res); err != nil {
  85868. return nil, err
  85869. }
  85870. ret := &RegionInstanceGroupManagersListInstancesResponse{
  85871. ServerResponse: googleapi.ServerResponse{
  85872. Header: res.Header,
  85873. HTTPStatusCode: res.StatusCode,
  85874. },
  85875. }
  85876. target := &ret
  85877. if err := gensupport.DecodeResponse(target, res); err != nil {
  85878. return nil, err
  85879. }
  85880. return ret, nil
  85881. // {
  85882. // "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.",
  85883. // "httpMethod": "POST",
  85884. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  85885. // "parameterOrder": [
  85886. // "project",
  85887. // "region",
  85888. // "instanceGroupManager"
  85889. // ],
  85890. // "parameters": {
  85891. // "filter": {
  85892. // "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).",
  85893. // "location": "query",
  85894. // "type": "string"
  85895. // },
  85896. // "instanceGroupManager": {
  85897. // "description": "The name of the managed instance group.",
  85898. // "location": "path",
  85899. // "required": true,
  85900. // "type": "string"
  85901. // },
  85902. // "maxResults": {
  85903. // "default": "500",
  85904. // "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)",
  85905. // "format": "uint32",
  85906. // "location": "query",
  85907. // "minimum": "0",
  85908. // "type": "integer"
  85909. // },
  85910. // "order_by": {
  85911. // "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.",
  85912. // "location": "query",
  85913. // "type": "string"
  85914. // },
  85915. // "pageToken": {
  85916. // "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.",
  85917. // "location": "query",
  85918. // "type": "string"
  85919. // },
  85920. // "project": {
  85921. // "description": "Project ID for this request.",
  85922. // "location": "path",
  85923. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85924. // "required": true,
  85925. // "type": "string"
  85926. // },
  85927. // "region": {
  85928. // "description": "Name of the region scoping this request.",
  85929. // "location": "path",
  85930. // "required": true,
  85931. // "type": "string"
  85932. // }
  85933. // },
  85934. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  85935. // "response": {
  85936. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  85937. // },
  85938. // "scopes": [
  85939. // "https://www.googleapis.com/auth/cloud-platform",
  85940. // "https://www.googleapis.com/auth/compute",
  85941. // "https://www.googleapis.com/auth/compute.readonly"
  85942. // ]
  85943. // }
  85944. }
  85945. // Pages invokes f for each page of results.
  85946. // A non-nil error returned from f will halt the iteration.
  85947. // The provided context supersedes any context provided to the Context method.
  85948. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  85949. c.ctx_ = ctx
  85950. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85951. for {
  85952. x, err := c.Do()
  85953. if err != nil {
  85954. return err
  85955. }
  85956. if err := f(x); err != nil {
  85957. return err
  85958. }
  85959. if x.NextPageToken == "" {
  85960. return nil
  85961. }
  85962. c.PageToken(x.NextPageToken)
  85963. }
  85964. }
  85965. // method id "compute.regionInstanceGroupManagers.patch":
  85966. type RegionInstanceGroupManagersPatchCall struct {
  85967. s *Service
  85968. project string
  85969. region string
  85970. instanceGroupManager string
  85971. instancegroupmanager *InstanceGroupManager
  85972. urlParams_ gensupport.URLParams
  85973. ctx_ context.Context
  85974. header_ http.Header
  85975. }
  85976. // Patch: Updates a managed instance group using the information that
  85977. // you specify in the request. This operation is marked as DONE when the
  85978. // group is patched even if the instances in the group are still in the
  85979. // process of being patched. You must separately verify the status of
  85980. // the individual instances with the listmanagedinstances method. This
  85981. // method supports PATCH semantics and uses the JSON merge patch format
  85982. // and processing rules.
  85983. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  85984. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85985. c.project = project
  85986. c.region = region
  85987. c.instanceGroupManager = instanceGroupManager
  85988. c.instancegroupmanager = instancegroupmanager
  85989. return c
  85990. }
  85991. // RequestId sets the optional parameter "requestId": An optional
  85992. // request ID to identify requests. Specify a unique request ID so that
  85993. // if you must retry your request, the server will know to ignore the
  85994. // request if it has already been completed.
  85995. //
  85996. // For example, consider a situation where you make an initial request
  85997. // and the request times out. If you make the request again with the
  85998. // same request ID, the server can check if original operation with the
  85999. // same request ID was received, and if so, will ignore the second
  86000. // request. This prevents clients from accidentally creating duplicate
  86001. // commitments.
  86002. //
  86003. // The request ID must be a valid UUID with the exception that zero UUID
  86004. // is not supported (00000000-0000-0000-0000-000000000000).
  86005. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  86006. c.urlParams_.Set("requestId", requestId)
  86007. return c
  86008. }
  86009. // Fields allows partial responses to be retrieved. See
  86010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86011. // for more information.
  86012. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  86013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86014. return c
  86015. }
  86016. // Context sets the context to be used in this call's Do method. Any
  86017. // pending HTTP request will be aborted if the provided context is
  86018. // canceled.
  86019. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  86020. c.ctx_ = ctx
  86021. return c
  86022. }
  86023. // Header returns an http.Header that can be modified by the caller to
  86024. // add HTTP headers to the request.
  86025. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  86026. if c.header_ == nil {
  86027. c.header_ = make(http.Header)
  86028. }
  86029. return c.header_
  86030. }
  86031. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  86032. reqHeaders := make(http.Header)
  86033. for k, v := range c.header_ {
  86034. reqHeaders[k] = v
  86035. }
  86036. reqHeaders.Set("User-Agent", c.s.userAgent())
  86037. var body io.Reader = nil
  86038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  86039. if err != nil {
  86040. return nil, err
  86041. }
  86042. reqHeaders.Set("Content-Type", "application/json")
  86043. c.urlParams_.Set("alt", alt)
  86044. c.urlParams_.Set("prettyPrint", "false")
  86045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  86046. urls += "?" + c.urlParams_.Encode()
  86047. req, err := http.NewRequest("PATCH", 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. "region": c.region,
  86055. "instanceGroupManager": c.instanceGroupManager,
  86056. })
  86057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86058. }
  86059. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  86060. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86061. // status code is an error. Response headers are in either
  86062. // *Operation.ServerResponse.Header or (if a response was returned at
  86063. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86064. // to check whether the returned error was because
  86065. // http.StatusNotModified was returned.
  86066. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86067. gensupport.SetOptions(c.urlParams_, opts...)
  86068. res, err := c.doRequest("json")
  86069. if res != nil && res.StatusCode == http.StatusNotModified {
  86070. if res.Body != nil {
  86071. res.Body.Close()
  86072. }
  86073. return nil, &googleapi.Error{
  86074. Code: res.StatusCode,
  86075. Header: res.Header,
  86076. }
  86077. }
  86078. if err != nil {
  86079. return nil, err
  86080. }
  86081. defer googleapi.CloseBody(res)
  86082. if err := googleapi.CheckResponse(res); err != nil {
  86083. return nil, err
  86084. }
  86085. ret := &Operation{
  86086. ServerResponse: googleapi.ServerResponse{
  86087. Header: res.Header,
  86088. HTTPStatusCode: res.StatusCode,
  86089. },
  86090. }
  86091. target := &ret
  86092. if err := gensupport.DecodeResponse(target, res); err != nil {
  86093. return nil, err
  86094. }
  86095. return ret, nil
  86096. // {
  86097. // "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.",
  86098. // "httpMethod": "PATCH",
  86099. // "id": "compute.regionInstanceGroupManagers.patch",
  86100. // "parameterOrder": [
  86101. // "project",
  86102. // "region",
  86103. // "instanceGroupManager"
  86104. // ],
  86105. // "parameters": {
  86106. // "instanceGroupManager": {
  86107. // "description": "The name of the instance group manager.",
  86108. // "location": "path",
  86109. // "required": true,
  86110. // "type": "string"
  86111. // },
  86112. // "project": {
  86113. // "description": "Project ID for this request.",
  86114. // "location": "path",
  86115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86116. // "required": true,
  86117. // "type": "string"
  86118. // },
  86119. // "region": {
  86120. // "description": "Name of the region scoping this request.",
  86121. // "location": "path",
  86122. // "required": true,
  86123. // "type": "string"
  86124. // },
  86125. // "requestId": {
  86126. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86127. // "location": "query",
  86128. // "type": "string"
  86129. // }
  86130. // },
  86131. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  86132. // "request": {
  86133. // "$ref": "InstanceGroupManager"
  86134. // },
  86135. // "response": {
  86136. // "$ref": "Operation"
  86137. // },
  86138. // "scopes": [
  86139. // "https://www.googleapis.com/auth/cloud-platform",
  86140. // "https://www.googleapis.com/auth/compute"
  86141. // ]
  86142. // }
  86143. }
  86144. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  86145. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  86146. s *Service
  86147. project string
  86148. region string
  86149. instanceGroupManager string
  86150. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  86151. urlParams_ gensupport.URLParams
  86152. ctx_ context.Context
  86153. header_ http.Header
  86154. }
  86155. // RecreateInstances: Flags the specified instances in the managed
  86156. // instance group to be immediately recreated. The instances are deleted
  86157. // and recreated using the current instance template for the managed
  86158. // instance group. This operation is marked as DONE when the flag is set
  86159. // even if the instances have not yet been recreated. You must
  86160. // separately verify the status of the recreating action with the
  86161. // listmanagedinstances method.
  86162. //
  86163. // If the group is part of a backend service that has enabled connection
  86164. // draining, it can take up to 60 seconds after the connection draining
  86165. // duration has elapsed before the VM instance is removed or
  86166. // deleted.
  86167. //
  86168. // You can specify a maximum of 1000 instances with this method per
  86169. // request.
  86170. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  86171. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86172. c.project = project
  86173. c.region = region
  86174. c.instanceGroupManager = instanceGroupManager
  86175. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  86176. return c
  86177. }
  86178. // RequestId sets the optional parameter "requestId": An optional
  86179. // request ID to identify requests. Specify a unique request ID so that
  86180. // if you must retry your request, the server will know to ignore the
  86181. // request if it has already been completed.
  86182. //
  86183. // For example, consider a situation where you make an initial request
  86184. // and the request times out. If you make the request again with the
  86185. // same request ID, the server can check if original operation with the
  86186. // same request ID was received, and if so, will ignore the second
  86187. // request. This prevents clients from accidentally creating duplicate
  86188. // commitments.
  86189. //
  86190. // The request ID must be a valid UUID with the exception that zero UUID
  86191. // is not supported (00000000-0000-0000-0000-000000000000).
  86192. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  86193. c.urlParams_.Set("requestId", requestId)
  86194. return c
  86195. }
  86196. // Fields allows partial responses to be retrieved. See
  86197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86198. // for more information.
  86199. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  86200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86201. return c
  86202. }
  86203. // Context sets the context to be used in this call's Do method. Any
  86204. // pending HTTP request will be aborted if the provided context is
  86205. // canceled.
  86206. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  86207. c.ctx_ = ctx
  86208. return c
  86209. }
  86210. // Header returns an http.Header that can be modified by the caller to
  86211. // add HTTP headers to the request.
  86212. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  86213. if c.header_ == nil {
  86214. c.header_ = make(http.Header)
  86215. }
  86216. return c.header_
  86217. }
  86218. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  86219. reqHeaders := make(http.Header)
  86220. for k, v := range c.header_ {
  86221. reqHeaders[k] = v
  86222. }
  86223. reqHeaders.Set("User-Agent", c.s.userAgent())
  86224. var body io.Reader = nil
  86225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  86226. if err != nil {
  86227. return nil, err
  86228. }
  86229. reqHeaders.Set("Content-Type", "application/json")
  86230. c.urlParams_.Set("alt", alt)
  86231. c.urlParams_.Set("prettyPrint", "false")
  86232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  86233. urls += "?" + c.urlParams_.Encode()
  86234. req, err := http.NewRequest("POST", urls, body)
  86235. if err != nil {
  86236. return nil, err
  86237. }
  86238. req.Header = reqHeaders
  86239. googleapi.Expand(req.URL, map[string]string{
  86240. "project": c.project,
  86241. "region": c.region,
  86242. "instanceGroupManager": c.instanceGroupManager,
  86243. })
  86244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86245. }
  86246. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  86247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86248. // status code is an error. Response headers are in either
  86249. // *Operation.ServerResponse.Header or (if a response was returned at
  86250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86251. // to check whether the returned error was because
  86252. // http.StatusNotModified was returned.
  86253. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86254. gensupport.SetOptions(c.urlParams_, opts...)
  86255. res, err := c.doRequest("json")
  86256. if res != nil && res.StatusCode == http.StatusNotModified {
  86257. if res.Body != nil {
  86258. res.Body.Close()
  86259. }
  86260. return nil, &googleapi.Error{
  86261. Code: res.StatusCode,
  86262. Header: res.Header,
  86263. }
  86264. }
  86265. if err != nil {
  86266. return nil, err
  86267. }
  86268. defer googleapi.CloseBody(res)
  86269. if err := googleapi.CheckResponse(res); err != nil {
  86270. return nil, err
  86271. }
  86272. ret := &Operation{
  86273. ServerResponse: googleapi.ServerResponse{
  86274. Header: res.Header,
  86275. HTTPStatusCode: res.StatusCode,
  86276. },
  86277. }
  86278. target := &ret
  86279. if err := gensupport.DecodeResponse(target, res); err != nil {
  86280. return nil, err
  86281. }
  86282. return ret, nil
  86283. // {
  86284. // "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.",
  86285. // "httpMethod": "POST",
  86286. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  86287. // "parameterOrder": [
  86288. // "project",
  86289. // "region",
  86290. // "instanceGroupManager"
  86291. // ],
  86292. // "parameters": {
  86293. // "instanceGroupManager": {
  86294. // "description": "Name of the managed instance group.",
  86295. // "location": "path",
  86296. // "required": true,
  86297. // "type": "string"
  86298. // },
  86299. // "project": {
  86300. // "description": "Project ID for this request.",
  86301. // "location": "path",
  86302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86303. // "required": true,
  86304. // "type": "string"
  86305. // },
  86306. // "region": {
  86307. // "description": "Name of the region scoping this request.",
  86308. // "location": "path",
  86309. // "required": true,
  86310. // "type": "string"
  86311. // },
  86312. // "requestId": {
  86313. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86314. // "location": "query",
  86315. // "type": "string"
  86316. // }
  86317. // },
  86318. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  86319. // "request": {
  86320. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  86321. // },
  86322. // "response": {
  86323. // "$ref": "Operation"
  86324. // },
  86325. // "scopes": [
  86326. // "https://www.googleapis.com/auth/cloud-platform",
  86327. // "https://www.googleapis.com/auth/compute"
  86328. // ]
  86329. // }
  86330. }
  86331. // method id "compute.regionInstanceGroupManagers.resize":
  86332. type RegionInstanceGroupManagersResizeCall struct {
  86333. s *Service
  86334. project string
  86335. region string
  86336. instanceGroupManager string
  86337. urlParams_ gensupport.URLParams
  86338. ctx_ context.Context
  86339. header_ http.Header
  86340. }
  86341. // Resize: Changes the intended size of the managed instance group. If
  86342. // you increase the size, the group creates new instances using the
  86343. // current instance template. If you decrease the size, the group
  86344. // deletes one or more instances.
  86345. //
  86346. // The resize operation is marked DONE if the resize request is
  86347. // successful. The underlying actions take additional time. You must
  86348. // separately verify the status of the creating or deleting actions with
  86349. // the listmanagedinstances method.
  86350. //
  86351. // If the group is part of a backend service that has enabled connection
  86352. // draining, it can take up to 60 seconds after the connection draining
  86353. // duration has elapsed before the VM instance is removed or deleted.
  86354. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  86355. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86356. c.project = project
  86357. c.region = region
  86358. c.instanceGroupManager = instanceGroupManager
  86359. c.urlParams_.Set("size", fmt.Sprint(size))
  86360. return c
  86361. }
  86362. // RequestId sets the optional parameter "requestId": An optional
  86363. // request ID to identify requests. Specify a unique request ID so that
  86364. // if you must retry your request, the server will know to ignore the
  86365. // request if it has already been completed.
  86366. //
  86367. // For example, consider a situation where you make an initial request
  86368. // and the request times out. If you make the request again with the
  86369. // same request ID, the server can check if original operation with the
  86370. // same request ID was received, and if so, will ignore the second
  86371. // request. This prevents clients from accidentally creating duplicate
  86372. // commitments.
  86373. //
  86374. // The request ID must be a valid UUID with the exception that zero UUID
  86375. // is not supported (00000000-0000-0000-0000-000000000000).
  86376. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  86377. c.urlParams_.Set("requestId", requestId)
  86378. return c
  86379. }
  86380. // Fields allows partial responses to be retrieved. See
  86381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86382. // for more information.
  86383. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  86384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86385. return c
  86386. }
  86387. // Context sets the context to be used in this call's Do method. Any
  86388. // pending HTTP request will be aborted if the provided context is
  86389. // canceled.
  86390. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  86391. c.ctx_ = ctx
  86392. return c
  86393. }
  86394. // Header returns an http.Header that can be modified by the caller to
  86395. // add HTTP headers to the request.
  86396. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  86397. if c.header_ == nil {
  86398. c.header_ = make(http.Header)
  86399. }
  86400. return c.header_
  86401. }
  86402. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  86403. reqHeaders := make(http.Header)
  86404. for k, v := range c.header_ {
  86405. reqHeaders[k] = v
  86406. }
  86407. reqHeaders.Set("User-Agent", c.s.userAgent())
  86408. var body io.Reader = nil
  86409. c.urlParams_.Set("alt", alt)
  86410. c.urlParams_.Set("prettyPrint", "false")
  86411. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  86412. urls += "?" + c.urlParams_.Encode()
  86413. req, err := http.NewRequest("POST", urls, body)
  86414. if err != nil {
  86415. return nil, err
  86416. }
  86417. req.Header = reqHeaders
  86418. googleapi.Expand(req.URL, map[string]string{
  86419. "project": c.project,
  86420. "region": c.region,
  86421. "instanceGroupManager": c.instanceGroupManager,
  86422. })
  86423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86424. }
  86425. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  86426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86427. // status code is an error. Response headers are in either
  86428. // *Operation.ServerResponse.Header or (if a response was returned at
  86429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86430. // to check whether the returned error was because
  86431. // http.StatusNotModified was returned.
  86432. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86433. gensupport.SetOptions(c.urlParams_, opts...)
  86434. res, err := c.doRequest("json")
  86435. if res != nil && res.StatusCode == http.StatusNotModified {
  86436. if res.Body != nil {
  86437. res.Body.Close()
  86438. }
  86439. return nil, &googleapi.Error{
  86440. Code: res.StatusCode,
  86441. Header: res.Header,
  86442. }
  86443. }
  86444. if err != nil {
  86445. return nil, err
  86446. }
  86447. defer googleapi.CloseBody(res)
  86448. if err := googleapi.CheckResponse(res); err != nil {
  86449. return nil, err
  86450. }
  86451. ret := &Operation{
  86452. ServerResponse: googleapi.ServerResponse{
  86453. Header: res.Header,
  86454. HTTPStatusCode: res.StatusCode,
  86455. },
  86456. }
  86457. target := &ret
  86458. if err := gensupport.DecodeResponse(target, res); err != nil {
  86459. return nil, err
  86460. }
  86461. return ret, nil
  86462. // {
  86463. // "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.",
  86464. // "httpMethod": "POST",
  86465. // "id": "compute.regionInstanceGroupManagers.resize",
  86466. // "parameterOrder": [
  86467. // "project",
  86468. // "region",
  86469. // "instanceGroupManager",
  86470. // "size"
  86471. // ],
  86472. // "parameters": {
  86473. // "instanceGroupManager": {
  86474. // "description": "Name of the managed instance group.",
  86475. // "location": "path",
  86476. // "required": true,
  86477. // "type": "string"
  86478. // },
  86479. // "project": {
  86480. // "description": "Project ID for this request.",
  86481. // "location": "path",
  86482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86483. // "required": true,
  86484. // "type": "string"
  86485. // },
  86486. // "region": {
  86487. // "description": "Name of the region scoping this request.",
  86488. // "location": "path",
  86489. // "required": true,
  86490. // "type": "string"
  86491. // },
  86492. // "requestId": {
  86493. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86494. // "location": "query",
  86495. // "type": "string"
  86496. // },
  86497. // "size": {
  86498. // "description": "Number of instances that should exist in this instance group manager.",
  86499. // "format": "int32",
  86500. // "location": "query",
  86501. // "minimum": "0",
  86502. // "required": true,
  86503. // "type": "integer"
  86504. // }
  86505. // },
  86506. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  86507. // "response": {
  86508. // "$ref": "Operation"
  86509. // },
  86510. // "scopes": [
  86511. // "https://www.googleapis.com/auth/cloud-platform",
  86512. // "https://www.googleapis.com/auth/compute"
  86513. // ]
  86514. // }
  86515. }
  86516. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  86517. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  86518. s *Service
  86519. project string
  86520. region string
  86521. instanceGroupManager string
  86522. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  86523. urlParams_ gensupport.URLParams
  86524. ctx_ context.Context
  86525. header_ http.Header
  86526. }
  86527. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  86528. // instances in this managed instance group. [Deprecated] This method is
  86529. // deprecated. Please use Patch instead.
  86530. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  86531. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86532. c.project = project
  86533. c.region = region
  86534. c.instanceGroupManager = instanceGroupManager
  86535. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  86536. return c
  86537. }
  86538. // RequestId sets the optional parameter "requestId": An optional
  86539. // request ID to identify requests. Specify a unique request ID so that
  86540. // if you must retry your request, the server will know to ignore the
  86541. // request if it has already been completed.
  86542. //
  86543. // For example, consider a situation where you make an initial request
  86544. // and the request times out. If you make the request again with the
  86545. // same request ID, the server can check if original operation with the
  86546. // same request ID was received, and if so, will ignore the second
  86547. // request. This prevents clients from accidentally creating duplicate
  86548. // commitments.
  86549. //
  86550. // The request ID must be a valid UUID with the exception that zero UUID
  86551. // is not supported (00000000-0000-0000-0000-000000000000).
  86552. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  86553. c.urlParams_.Set("requestId", requestId)
  86554. return c
  86555. }
  86556. // Fields allows partial responses to be retrieved. See
  86557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86558. // for more information.
  86559. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  86560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86561. return c
  86562. }
  86563. // Context sets the context to be used in this call's Do method. Any
  86564. // pending HTTP request will be aborted if the provided context is
  86565. // canceled.
  86566. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  86567. c.ctx_ = ctx
  86568. return c
  86569. }
  86570. // Header returns an http.Header that can be modified by the caller to
  86571. // add HTTP headers to the request.
  86572. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  86573. if c.header_ == nil {
  86574. c.header_ = make(http.Header)
  86575. }
  86576. return c.header_
  86577. }
  86578. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  86579. reqHeaders := make(http.Header)
  86580. for k, v := range c.header_ {
  86581. reqHeaders[k] = v
  86582. }
  86583. reqHeaders.Set("User-Agent", c.s.userAgent())
  86584. var body io.Reader = nil
  86585. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  86586. if err != nil {
  86587. return nil, err
  86588. }
  86589. reqHeaders.Set("Content-Type", "application/json")
  86590. c.urlParams_.Set("alt", alt)
  86591. c.urlParams_.Set("prettyPrint", "false")
  86592. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  86593. urls += "?" + c.urlParams_.Encode()
  86594. req, err := http.NewRequest("POST", urls, body)
  86595. if err != nil {
  86596. return nil, err
  86597. }
  86598. req.Header = reqHeaders
  86599. googleapi.Expand(req.URL, map[string]string{
  86600. "project": c.project,
  86601. "region": c.region,
  86602. "instanceGroupManager": c.instanceGroupManager,
  86603. })
  86604. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86605. }
  86606. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  86607. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86608. // status code is an error. Response headers are in either
  86609. // *Operation.ServerResponse.Header or (if a response was returned at
  86610. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86611. // to check whether the returned error was because
  86612. // http.StatusNotModified was returned.
  86613. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86614. gensupport.SetOptions(c.urlParams_, opts...)
  86615. res, err := c.doRequest("json")
  86616. if res != nil && res.StatusCode == http.StatusNotModified {
  86617. if res.Body != nil {
  86618. res.Body.Close()
  86619. }
  86620. return nil, &googleapi.Error{
  86621. Code: res.StatusCode,
  86622. Header: res.Header,
  86623. }
  86624. }
  86625. if err != nil {
  86626. return nil, err
  86627. }
  86628. defer googleapi.CloseBody(res)
  86629. if err := googleapi.CheckResponse(res); err != nil {
  86630. return nil, err
  86631. }
  86632. ret := &Operation{
  86633. ServerResponse: googleapi.ServerResponse{
  86634. Header: res.Header,
  86635. HTTPStatusCode: res.StatusCode,
  86636. },
  86637. }
  86638. target := &ret
  86639. if err := gensupport.DecodeResponse(target, res); err != nil {
  86640. return nil, err
  86641. }
  86642. return ret, nil
  86643. // {
  86644. // "description": "Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.",
  86645. // "httpMethod": "POST",
  86646. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  86647. // "parameterOrder": [
  86648. // "project",
  86649. // "region",
  86650. // "instanceGroupManager"
  86651. // ],
  86652. // "parameters": {
  86653. // "instanceGroupManager": {
  86654. // "description": "Name of the managed instance group.",
  86655. // "location": "path",
  86656. // "required": true,
  86657. // "type": "string"
  86658. // },
  86659. // "project": {
  86660. // "description": "Project ID for this request.",
  86661. // "location": "path",
  86662. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86663. // "required": true,
  86664. // "type": "string"
  86665. // },
  86666. // "region": {
  86667. // "description": "Name of the region scoping this request.",
  86668. // "location": "path",
  86669. // "required": true,
  86670. // "type": "string"
  86671. // },
  86672. // "requestId": {
  86673. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86674. // "location": "query",
  86675. // "type": "string"
  86676. // }
  86677. // },
  86678. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  86679. // "request": {
  86680. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  86681. // },
  86682. // "response": {
  86683. // "$ref": "Operation"
  86684. // },
  86685. // "scopes": [
  86686. // "https://www.googleapis.com/auth/cloud-platform",
  86687. // "https://www.googleapis.com/auth/compute"
  86688. // ]
  86689. // }
  86690. }
  86691. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  86692. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  86693. s *Service
  86694. project string
  86695. region string
  86696. instanceGroupManager string
  86697. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  86698. urlParams_ gensupport.URLParams
  86699. ctx_ context.Context
  86700. header_ http.Header
  86701. }
  86702. // SetInstanceTemplate: Sets the instance template to use when creating
  86703. // new instances or recreating instances in this group. Existing
  86704. // instances are not affected.
  86705. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  86706. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86707. c.project = project
  86708. c.region = region
  86709. c.instanceGroupManager = instanceGroupManager
  86710. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  86711. return c
  86712. }
  86713. // RequestId sets the optional parameter "requestId": An optional
  86714. // request ID to identify requests. Specify a unique request ID so that
  86715. // if you must retry your request, the server will know to ignore the
  86716. // request if it has already been completed.
  86717. //
  86718. // For example, consider a situation where you make an initial request
  86719. // and the request times out. If you make the request again with the
  86720. // same request ID, the server can check if original operation with the
  86721. // same request ID was received, and if so, will ignore the second
  86722. // request. This prevents clients from accidentally creating duplicate
  86723. // commitments.
  86724. //
  86725. // The request ID must be a valid UUID with the exception that zero UUID
  86726. // is not supported (00000000-0000-0000-0000-000000000000).
  86727. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  86728. c.urlParams_.Set("requestId", requestId)
  86729. return c
  86730. }
  86731. // Fields allows partial responses to be retrieved. See
  86732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86733. // for more information.
  86734. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  86735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86736. return c
  86737. }
  86738. // Context sets the context to be used in this call's Do method. Any
  86739. // pending HTTP request will be aborted if the provided context is
  86740. // canceled.
  86741. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  86742. c.ctx_ = ctx
  86743. return c
  86744. }
  86745. // Header returns an http.Header that can be modified by the caller to
  86746. // add HTTP headers to the request.
  86747. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  86748. if c.header_ == nil {
  86749. c.header_ = make(http.Header)
  86750. }
  86751. return c.header_
  86752. }
  86753. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  86754. reqHeaders := make(http.Header)
  86755. for k, v := range c.header_ {
  86756. reqHeaders[k] = v
  86757. }
  86758. reqHeaders.Set("User-Agent", c.s.userAgent())
  86759. var body io.Reader = nil
  86760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  86761. if err != nil {
  86762. return nil, err
  86763. }
  86764. reqHeaders.Set("Content-Type", "application/json")
  86765. c.urlParams_.Set("alt", alt)
  86766. c.urlParams_.Set("prettyPrint", "false")
  86767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  86768. urls += "?" + c.urlParams_.Encode()
  86769. req, err := http.NewRequest("POST", urls, body)
  86770. if err != nil {
  86771. return nil, err
  86772. }
  86773. req.Header = reqHeaders
  86774. googleapi.Expand(req.URL, map[string]string{
  86775. "project": c.project,
  86776. "region": c.region,
  86777. "instanceGroupManager": c.instanceGroupManager,
  86778. })
  86779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86780. }
  86781. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  86782. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86783. // status code is an error. Response headers are in either
  86784. // *Operation.ServerResponse.Header or (if a response was returned at
  86785. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86786. // to check whether the returned error was because
  86787. // http.StatusNotModified was returned.
  86788. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86789. gensupport.SetOptions(c.urlParams_, opts...)
  86790. res, err := c.doRequest("json")
  86791. if res != nil && res.StatusCode == http.StatusNotModified {
  86792. if res.Body != nil {
  86793. res.Body.Close()
  86794. }
  86795. return nil, &googleapi.Error{
  86796. Code: res.StatusCode,
  86797. Header: res.Header,
  86798. }
  86799. }
  86800. if err != nil {
  86801. return nil, err
  86802. }
  86803. defer googleapi.CloseBody(res)
  86804. if err := googleapi.CheckResponse(res); err != nil {
  86805. return nil, err
  86806. }
  86807. ret := &Operation{
  86808. ServerResponse: googleapi.ServerResponse{
  86809. Header: res.Header,
  86810. HTTPStatusCode: res.StatusCode,
  86811. },
  86812. }
  86813. target := &ret
  86814. if err := gensupport.DecodeResponse(target, res); err != nil {
  86815. return nil, err
  86816. }
  86817. return ret, nil
  86818. // {
  86819. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  86820. // "httpMethod": "POST",
  86821. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  86822. // "parameterOrder": [
  86823. // "project",
  86824. // "region",
  86825. // "instanceGroupManager"
  86826. // ],
  86827. // "parameters": {
  86828. // "instanceGroupManager": {
  86829. // "description": "The name of the managed instance group.",
  86830. // "location": "path",
  86831. // "required": true,
  86832. // "type": "string"
  86833. // },
  86834. // "project": {
  86835. // "description": "Project ID for this request.",
  86836. // "location": "path",
  86837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86838. // "required": true,
  86839. // "type": "string"
  86840. // },
  86841. // "region": {
  86842. // "description": "Name of the region scoping this request.",
  86843. // "location": "path",
  86844. // "required": true,
  86845. // "type": "string"
  86846. // },
  86847. // "requestId": {
  86848. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86849. // "location": "query",
  86850. // "type": "string"
  86851. // }
  86852. // },
  86853. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  86854. // "request": {
  86855. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  86856. // },
  86857. // "response": {
  86858. // "$ref": "Operation"
  86859. // },
  86860. // "scopes": [
  86861. // "https://www.googleapis.com/auth/cloud-platform",
  86862. // "https://www.googleapis.com/auth/compute"
  86863. // ]
  86864. // }
  86865. }
  86866. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  86867. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  86868. s *Service
  86869. project string
  86870. region string
  86871. instanceGroupManager string
  86872. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  86873. urlParams_ gensupport.URLParams
  86874. ctx_ context.Context
  86875. header_ http.Header
  86876. }
  86877. // SetTargetPools: Modifies the target pools to which all new instances
  86878. // in this group are assigned. Existing instances in the group are not
  86879. // affected.
  86880. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  86881. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86882. c.project = project
  86883. c.region = region
  86884. c.instanceGroupManager = instanceGroupManager
  86885. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  86886. return c
  86887. }
  86888. // RequestId sets the optional parameter "requestId": An optional
  86889. // request ID to identify requests. Specify a unique request ID so that
  86890. // if you must retry your request, the server will know to ignore the
  86891. // request if it has already been completed.
  86892. //
  86893. // For example, consider a situation where you make an initial request
  86894. // and the request times out. If you make the request again with the
  86895. // same request ID, the server can check if original operation with the
  86896. // same request ID was received, and if so, will ignore the second
  86897. // request. This prevents clients from accidentally creating duplicate
  86898. // commitments.
  86899. //
  86900. // The request ID must be a valid UUID with the exception that zero UUID
  86901. // is not supported (00000000-0000-0000-0000-000000000000).
  86902. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  86903. c.urlParams_.Set("requestId", requestId)
  86904. return c
  86905. }
  86906. // Fields allows partial responses to be retrieved. See
  86907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86908. // for more information.
  86909. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  86910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86911. return c
  86912. }
  86913. // Context sets the context to be used in this call's Do method. Any
  86914. // pending HTTP request will be aborted if the provided context is
  86915. // canceled.
  86916. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  86917. c.ctx_ = ctx
  86918. return c
  86919. }
  86920. // Header returns an http.Header that can be modified by the caller to
  86921. // add HTTP headers to the request.
  86922. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  86923. if c.header_ == nil {
  86924. c.header_ = make(http.Header)
  86925. }
  86926. return c.header_
  86927. }
  86928. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  86929. reqHeaders := make(http.Header)
  86930. for k, v := range c.header_ {
  86931. reqHeaders[k] = v
  86932. }
  86933. reqHeaders.Set("User-Agent", c.s.userAgent())
  86934. var body io.Reader = nil
  86935. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  86936. if err != nil {
  86937. return nil, err
  86938. }
  86939. reqHeaders.Set("Content-Type", "application/json")
  86940. c.urlParams_.Set("alt", alt)
  86941. c.urlParams_.Set("prettyPrint", "false")
  86942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  86943. urls += "?" + c.urlParams_.Encode()
  86944. req, err := http.NewRequest("POST", urls, body)
  86945. if err != nil {
  86946. return nil, err
  86947. }
  86948. req.Header = reqHeaders
  86949. googleapi.Expand(req.URL, map[string]string{
  86950. "project": c.project,
  86951. "region": c.region,
  86952. "instanceGroupManager": c.instanceGroupManager,
  86953. })
  86954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86955. }
  86956. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  86957. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86958. // status code is an error. Response headers are in either
  86959. // *Operation.ServerResponse.Header or (if a response was returned at
  86960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86961. // to check whether the returned error was because
  86962. // http.StatusNotModified was returned.
  86963. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86964. gensupport.SetOptions(c.urlParams_, opts...)
  86965. res, err := c.doRequest("json")
  86966. if res != nil && res.StatusCode == http.StatusNotModified {
  86967. if res.Body != nil {
  86968. res.Body.Close()
  86969. }
  86970. return nil, &googleapi.Error{
  86971. Code: res.StatusCode,
  86972. Header: res.Header,
  86973. }
  86974. }
  86975. if err != nil {
  86976. return nil, err
  86977. }
  86978. defer googleapi.CloseBody(res)
  86979. if err := googleapi.CheckResponse(res); err != nil {
  86980. return nil, err
  86981. }
  86982. ret := &Operation{
  86983. ServerResponse: googleapi.ServerResponse{
  86984. Header: res.Header,
  86985. HTTPStatusCode: res.StatusCode,
  86986. },
  86987. }
  86988. target := &ret
  86989. if err := gensupport.DecodeResponse(target, res); err != nil {
  86990. return nil, err
  86991. }
  86992. return ret, nil
  86993. // {
  86994. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  86995. // "httpMethod": "POST",
  86996. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  86997. // "parameterOrder": [
  86998. // "project",
  86999. // "region",
  87000. // "instanceGroupManager"
  87001. // ],
  87002. // "parameters": {
  87003. // "instanceGroupManager": {
  87004. // "description": "Name of the managed instance group.",
  87005. // "location": "path",
  87006. // "required": true,
  87007. // "type": "string"
  87008. // },
  87009. // "project": {
  87010. // "description": "Project ID for this request.",
  87011. // "location": "path",
  87012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87013. // "required": true,
  87014. // "type": "string"
  87015. // },
  87016. // "region": {
  87017. // "description": "Name of the region scoping this request.",
  87018. // "location": "path",
  87019. // "required": true,
  87020. // "type": "string"
  87021. // },
  87022. // "requestId": {
  87023. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87024. // "location": "query",
  87025. // "type": "string"
  87026. // }
  87027. // },
  87028. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  87029. // "request": {
  87030. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  87031. // },
  87032. // "response": {
  87033. // "$ref": "Operation"
  87034. // },
  87035. // "scopes": [
  87036. // "https://www.googleapis.com/auth/cloud-platform",
  87037. // "https://www.googleapis.com/auth/compute"
  87038. // ]
  87039. // }
  87040. }
  87041. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  87042. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  87043. s *Service
  87044. project string
  87045. region string
  87046. resource string
  87047. testpermissionsrequest *TestPermissionsRequest
  87048. urlParams_ gensupport.URLParams
  87049. ctx_ context.Context
  87050. header_ http.Header
  87051. }
  87052. // TestIamPermissions: Returns permissions that a caller has on the
  87053. // specified resource.
  87054. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  87055. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87056. c.project = project
  87057. c.region = region
  87058. c.resource = resource
  87059. c.testpermissionsrequest = testpermissionsrequest
  87060. return c
  87061. }
  87062. // Fields allows partial responses to be retrieved. See
  87063. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87064. // for more information.
  87065. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  87066. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87067. return c
  87068. }
  87069. // Context sets the context to be used in this call's Do method. Any
  87070. // pending HTTP request will be aborted if the provided context is
  87071. // canceled.
  87072. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  87073. c.ctx_ = ctx
  87074. return c
  87075. }
  87076. // Header returns an http.Header that can be modified by the caller to
  87077. // add HTTP headers to the request.
  87078. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  87079. if c.header_ == nil {
  87080. c.header_ = make(http.Header)
  87081. }
  87082. return c.header_
  87083. }
  87084. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  87085. reqHeaders := make(http.Header)
  87086. for k, v := range c.header_ {
  87087. reqHeaders[k] = v
  87088. }
  87089. reqHeaders.Set("User-Agent", c.s.userAgent())
  87090. var body io.Reader = nil
  87091. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  87092. if err != nil {
  87093. return nil, err
  87094. }
  87095. reqHeaders.Set("Content-Type", "application/json")
  87096. c.urlParams_.Set("alt", alt)
  87097. c.urlParams_.Set("prettyPrint", "false")
  87098. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  87099. urls += "?" + c.urlParams_.Encode()
  87100. req, err := http.NewRequest("POST", urls, body)
  87101. if err != nil {
  87102. return nil, err
  87103. }
  87104. req.Header = reqHeaders
  87105. googleapi.Expand(req.URL, map[string]string{
  87106. "project": c.project,
  87107. "region": c.region,
  87108. "resource": c.resource,
  87109. })
  87110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87111. }
  87112. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  87113. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  87114. // non-2xx status code is an error. Response headers are in either
  87115. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  87116. // returned at all) in error.(*googleapi.Error).Header. Use
  87117. // googleapi.IsNotModified to check whether the returned error was
  87118. // because http.StatusNotModified was returned.
  87119. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  87120. gensupport.SetOptions(c.urlParams_, opts...)
  87121. res, err := c.doRequest("json")
  87122. if res != nil && res.StatusCode == http.StatusNotModified {
  87123. if res.Body != nil {
  87124. res.Body.Close()
  87125. }
  87126. return nil, &googleapi.Error{
  87127. Code: res.StatusCode,
  87128. Header: res.Header,
  87129. }
  87130. }
  87131. if err != nil {
  87132. return nil, err
  87133. }
  87134. defer googleapi.CloseBody(res)
  87135. if err := googleapi.CheckResponse(res); err != nil {
  87136. return nil, err
  87137. }
  87138. ret := &TestPermissionsResponse{
  87139. ServerResponse: googleapi.ServerResponse{
  87140. Header: res.Header,
  87141. HTTPStatusCode: res.StatusCode,
  87142. },
  87143. }
  87144. target := &ret
  87145. if err := gensupport.DecodeResponse(target, res); err != nil {
  87146. return nil, err
  87147. }
  87148. return ret, nil
  87149. // {
  87150. // "description": "Returns permissions that a caller has on the specified resource.",
  87151. // "httpMethod": "POST",
  87152. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  87153. // "parameterOrder": [
  87154. // "project",
  87155. // "region",
  87156. // "resource"
  87157. // ],
  87158. // "parameters": {
  87159. // "project": {
  87160. // "description": "Project ID for this request.",
  87161. // "location": "path",
  87162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87163. // "required": true,
  87164. // "type": "string"
  87165. // },
  87166. // "region": {
  87167. // "description": "The name of the region for this request.",
  87168. // "location": "path",
  87169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87170. // "required": true,
  87171. // "type": "string"
  87172. // },
  87173. // "resource": {
  87174. // "description": "Name or id of the resource for this request.",
  87175. // "location": "path",
  87176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87177. // "required": true,
  87178. // "type": "string"
  87179. // }
  87180. // },
  87181. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  87182. // "request": {
  87183. // "$ref": "TestPermissionsRequest"
  87184. // },
  87185. // "response": {
  87186. // "$ref": "TestPermissionsResponse"
  87187. // },
  87188. // "scopes": [
  87189. // "https://www.googleapis.com/auth/cloud-platform",
  87190. // "https://www.googleapis.com/auth/compute",
  87191. // "https://www.googleapis.com/auth/compute.readonly"
  87192. // ]
  87193. // }
  87194. }
  87195. // method id "compute.regionInstanceGroupManagers.update":
  87196. type RegionInstanceGroupManagersUpdateCall struct {
  87197. s *Service
  87198. project string
  87199. region string
  87200. instanceGroupManager string
  87201. instancegroupmanager *InstanceGroupManager
  87202. urlParams_ gensupport.URLParams
  87203. ctx_ context.Context
  87204. header_ http.Header
  87205. }
  87206. // Update: Updates a managed instance group using the information that
  87207. // you specify in the request. This operation is marked as DONE when the
  87208. // group is updated even if the instances in the group have not yet been
  87209. // updated. You must separately verify the status of the individual
  87210. // instances with the listmanagedinstances method.
  87211. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  87212. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87213. c.project = project
  87214. c.region = region
  87215. c.instanceGroupManager = instanceGroupManager
  87216. c.instancegroupmanager = instancegroupmanager
  87217. return c
  87218. }
  87219. // RequestId sets the optional parameter "requestId": An optional
  87220. // request ID to identify requests. Specify a unique request ID so that
  87221. // if you must retry your request, the server will know to ignore the
  87222. // request if it has already been completed.
  87223. //
  87224. // For example, consider a situation where you make an initial request
  87225. // and the request times out. If you make the request again with the
  87226. // same request ID, the server can check if original operation with the
  87227. // same request ID was received, and if so, will ignore the second
  87228. // request. This prevents clients from accidentally creating duplicate
  87229. // commitments.
  87230. //
  87231. // The request ID must be a valid UUID with the exception that zero UUID
  87232. // is not supported (00000000-0000-0000-0000-000000000000).
  87233. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  87234. c.urlParams_.Set("requestId", requestId)
  87235. return c
  87236. }
  87237. // Fields allows partial responses to be retrieved. See
  87238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87239. // for more information.
  87240. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  87241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87242. return c
  87243. }
  87244. // Context sets the context to be used in this call's Do method. Any
  87245. // pending HTTP request will be aborted if the provided context is
  87246. // canceled.
  87247. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  87248. c.ctx_ = ctx
  87249. return c
  87250. }
  87251. // Header returns an http.Header that can be modified by the caller to
  87252. // add HTTP headers to the request.
  87253. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  87254. if c.header_ == nil {
  87255. c.header_ = make(http.Header)
  87256. }
  87257. return c.header_
  87258. }
  87259. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  87260. reqHeaders := make(http.Header)
  87261. for k, v := range c.header_ {
  87262. reqHeaders[k] = v
  87263. }
  87264. reqHeaders.Set("User-Agent", c.s.userAgent())
  87265. var body io.Reader = nil
  87266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  87267. if err != nil {
  87268. return nil, err
  87269. }
  87270. reqHeaders.Set("Content-Type", "application/json")
  87271. c.urlParams_.Set("alt", alt)
  87272. c.urlParams_.Set("prettyPrint", "false")
  87273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  87274. urls += "?" + c.urlParams_.Encode()
  87275. req, err := http.NewRequest("PUT", urls, body)
  87276. if err != nil {
  87277. return nil, err
  87278. }
  87279. req.Header = reqHeaders
  87280. googleapi.Expand(req.URL, map[string]string{
  87281. "project": c.project,
  87282. "region": c.region,
  87283. "instanceGroupManager": c.instanceGroupManager,
  87284. })
  87285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87286. }
  87287. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  87288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87289. // status code is an error. Response headers are in either
  87290. // *Operation.ServerResponse.Header or (if a response was returned at
  87291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87292. // to check whether the returned error was because
  87293. // http.StatusNotModified was returned.
  87294. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87295. gensupport.SetOptions(c.urlParams_, opts...)
  87296. res, err := c.doRequest("json")
  87297. if res != nil && res.StatusCode == http.StatusNotModified {
  87298. if res.Body != nil {
  87299. res.Body.Close()
  87300. }
  87301. return nil, &googleapi.Error{
  87302. Code: res.StatusCode,
  87303. Header: res.Header,
  87304. }
  87305. }
  87306. if err != nil {
  87307. return nil, err
  87308. }
  87309. defer googleapi.CloseBody(res)
  87310. if err := googleapi.CheckResponse(res); err != nil {
  87311. return nil, err
  87312. }
  87313. ret := &Operation{
  87314. ServerResponse: googleapi.ServerResponse{
  87315. Header: res.Header,
  87316. HTTPStatusCode: res.StatusCode,
  87317. },
  87318. }
  87319. target := &ret
  87320. if err := gensupport.DecodeResponse(target, res); err != nil {
  87321. return nil, err
  87322. }
  87323. return ret, nil
  87324. // {
  87325. // "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 updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method.",
  87326. // "httpMethod": "PUT",
  87327. // "id": "compute.regionInstanceGroupManagers.update",
  87328. // "parameterOrder": [
  87329. // "project",
  87330. // "region",
  87331. // "instanceGroupManager"
  87332. // ],
  87333. // "parameters": {
  87334. // "instanceGroupManager": {
  87335. // "description": "The name of the instance group manager.",
  87336. // "location": "path",
  87337. // "required": true,
  87338. // "type": "string"
  87339. // },
  87340. // "project": {
  87341. // "description": "Project ID for this request.",
  87342. // "location": "path",
  87343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87344. // "required": true,
  87345. // "type": "string"
  87346. // },
  87347. // "region": {
  87348. // "description": "Name of the region scoping this request.",
  87349. // "location": "path",
  87350. // "required": true,
  87351. // "type": "string"
  87352. // },
  87353. // "requestId": {
  87354. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87355. // "location": "query",
  87356. // "type": "string"
  87357. // }
  87358. // },
  87359. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  87360. // "request": {
  87361. // "$ref": "InstanceGroupManager"
  87362. // },
  87363. // "response": {
  87364. // "$ref": "Operation"
  87365. // },
  87366. // "scopes": [
  87367. // "https://www.googleapis.com/auth/cloud-platform",
  87368. // "https://www.googleapis.com/auth/compute"
  87369. // ]
  87370. // }
  87371. }
  87372. // method id "compute.regionInstanceGroups.get":
  87373. type RegionInstanceGroupsGetCall struct {
  87374. s *Service
  87375. project string
  87376. region string
  87377. instanceGroup string
  87378. urlParams_ gensupport.URLParams
  87379. ifNoneMatch_ string
  87380. ctx_ context.Context
  87381. header_ http.Header
  87382. }
  87383. // Get: Returns the specified instance group resource.
  87384. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  87385. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87386. c.project = project
  87387. c.region = region
  87388. c.instanceGroup = instanceGroup
  87389. return c
  87390. }
  87391. // Fields allows partial responses to be retrieved. See
  87392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87393. // for more information.
  87394. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  87395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87396. return c
  87397. }
  87398. // IfNoneMatch sets the optional parameter which makes the operation
  87399. // fail if the object's ETag matches the given value. This is useful for
  87400. // getting updates only after the object has changed since the last
  87401. // request. Use googleapi.IsNotModified to check whether the response
  87402. // error from Do is the result of In-None-Match.
  87403. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  87404. c.ifNoneMatch_ = entityTag
  87405. return c
  87406. }
  87407. // Context sets the context to be used in this call's Do method. Any
  87408. // pending HTTP request will be aborted if the provided context is
  87409. // canceled.
  87410. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  87411. c.ctx_ = ctx
  87412. return c
  87413. }
  87414. // Header returns an http.Header that can be modified by the caller to
  87415. // add HTTP headers to the request.
  87416. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  87417. if c.header_ == nil {
  87418. c.header_ = make(http.Header)
  87419. }
  87420. return c.header_
  87421. }
  87422. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  87423. reqHeaders := make(http.Header)
  87424. for k, v := range c.header_ {
  87425. reqHeaders[k] = v
  87426. }
  87427. reqHeaders.Set("User-Agent", c.s.userAgent())
  87428. if c.ifNoneMatch_ != "" {
  87429. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87430. }
  87431. var body io.Reader = nil
  87432. c.urlParams_.Set("alt", alt)
  87433. c.urlParams_.Set("prettyPrint", "false")
  87434. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  87435. urls += "?" + c.urlParams_.Encode()
  87436. req, err := http.NewRequest("GET", urls, body)
  87437. if err != nil {
  87438. return nil, err
  87439. }
  87440. req.Header = reqHeaders
  87441. googleapi.Expand(req.URL, map[string]string{
  87442. "project": c.project,
  87443. "region": c.region,
  87444. "instanceGroup": c.instanceGroup,
  87445. })
  87446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87447. }
  87448. // Do executes the "compute.regionInstanceGroups.get" call.
  87449. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  87450. // status code is an error. Response headers are in either
  87451. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  87452. // at all) in error.(*googleapi.Error).Header. Use
  87453. // googleapi.IsNotModified to check whether the returned error was
  87454. // because http.StatusNotModified was returned.
  87455. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  87456. gensupport.SetOptions(c.urlParams_, opts...)
  87457. res, err := c.doRequest("json")
  87458. if res != nil && res.StatusCode == http.StatusNotModified {
  87459. if res.Body != nil {
  87460. res.Body.Close()
  87461. }
  87462. return nil, &googleapi.Error{
  87463. Code: res.StatusCode,
  87464. Header: res.Header,
  87465. }
  87466. }
  87467. if err != nil {
  87468. return nil, err
  87469. }
  87470. defer googleapi.CloseBody(res)
  87471. if err := googleapi.CheckResponse(res); err != nil {
  87472. return nil, err
  87473. }
  87474. ret := &InstanceGroup{
  87475. ServerResponse: googleapi.ServerResponse{
  87476. Header: res.Header,
  87477. HTTPStatusCode: res.StatusCode,
  87478. },
  87479. }
  87480. target := &ret
  87481. if err := gensupport.DecodeResponse(target, res); err != nil {
  87482. return nil, err
  87483. }
  87484. return ret, nil
  87485. // {
  87486. // "description": "Returns the specified instance group resource.",
  87487. // "httpMethod": "GET",
  87488. // "id": "compute.regionInstanceGroups.get",
  87489. // "parameterOrder": [
  87490. // "project",
  87491. // "region",
  87492. // "instanceGroup"
  87493. // ],
  87494. // "parameters": {
  87495. // "instanceGroup": {
  87496. // "description": "Name of the instance group resource to return.",
  87497. // "location": "path",
  87498. // "required": true,
  87499. // "type": "string"
  87500. // },
  87501. // "project": {
  87502. // "description": "Project ID for this request.",
  87503. // "location": "path",
  87504. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87505. // "required": true,
  87506. // "type": "string"
  87507. // },
  87508. // "region": {
  87509. // "description": "Name of the region scoping this request.",
  87510. // "location": "path",
  87511. // "required": true,
  87512. // "type": "string"
  87513. // }
  87514. // },
  87515. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  87516. // "response": {
  87517. // "$ref": "InstanceGroup"
  87518. // },
  87519. // "scopes": [
  87520. // "https://www.googleapis.com/auth/cloud-platform",
  87521. // "https://www.googleapis.com/auth/compute",
  87522. // "https://www.googleapis.com/auth/compute.readonly"
  87523. // ]
  87524. // }
  87525. }
  87526. // method id "compute.regionInstanceGroups.list":
  87527. type RegionInstanceGroupsListCall struct {
  87528. s *Service
  87529. project string
  87530. region string
  87531. urlParams_ gensupport.URLParams
  87532. ifNoneMatch_ string
  87533. ctx_ context.Context
  87534. header_ http.Header
  87535. }
  87536. // List: Retrieves the list of instance group resources contained within
  87537. // the specified region.
  87538. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  87539. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87540. c.project = project
  87541. c.region = region
  87542. return c
  87543. }
  87544. // Filter sets the optional parameter "filter": A filter expression that
  87545. // filters resources listed in the response. The expression must specify
  87546. // the field name, a comparison operator, and the value that you want to
  87547. // use for filtering. The value must be a string, a number, or a
  87548. // boolean. The comparison operator must be either =, !=, >, or <.
  87549. //
  87550. // For example, if you are filtering Compute Engine instances, you can
  87551. // exclude instances named example-instance by specifying name !=
  87552. // example-instance.
  87553. //
  87554. // You can also filter nested fields. For example, you could specify
  87555. // scheduling.automaticRestart = false to include instances only if they
  87556. // are not scheduled for automatic restarts. You can use filtering on
  87557. // nested fields to filter based on resource labels.
  87558. //
  87559. // To filter on multiple expressions, provide each separate expression
  87560. // within parentheses. For example, (scheduling.automaticRestart = true)
  87561. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87562. // AND expression. However, you can include AND and OR expressions
  87563. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87564. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87565. // true).
  87566. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  87567. c.urlParams_.Set("filter", filter)
  87568. return c
  87569. }
  87570. // MaxResults sets the optional parameter "maxResults": The maximum
  87571. // number of results per page that should be returned. If the number of
  87572. // available results is larger than maxResults, Compute Engine returns a
  87573. // nextPageToken that can be used to get the next page of results in
  87574. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87575. // (Default: 500)
  87576. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  87577. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87578. return c
  87579. }
  87580. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87581. // a certain order. By default, results are returned in alphanumerical
  87582. // order based on the resource name.
  87583. //
  87584. // You can also sort results in descending order based on the creation
  87585. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87586. // based on the creationTimestamp field in reverse chronological order
  87587. // (newest result first). Use this to sort resources like operations so
  87588. // that the newest operation is returned first.
  87589. //
  87590. // Currently, only sorting by name or creationTimestamp desc is
  87591. // supported.
  87592. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  87593. c.urlParams_.Set("orderBy", orderBy)
  87594. return c
  87595. }
  87596. // PageToken sets the optional parameter "pageToken": Specifies a page
  87597. // token to use. Set pageToken to the nextPageToken returned by a
  87598. // previous list request to get the next page of results.
  87599. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  87600. c.urlParams_.Set("pageToken", pageToken)
  87601. return c
  87602. }
  87603. // Fields allows partial responses to be retrieved. See
  87604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87605. // for more information.
  87606. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  87607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87608. return c
  87609. }
  87610. // IfNoneMatch sets the optional parameter which makes the operation
  87611. // fail if the object's ETag matches the given value. This is useful for
  87612. // getting updates only after the object has changed since the last
  87613. // request. Use googleapi.IsNotModified to check whether the response
  87614. // error from Do is the result of In-None-Match.
  87615. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  87616. c.ifNoneMatch_ = entityTag
  87617. return c
  87618. }
  87619. // Context sets the context to be used in this call's Do method. Any
  87620. // pending HTTP request will be aborted if the provided context is
  87621. // canceled.
  87622. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  87623. c.ctx_ = ctx
  87624. return c
  87625. }
  87626. // Header returns an http.Header that can be modified by the caller to
  87627. // add HTTP headers to the request.
  87628. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  87629. if c.header_ == nil {
  87630. c.header_ = make(http.Header)
  87631. }
  87632. return c.header_
  87633. }
  87634. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  87635. reqHeaders := make(http.Header)
  87636. for k, v := range c.header_ {
  87637. reqHeaders[k] = v
  87638. }
  87639. reqHeaders.Set("User-Agent", c.s.userAgent())
  87640. if c.ifNoneMatch_ != "" {
  87641. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87642. }
  87643. var body io.Reader = nil
  87644. c.urlParams_.Set("alt", alt)
  87645. c.urlParams_.Set("prettyPrint", "false")
  87646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  87647. urls += "?" + c.urlParams_.Encode()
  87648. req, err := http.NewRequest("GET", urls, body)
  87649. if err != nil {
  87650. return nil, err
  87651. }
  87652. req.Header = reqHeaders
  87653. googleapi.Expand(req.URL, map[string]string{
  87654. "project": c.project,
  87655. "region": c.region,
  87656. })
  87657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87658. }
  87659. // Do executes the "compute.regionInstanceGroups.list" call.
  87660. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  87661. // non-2xx status code is an error. Response headers are in either
  87662. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  87663. // returned at all) in error.(*googleapi.Error).Header. Use
  87664. // googleapi.IsNotModified to check whether the returned error was
  87665. // because http.StatusNotModified was returned.
  87666. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  87667. gensupport.SetOptions(c.urlParams_, opts...)
  87668. res, err := c.doRequest("json")
  87669. if res != nil && res.StatusCode == http.StatusNotModified {
  87670. if res.Body != nil {
  87671. res.Body.Close()
  87672. }
  87673. return nil, &googleapi.Error{
  87674. Code: res.StatusCode,
  87675. Header: res.Header,
  87676. }
  87677. }
  87678. if err != nil {
  87679. return nil, err
  87680. }
  87681. defer googleapi.CloseBody(res)
  87682. if err := googleapi.CheckResponse(res); err != nil {
  87683. return nil, err
  87684. }
  87685. ret := &RegionInstanceGroupList{
  87686. ServerResponse: googleapi.ServerResponse{
  87687. Header: res.Header,
  87688. HTTPStatusCode: res.StatusCode,
  87689. },
  87690. }
  87691. target := &ret
  87692. if err := gensupport.DecodeResponse(target, res); err != nil {
  87693. return nil, err
  87694. }
  87695. return ret, nil
  87696. // {
  87697. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  87698. // "httpMethod": "GET",
  87699. // "id": "compute.regionInstanceGroups.list",
  87700. // "parameterOrder": [
  87701. // "project",
  87702. // "region"
  87703. // ],
  87704. // "parameters": {
  87705. // "filter": {
  87706. // "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).",
  87707. // "location": "query",
  87708. // "type": "string"
  87709. // },
  87710. // "maxResults": {
  87711. // "default": "500",
  87712. // "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)",
  87713. // "format": "uint32",
  87714. // "location": "query",
  87715. // "minimum": "0",
  87716. // "type": "integer"
  87717. // },
  87718. // "orderBy": {
  87719. // "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.",
  87720. // "location": "query",
  87721. // "type": "string"
  87722. // },
  87723. // "pageToken": {
  87724. // "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.",
  87725. // "location": "query",
  87726. // "type": "string"
  87727. // },
  87728. // "project": {
  87729. // "description": "Project ID for this request.",
  87730. // "location": "path",
  87731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87732. // "required": true,
  87733. // "type": "string"
  87734. // },
  87735. // "region": {
  87736. // "description": "Name of the region scoping this request.",
  87737. // "location": "path",
  87738. // "required": true,
  87739. // "type": "string"
  87740. // }
  87741. // },
  87742. // "path": "{project}/regions/{region}/instanceGroups",
  87743. // "response": {
  87744. // "$ref": "RegionInstanceGroupList"
  87745. // },
  87746. // "scopes": [
  87747. // "https://www.googleapis.com/auth/cloud-platform",
  87748. // "https://www.googleapis.com/auth/compute",
  87749. // "https://www.googleapis.com/auth/compute.readonly"
  87750. // ]
  87751. // }
  87752. }
  87753. // Pages invokes f for each page of results.
  87754. // A non-nil error returned from f will halt the iteration.
  87755. // The provided context supersedes any context provided to the Context method.
  87756. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  87757. c.ctx_ = ctx
  87758. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87759. for {
  87760. x, err := c.Do()
  87761. if err != nil {
  87762. return err
  87763. }
  87764. if err := f(x); err != nil {
  87765. return err
  87766. }
  87767. if x.NextPageToken == "" {
  87768. return nil
  87769. }
  87770. c.PageToken(x.NextPageToken)
  87771. }
  87772. }
  87773. // method id "compute.regionInstanceGroups.listInstances":
  87774. type RegionInstanceGroupsListInstancesCall struct {
  87775. s *Service
  87776. project string
  87777. region string
  87778. instanceGroup string
  87779. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  87780. urlParams_ gensupport.URLParams
  87781. ctx_ context.Context
  87782. header_ http.Header
  87783. }
  87784. // ListInstances: Lists the instances in the specified instance group
  87785. // and displays information about the named ports. Depending on the
  87786. // specified options, this method can list all instances or only the
  87787. // instances that are running.
  87788. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  87789. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87790. c.project = project
  87791. c.region = region
  87792. c.instanceGroup = instanceGroup
  87793. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  87794. return c
  87795. }
  87796. // Filter sets the optional parameter "filter": A filter expression that
  87797. // filters resources listed in the response. The expression must specify
  87798. // the field name, a comparison operator, and the value that you want to
  87799. // use for filtering. The value must be a string, a number, or a
  87800. // boolean. The comparison operator must be either =, !=, >, or <.
  87801. //
  87802. // For example, if you are filtering Compute Engine instances, you can
  87803. // exclude instances named example-instance by specifying name !=
  87804. // example-instance.
  87805. //
  87806. // You can also filter nested fields. For example, you could specify
  87807. // scheduling.automaticRestart = false to include instances only if they
  87808. // are not scheduled for automatic restarts. You can use filtering on
  87809. // nested fields to filter based on resource labels.
  87810. //
  87811. // To filter on multiple expressions, provide each separate expression
  87812. // within parentheses. For example, (scheduling.automaticRestart = true)
  87813. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87814. // AND expression. However, you can include AND and OR expressions
  87815. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87816. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87817. // true).
  87818. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  87819. c.urlParams_.Set("filter", filter)
  87820. return c
  87821. }
  87822. // MaxResults sets the optional parameter "maxResults": The maximum
  87823. // number of results per page that should be returned. If the number of
  87824. // available results is larger than maxResults, Compute Engine returns a
  87825. // nextPageToken that can be used to get the next page of results in
  87826. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87827. // (Default: 500)
  87828. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  87829. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87830. return c
  87831. }
  87832. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87833. // a certain order. By default, results are returned in alphanumerical
  87834. // order based on the resource name.
  87835. //
  87836. // You can also sort results in descending order based on the creation
  87837. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87838. // based on the creationTimestamp field in reverse chronological order
  87839. // (newest result first). Use this to sort resources like operations so
  87840. // that the newest operation is returned first.
  87841. //
  87842. // Currently, only sorting by name or creationTimestamp desc is
  87843. // supported.
  87844. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  87845. c.urlParams_.Set("orderBy", orderBy)
  87846. return c
  87847. }
  87848. // PageToken sets the optional parameter "pageToken": Specifies a page
  87849. // token to use. Set pageToken to the nextPageToken returned by a
  87850. // previous list request to get the next page of results.
  87851. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  87852. c.urlParams_.Set("pageToken", pageToken)
  87853. return c
  87854. }
  87855. // Fields allows partial responses to be retrieved. See
  87856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87857. // for more information.
  87858. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  87859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87860. return c
  87861. }
  87862. // Context sets the context to be used in this call's Do method. Any
  87863. // pending HTTP request will be aborted if the provided context is
  87864. // canceled.
  87865. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  87866. c.ctx_ = ctx
  87867. return c
  87868. }
  87869. // Header returns an http.Header that can be modified by the caller to
  87870. // add HTTP headers to the request.
  87871. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  87872. if c.header_ == nil {
  87873. c.header_ = make(http.Header)
  87874. }
  87875. return c.header_
  87876. }
  87877. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  87878. reqHeaders := make(http.Header)
  87879. for k, v := range c.header_ {
  87880. reqHeaders[k] = v
  87881. }
  87882. reqHeaders.Set("User-Agent", c.s.userAgent())
  87883. var body io.Reader = nil
  87884. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  87885. if err != nil {
  87886. return nil, err
  87887. }
  87888. reqHeaders.Set("Content-Type", "application/json")
  87889. c.urlParams_.Set("alt", alt)
  87890. c.urlParams_.Set("prettyPrint", "false")
  87891. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  87892. urls += "?" + c.urlParams_.Encode()
  87893. req, err := http.NewRequest("POST", urls, body)
  87894. if err != nil {
  87895. return nil, err
  87896. }
  87897. req.Header = reqHeaders
  87898. googleapi.Expand(req.URL, map[string]string{
  87899. "project": c.project,
  87900. "region": c.region,
  87901. "instanceGroup": c.instanceGroup,
  87902. })
  87903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87904. }
  87905. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  87906. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  87907. // non-nil. Any non-2xx status code is an error. Response headers are in
  87908. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  87909. // (if a response was returned at all) in
  87910. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  87911. // whether the returned error was because http.StatusNotModified was
  87912. // returned.
  87913. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  87914. gensupport.SetOptions(c.urlParams_, opts...)
  87915. res, err := c.doRequest("json")
  87916. if res != nil && res.StatusCode == http.StatusNotModified {
  87917. if res.Body != nil {
  87918. res.Body.Close()
  87919. }
  87920. return nil, &googleapi.Error{
  87921. Code: res.StatusCode,
  87922. Header: res.Header,
  87923. }
  87924. }
  87925. if err != nil {
  87926. return nil, err
  87927. }
  87928. defer googleapi.CloseBody(res)
  87929. if err := googleapi.CheckResponse(res); err != nil {
  87930. return nil, err
  87931. }
  87932. ret := &RegionInstanceGroupsListInstances{
  87933. ServerResponse: googleapi.ServerResponse{
  87934. Header: res.Header,
  87935. HTTPStatusCode: res.StatusCode,
  87936. },
  87937. }
  87938. target := &ret
  87939. if err := gensupport.DecodeResponse(target, res); err != nil {
  87940. return nil, err
  87941. }
  87942. return ret, nil
  87943. // {
  87944. // "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.",
  87945. // "httpMethod": "POST",
  87946. // "id": "compute.regionInstanceGroups.listInstances",
  87947. // "parameterOrder": [
  87948. // "project",
  87949. // "region",
  87950. // "instanceGroup"
  87951. // ],
  87952. // "parameters": {
  87953. // "filter": {
  87954. // "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).",
  87955. // "location": "query",
  87956. // "type": "string"
  87957. // },
  87958. // "instanceGroup": {
  87959. // "description": "Name of the regional instance group for which we want to list the instances.",
  87960. // "location": "path",
  87961. // "required": true,
  87962. // "type": "string"
  87963. // },
  87964. // "maxResults": {
  87965. // "default": "500",
  87966. // "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)",
  87967. // "format": "uint32",
  87968. // "location": "query",
  87969. // "minimum": "0",
  87970. // "type": "integer"
  87971. // },
  87972. // "orderBy": {
  87973. // "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.",
  87974. // "location": "query",
  87975. // "type": "string"
  87976. // },
  87977. // "pageToken": {
  87978. // "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.",
  87979. // "location": "query",
  87980. // "type": "string"
  87981. // },
  87982. // "project": {
  87983. // "description": "Project ID for this request.",
  87984. // "location": "path",
  87985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87986. // "required": true,
  87987. // "type": "string"
  87988. // },
  87989. // "region": {
  87990. // "description": "Name of the region scoping this request.",
  87991. // "location": "path",
  87992. // "required": true,
  87993. // "type": "string"
  87994. // }
  87995. // },
  87996. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  87997. // "request": {
  87998. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  87999. // },
  88000. // "response": {
  88001. // "$ref": "RegionInstanceGroupsListInstances"
  88002. // },
  88003. // "scopes": [
  88004. // "https://www.googleapis.com/auth/cloud-platform",
  88005. // "https://www.googleapis.com/auth/compute",
  88006. // "https://www.googleapis.com/auth/compute.readonly"
  88007. // ]
  88008. // }
  88009. }
  88010. // Pages invokes f for each page of results.
  88011. // A non-nil error returned from f will halt the iteration.
  88012. // The provided context supersedes any context provided to the Context method.
  88013. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  88014. c.ctx_ = ctx
  88015. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88016. for {
  88017. x, err := c.Do()
  88018. if err != nil {
  88019. return err
  88020. }
  88021. if err := f(x); err != nil {
  88022. return err
  88023. }
  88024. if x.NextPageToken == "" {
  88025. return nil
  88026. }
  88027. c.PageToken(x.NextPageToken)
  88028. }
  88029. }
  88030. // method id "compute.regionInstanceGroups.setNamedPorts":
  88031. type RegionInstanceGroupsSetNamedPortsCall struct {
  88032. s *Service
  88033. project string
  88034. region string
  88035. instanceGroup string
  88036. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  88037. urlParams_ gensupport.URLParams
  88038. ctx_ context.Context
  88039. header_ http.Header
  88040. }
  88041. // SetNamedPorts: Sets the named ports for the specified regional
  88042. // instance group.
  88043. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  88044. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88045. c.project = project
  88046. c.region = region
  88047. c.instanceGroup = instanceGroup
  88048. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  88049. return c
  88050. }
  88051. // RequestId sets the optional parameter "requestId": An optional
  88052. // request ID to identify requests. Specify a unique request ID so that
  88053. // if you must retry your request, the server will know to ignore the
  88054. // request if it has already been completed.
  88055. //
  88056. // For example, consider a situation where you make an initial request
  88057. // and the request times out. If you make the request again with the
  88058. // same request ID, the server can check if original operation with the
  88059. // same request ID was received, and if so, will ignore the second
  88060. // request. This prevents clients from accidentally creating duplicate
  88061. // commitments.
  88062. //
  88063. // The request ID must be a valid UUID with the exception that zero UUID
  88064. // is not supported (00000000-0000-0000-0000-000000000000).
  88065. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  88066. c.urlParams_.Set("requestId", requestId)
  88067. return c
  88068. }
  88069. // Fields allows partial responses to be retrieved. See
  88070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88071. // for more information.
  88072. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  88073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88074. return c
  88075. }
  88076. // Context sets the context to be used in this call's Do method. Any
  88077. // pending HTTP request will be aborted if the provided context is
  88078. // canceled.
  88079. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  88080. c.ctx_ = ctx
  88081. return c
  88082. }
  88083. // Header returns an http.Header that can be modified by the caller to
  88084. // add HTTP headers to the request.
  88085. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  88086. if c.header_ == nil {
  88087. c.header_ = make(http.Header)
  88088. }
  88089. return c.header_
  88090. }
  88091. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  88092. reqHeaders := make(http.Header)
  88093. for k, v := range c.header_ {
  88094. reqHeaders[k] = v
  88095. }
  88096. reqHeaders.Set("User-Agent", c.s.userAgent())
  88097. var body io.Reader = nil
  88098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  88099. if err != nil {
  88100. return nil, err
  88101. }
  88102. reqHeaders.Set("Content-Type", "application/json")
  88103. c.urlParams_.Set("alt", alt)
  88104. c.urlParams_.Set("prettyPrint", "false")
  88105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  88106. urls += "?" + c.urlParams_.Encode()
  88107. req, err := http.NewRequest("POST", urls, body)
  88108. if err != nil {
  88109. return nil, err
  88110. }
  88111. req.Header = reqHeaders
  88112. googleapi.Expand(req.URL, map[string]string{
  88113. "project": c.project,
  88114. "region": c.region,
  88115. "instanceGroup": c.instanceGroup,
  88116. })
  88117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88118. }
  88119. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  88120. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88121. // status code is an error. Response headers are in either
  88122. // *Operation.ServerResponse.Header or (if a response was returned at
  88123. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88124. // to check whether the returned error was because
  88125. // http.StatusNotModified was returned.
  88126. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88127. gensupport.SetOptions(c.urlParams_, opts...)
  88128. res, err := c.doRequest("json")
  88129. if res != nil && res.StatusCode == http.StatusNotModified {
  88130. if res.Body != nil {
  88131. res.Body.Close()
  88132. }
  88133. return nil, &googleapi.Error{
  88134. Code: res.StatusCode,
  88135. Header: res.Header,
  88136. }
  88137. }
  88138. if err != nil {
  88139. return nil, err
  88140. }
  88141. defer googleapi.CloseBody(res)
  88142. if err := googleapi.CheckResponse(res); err != nil {
  88143. return nil, err
  88144. }
  88145. ret := &Operation{
  88146. ServerResponse: googleapi.ServerResponse{
  88147. Header: res.Header,
  88148. HTTPStatusCode: res.StatusCode,
  88149. },
  88150. }
  88151. target := &ret
  88152. if err := gensupport.DecodeResponse(target, res); err != nil {
  88153. return nil, err
  88154. }
  88155. return ret, nil
  88156. // {
  88157. // "description": "Sets the named ports for the specified regional instance group.",
  88158. // "httpMethod": "POST",
  88159. // "id": "compute.regionInstanceGroups.setNamedPorts",
  88160. // "parameterOrder": [
  88161. // "project",
  88162. // "region",
  88163. // "instanceGroup"
  88164. // ],
  88165. // "parameters": {
  88166. // "instanceGroup": {
  88167. // "description": "The name of the regional instance group where the named ports are updated.",
  88168. // "location": "path",
  88169. // "required": true,
  88170. // "type": "string"
  88171. // },
  88172. // "project": {
  88173. // "description": "Project ID for this request.",
  88174. // "location": "path",
  88175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88176. // "required": true,
  88177. // "type": "string"
  88178. // },
  88179. // "region": {
  88180. // "description": "Name of the region scoping this request.",
  88181. // "location": "path",
  88182. // "required": true,
  88183. // "type": "string"
  88184. // },
  88185. // "requestId": {
  88186. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88187. // "location": "query",
  88188. // "type": "string"
  88189. // }
  88190. // },
  88191. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  88192. // "request": {
  88193. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  88194. // },
  88195. // "response": {
  88196. // "$ref": "Operation"
  88197. // },
  88198. // "scopes": [
  88199. // "https://www.googleapis.com/auth/cloud-platform",
  88200. // "https://www.googleapis.com/auth/compute"
  88201. // ]
  88202. // }
  88203. }
  88204. // method id "compute.regionInstanceGroups.testIamPermissions":
  88205. type RegionInstanceGroupsTestIamPermissionsCall struct {
  88206. s *Service
  88207. project string
  88208. region string
  88209. resource string
  88210. testpermissionsrequest *TestPermissionsRequest
  88211. urlParams_ gensupport.URLParams
  88212. ctx_ context.Context
  88213. header_ http.Header
  88214. }
  88215. // TestIamPermissions: Returns permissions that a caller has on the
  88216. // specified resource.
  88217. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  88218. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88219. c.project = project
  88220. c.region = region
  88221. c.resource = resource
  88222. c.testpermissionsrequest = testpermissionsrequest
  88223. return c
  88224. }
  88225. // Fields allows partial responses to be retrieved. See
  88226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88227. // for more information.
  88228. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  88229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88230. return c
  88231. }
  88232. // Context sets the context to be used in this call's Do method. Any
  88233. // pending HTTP request will be aborted if the provided context is
  88234. // canceled.
  88235. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  88236. c.ctx_ = ctx
  88237. return c
  88238. }
  88239. // Header returns an http.Header that can be modified by the caller to
  88240. // add HTTP headers to the request.
  88241. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  88242. if c.header_ == nil {
  88243. c.header_ = make(http.Header)
  88244. }
  88245. return c.header_
  88246. }
  88247. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88248. reqHeaders := make(http.Header)
  88249. for k, v := range c.header_ {
  88250. reqHeaders[k] = v
  88251. }
  88252. reqHeaders.Set("User-Agent", c.s.userAgent())
  88253. var body io.Reader = nil
  88254. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88255. if err != nil {
  88256. return nil, err
  88257. }
  88258. reqHeaders.Set("Content-Type", "application/json")
  88259. c.urlParams_.Set("alt", alt)
  88260. c.urlParams_.Set("prettyPrint", "false")
  88261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  88262. urls += "?" + c.urlParams_.Encode()
  88263. req, err := http.NewRequest("POST", urls, body)
  88264. if err != nil {
  88265. return nil, err
  88266. }
  88267. req.Header = reqHeaders
  88268. googleapi.Expand(req.URL, map[string]string{
  88269. "project": c.project,
  88270. "region": c.region,
  88271. "resource": c.resource,
  88272. })
  88273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88274. }
  88275. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  88276. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  88277. // non-2xx status code is an error. Response headers are in either
  88278. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  88279. // returned at all) in error.(*googleapi.Error).Header. Use
  88280. // googleapi.IsNotModified to check whether the returned error was
  88281. // because http.StatusNotModified was returned.
  88282. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  88283. gensupport.SetOptions(c.urlParams_, opts...)
  88284. res, err := c.doRequest("json")
  88285. if res != nil && res.StatusCode == http.StatusNotModified {
  88286. if res.Body != nil {
  88287. res.Body.Close()
  88288. }
  88289. return nil, &googleapi.Error{
  88290. Code: res.StatusCode,
  88291. Header: res.Header,
  88292. }
  88293. }
  88294. if err != nil {
  88295. return nil, err
  88296. }
  88297. defer googleapi.CloseBody(res)
  88298. if err := googleapi.CheckResponse(res); err != nil {
  88299. return nil, err
  88300. }
  88301. ret := &TestPermissionsResponse{
  88302. ServerResponse: googleapi.ServerResponse{
  88303. Header: res.Header,
  88304. HTTPStatusCode: res.StatusCode,
  88305. },
  88306. }
  88307. target := &ret
  88308. if err := gensupport.DecodeResponse(target, res); err != nil {
  88309. return nil, err
  88310. }
  88311. return ret, nil
  88312. // {
  88313. // "description": "Returns permissions that a caller has on the specified resource.",
  88314. // "httpMethod": "POST",
  88315. // "id": "compute.regionInstanceGroups.testIamPermissions",
  88316. // "parameterOrder": [
  88317. // "project",
  88318. // "region",
  88319. // "resource"
  88320. // ],
  88321. // "parameters": {
  88322. // "project": {
  88323. // "description": "Project ID for this request.",
  88324. // "location": "path",
  88325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88326. // "required": true,
  88327. // "type": "string"
  88328. // },
  88329. // "region": {
  88330. // "description": "The name of the region for this request.",
  88331. // "location": "path",
  88332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88333. // "required": true,
  88334. // "type": "string"
  88335. // },
  88336. // "resource": {
  88337. // "description": "Name or id of the resource for this request.",
  88338. // "location": "path",
  88339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88340. // "required": true,
  88341. // "type": "string"
  88342. // }
  88343. // },
  88344. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  88345. // "request": {
  88346. // "$ref": "TestPermissionsRequest"
  88347. // },
  88348. // "response": {
  88349. // "$ref": "TestPermissionsResponse"
  88350. // },
  88351. // "scopes": [
  88352. // "https://www.googleapis.com/auth/cloud-platform",
  88353. // "https://www.googleapis.com/auth/compute",
  88354. // "https://www.googleapis.com/auth/compute.readonly"
  88355. // ]
  88356. // }
  88357. }
  88358. // method id "compute.regionOperations.delete":
  88359. type RegionOperationsDeleteCall struct {
  88360. s *Service
  88361. project string
  88362. region string
  88363. operation string
  88364. urlParams_ gensupport.URLParams
  88365. ctx_ context.Context
  88366. header_ http.Header
  88367. }
  88368. // Delete: Deletes the specified region-specific Operations resource.
  88369. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  88370. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  88371. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88372. c.project = project
  88373. c.region = region
  88374. c.operation = operation
  88375. return c
  88376. }
  88377. // Fields allows partial responses to be retrieved. See
  88378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88379. // for more information.
  88380. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  88381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88382. return c
  88383. }
  88384. // Context sets the context to be used in this call's Do method. Any
  88385. // pending HTTP request will be aborted if the provided context is
  88386. // canceled.
  88387. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  88388. c.ctx_ = ctx
  88389. return c
  88390. }
  88391. // Header returns an http.Header that can be modified by the caller to
  88392. // add HTTP headers to the request.
  88393. func (c *RegionOperationsDeleteCall) Header() http.Header {
  88394. if c.header_ == nil {
  88395. c.header_ = make(http.Header)
  88396. }
  88397. return c.header_
  88398. }
  88399. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  88400. reqHeaders := make(http.Header)
  88401. for k, v := range c.header_ {
  88402. reqHeaders[k] = v
  88403. }
  88404. reqHeaders.Set("User-Agent", c.s.userAgent())
  88405. var body io.Reader = nil
  88406. c.urlParams_.Set("alt", alt)
  88407. c.urlParams_.Set("prettyPrint", "false")
  88408. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  88409. urls += "?" + c.urlParams_.Encode()
  88410. req, err := http.NewRequest("DELETE", urls, body)
  88411. if err != nil {
  88412. return nil, err
  88413. }
  88414. req.Header = reqHeaders
  88415. googleapi.Expand(req.URL, map[string]string{
  88416. "project": c.project,
  88417. "region": c.region,
  88418. "operation": c.operation,
  88419. })
  88420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88421. }
  88422. // Do executes the "compute.regionOperations.delete" call.
  88423. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  88424. gensupport.SetOptions(c.urlParams_, opts...)
  88425. res, err := c.doRequest("json")
  88426. if err != nil {
  88427. return err
  88428. }
  88429. defer googleapi.CloseBody(res)
  88430. if err := googleapi.CheckResponse(res); err != nil {
  88431. return err
  88432. }
  88433. return nil
  88434. // {
  88435. // "description": "Deletes the specified region-specific Operations resource.",
  88436. // "httpMethod": "DELETE",
  88437. // "id": "compute.regionOperations.delete",
  88438. // "parameterOrder": [
  88439. // "project",
  88440. // "region",
  88441. // "operation"
  88442. // ],
  88443. // "parameters": {
  88444. // "operation": {
  88445. // "description": "Name of the Operations resource to delete.",
  88446. // "location": "path",
  88447. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88448. // "required": true,
  88449. // "type": "string"
  88450. // },
  88451. // "project": {
  88452. // "description": "Project ID for this request.",
  88453. // "location": "path",
  88454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88455. // "required": true,
  88456. // "type": "string"
  88457. // },
  88458. // "region": {
  88459. // "description": "Name of the region for this request.",
  88460. // "location": "path",
  88461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88462. // "required": true,
  88463. // "type": "string"
  88464. // }
  88465. // },
  88466. // "path": "{project}/regions/{region}/operations/{operation}",
  88467. // "scopes": [
  88468. // "https://www.googleapis.com/auth/cloud-platform",
  88469. // "https://www.googleapis.com/auth/compute"
  88470. // ]
  88471. // }
  88472. }
  88473. // method id "compute.regionOperations.get":
  88474. type RegionOperationsGetCall struct {
  88475. s *Service
  88476. project string
  88477. region string
  88478. operation string
  88479. urlParams_ gensupport.URLParams
  88480. ifNoneMatch_ string
  88481. ctx_ context.Context
  88482. header_ http.Header
  88483. }
  88484. // Get: Retrieves the specified region-specific Operations resource.
  88485. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  88486. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  88487. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88488. c.project = project
  88489. c.region = region
  88490. c.operation = operation
  88491. return c
  88492. }
  88493. // Fields allows partial responses to be retrieved. See
  88494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88495. // for more information.
  88496. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  88497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88498. return c
  88499. }
  88500. // IfNoneMatch sets the optional parameter which makes the operation
  88501. // fail if the object's ETag matches the given value. This is useful for
  88502. // getting updates only after the object has changed since the last
  88503. // request. Use googleapi.IsNotModified to check whether the response
  88504. // error from Do is the result of In-None-Match.
  88505. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  88506. c.ifNoneMatch_ = entityTag
  88507. return c
  88508. }
  88509. // Context sets the context to be used in this call's Do method. Any
  88510. // pending HTTP request will be aborted if the provided context is
  88511. // canceled.
  88512. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  88513. c.ctx_ = ctx
  88514. return c
  88515. }
  88516. // Header returns an http.Header that can be modified by the caller to
  88517. // add HTTP headers to the request.
  88518. func (c *RegionOperationsGetCall) Header() http.Header {
  88519. if c.header_ == nil {
  88520. c.header_ = make(http.Header)
  88521. }
  88522. return c.header_
  88523. }
  88524. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  88525. reqHeaders := make(http.Header)
  88526. for k, v := range c.header_ {
  88527. reqHeaders[k] = v
  88528. }
  88529. reqHeaders.Set("User-Agent", c.s.userAgent())
  88530. if c.ifNoneMatch_ != "" {
  88531. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88532. }
  88533. var body io.Reader = nil
  88534. c.urlParams_.Set("alt", alt)
  88535. c.urlParams_.Set("prettyPrint", "false")
  88536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  88537. urls += "?" + c.urlParams_.Encode()
  88538. req, err := http.NewRequest("GET", urls, body)
  88539. if err != nil {
  88540. return nil, err
  88541. }
  88542. req.Header = reqHeaders
  88543. googleapi.Expand(req.URL, map[string]string{
  88544. "project": c.project,
  88545. "region": c.region,
  88546. "operation": c.operation,
  88547. })
  88548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88549. }
  88550. // Do executes the "compute.regionOperations.get" call.
  88551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88552. // status code is an error. Response headers are in either
  88553. // *Operation.ServerResponse.Header or (if a response was returned at
  88554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88555. // to check whether the returned error was because
  88556. // http.StatusNotModified was returned.
  88557. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88558. gensupport.SetOptions(c.urlParams_, opts...)
  88559. res, err := c.doRequest("json")
  88560. if res != nil && res.StatusCode == http.StatusNotModified {
  88561. if res.Body != nil {
  88562. res.Body.Close()
  88563. }
  88564. return nil, &googleapi.Error{
  88565. Code: res.StatusCode,
  88566. Header: res.Header,
  88567. }
  88568. }
  88569. if err != nil {
  88570. return nil, err
  88571. }
  88572. defer googleapi.CloseBody(res)
  88573. if err := googleapi.CheckResponse(res); err != nil {
  88574. return nil, err
  88575. }
  88576. ret := &Operation{
  88577. ServerResponse: googleapi.ServerResponse{
  88578. Header: res.Header,
  88579. HTTPStatusCode: res.StatusCode,
  88580. },
  88581. }
  88582. target := &ret
  88583. if err := gensupport.DecodeResponse(target, res); err != nil {
  88584. return nil, err
  88585. }
  88586. return ret, nil
  88587. // {
  88588. // "description": "Retrieves the specified region-specific Operations resource.",
  88589. // "httpMethod": "GET",
  88590. // "id": "compute.regionOperations.get",
  88591. // "parameterOrder": [
  88592. // "project",
  88593. // "region",
  88594. // "operation"
  88595. // ],
  88596. // "parameters": {
  88597. // "operation": {
  88598. // "description": "Name of the Operations resource to return.",
  88599. // "location": "path",
  88600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88601. // "required": true,
  88602. // "type": "string"
  88603. // },
  88604. // "project": {
  88605. // "description": "Project ID for this request.",
  88606. // "location": "path",
  88607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88608. // "required": true,
  88609. // "type": "string"
  88610. // },
  88611. // "region": {
  88612. // "description": "Name of the region for this request.",
  88613. // "location": "path",
  88614. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88615. // "required": true,
  88616. // "type": "string"
  88617. // }
  88618. // },
  88619. // "path": "{project}/regions/{region}/operations/{operation}",
  88620. // "response": {
  88621. // "$ref": "Operation"
  88622. // },
  88623. // "scopes": [
  88624. // "https://www.googleapis.com/auth/cloud-platform",
  88625. // "https://www.googleapis.com/auth/compute",
  88626. // "https://www.googleapis.com/auth/compute.readonly"
  88627. // ]
  88628. // }
  88629. }
  88630. // method id "compute.regionOperations.list":
  88631. type RegionOperationsListCall struct {
  88632. s *Service
  88633. project string
  88634. region string
  88635. urlParams_ gensupport.URLParams
  88636. ifNoneMatch_ string
  88637. ctx_ context.Context
  88638. header_ http.Header
  88639. }
  88640. // List: Retrieves a list of Operation resources contained within the
  88641. // specified region.
  88642. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  88643. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  88644. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88645. c.project = project
  88646. c.region = region
  88647. return c
  88648. }
  88649. // Filter sets the optional parameter "filter": A filter expression that
  88650. // filters resources listed in the response. The expression must specify
  88651. // the field name, a comparison operator, and the value that you want to
  88652. // use for filtering. The value must be a string, a number, or a
  88653. // boolean. The comparison operator must be either =, !=, >, or <.
  88654. //
  88655. // For example, if you are filtering Compute Engine instances, you can
  88656. // exclude instances named example-instance by specifying name !=
  88657. // example-instance.
  88658. //
  88659. // You can also filter nested fields. For example, you could specify
  88660. // scheduling.automaticRestart = false to include instances only if they
  88661. // are not scheduled for automatic restarts. You can use filtering on
  88662. // nested fields to filter based on resource labels.
  88663. //
  88664. // To filter on multiple expressions, provide each separate expression
  88665. // within parentheses. For example, (scheduling.automaticRestart = true)
  88666. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88667. // AND expression. However, you can include AND and OR expressions
  88668. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88669. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88670. // true).
  88671. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  88672. c.urlParams_.Set("filter", filter)
  88673. return c
  88674. }
  88675. // MaxResults sets the optional parameter "maxResults": The maximum
  88676. // number of results per page that should be returned. If the number of
  88677. // available results is larger than maxResults, Compute Engine returns a
  88678. // nextPageToken that can be used to get the next page of results in
  88679. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88680. // (Default: 500)
  88681. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  88682. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88683. return c
  88684. }
  88685. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88686. // a certain order. By default, results are returned in alphanumerical
  88687. // order based on the resource name.
  88688. //
  88689. // You can also sort results in descending order based on the creation
  88690. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88691. // based on the creationTimestamp field in reverse chronological order
  88692. // (newest result first). Use this to sort resources like operations so
  88693. // that the newest operation is returned first.
  88694. //
  88695. // Currently, only sorting by name or creationTimestamp desc is
  88696. // supported.
  88697. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  88698. c.urlParams_.Set("orderBy", orderBy)
  88699. return c
  88700. }
  88701. // PageToken sets the optional parameter "pageToken": Specifies a page
  88702. // token to use. Set pageToken to the nextPageToken returned by a
  88703. // previous list request to get the next page of results.
  88704. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  88705. c.urlParams_.Set("pageToken", pageToken)
  88706. return c
  88707. }
  88708. // Fields allows partial responses to be retrieved. See
  88709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88710. // for more information.
  88711. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  88712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88713. return c
  88714. }
  88715. // IfNoneMatch sets the optional parameter which makes the operation
  88716. // fail if the object's ETag matches the given value. This is useful for
  88717. // getting updates only after the object has changed since the last
  88718. // request. Use googleapi.IsNotModified to check whether the response
  88719. // error from Do is the result of In-None-Match.
  88720. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  88721. c.ifNoneMatch_ = entityTag
  88722. return c
  88723. }
  88724. // Context sets the context to be used in this call's Do method. Any
  88725. // pending HTTP request will be aborted if the provided context is
  88726. // canceled.
  88727. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  88728. c.ctx_ = ctx
  88729. return c
  88730. }
  88731. // Header returns an http.Header that can be modified by the caller to
  88732. // add HTTP headers to the request.
  88733. func (c *RegionOperationsListCall) Header() http.Header {
  88734. if c.header_ == nil {
  88735. c.header_ = make(http.Header)
  88736. }
  88737. return c.header_
  88738. }
  88739. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  88740. reqHeaders := make(http.Header)
  88741. for k, v := range c.header_ {
  88742. reqHeaders[k] = v
  88743. }
  88744. reqHeaders.Set("User-Agent", c.s.userAgent())
  88745. if c.ifNoneMatch_ != "" {
  88746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88747. }
  88748. var body io.Reader = nil
  88749. c.urlParams_.Set("alt", alt)
  88750. c.urlParams_.Set("prettyPrint", "false")
  88751. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  88752. urls += "?" + c.urlParams_.Encode()
  88753. req, err := http.NewRequest("GET", urls, body)
  88754. if err != nil {
  88755. return nil, err
  88756. }
  88757. req.Header = reqHeaders
  88758. googleapi.Expand(req.URL, map[string]string{
  88759. "project": c.project,
  88760. "region": c.region,
  88761. })
  88762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88763. }
  88764. // Do executes the "compute.regionOperations.list" call.
  88765. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  88766. // status code is an error. Response headers are in either
  88767. // *OperationList.ServerResponse.Header or (if a response was returned
  88768. // at all) in error.(*googleapi.Error).Header. Use
  88769. // googleapi.IsNotModified to check whether the returned error was
  88770. // because http.StatusNotModified was returned.
  88771. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  88772. gensupport.SetOptions(c.urlParams_, opts...)
  88773. res, err := c.doRequest("json")
  88774. if res != nil && res.StatusCode == http.StatusNotModified {
  88775. if res.Body != nil {
  88776. res.Body.Close()
  88777. }
  88778. return nil, &googleapi.Error{
  88779. Code: res.StatusCode,
  88780. Header: res.Header,
  88781. }
  88782. }
  88783. if err != nil {
  88784. return nil, err
  88785. }
  88786. defer googleapi.CloseBody(res)
  88787. if err := googleapi.CheckResponse(res); err != nil {
  88788. return nil, err
  88789. }
  88790. ret := &OperationList{
  88791. ServerResponse: googleapi.ServerResponse{
  88792. Header: res.Header,
  88793. HTTPStatusCode: res.StatusCode,
  88794. },
  88795. }
  88796. target := &ret
  88797. if err := gensupport.DecodeResponse(target, res); err != nil {
  88798. return nil, err
  88799. }
  88800. return ret, nil
  88801. // {
  88802. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  88803. // "httpMethod": "GET",
  88804. // "id": "compute.regionOperations.list",
  88805. // "parameterOrder": [
  88806. // "project",
  88807. // "region"
  88808. // ],
  88809. // "parameters": {
  88810. // "filter": {
  88811. // "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).",
  88812. // "location": "query",
  88813. // "type": "string"
  88814. // },
  88815. // "maxResults": {
  88816. // "default": "500",
  88817. // "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)",
  88818. // "format": "uint32",
  88819. // "location": "query",
  88820. // "minimum": "0",
  88821. // "type": "integer"
  88822. // },
  88823. // "orderBy": {
  88824. // "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.",
  88825. // "location": "query",
  88826. // "type": "string"
  88827. // },
  88828. // "pageToken": {
  88829. // "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.",
  88830. // "location": "query",
  88831. // "type": "string"
  88832. // },
  88833. // "project": {
  88834. // "description": "Project ID for this request.",
  88835. // "location": "path",
  88836. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88837. // "required": true,
  88838. // "type": "string"
  88839. // },
  88840. // "region": {
  88841. // "description": "Name of the region for this request.",
  88842. // "location": "path",
  88843. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88844. // "required": true,
  88845. // "type": "string"
  88846. // }
  88847. // },
  88848. // "path": "{project}/regions/{region}/operations",
  88849. // "response": {
  88850. // "$ref": "OperationList"
  88851. // },
  88852. // "scopes": [
  88853. // "https://www.googleapis.com/auth/cloud-platform",
  88854. // "https://www.googleapis.com/auth/compute",
  88855. // "https://www.googleapis.com/auth/compute.readonly"
  88856. // ]
  88857. // }
  88858. }
  88859. // Pages invokes f for each page of results.
  88860. // A non-nil error returned from f will halt the iteration.
  88861. // The provided context supersedes any context provided to the Context method.
  88862. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  88863. c.ctx_ = ctx
  88864. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88865. for {
  88866. x, err := c.Do()
  88867. if err != nil {
  88868. return err
  88869. }
  88870. if err := f(x); err != nil {
  88871. return err
  88872. }
  88873. if x.NextPageToken == "" {
  88874. return nil
  88875. }
  88876. c.PageToken(x.NextPageToken)
  88877. }
  88878. }
  88879. // method id "compute.regions.get":
  88880. type RegionsGetCall struct {
  88881. s *Service
  88882. project string
  88883. region string
  88884. urlParams_ gensupport.URLParams
  88885. ifNoneMatch_ string
  88886. ctx_ context.Context
  88887. header_ http.Header
  88888. }
  88889. // Get: Returns the specified Region resource. Gets a list of available
  88890. // regions by making a list() request.
  88891. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  88892. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  88893. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88894. c.project = project
  88895. c.region = region
  88896. return c
  88897. }
  88898. // Fields allows partial responses to be retrieved. See
  88899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88900. // for more information.
  88901. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  88902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88903. return c
  88904. }
  88905. // IfNoneMatch sets the optional parameter which makes the operation
  88906. // fail if the object's ETag matches the given value. This is useful for
  88907. // getting updates only after the object has changed since the last
  88908. // request. Use googleapi.IsNotModified to check whether the response
  88909. // error from Do is the result of In-None-Match.
  88910. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  88911. c.ifNoneMatch_ = entityTag
  88912. return c
  88913. }
  88914. // Context sets the context to be used in this call's Do method. Any
  88915. // pending HTTP request will be aborted if the provided context is
  88916. // canceled.
  88917. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  88918. c.ctx_ = ctx
  88919. return c
  88920. }
  88921. // Header returns an http.Header that can be modified by the caller to
  88922. // add HTTP headers to the request.
  88923. func (c *RegionsGetCall) Header() http.Header {
  88924. if c.header_ == nil {
  88925. c.header_ = make(http.Header)
  88926. }
  88927. return c.header_
  88928. }
  88929. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  88930. reqHeaders := make(http.Header)
  88931. for k, v := range c.header_ {
  88932. reqHeaders[k] = v
  88933. }
  88934. reqHeaders.Set("User-Agent", c.s.userAgent())
  88935. if c.ifNoneMatch_ != "" {
  88936. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88937. }
  88938. var body io.Reader = nil
  88939. c.urlParams_.Set("alt", alt)
  88940. c.urlParams_.Set("prettyPrint", "false")
  88941. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  88942. urls += "?" + c.urlParams_.Encode()
  88943. req, err := http.NewRequest("GET", urls, body)
  88944. if err != nil {
  88945. return nil, err
  88946. }
  88947. req.Header = reqHeaders
  88948. googleapi.Expand(req.URL, map[string]string{
  88949. "project": c.project,
  88950. "region": c.region,
  88951. })
  88952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88953. }
  88954. // Do executes the "compute.regions.get" call.
  88955. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  88956. // code is an error. Response headers are in either
  88957. // *Region.ServerResponse.Header or (if a response was returned at all)
  88958. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  88959. // check whether the returned error was because http.StatusNotModified
  88960. // was returned.
  88961. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  88962. gensupport.SetOptions(c.urlParams_, opts...)
  88963. res, err := c.doRequest("json")
  88964. if res != nil && res.StatusCode == http.StatusNotModified {
  88965. if res.Body != nil {
  88966. res.Body.Close()
  88967. }
  88968. return nil, &googleapi.Error{
  88969. Code: res.StatusCode,
  88970. Header: res.Header,
  88971. }
  88972. }
  88973. if err != nil {
  88974. return nil, err
  88975. }
  88976. defer googleapi.CloseBody(res)
  88977. if err := googleapi.CheckResponse(res); err != nil {
  88978. return nil, err
  88979. }
  88980. ret := &Region{
  88981. ServerResponse: googleapi.ServerResponse{
  88982. Header: res.Header,
  88983. HTTPStatusCode: res.StatusCode,
  88984. },
  88985. }
  88986. target := &ret
  88987. if err := gensupport.DecodeResponse(target, res); err != nil {
  88988. return nil, err
  88989. }
  88990. return ret, nil
  88991. // {
  88992. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  88993. // "httpMethod": "GET",
  88994. // "id": "compute.regions.get",
  88995. // "parameterOrder": [
  88996. // "project",
  88997. // "region"
  88998. // ],
  88999. // "parameters": {
  89000. // "project": {
  89001. // "description": "Project ID for this request.",
  89002. // "location": "path",
  89003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89004. // "required": true,
  89005. // "type": "string"
  89006. // },
  89007. // "region": {
  89008. // "description": "Name of the region resource to return.",
  89009. // "location": "path",
  89010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89011. // "required": true,
  89012. // "type": "string"
  89013. // }
  89014. // },
  89015. // "path": "{project}/regions/{region}",
  89016. // "response": {
  89017. // "$ref": "Region"
  89018. // },
  89019. // "scopes": [
  89020. // "https://www.googleapis.com/auth/cloud-platform",
  89021. // "https://www.googleapis.com/auth/compute",
  89022. // "https://www.googleapis.com/auth/compute.readonly"
  89023. // ]
  89024. // }
  89025. }
  89026. // method id "compute.regions.list":
  89027. type RegionsListCall struct {
  89028. s *Service
  89029. project string
  89030. urlParams_ gensupport.URLParams
  89031. ifNoneMatch_ string
  89032. ctx_ context.Context
  89033. header_ http.Header
  89034. }
  89035. // List: Retrieves the list of region resources available to the
  89036. // specified project.
  89037. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  89038. func (r *RegionsService) List(project string) *RegionsListCall {
  89039. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89040. c.project = project
  89041. return c
  89042. }
  89043. // Filter sets the optional parameter "filter": A filter expression that
  89044. // filters resources listed in the response. The expression must specify
  89045. // the field name, a comparison operator, and the value that you want to
  89046. // use for filtering. The value must be a string, a number, or a
  89047. // boolean. The comparison operator must be either =, !=, >, or <.
  89048. //
  89049. // For example, if you are filtering Compute Engine instances, you can
  89050. // exclude instances named example-instance by specifying name !=
  89051. // example-instance.
  89052. //
  89053. // You can also filter nested fields. For example, you could specify
  89054. // scheduling.automaticRestart = false to include instances only if they
  89055. // are not scheduled for automatic restarts. You can use filtering on
  89056. // nested fields to filter based on resource labels.
  89057. //
  89058. // To filter on multiple expressions, provide each separate expression
  89059. // within parentheses. For example, (scheduling.automaticRestart = true)
  89060. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89061. // AND expression. However, you can include AND and OR expressions
  89062. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89063. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89064. // true).
  89065. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  89066. c.urlParams_.Set("filter", filter)
  89067. return c
  89068. }
  89069. // MaxResults sets the optional parameter "maxResults": The maximum
  89070. // number of results per page that should be returned. If the number of
  89071. // available results is larger than maxResults, Compute Engine returns a
  89072. // nextPageToken that can be used to get the next page of results in
  89073. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89074. // (Default: 500)
  89075. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  89076. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89077. return c
  89078. }
  89079. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89080. // a certain order. By default, results are returned in alphanumerical
  89081. // order based on the resource name.
  89082. //
  89083. // You can also sort results in descending order based on the creation
  89084. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89085. // based on the creationTimestamp field in reverse chronological order
  89086. // (newest result first). Use this to sort resources like operations so
  89087. // that the newest operation is returned first.
  89088. //
  89089. // Currently, only sorting by name or creationTimestamp desc is
  89090. // supported.
  89091. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  89092. c.urlParams_.Set("orderBy", orderBy)
  89093. return c
  89094. }
  89095. // PageToken sets the optional parameter "pageToken": Specifies a page
  89096. // token to use. Set pageToken to the nextPageToken returned by a
  89097. // previous list request to get the next page of results.
  89098. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  89099. c.urlParams_.Set("pageToken", pageToken)
  89100. return c
  89101. }
  89102. // Fields allows partial responses to be retrieved. See
  89103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89104. // for more information.
  89105. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  89106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89107. return c
  89108. }
  89109. // IfNoneMatch sets the optional parameter which makes the operation
  89110. // fail if the object's ETag matches the given value. This is useful for
  89111. // getting updates only after the object has changed since the last
  89112. // request. Use googleapi.IsNotModified to check whether the response
  89113. // error from Do is the result of In-None-Match.
  89114. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  89115. c.ifNoneMatch_ = entityTag
  89116. return c
  89117. }
  89118. // Context sets the context to be used in this call's Do method. Any
  89119. // pending HTTP request will be aborted if the provided context is
  89120. // canceled.
  89121. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  89122. c.ctx_ = ctx
  89123. return c
  89124. }
  89125. // Header returns an http.Header that can be modified by the caller to
  89126. // add HTTP headers to the request.
  89127. func (c *RegionsListCall) Header() http.Header {
  89128. if c.header_ == nil {
  89129. c.header_ = make(http.Header)
  89130. }
  89131. return c.header_
  89132. }
  89133. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  89134. reqHeaders := make(http.Header)
  89135. for k, v := range c.header_ {
  89136. reqHeaders[k] = v
  89137. }
  89138. reqHeaders.Set("User-Agent", c.s.userAgent())
  89139. if c.ifNoneMatch_ != "" {
  89140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89141. }
  89142. var body io.Reader = nil
  89143. c.urlParams_.Set("alt", alt)
  89144. c.urlParams_.Set("prettyPrint", "false")
  89145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  89146. urls += "?" + c.urlParams_.Encode()
  89147. req, err := http.NewRequest("GET", urls, body)
  89148. if err != nil {
  89149. return nil, err
  89150. }
  89151. req.Header = reqHeaders
  89152. googleapi.Expand(req.URL, map[string]string{
  89153. "project": c.project,
  89154. })
  89155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89156. }
  89157. // Do executes the "compute.regions.list" call.
  89158. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  89159. // status code is an error. Response headers are in either
  89160. // *RegionList.ServerResponse.Header or (if a response was returned at
  89161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89162. // to check whether the returned error was because
  89163. // http.StatusNotModified was returned.
  89164. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  89165. gensupport.SetOptions(c.urlParams_, opts...)
  89166. res, err := c.doRequest("json")
  89167. if res != nil && res.StatusCode == http.StatusNotModified {
  89168. if res.Body != nil {
  89169. res.Body.Close()
  89170. }
  89171. return nil, &googleapi.Error{
  89172. Code: res.StatusCode,
  89173. Header: res.Header,
  89174. }
  89175. }
  89176. if err != nil {
  89177. return nil, err
  89178. }
  89179. defer googleapi.CloseBody(res)
  89180. if err := googleapi.CheckResponse(res); err != nil {
  89181. return nil, err
  89182. }
  89183. ret := &RegionList{
  89184. ServerResponse: googleapi.ServerResponse{
  89185. Header: res.Header,
  89186. HTTPStatusCode: res.StatusCode,
  89187. },
  89188. }
  89189. target := &ret
  89190. if err := gensupport.DecodeResponse(target, res); err != nil {
  89191. return nil, err
  89192. }
  89193. return ret, nil
  89194. // {
  89195. // "description": "Retrieves the list of region resources available to the specified project.",
  89196. // "httpMethod": "GET",
  89197. // "id": "compute.regions.list",
  89198. // "parameterOrder": [
  89199. // "project"
  89200. // ],
  89201. // "parameters": {
  89202. // "filter": {
  89203. // "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).",
  89204. // "location": "query",
  89205. // "type": "string"
  89206. // },
  89207. // "maxResults": {
  89208. // "default": "500",
  89209. // "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)",
  89210. // "format": "uint32",
  89211. // "location": "query",
  89212. // "minimum": "0",
  89213. // "type": "integer"
  89214. // },
  89215. // "orderBy": {
  89216. // "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.",
  89217. // "location": "query",
  89218. // "type": "string"
  89219. // },
  89220. // "pageToken": {
  89221. // "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.",
  89222. // "location": "query",
  89223. // "type": "string"
  89224. // },
  89225. // "project": {
  89226. // "description": "Project ID for this request.",
  89227. // "location": "path",
  89228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89229. // "required": true,
  89230. // "type": "string"
  89231. // }
  89232. // },
  89233. // "path": "{project}/regions",
  89234. // "response": {
  89235. // "$ref": "RegionList"
  89236. // },
  89237. // "scopes": [
  89238. // "https://www.googleapis.com/auth/cloud-platform",
  89239. // "https://www.googleapis.com/auth/compute",
  89240. // "https://www.googleapis.com/auth/compute.readonly"
  89241. // ]
  89242. // }
  89243. }
  89244. // Pages invokes f for each page of results.
  89245. // A non-nil error returned from f will halt the iteration.
  89246. // The provided context supersedes any context provided to the Context method.
  89247. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  89248. c.ctx_ = ctx
  89249. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89250. for {
  89251. x, err := c.Do()
  89252. if err != nil {
  89253. return err
  89254. }
  89255. if err := f(x); err != nil {
  89256. return err
  89257. }
  89258. if x.NextPageToken == "" {
  89259. return nil
  89260. }
  89261. c.PageToken(x.NextPageToken)
  89262. }
  89263. }
  89264. // method id "compute.resourcePolicies.aggregatedList":
  89265. type ResourcePoliciesAggregatedListCall struct {
  89266. s *Service
  89267. project string
  89268. urlParams_ gensupport.URLParams
  89269. ifNoneMatch_ string
  89270. ctx_ context.Context
  89271. header_ http.Header
  89272. }
  89273. // AggregatedList: Retrieves an aggregated list of resource policies.
  89274. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  89275. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89276. c.project = project
  89277. return c
  89278. }
  89279. // Filter sets the optional parameter "filter": A filter expression that
  89280. // filters resources listed in the response. The expression must specify
  89281. // the field name, a comparison operator, and the value that you want to
  89282. // use for filtering. The value must be a string, a number, or a
  89283. // boolean. The comparison operator must be either =, !=, >, or <.
  89284. //
  89285. // For example, if you are filtering Compute Engine instances, you can
  89286. // exclude instances named example-instance by specifying name !=
  89287. // example-instance.
  89288. //
  89289. // You can also filter nested fields. For example, you could specify
  89290. // scheduling.automaticRestart = false to include instances only if they
  89291. // are not scheduled for automatic restarts. You can use filtering on
  89292. // nested fields to filter based on resource labels.
  89293. //
  89294. // To filter on multiple expressions, provide each separate expression
  89295. // within parentheses. For example, (scheduling.automaticRestart = true)
  89296. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89297. // AND expression. However, you can include AND and OR expressions
  89298. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89299. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89300. // true).
  89301. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  89302. c.urlParams_.Set("filter", filter)
  89303. return c
  89304. }
  89305. // MaxResults sets the optional parameter "maxResults": The maximum
  89306. // number of results per page that should be returned. If the number of
  89307. // available results is larger than maxResults, Compute Engine returns a
  89308. // nextPageToken that can be used to get the next page of results in
  89309. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89310. // (Default: 500)
  89311. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  89312. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89313. return c
  89314. }
  89315. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89316. // a certain order. By default, results are returned in alphanumerical
  89317. // order based on the resource name.
  89318. //
  89319. // You can also sort results in descending order based on the creation
  89320. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89321. // based on the creationTimestamp field in reverse chronological order
  89322. // (newest result first). Use this to sort resources like operations so
  89323. // that the newest operation is returned first.
  89324. //
  89325. // Currently, only sorting by name or creationTimestamp desc is
  89326. // supported.
  89327. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  89328. c.urlParams_.Set("orderBy", orderBy)
  89329. return c
  89330. }
  89331. // PageToken sets the optional parameter "pageToken": Specifies a page
  89332. // token to use. Set pageToken to the nextPageToken returned by a
  89333. // previous list request to get the next page of results.
  89334. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  89335. c.urlParams_.Set("pageToken", pageToken)
  89336. return c
  89337. }
  89338. // Fields allows partial responses to be retrieved. See
  89339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89340. // for more information.
  89341. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  89342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89343. return c
  89344. }
  89345. // IfNoneMatch sets the optional parameter which makes the operation
  89346. // fail if the object's ETag matches the given value. This is useful for
  89347. // getting updates only after the object has changed since the last
  89348. // request. Use googleapi.IsNotModified to check whether the response
  89349. // error from Do is the result of In-None-Match.
  89350. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  89351. c.ifNoneMatch_ = entityTag
  89352. return c
  89353. }
  89354. // Context sets the context to be used in this call's Do method. Any
  89355. // pending HTTP request will be aborted if the provided context is
  89356. // canceled.
  89357. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  89358. c.ctx_ = ctx
  89359. return c
  89360. }
  89361. // Header returns an http.Header that can be modified by the caller to
  89362. // add HTTP headers to the request.
  89363. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  89364. if c.header_ == nil {
  89365. c.header_ = make(http.Header)
  89366. }
  89367. return c.header_
  89368. }
  89369. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  89370. reqHeaders := make(http.Header)
  89371. for k, v := range c.header_ {
  89372. reqHeaders[k] = v
  89373. }
  89374. reqHeaders.Set("User-Agent", c.s.userAgent())
  89375. if c.ifNoneMatch_ != "" {
  89376. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89377. }
  89378. var body io.Reader = nil
  89379. c.urlParams_.Set("alt", alt)
  89380. c.urlParams_.Set("prettyPrint", "false")
  89381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  89382. urls += "?" + c.urlParams_.Encode()
  89383. req, err := http.NewRequest("GET", urls, body)
  89384. if err != nil {
  89385. return nil, err
  89386. }
  89387. req.Header = reqHeaders
  89388. googleapi.Expand(req.URL, map[string]string{
  89389. "project": c.project,
  89390. })
  89391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89392. }
  89393. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  89394. // Exactly one of *ResourcePolicyAggregatedList or error will be
  89395. // non-nil. Any non-2xx status code is an error. Response headers are in
  89396. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  89397. // response was returned at all) in error.(*googleapi.Error).Header. Use
  89398. // googleapi.IsNotModified to check whether the returned error was
  89399. // because http.StatusNotModified was returned.
  89400. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  89401. gensupport.SetOptions(c.urlParams_, opts...)
  89402. res, err := c.doRequest("json")
  89403. if res != nil && res.StatusCode == http.StatusNotModified {
  89404. if res.Body != nil {
  89405. res.Body.Close()
  89406. }
  89407. return nil, &googleapi.Error{
  89408. Code: res.StatusCode,
  89409. Header: res.Header,
  89410. }
  89411. }
  89412. if err != nil {
  89413. return nil, err
  89414. }
  89415. defer googleapi.CloseBody(res)
  89416. if err := googleapi.CheckResponse(res); err != nil {
  89417. return nil, err
  89418. }
  89419. ret := &ResourcePolicyAggregatedList{
  89420. ServerResponse: googleapi.ServerResponse{
  89421. Header: res.Header,
  89422. HTTPStatusCode: res.StatusCode,
  89423. },
  89424. }
  89425. target := &ret
  89426. if err := gensupport.DecodeResponse(target, res); err != nil {
  89427. return nil, err
  89428. }
  89429. return ret, nil
  89430. // {
  89431. // "description": "Retrieves an aggregated list of resource policies.",
  89432. // "httpMethod": "GET",
  89433. // "id": "compute.resourcePolicies.aggregatedList",
  89434. // "parameterOrder": [
  89435. // "project"
  89436. // ],
  89437. // "parameters": {
  89438. // "filter": {
  89439. // "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).",
  89440. // "location": "query",
  89441. // "type": "string"
  89442. // },
  89443. // "maxResults": {
  89444. // "default": "500",
  89445. // "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)",
  89446. // "format": "uint32",
  89447. // "location": "query",
  89448. // "minimum": "0",
  89449. // "type": "integer"
  89450. // },
  89451. // "orderBy": {
  89452. // "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.",
  89453. // "location": "query",
  89454. // "type": "string"
  89455. // },
  89456. // "pageToken": {
  89457. // "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.",
  89458. // "location": "query",
  89459. // "type": "string"
  89460. // },
  89461. // "project": {
  89462. // "description": "Project ID for this request.",
  89463. // "location": "path",
  89464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89465. // "required": true,
  89466. // "type": "string"
  89467. // }
  89468. // },
  89469. // "path": "{project}/aggregated/resourcePolicies",
  89470. // "response": {
  89471. // "$ref": "ResourcePolicyAggregatedList"
  89472. // },
  89473. // "scopes": [
  89474. // "https://www.googleapis.com/auth/cloud-platform",
  89475. // "https://www.googleapis.com/auth/compute",
  89476. // "https://www.googleapis.com/auth/compute.readonly"
  89477. // ]
  89478. // }
  89479. }
  89480. // Pages invokes f for each page of results.
  89481. // A non-nil error returned from f will halt the iteration.
  89482. // The provided context supersedes any context provided to the Context method.
  89483. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  89484. c.ctx_ = ctx
  89485. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89486. for {
  89487. x, err := c.Do()
  89488. if err != nil {
  89489. return err
  89490. }
  89491. if err := f(x); err != nil {
  89492. return err
  89493. }
  89494. if x.NextPageToken == "" {
  89495. return nil
  89496. }
  89497. c.PageToken(x.NextPageToken)
  89498. }
  89499. }
  89500. // method id "compute.resourcePolicies.delete":
  89501. type ResourcePoliciesDeleteCall struct {
  89502. s *Service
  89503. project string
  89504. region string
  89505. resourcePolicy string
  89506. urlParams_ gensupport.URLParams
  89507. ctx_ context.Context
  89508. header_ http.Header
  89509. }
  89510. // Delete: Deletes the specified resource policy.
  89511. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  89512. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89513. c.project = project
  89514. c.region = region
  89515. c.resourcePolicy = resourcePolicy
  89516. return c
  89517. }
  89518. // RequestId sets the optional parameter "requestId": An optional
  89519. // request ID to identify requests. Specify a unique request ID so that
  89520. // if you must retry your request, the server will know to ignore the
  89521. // request if it has already been completed.
  89522. //
  89523. // For example, consider a situation where you make an initial request
  89524. // and the request times out. If you make the request again with the
  89525. // same request ID, the server can check if original operation with the
  89526. // same request ID was received, and if so, will ignore the second
  89527. // request. This prevents clients from accidentally creating duplicate
  89528. // commitments.
  89529. //
  89530. // The request ID must be a valid UUID with the exception that zero UUID
  89531. // is not supported (00000000-0000-0000-0000-000000000000).
  89532. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  89533. c.urlParams_.Set("requestId", requestId)
  89534. return c
  89535. }
  89536. // Fields allows partial responses to be retrieved. See
  89537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89538. // for more information.
  89539. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  89540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89541. return c
  89542. }
  89543. // Context sets the context to be used in this call's Do method. Any
  89544. // pending HTTP request will be aborted if the provided context is
  89545. // canceled.
  89546. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  89547. c.ctx_ = ctx
  89548. return c
  89549. }
  89550. // Header returns an http.Header that can be modified by the caller to
  89551. // add HTTP headers to the request.
  89552. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  89553. if c.header_ == nil {
  89554. c.header_ = make(http.Header)
  89555. }
  89556. return c.header_
  89557. }
  89558. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  89559. reqHeaders := make(http.Header)
  89560. for k, v := range c.header_ {
  89561. reqHeaders[k] = v
  89562. }
  89563. reqHeaders.Set("User-Agent", c.s.userAgent())
  89564. var body io.Reader = nil
  89565. c.urlParams_.Set("alt", alt)
  89566. c.urlParams_.Set("prettyPrint", "false")
  89567. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  89568. urls += "?" + c.urlParams_.Encode()
  89569. req, err := http.NewRequest("DELETE", urls, body)
  89570. if err != nil {
  89571. return nil, err
  89572. }
  89573. req.Header = reqHeaders
  89574. googleapi.Expand(req.URL, map[string]string{
  89575. "project": c.project,
  89576. "region": c.region,
  89577. "resourcePolicy": c.resourcePolicy,
  89578. })
  89579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89580. }
  89581. // Do executes the "compute.resourcePolicies.delete" call.
  89582. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89583. // status code is an error. Response headers are in either
  89584. // *Operation.ServerResponse.Header or (if a response was returned at
  89585. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89586. // to check whether the returned error was because
  89587. // http.StatusNotModified was returned.
  89588. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89589. gensupport.SetOptions(c.urlParams_, opts...)
  89590. res, err := c.doRequest("json")
  89591. if res != nil && res.StatusCode == http.StatusNotModified {
  89592. if res.Body != nil {
  89593. res.Body.Close()
  89594. }
  89595. return nil, &googleapi.Error{
  89596. Code: res.StatusCode,
  89597. Header: res.Header,
  89598. }
  89599. }
  89600. if err != nil {
  89601. return nil, err
  89602. }
  89603. defer googleapi.CloseBody(res)
  89604. if err := googleapi.CheckResponse(res); err != nil {
  89605. return nil, err
  89606. }
  89607. ret := &Operation{
  89608. ServerResponse: googleapi.ServerResponse{
  89609. Header: res.Header,
  89610. HTTPStatusCode: res.StatusCode,
  89611. },
  89612. }
  89613. target := &ret
  89614. if err := gensupport.DecodeResponse(target, res); err != nil {
  89615. return nil, err
  89616. }
  89617. return ret, nil
  89618. // {
  89619. // "description": "Deletes the specified resource policy.",
  89620. // "httpMethod": "DELETE",
  89621. // "id": "compute.resourcePolicies.delete",
  89622. // "parameterOrder": [
  89623. // "project",
  89624. // "region",
  89625. // "resourcePolicy"
  89626. // ],
  89627. // "parameters": {
  89628. // "project": {
  89629. // "description": "Project ID for this request.",
  89630. // "location": "path",
  89631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89632. // "required": true,
  89633. // "type": "string"
  89634. // },
  89635. // "region": {
  89636. // "description": "Name of the region for this request.",
  89637. // "location": "path",
  89638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89639. // "required": true,
  89640. // "type": "string"
  89641. // },
  89642. // "requestId": {
  89643. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89644. // "location": "query",
  89645. // "type": "string"
  89646. // },
  89647. // "resourcePolicy": {
  89648. // "description": "Name of the resource policy to delete.",
  89649. // "location": "path",
  89650. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89651. // "required": true,
  89652. // "type": "string"
  89653. // }
  89654. // },
  89655. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  89656. // "response": {
  89657. // "$ref": "Operation"
  89658. // },
  89659. // "scopes": [
  89660. // "https://www.googleapis.com/auth/cloud-platform",
  89661. // "https://www.googleapis.com/auth/compute"
  89662. // ]
  89663. // }
  89664. }
  89665. // method id "compute.resourcePolicies.get":
  89666. type ResourcePoliciesGetCall struct {
  89667. s *Service
  89668. project string
  89669. region string
  89670. resourcePolicy string
  89671. urlParams_ gensupport.URLParams
  89672. ifNoneMatch_ string
  89673. ctx_ context.Context
  89674. header_ http.Header
  89675. }
  89676. // Get: Retrieves all information of the specified resource policy.
  89677. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  89678. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89679. c.project = project
  89680. c.region = region
  89681. c.resourcePolicy = resourcePolicy
  89682. return c
  89683. }
  89684. // Fields allows partial responses to be retrieved. See
  89685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89686. // for more information.
  89687. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  89688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89689. return c
  89690. }
  89691. // IfNoneMatch sets the optional parameter which makes the operation
  89692. // fail if the object's ETag matches the given value. This is useful for
  89693. // getting updates only after the object has changed since the last
  89694. // request. Use googleapi.IsNotModified to check whether the response
  89695. // error from Do is the result of In-None-Match.
  89696. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  89697. c.ifNoneMatch_ = entityTag
  89698. return c
  89699. }
  89700. // Context sets the context to be used in this call's Do method. Any
  89701. // pending HTTP request will be aborted if the provided context is
  89702. // canceled.
  89703. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  89704. c.ctx_ = ctx
  89705. return c
  89706. }
  89707. // Header returns an http.Header that can be modified by the caller to
  89708. // add HTTP headers to the request.
  89709. func (c *ResourcePoliciesGetCall) Header() http.Header {
  89710. if c.header_ == nil {
  89711. c.header_ = make(http.Header)
  89712. }
  89713. return c.header_
  89714. }
  89715. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  89716. reqHeaders := make(http.Header)
  89717. for k, v := range c.header_ {
  89718. reqHeaders[k] = v
  89719. }
  89720. reqHeaders.Set("User-Agent", c.s.userAgent())
  89721. if c.ifNoneMatch_ != "" {
  89722. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89723. }
  89724. var body io.Reader = nil
  89725. c.urlParams_.Set("alt", alt)
  89726. c.urlParams_.Set("prettyPrint", "false")
  89727. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  89728. urls += "?" + c.urlParams_.Encode()
  89729. req, err := http.NewRequest("GET", urls, body)
  89730. if err != nil {
  89731. return nil, err
  89732. }
  89733. req.Header = reqHeaders
  89734. googleapi.Expand(req.URL, map[string]string{
  89735. "project": c.project,
  89736. "region": c.region,
  89737. "resourcePolicy": c.resourcePolicy,
  89738. })
  89739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89740. }
  89741. // Do executes the "compute.resourcePolicies.get" call.
  89742. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  89743. // status code is an error. Response headers are in either
  89744. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  89745. // at all) in error.(*googleapi.Error).Header. Use
  89746. // googleapi.IsNotModified to check whether the returned error was
  89747. // because http.StatusNotModified was returned.
  89748. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  89749. gensupport.SetOptions(c.urlParams_, opts...)
  89750. res, err := c.doRequest("json")
  89751. if res != nil && res.StatusCode == http.StatusNotModified {
  89752. if res.Body != nil {
  89753. res.Body.Close()
  89754. }
  89755. return nil, &googleapi.Error{
  89756. Code: res.StatusCode,
  89757. Header: res.Header,
  89758. }
  89759. }
  89760. if err != nil {
  89761. return nil, err
  89762. }
  89763. defer googleapi.CloseBody(res)
  89764. if err := googleapi.CheckResponse(res); err != nil {
  89765. return nil, err
  89766. }
  89767. ret := &ResourcePolicy{
  89768. ServerResponse: googleapi.ServerResponse{
  89769. Header: res.Header,
  89770. HTTPStatusCode: res.StatusCode,
  89771. },
  89772. }
  89773. target := &ret
  89774. if err := gensupport.DecodeResponse(target, res); err != nil {
  89775. return nil, err
  89776. }
  89777. return ret, nil
  89778. // {
  89779. // "description": "Retrieves all information of the specified resource policy.",
  89780. // "httpMethod": "GET",
  89781. // "id": "compute.resourcePolicies.get",
  89782. // "parameterOrder": [
  89783. // "project",
  89784. // "region",
  89785. // "resourcePolicy"
  89786. // ],
  89787. // "parameters": {
  89788. // "project": {
  89789. // "description": "Project ID for this request.",
  89790. // "location": "path",
  89791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89792. // "required": true,
  89793. // "type": "string"
  89794. // },
  89795. // "region": {
  89796. // "description": "Name of the region for this request.",
  89797. // "location": "path",
  89798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89799. // "required": true,
  89800. // "type": "string"
  89801. // },
  89802. // "resourcePolicy": {
  89803. // "description": "Name of the resource policy to retrieve.",
  89804. // "location": "path",
  89805. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89806. // "required": true,
  89807. // "type": "string"
  89808. // }
  89809. // },
  89810. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  89811. // "response": {
  89812. // "$ref": "ResourcePolicy"
  89813. // },
  89814. // "scopes": [
  89815. // "https://www.googleapis.com/auth/cloud-platform",
  89816. // "https://www.googleapis.com/auth/compute",
  89817. // "https://www.googleapis.com/auth/compute.readonly"
  89818. // ]
  89819. // }
  89820. }
  89821. // method id "compute.resourcePolicies.insert":
  89822. type ResourcePoliciesInsertCall struct {
  89823. s *Service
  89824. project string
  89825. region string
  89826. resourcepolicy *ResourcePolicy
  89827. urlParams_ gensupport.URLParams
  89828. ctx_ context.Context
  89829. header_ http.Header
  89830. }
  89831. // Insert: Creates a new resource policy.
  89832. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  89833. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89834. c.project = project
  89835. c.region = region
  89836. c.resourcepolicy = resourcepolicy
  89837. return c
  89838. }
  89839. // RequestId sets the optional parameter "requestId": An optional
  89840. // request ID to identify requests. Specify a unique request ID so that
  89841. // if you must retry your request, the server will know to ignore the
  89842. // request if it has already been completed.
  89843. //
  89844. // For example, consider a situation where you make an initial request
  89845. // and the request times out. If you make the request again with the
  89846. // same request ID, the server can check if original operation with the
  89847. // same request ID was received, and if so, will ignore the second
  89848. // request. This prevents clients from accidentally creating duplicate
  89849. // commitments.
  89850. //
  89851. // The request ID must be a valid UUID with the exception that zero UUID
  89852. // is not supported (00000000-0000-0000-0000-000000000000).
  89853. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  89854. c.urlParams_.Set("requestId", requestId)
  89855. return c
  89856. }
  89857. // Fields allows partial responses to be retrieved. See
  89858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89859. // for more information.
  89860. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  89861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89862. return c
  89863. }
  89864. // Context sets the context to be used in this call's Do method. Any
  89865. // pending HTTP request will be aborted if the provided context is
  89866. // canceled.
  89867. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  89868. c.ctx_ = ctx
  89869. return c
  89870. }
  89871. // Header returns an http.Header that can be modified by the caller to
  89872. // add HTTP headers to the request.
  89873. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  89874. if c.header_ == nil {
  89875. c.header_ = make(http.Header)
  89876. }
  89877. return c.header_
  89878. }
  89879. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  89880. reqHeaders := make(http.Header)
  89881. for k, v := range c.header_ {
  89882. reqHeaders[k] = v
  89883. }
  89884. reqHeaders.Set("User-Agent", c.s.userAgent())
  89885. var body io.Reader = nil
  89886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  89887. if err != nil {
  89888. return nil, err
  89889. }
  89890. reqHeaders.Set("Content-Type", "application/json")
  89891. c.urlParams_.Set("alt", alt)
  89892. c.urlParams_.Set("prettyPrint", "false")
  89893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  89894. urls += "?" + c.urlParams_.Encode()
  89895. req, err := http.NewRequest("POST", urls, body)
  89896. if err != nil {
  89897. return nil, err
  89898. }
  89899. req.Header = reqHeaders
  89900. googleapi.Expand(req.URL, map[string]string{
  89901. "project": c.project,
  89902. "region": c.region,
  89903. })
  89904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89905. }
  89906. // Do executes the "compute.resourcePolicies.insert" call.
  89907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89908. // status code is an error. Response headers are in either
  89909. // *Operation.ServerResponse.Header or (if a response was returned at
  89910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89911. // to check whether the returned error was because
  89912. // http.StatusNotModified was returned.
  89913. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89914. gensupport.SetOptions(c.urlParams_, opts...)
  89915. res, err := c.doRequest("json")
  89916. if res != nil && res.StatusCode == http.StatusNotModified {
  89917. if res.Body != nil {
  89918. res.Body.Close()
  89919. }
  89920. return nil, &googleapi.Error{
  89921. Code: res.StatusCode,
  89922. Header: res.Header,
  89923. }
  89924. }
  89925. if err != nil {
  89926. return nil, err
  89927. }
  89928. defer googleapi.CloseBody(res)
  89929. if err := googleapi.CheckResponse(res); err != nil {
  89930. return nil, err
  89931. }
  89932. ret := &Operation{
  89933. ServerResponse: googleapi.ServerResponse{
  89934. Header: res.Header,
  89935. HTTPStatusCode: res.StatusCode,
  89936. },
  89937. }
  89938. target := &ret
  89939. if err := gensupport.DecodeResponse(target, res); err != nil {
  89940. return nil, err
  89941. }
  89942. return ret, nil
  89943. // {
  89944. // "description": "Creates a new resource policy.",
  89945. // "httpMethod": "POST",
  89946. // "id": "compute.resourcePolicies.insert",
  89947. // "parameterOrder": [
  89948. // "project",
  89949. // "region"
  89950. // ],
  89951. // "parameters": {
  89952. // "project": {
  89953. // "description": "Project ID for this request.",
  89954. // "location": "path",
  89955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89956. // "required": true,
  89957. // "type": "string"
  89958. // },
  89959. // "region": {
  89960. // "description": "Name of the region for this request.",
  89961. // "location": "path",
  89962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89963. // "required": true,
  89964. // "type": "string"
  89965. // },
  89966. // "requestId": {
  89967. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89968. // "location": "query",
  89969. // "type": "string"
  89970. // }
  89971. // },
  89972. // "path": "{project}/regions/{region}/resourcePolicies",
  89973. // "request": {
  89974. // "$ref": "ResourcePolicy"
  89975. // },
  89976. // "response": {
  89977. // "$ref": "Operation"
  89978. // },
  89979. // "scopes": [
  89980. // "https://www.googleapis.com/auth/cloud-platform",
  89981. // "https://www.googleapis.com/auth/compute"
  89982. // ]
  89983. // }
  89984. }
  89985. // method id "compute.resourcePolicies.list":
  89986. type ResourcePoliciesListCall struct {
  89987. s *Service
  89988. project string
  89989. region string
  89990. urlParams_ gensupport.URLParams
  89991. ifNoneMatch_ string
  89992. ctx_ context.Context
  89993. header_ http.Header
  89994. }
  89995. // List: A list all the resource policies that have been configured for
  89996. // the specified project in specified region.
  89997. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  89998. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89999. c.project = project
  90000. c.region = region
  90001. return c
  90002. }
  90003. // Filter sets the optional parameter "filter": A filter expression that
  90004. // filters resources listed in the response. The expression must specify
  90005. // the field name, a comparison operator, and the value that you want to
  90006. // use for filtering. The value must be a string, a number, or a
  90007. // boolean. The comparison operator must be either =, !=, >, or <.
  90008. //
  90009. // For example, if you are filtering Compute Engine instances, you can
  90010. // exclude instances named example-instance by specifying name !=
  90011. // example-instance.
  90012. //
  90013. // You can also filter nested fields. For example, you could specify
  90014. // scheduling.automaticRestart = false to include instances only if they
  90015. // are not scheduled for automatic restarts. You can use filtering on
  90016. // nested fields to filter based on resource labels.
  90017. //
  90018. // To filter on multiple expressions, provide each separate expression
  90019. // within parentheses. For example, (scheduling.automaticRestart = true)
  90020. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90021. // AND expression. However, you can include AND and OR expressions
  90022. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90023. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90024. // true).
  90025. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  90026. c.urlParams_.Set("filter", filter)
  90027. return c
  90028. }
  90029. // MaxResults sets the optional parameter "maxResults": The maximum
  90030. // number of results per page that should be returned. If the number of
  90031. // available results is larger than maxResults, Compute Engine returns a
  90032. // nextPageToken that can be used to get the next page of results in
  90033. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90034. // (Default: 500)
  90035. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  90036. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90037. return c
  90038. }
  90039. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90040. // a certain order. By default, results are returned in alphanumerical
  90041. // order based on the resource name.
  90042. //
  90043. // You can also sort results in descending order based on the creation
  90044. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90045. // based on the creationTimestamp field in reverse chronological order
  90046. // (newest result first). Use this to sort resources like operations so
  90047. // that the newest operation is returned first.
  90048. //
  90049. // Currently, only sorting by name or creationTimestamp desc is
  90050. // supported.
  90051. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  90052. c.urlParams_.Set("orderBy", orderBy)
  90053. return c
  90054. }
  90055. // PageToken sets the optional parameter "pageToken": Specifies a page
  90056. // token to use. Set pageToken to the nextPageToken returned by a
  90057. // previous list request to get the next page of results.
  90058. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  90059. c.urlParams_.Set("pageToken", pageToken)
  90060. return c
  90061. }
  90062. // Fields allows partial responses to be retrieved. See
  90063. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90064. // for more information.
  90065. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  90066. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90067. return c
  90068. }
  90069. // IfNoneMatch sets the optional parameter which makes the operation
  90070. // fail if the object's ETag matches the given value. This is useful for
  90071. // getting updates only after the object has changed since the last
  90072. // request. Use googleapi.IsNotModified to check whether the response
  90073. // error from Do is the result of In-None-Match.
  90074. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  90075. c.ifNoneMatch_ = entityTag
  90076. return c
  90077. }
  90078. // Context sets the context to be used in this call's Do method. Any
  90079. // pending HTTP request will be aborted if the provided context is
  90080. // canceled.
  90081. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  90082. c.ctx_ = ctx
  90083. return c
  90084. }
  90085. // Header returns an http.Header that can be modified by the caller to
  90086. // add HTTP headers to the request.
  90087. func (c *ResourcePoliciesListCall) Header() http.Header {
  90088. if c.header_ == nil {
  90089. c.header_ = make(http.Header)
  90090. }
  90091. return c.header_
  90092. }
  90093. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  90094. reqHeaders := make(http.Header)
  90095. for k, v := range c.header_ {
  90096. reqHeaders[k] = v
  90097. }
  90098. reqHeaders.Set("User-Agent", c.s.userAgent())
  90099. if c.ifNoneMatch_ != "" {
  90100. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90101. }
  90102. var body io.Reader = nil
  90103. c.urlParams_.Set("alt", alt)
  90104. c.urlParams_.Set("prettyPrint", "false")
  90105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  90106. urls += "?" + c.urlParams_.Encode()
  90107. req, err := http.NewRequest("GET", urls, body)
  90108. if err != nil {
  90109. return nil, err
  90110. }
  90111. req.Header = reqHeaders
  90112. googleapi.Expand(req.URL, map[string]string{
  90113. "project": c.project,
  90114. "region": c.region,
  90115. })
  90116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90117. }
  90118. // Do executes the "compute.resourcePolicies.list" call.
  90119. // Exactly one of *ResourcePolicyList or error will be non-nil. Any
  90120. // non-2xx status code is an error. Response headers are in either
  90121. // *ResourcePolicyList.ServerResponse.Header or (if a response was
  90122. // returned at all) in error.(*googleapi.Error).Header. Use
  90123. // googleapi.IsNotModified to check whether the returned error was
  90124. // because http.StatusNotModified was returned.
  90125. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, error) {
  90126. gensupport.SetOptions(c.urlParams_, opts...)
  90127. res, err := c.doRequest("json")
  90128. if res != nil && res.StatusCode == http.StatusNotModified {
  90129. if res.Body != nil {
  90130. res.Body.Close()
  90131. }
  90132. return nil, &googleapi.Error{
  90133. Code: res.StatusCode,
  90134. Header: res.Header,
  90135. }
  90136. }
  90137. if err != nil {
  90138. return nil, err
  90139. }
  90140. defer googleapi.CloseBody(res)
  90141. if err := googleapi.CheckResponse(res); err != nil {
  90142. return nil, err
  90143. }
  90144. ret := &ResourcePolicyList{
  90145. ServerResponse: googleapi.ServerResponse{
  90146. Header: res.Header,
  90147. HTTPStatusCode: res.StatusCode,
  90148. },
  90149. }
  90150. target := &ret
  90151. if err := gensupport.DecodeResponse(target, res); err != nil {
  90152. return nil, err
  90153. }
  90154. return ret, nil
  90155. // {
  90156. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  90157. // "httpMethod": "GET",
  90158. // "id": "compute.resourcePolicies.list",
  90159. // "parameterOrder": [
  90160. // "project",
  90161. // "region"
  90162. // ],
  90163. // "parameters": {
  90164. // "filter": {
  90165. // "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).",
  90166. // "location": "query",
  90167. // "type": "string"
  90168. // },
  90169. // "maxResults": {
  90170. // "default": "500",
  90171. // "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)",
  90172. // "format": "uint32",
  90173. // "location": "query",
  90174. // "minimum": "0",
  90175. // "type": "integer"
  90176. // },
  90177. // "orderBy": {
  90178. // "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.",
  90179. // "location": "query",
  90180. // "type": "string"
  90181. // },
  90182. // "pageToken": {
  90183. // "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.",
  90184. // "location": "query",
  90185. // "type": "string"
  90186. // },
  90187. // "project": {
  90188. // "description": "Project ID for this request.",
  90189. // "location": "path",
  90190. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90191. // "required": true,
  90192. // "type": "string"
  90193. // },
  90194. // "region": {
  90195. // "description": "Name of the region for this request.",
  90196. // "location": "path",
  90197. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90198. // "required": true,
  90199. // "type": "string"
  90200. // }
  90201. // },
  90202. // "path": "{project}/regions/{region}/resourcePolicies",
  90203. // "response": {
  90204. // "$ref": "ResourcePolicyList"
  90205. // },
  90206. // "scopes": [
  90207. // "https://www.googleapis.com/auth/cloud-platform",
  90208. // "https://www.googleapis.com/auth/compute",
  90209. // "https://www.googleapis.com/auth/compute.readonly"
  90210. // ]
  90211. // }
  90212. }
  90213. // Pages invokes f for each page of results.
  90214. // A non-nil error returned from f will halt the iteration.
  90215. // The provided context supersedes any context provided to the Context method.
  90216. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) error) error {
  90217. c.ctx_ = ctx
  90218. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90219. for {
  90220. x, err := c.Do()
  90221. if err != nil {
  90222. return err
  90223. }
  90224. if err := f(x); err != nil {
  90225. return err
  90226. }
  90227. if x.NextPageToken == "" {
  90228. return nil
  90229. }
  90230. c.PageToken(x.NextPageToken)
  90231. }
  90232. }
  90233. // method id "compute.resourcePolicies.testIamPermissions":
  90234. type ResourcePoliciesTestIamPermissionsCall struct {
  90235. s *Service
  90236. project string
  90237. region string
  90238. resource string
  90239. testpermissionsrequest *TestPermissionsRequest
  90240. urlParams_ gensupport.URLParams
  90241. ctx_ context.Context
  90242. header_ http.Header
  90243. }
  90244. // TestIamPermissions: Returns permissions that a caller has on the
  90245. // specified resource.
  90246. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  90247. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90248. c.project = project
  90249. c.region = region
  90250. c.resource = resource
  90251. c.testpermissionsrequest = testpermissionsrequest
  90252. return c
  90253. }
  90254. // Fields allows partial responses to be retrieved. See
  90255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90256. // for more information.
  90257. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  90258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90259. return c
  90260. }
  90261. // Context sets the context to be used in this call's Do method. Any
  90262. // pending HTTP request will be aborted if the provided context is
  90263. // canceled.
  90264. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  90265. c.ctx_ = ctx
  90266. return c
  90267. }
  90268. // Header returns an http.Header that can be modified by the caller to
  90269. // add HTTP headers to the request.
  90270. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  90271. if c.header_ == nil {
  90272. c.header_ = make(http.Header)
  90273. }
  90274. return c.header_
  90275. }
  90276. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  90277. reqHeaders := make(http.Header)
  90278. for k, v := range c.header_ {
  90279. reqHeaders[k] = v
  90280. }
  90281. reqHeaders.Set("User-Agent", c.s.userAgent())
  90282. var body io.Reader = nil
  90283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  90284. if err != nil {
  90285. return nil, err
  90286. }
  90287. reqHeaders.Set("Content-Type", "application/json")
  90288. c.urlParams_.Set("alt", alt)
  90289. c.urlParams_.Set("prettyPrint", "false")
  90290. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  90291. urls += "?" + c.urlParams_.Encode()
  90292. req, err := http.NewRequest("POST", urls, body)
  90293. if err != nil {
  90294. return nil, err
  90295. }
  90296. req.Header = reqHeaders
  90297. googleapi.Expand(req.URL, map[string]string{
  90298. "project": c.project,
  90299. "region": c.region,
  90300. "resource": c.resource,
  90301. })
  90302. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90303. }
  90304. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  90305. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  90306. // non-2xx status code is an error. Response headers are in either
  90307. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  90308. // returned at all) in error.(*googleapi.Error).Header. Use
  90309. // googleapi.IsNotModified to check whether the returned error was
  90310. // because http.StatusNotModified was returned.
  90311. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  90312. gensupport.SetOptions(c.urlParams_, opts...)
  90313. res, err := c.doRequest("json")
  90314. if res != nil && res.StatusCode == http.StatusNotModified {
  90315. if res.Body != nil {
  90316. res.Body.Close()
  90317. }
  90318. return nil, &googleapi.Error{
  90319. Code: res.StatusCode,
  90320. Header: res.Header,
  90321. }
  90322. }
  90323. if err != nil {
  90324. return nil, err
  90325. }
  90326. defer googleapi.CloseBody(res)
  90327. if err := googleapi.CheckResponse(res); err != nil {
  90328. return nil, err
  90329. }
  90330. ret := &TestPermissionsResponse{
  90331. ServerResponse: googleapi.ServerResponse{
  90332. Header: res.Header,
  90333. HTTPStatusCode: res.StatusCode,
  90334. },
  90335. }
  90336. target := &ret
  90337. if err := gensupport.DecodeResponse(target, res); err != nil {
  90338. return nil, err
  90339. }
  90340. return ret, nil
  90341. // {
  90342. // "description": "Returns permissions that a caller has on the specified resource.",
  90343. // "httpMethod": "POST",
  90344. // "id": "compute.resourcePolicies.testIamPermissions",
  90345. // "parameterOrder": [
  90346. // "project",
  90347. // "region",
  90348. // "resource"
  90349. // ],
  90350. // "parameters": {
  90351. // "project": {
  90352. // "description": "Project ID for this request.",
  90353. // "location": "path",
  90354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90355. // "required": true,
  90356. // "type": "string"
  90357. // },
  90358. // "region": {
  90359. // "description": "The name of the region for this request.",
  90360. // "location": "path",
  90361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90362. // "required": true,
  90363. // "type": "string"
  90364. // },
  90365. // "resource": {
  90366. // "description": "Name or id of the resource for this request.",
  90367. // "location": "path",
  90368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90369. // "required": true,
  90370. // "type": "string"
  90371. // }
  90372. // },
  90373. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  90374. // "request": {
  90375. // "$ref": "TestPermissionsRequest"
  90376. // },
  90377. // "response": {
  90378. // "$ref": "TestPermissionsResponse"
  90379. // },
  90380. // "scopes": [
  90381. // "https://www.googleapis.com/auth/cloud-platform",
  90382. // "https://www.googleapis.com/auth/compute",
  90383. // "https://www.googleapis.com/auth/compute.readonly"
  90384. // ]
  90385. // }
  90386. }
  90387. // method id "compute.routers.aggregatedList":
  90388. type RoutersAggregatedListCall struct {
  90389. s *Service
  90390. project string
  90391. urlParams_ gensupport.URLParams
  90392. ifNoneMatch_ string
  90393. ctx_ context.Context
  90394. header_ http.Header
  90395. }
  90396. // AggregatedList: Retrieves an aggregated list of routers.
  90397. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  90398. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90399. c.project = project
  90400. return c
  90401. }
  90402. // Filter sets the optional parameter "filter": A filter expression that
  90403. // filters resources listed in the response. The expression must specify
  90404. // the field name, a comparison operator, and the value that you want to
  90405. // use for filtering. The value must be a string, a number, or a
  90406. // boolean. The comparison operator must be either =, !=, >, or <.
  90407. //
  90408. // For example, if you are filtering Compute Engine instances, you can
  90409. // exclude instances named example-instance by specifying name !=
  90410. // example-instance.
  90411. //
  90412. // You can also filter nested fields. For example, you could specify
  90413. // scheduling.automaticRestart = false to include instances only if they
  90414. // are not scheduled for automatic restarts. You can use filtering on
  90415. // nested fields to filter based on resource labels.
  90416. //
  90417. // To filter on multiple expressions, provide each separate expression
  90418. // within parentheses. For example, (scheduling.automaticRestart = true)
  90419. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90420. // AND expression. However, you can include AND and OR expressions
  90421. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90422. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90423. // true).
  90424. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  90425. c.urlParams_.Set("filter", filter)
  90426. return c
  90427. }
  90428. // MaxResults sets the optional parameter "maxResults": The maximum
  90429. // number of results per page that should be returned. If the number of
  90430. // available results is larger than maxResults, Compute Engine returns a
  90431. // nextPageToken that can be used to get the next page of results in
  90432. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90433. // (Default: 500)
  90434. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  90435. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90436. return c
  90437. }
  90438. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90439. // a certain order. By default, results are returned in alphanumerical
  90440. // order based on the resource name.
  90441. //
  90442. // You can also sort results in descending order based on the creation
  90443. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90444. // based on the creationTimestamp field in reverse chronological order
  90445. // (newest result first). Use this to sort resources like operations so
  90446. // that the newest operation is returned first.
  90447. //
  90448. // Currently, only sorting by name or creationTimestamp desc is
  90449. // supported.
  90450. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  90451. c.urlParams_.Set("orderBy", orderBy)
  90452. return c
  90453. }
  90454. // PageToken sets the optional parameter "pageToken": Specifies a page
  90455. // token to use. Set pageToken to the nextPageToken returned by a
  90456. // previous list request to get the next page of results.
  90457. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  90458. c.urlParams_.Set("pageToken", pageToken)
  90459. return c
  90460. }
  90461. // Fields allows partial responses to be retrieved. See
  90462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90463. // for more information.
  90464. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  90465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90466. return c
  90467. }
  90468. // IfNoneMatch sets the optional parameter which makes the operation
  90469. // fail if the object's ETag matches the given value. This is useful for
  90470. // getting updates only after the object has changed since the last
  90471. // request. Use googleapi.IsNotModified to check whether the response
  90472. // error from Do is the result of In-None-Match.
  90473. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  90474. c.ifNoneMatch_ = entityTag
  90475. return c
  90476. }
  90477. // Context sets the context to be used in this call's Do method. Any
  90478. // pending HTTP request will be aborted if the provided context is
  90479. // canceled.
  90480. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  90481. c.ctx_ = ctx
  90482. return c
  90483. }
  90484. // Header returns an http.Header that can be modified by the caller to
  90485. // add HTTP headers to the request.
  90486. func (c *RoutersAggregatedListCall) Header() http.Header {
  90487. if c.header_ == nil {
  90488. c.header_ = make(http.Header)
  90489. }
  90490. return c.header_
  90491. }
  90492. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  90493. reqHeaders := make(http.Header)
  90494. for k, v := range c.header_ {
  90495. reqHeaders[k] = v
  90496. }
  90497. reqHeaders.Set("User-Agent", c.s.userAgent())
  90498. if c.ifNoneMatch_ != "" {
  90499. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90500. }
  90501. var body io.Reader = nil
  90502. c.urlParams_.Set("alt", alt)
  90503. c.urlParams_.Set("prettyPrint", "false")
  90504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  90505. urls += "?" + c.urlParams_.Encode()
  90506. req, err := http.NewRequest("GET", urls, body)
  90507. if err != nil {
  90508. return nil, err
  90509. }
  90510. req.Header = reqHeaders
  90511. googleapi.Expand(req.URL, map[string]string{
  90512. "project": c.project,
  90513. })
  90514. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90515. }
  90516. // Do executes the "compute.routers.aggregatedList" call.
  90517. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  90518. // non-2xx status code is an error. Response headers are in either
  90519. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  90520. // returned at all) in error.(*googleapi.Error).Header. Use
  90521. // googleapi.IsNotModified to check whether the returned error was
  90522. // because http.StatusNotModified was returned.
  90523. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  90524. gensupport.SetOptions(c.urlParams_, opts...)
  90525. res, err := c.doRequest("json")
  90526. if res != nil && res.StatusCode == http.StatusNotModified {
  90527. if res.Body != nil {
  90528. res.Body.Close()
  90529. }
  90530. return nil, &googleapi.Error{
  90531. Code: res.StatusCode,
  90532. Header: res.Header,
  90533. }
  90534. }
  90535. if err != nil {
  90536. return nil, err
  90537. }
  90538. defer googleapi.CloseBody(res)
  90539. if err := googleapi.CheckResponse(res); err != nil {
  90540. return nil, err
  90541. }
  90542. ret := &RouterAggregatedList{
  90543. ServerResponse: googleapi.ServerResponse{
  90544. Header: res.Header,
  90545. HTTPStatusCode: res.StatusCode,
  90546. },
  90547. }
  90548. target := &ret
  90549. if err := gensupport.DecodeResponse(target, res); err != nil {
  90550. return nil, err
  90551. }
  90552. return ret, nil
  90553. // {
  90554. // "description": "Retrieves an aggregated list of routers.",
  90555. // "httpMethod": "GET",
  90556. // "id": "compute.routers.aggregatedList",
  90557. // "parameterOrder": [
  90558. // "project"
  90559. // ],
  90560. // "parameters": {
  90561. // "filter": {
  90562. // "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).",
  90563. // "location": "query",
  90564. // "type": "string"
  90565. // },
  90566. // "maxResults": {
  90567. // "default": "500",
  90568. // "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)",
  90569. // "format": "uint32",
  90570. // "location": "query",
  90571. // "minimum": "0",
  90572. // "type": "integer"
  90573. // },
  90574. // "orderBy": {
  90575. // "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.",
  90576. // "location": "query",
  90577. // "type": "string"
  90578. // },
  90579. // "pageToken": {
  90580. // "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.",
  90581. // "location": "query",
  90582. // "type": "string"
  90583. // },
  90584. // "project": {
  90585. // "description": "Project ID for this request.",
  90586. // "location": "path",
  90587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90588. // "required": true,
  90589. // "type": "string"
  90590. // }
  90591. // },
  90592. // "path": "{project}/aggregated/routers",
  90593. // "response": {
  90594. // "$ref": "RouterAggregatedList"
  90595. // },
  90596. // "scopes": [
  90597. // "https://www.googleapis.com/auth/cloud-platform",
  90598. // "https://www.googleapis.com/auth/compute",
  90599. // "https://www.googleapis.com/auth/compute.readonly"
  90600. // ]
  90601. // }
  90602. }
  90603. // Pages invokes f for each page of results.
  90604. // A non-nil error returned from f will halt the iteration.
  90605. // The provided context supersedes any context provided to the Context method.
  90606. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  90607. c.ctx_ = ctx
  90608. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90609. for {
  90610. x, err := c.Do()
  90611. if err != nil {
  90612. return err
  90613. }
  90614. if err := f(x); err != nil {
  90615. return err
  90616. }
  90617. if x.NextPageToken == "" {
  90618. return nil
  90619. }
  90620. c.PageToken(x.NextPageToken)
  90621. }
  90622. }
  90623. // method id "compute.routers.delete":
  90624. type RoutersDeleteCall struct {
  90625. s *Service
  90626. project string
  90627. region string
  90628. router string
  90629. urlParams_ gensupport.URLParams
  90630. ctx_ context.Context
  90631. header_ http.Header
  90632. }
  90633. // Delete: Deletes the specified Router resource.
  90634. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  90635. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90636. c.project = project
  90637. c.region = region
  90638. c.router = router
  90639. return c
  90640. }
  90641. // RequestId sets the optional parameter "requestId": An optional
  90642. // request ID to identify requests. Specify a unique request ID so that
  90643. // if you must retry your request, the server will know to ignore the
  90644. // request if it has already been completed.
  90645. //
  90646. // For example, consider a situation where you make an initial request
  90647. // and the request times out. If you make the request again with the
  90648. // same request ID, the server can check if original operation with the
  90649. // same request ID was received, and if so, will ignore the second
  90650. // request. This prevents clients from accidentally creating duplicate
  90651. // commitments.
  90652. //
  90653. // The request ID must be a valid UUID with the exception that zero UUID
  90654. // is not supported (00000000-0000-0000-0000-000000000000).
  90655. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  90656. c.urlParams_.Set("requestId", requestId)
  90657. return c
  90658. }
  90659. // Fields allows partial responses to be retrieved. See
  90660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90661. // for more information.
  90662. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  90663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90664. return c
  90665. }
  90666. // Context sets the context to be used in this call's Do method. Any
  90667. // pending HTTP request will be aborted if the provided context is
  90668. // canceled.
  90669. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  90670. c.ctx_ = ctx
  90671. return c
  90672. }
  90673. // Header returns an http.Header that can be modified by the caller to
  90674. // add HTTP headers to the request.
  90675. func (c *RoutersDeleteCall) Header() http.Header {
  90676. if c.header_ == nil {
  90677. c.header_ = make(http.Header)
  90678. }
  90679. return c.header_
  90680. }
  90681. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  90682. reqHeaders := make(http.Header)
  90683. for k, v := range c.header_ {
  90684. reqHeaders[k] = v
  90685. }
  90686. reqHeaders.Set("User-Agent", c.s.userAgent())
  90687. var body io.Reader = nil
  90688. c.urlParams_.Set("alt", alt)
  90689. c.urlParams_.Set("prettyPrint", "false")
  90690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  90691. urls += "?" + c.urlParams_.Encode()
  90692. req, err := http.NewRequest("DELETE", urls, body)
  90693. if err != nil {
  90694. return nil, err
  90695. }
  90696. req.Header = reqHeaders
  90697. googleapi.Expand(req.URL, map[string]string{
  90698. "project": c.project,
  90699. "region": c.region,
  90700. "router": c.router,
  90701. })
  90702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90703. }
  90704. // Do executes the "compute.routers.delete" call.
  90705. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90706. // status code is an error. Response headers are in either
  90707. // *Operation.ServerResponse.Header or (if a response was returned at
  90708. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90709. // to check whether the returned error was because
  90710. // http.StatusNotModified was returned.
  90711. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90712. gensupport.SetOptions(c.urlParams_, opts...)
  90713. res, err := c.doRequest("json")
  90714. if res != nil && res.StatusCode == http.StatusNotModified {
  90715. if res.Body != nil {
  90716. res.Body.Close()
  90717. }
  90718. return nil, &googleapi.Error{
  90719. Code: res.StatusCode,
  90720. Header: res.Header,
  90721. }
  90722. }
  90723. if err != nil {
  90724. return nil, err
  90725. }
  90726. defer googleapi.CloseBody(res)
  90727. if err := googleapi.CheckResponse(res); err != nil {
  90728. return nil, err
  90729. }
  90730. ret := &Operation{
  90731. ServerResponse: googleapi.ServerResponse{
  90732. Header: res.Header,
  90733. HTTPStatusCode: res.StatusCode,
  90734. },
  90735. }
  90736. target := &ret
  90737. if err := gensupport.DecodeResponse(target, res); err != nil {
  90738. return nil, err
  90739. }
  90740. return ret, nil
  90741. // {
  90742. // "description": "Deletes the specified Router resource.",
  90743. // "httpMethod": "DELETE",
  90744. // "id": "compute.routers.delete",
  90745. // "parameterOrder": [
  90746. // "project",
  90747. // "region",
  90748. // "router"
  90749. // ],
  90750. // "parameters": {
  90751. // "project": {
  90752. // "description": "Project ID for this request.",
  90753. // "location": "path",
  90754. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90755. // "required": true,
  90756. // "type": "string"
  90757. // },
  90758. // "region": {
  90759. // "description": "Name of the region for this request.",
  90760. // "location": "path",
  90761. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90762. // "required": true,
  90763. // "type": "string"
  90764. // },
  90765. // "requestId": {
  90766. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90767. // "location": "query",
  90768. // "type": "string"
  90769. // },
  90770. // "router": {
  90771. // "description": "Name of the Router resource to delete.",
  90772. // "location": "path",
  90773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90774. // "required": true,
  90775. // "type": "string"
  90776. // }
  90777. // },
  90778. // "path": "{project}/regions/{region}/routers/{router}",
  90779. // "response": {
  90780. // "$ref": "Operation"
  90781. // },
  90782. // "scopes": [
  90783. // "https://www.googleapis.com/auth/cloud-platform",
  90784. // "https://www.googleapis.com/auth/compute"
  90785. // ]
  90786. // }
  90787. }
  90788. // method id "compute.routers.get":
  90789. type RoutersGetCall struct {
  90790. s *Service
  90791. project string
  90792. region string
  90793. router string
  90794. urlParams_ gensupport.URLParams
  90795. ifNoneMatch_ string
  90796. ctx_ context.Context
  90797. header_ http.Header
  90798. }
  90799. // Get: Returns the specified Router resource. Gets a list of available
  90800. // routers by making a list() request.
  90801. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  90802. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90803. c.project = project
  90804. c.region = region
  90805. c.router = router
  90806. return c
  90807. }
  90808. // Fields allows partial responses to be retrieved. See
  90809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90810. // for more information.
  90811. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  90812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90813. return c
  90814. }
  90815. // IfNoneMatch sets the optional parameter which makes the operation
  90816. // fail if the object's ETag matches the given value. This is useful for
  90817. // getting updates only after the object has changed since the last
  90818. // request. Use googleapi.IsNotModified to check whether the response
  90819. // error from Do is the result of In-None-Match.
  90820. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  90821. c.ifNoneMatch_ = entityTag
  90822. return c
  90823. }
  90824. // Context sets the context to be used in this call's Do method. Any
  90825. // pending HTTP request will be aborted if the provided context is
  90826. // canceled.
  90827. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  90828. c.ctx_ = ctx
  90829. return c
  90830. }
  90831. // Header returns an http.Header that can be modified by the caller to
  90832. // add HTTP headers to the request.
  90833. func (c *RoutersGetCall) Header() http.Header {
  90834. if c.header_ == nil {
  90835. c.header_ = make(http.Header)
  90836. }
  90837. return c.header_
  90838. }
  90839. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  90840. reqHeaders := make(http.Header)
  90841. for k, v := range c.header_ {
  90842. reqHeaders[k] = v
  90843. }
  90844. reqHeaders.Set("User-Agent", c.s.userAgent())
  90845. if c.ifNoneMatch_ != "" {
  90846. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90847. }
  90848. var body io.Reader = nil
  90849. c.urlParams_.Set("alt", alt)
  90850. c.urlParams_.Set("prettyPrint", "false")
  90851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  90852. urls += "?" + c.urlParams_.Encode()
  90853. req, err := http.NewRequest("GET", urls, body)
  90854. if err != nil {
  90855. return nil, err
  90856. }
  90857. req.Header = reqHeaders
  90858. googleapi.Expand(req.URL, map[string]string{
  90859. "project": c.project,
  90860. "region": c.region,
  90861. "router": c.router,
  90862. })
  90863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90864. }
  90865. // Do executes the "compute.routers.get" call.
  90866. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  90867. // code is an error. Response headers are in either
  90868. // *Router.ServerResponse.Header or (if a response was returned at all)
  90869. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  90870. // check whether the returned error was because http.StatusNotModified
  90871. // was returned.
  90872. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  90873. gensupport.SetOptions(c.urlParams_, opts...)
  90874. res, err := c.doRequest("json")
  90875. if res != nil && res.StatusCode == http.StatusNotModified {
  90876. if res.Body != nil {
  90877. res.Body.Close()
  90878. }
  90879. return nil, &googleapi.Error{
  90880. Code: res.StatusCode,
  90881. Header: res.Header,
  90882. }
  90883. }
  90884. if err != nil {
  90885. return nil, err
  90886. }
  90887. defer googleapi.CloseBody(res)
  90888. if err := googleapi.CheckResponse(res); err != nil {
  90889. return nil, err
  90890. }
  90891. ret := &Router{
  90892. ServerResponse: googleapi.ServerResponse{
  90893. Header: res.Header,
  90894. HTTPStatusCode: res.StatusCode,
  90895. },
  90896. }
  90897. target := &ret
  90898. if err := gensupport.DecodeResponse(target, res); err != nil {
  90899. return nil, err
  90900. }
  90901. return ret, nil
  90902. // {
  90903. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  90904. // "httpMethod": "GET",
  90905. // "id": "compute.routers.get",
  90906. // "parameterOrder": [
  90907. // "project",
  90908. // "region",
  90909. // "router"
  90910. // ],
  90911. // "parameters": {
  90912. // "project": {
  90913. // "description": "Project ID for this request.",
  90914. // "location": "path",
  90915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90916. // "required": true,
  90917. // "type": "string"
  90918. // },
  90919. // "region": {
  90920. // "description": "Name of the region for this request.",
  90921. // "location": "path",
  90922. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90923. // "required": true,
  90924. // "type": "string"
  90925. // },
  90926. // "router": {
  90927. // "description": "Name of the Router resource to return.",
  90928. // "location": "path",
  90929. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90930. // "required": true,
  90931. // "type": "string"
  90932. // }
  90933. // },
  90934. // "path": "{project}/regions/{region}/routers/{router}",
  90935. // "response": {
  90936. // "$ref": "Router"
  90937. // },
  90938. // "scopes": [
  90939. // "https://www.googleapis.com/auth/cloud-platform",
  90940. // "https://www.googleapis.com/auth/compute",
  90941. // "https://www.googleapis.com/auth/compute.readonly"
  90942. // ]
  90943. // }
  90944. }
  90945. // method id "compute.routers.getNatMappingInfo":
  90946. type RoutersGetNatMappingInfoCall struct {
  90947. s *Service
  90948. project string
  90949. region string
  90950. router string
  90951. urlParams_ gensupport.URLParams
  90952. ifNoneMatch_ string
  90953. ctx_ context.Context
  90954. header_ http.Header
  90955. }
  90956. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  90957. // endpoints.
  90958. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  90959. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90960. c.project = project
  90961. c.region = region
  90962. c.router = router
  90963. return c
  90964. }
  90965. // Filter sets the optional parameter "filter": A filter expression that
  90966. // filters resources listed in the response. The expression must specify
  90967. // the field name, a comparison operator, and the value that you want to
  90968. // use for filtering. The value must be a string, a number, or a
  90969. // boolean. The comparison operator must be either =, !=, >, or <.
  90970. //
  90971. // For example, if you are filtering Compute Engine instances, you can
  90972. // exclude instances named example-instance by specifying name !=
  90973. // example-instance.
  90974. //
  90975. // You can also filter nested fields. For example, you could specify
  90976. // scheduling.automaticRestart = false to include instances only if they
  90977. // are not scheduled for automatic restarts. You can use filtering on
  90978. // nested fields to filter based on resource labels.
  90979. //
  90980. // To filter on multiple expressions, provide each separate expression
  90981. // within parentheses. For example, (scheduling.automaticRestart = true)
  90982. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90983. // AND expression. However, you can include AND and OR expressions
  90984. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90985. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90986. // true).
  90987. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  90988. c.urlParams_.Set("filter", filter)
  90989. return c
  90990. }
  90991. // MaxResults sets the optional parameter "maxResults": The maximum
  90992. // number of results per page that should be returned. If the number of
  90993. // available results is larger than maxResults, Compute Engine returns a
  90994. // nextPageToken that can be used to get the next page of results in
  90995. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90996. // (Default: 500)
  90997. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  90998. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90999. return c
  91000. }
  91001. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91002. // a certain order. By default, results are returned in alphanumerical
  91003. // order based on the resource name.
  91004. //
  91005. // You can also sort results in descending order based on the creation
  91006. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91007. // based on the creationTimestamp field in reverse chronological order
  91008. // (newest result first). Use this to sort resources like operations so
  91009. // that the newest operation is returned first.
  91010. //
  91011. // Currently, only sorting by name or creationTimestamp desc is
  91012. // supported.
  91013. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  91014. c.urlParams_.Set("orderBy", orderBy)
  91015. return c
  91016. }
  91017. // PageToken sets the optional parameter "pageToken": Specifies a page
  91018. // token to use. Set pageToken to the nextPageToken returned by a
  91019. // previous list request to get the next page of results.
  91020. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  91021. c.urlParams_.Set("pageToken", pageToken)
  91022. return c
  91023. }
  91024. // Fields allows partial responses to be retrieved. See
  91025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91026. // for more information.
  91027. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  91028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91029. return c
  91030. }
  91031. // IfNoneMatch sets the optional parameter which makes the operation
  91032. // fail if the object's ETag matches the given value. This is useful for
  91033. // getting updates only after the object has changed since the last
  91034. // request. Use googleapi.IsNotModified to check whether the response
  91035. // error from Do is the result of In-None-Match.
  91036. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  91037. c.ifNoneMatch_ = entityTag
  91038. return c
  91039. }
  91040. // Context sets the context to be used in this call's Do method. Any
  91041. // pending HTTP request will be aborted if the provided context is
  91042. // canceled.
  91043. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  91044. c.ctx_ = ctx
  91045. return c
  91046. }
  91047. // Header returns an http.Header that can be modified by the caller to
  91048. // add HTTP headers to the request.
  91049. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  91050. if c.header_ == nil {
  91051. c.header_ = make(http.Header)
  91052. }
  91053. return c.header_
  91054. }
  91055. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  91056. reqHeaders := make(http.Header)
  91057. for k, v := range c.header_ {
  91058. reqHeaders[k] = v
  91059. }
  91060. reqHeaders.Set("User-Agent", c.s.userAgent())
  91061. if c.ifNoneMatch_ != "" {
  91062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91063. }
  91064. var body io.Reader = nil
  91065. c.urlParams_.Set("alt", alt)
  91066. c.urlParams_.Set("prettyPrint", "false")
  91067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  91068. urls += "?" + c.urlParams_.Encode()
  91069. req, err := http.NewRequest("GET", urls, body)
  91070. if err != nil {
  91071. return nil, err
  91072. }
  91073. req.Header = reqHeaders
  91074. googleapi.Expand(req.URL, map[string]string{
  91075. "project": c.project,
  91076. "region": c.region,
  91077. "router": c.router,
  91078. })
  91079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91080. }
  91081. // Do executes the "compute.routers.getNatMappingInfo" call.
  91082. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  91083. // Any non-2xx status code is an error. Response headers are in either
  91084. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  91085. // was returned at all) in error.(*googleapi.Error).Header. Use
  91086. // googleapi.IsNotModified to check whether the returned error was
  91087. // because http.StatusNotModified was returned.
  91088. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  91089. gensupport.SetOptions(c.urlParams_, opts...)
  91090. res, err := c.doRequest("json")
  91091. if res != nil && res.StatusCode == http.StatusNotModified {
  91092. if res.Body != nil {
  91093. res.Body.Close()
  91094. }
  91095. return nil, &googleapi.Error{
  91096. Code: res.StatusCode,
  91097. Header: res.Header,
  91098. }
  91099. }
  91100. if err != nil {
  91101. return nil, err
  91102. }
  91103. defer googleapi.CloseBody(res)
  91104. if err := googleapi.CheckResponse(res); err != nil {
  91105. return nil, err
  91106. }
  91107. ret := &VmEndpointNatMappingsList{
  91108. ServerResponse: googleapi.ServerResponse{
  91109. Header: res.Header,
  91110. HTTPStatusCode: res.StatusCode,
  91111. },
  91112. }
  91113. target := &ret
  91114. if err := gensupport.DecodeResponse(target, res); err != nil {
  91115. return nil, err
  91116. }
  91117. return ret, nil
  91118. // {
  91119. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  91120. // "httpMethod": "GET",
  91121. // "id": "compute.routers.getNatMappingInfo",
  91122. // "parameterOrder": [
  91123. // "project",
  91124. // "region",
  91125. // "router"
  91126. // ],
  91127. // "parameters": {
  91128. // "filter": {
  91129. // "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).",
  91130. // "location": "query",
  91131. // "type": "string"
  91132. // },
  91133. // "maxResults": {
  91134. // "default": "500",
  91135. // "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)",
  91136. // "format": "uint32",
  91137. // "location": "query",
  91138. // "minimum": "0",
  91139. // "type": "integer"
  91140. // },
  91141. // "orderBy": {
  91142. // "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.",
  91143. // "location": "query",
  91144. // "type": "string"
  91145. // },
  91146. // "pageToken": {
  91147. // "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.",
  91148. // "location": "query",
  91149. // "type": "string"
  91150. // },
  91151. // "project": {
  91152. // "description": "Project ID for this request.",
  91153. // "location": "path",
  91154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91155. // "required": true,
  91156. // "type": "string"
  91157. // },
  91158. // "region": {
  91159. // "description": "Name of the region for this request.",
  91160. // "location": "path",
  91161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91162. // "required": true,
  91163. // "type": "string"
  91164. // },
  91165. // "router": {
  91166. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  91167. // "location": "path",
  91168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91169. // "required": true,
  91170. // "type": "string"
  91171. // }
  91172. // },
  91173. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  91174. // "response": {
  91175. // "$ref": "VmEndpointNatMappingsList"
  91176. // },
  91177. // "scopes": [
  91178. // "https://www.googleapis.com/auth/cloud-platform",
  91179. // "https://www.googleapis.com/auth/compute",
  91180. // "https://www.googleapis.com/auth/compute.readonly"
  91181. // ]
  91182. // }
  91183. }
  91184. // Pages invokes f for each page of results.
  91185. // A non-nil error returned from f will halt the iteration.
  91186. // The provided context supersedes any context provided to the Context method.
  91187. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  91188. c.ctx_ = ctx
  91189. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91190. for {
  91191. x, err := c.Do()
  91192. if err != nil {
  91193. return err
  91194. }
  91195. if err := f(x); err != nil {
  91196. return err
  91197. }
  91198. if x.NextPageToken == "" {
  91199. return nil
  91200. }
  91201. c.PageToken(x.NextPageToken)
  91202. }
  91203. }
  91204. // method id "compute.routers.getRouterStatus":
  91205. type RoutersGetRouterStatusCall struct {
  91206. s *Service
  91207. project string
  91208. region string
  91209. router string
  91210. urlParams_ gensupport.URLParams
  91211. ifNoneMatch_ string
  91212. ctx_ context.Context
  91213. header_ http.Header
  91214. }
  91215. // GetRouterStatus: Retrieves runtime information of the specified
  91216. // router.
  91217. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  91218. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91219. c.project = project
  91220. c.region = region
  91221. c.router = router
  91222. return c
  91223. }
  91224. // Fields allows partial responses to be retrieved. See
  91225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91226. // for more information.
  91227. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  91228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91229. return c
  91230. }
  91231. // IfNoneMatch sets the optional parameter which makes the operation
  91232. // fail if the object's ETag matches the given value. This is useful for
  91233. // getting updates only after the object has changed since the last
  91234. // request. Use googleapi.IsNotModified to check whether the response
  91235. // error from Do is the result of In-None-Match.
  91236. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  91237. c.ifNoneMatch_ = entityTag
  91238. return c
  91239. }
  91240. // Context sets the context to be used in this call's Do method. Any
  91241. // pending HTTP request will be aborted if the provided context is
  91242. // canceled.
  91243. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  91244. c.ctx_ = ctx
  91245. return c
  91246. }
  91247. // Header returns an http.Header that can be modified by the caller to
  91248. // add HTTP headers to the request.
  91249. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  91250. if c.header_ == nil {
  91251. c.header_ = make(http.Header)
  91252. }
  91253. return c.header_
  91254. }
  91255. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  91256. reqHeaders := make(http.Header)
  91257. for k, v := range c.header_ {
  91258. reqHeaders[k] = v
  91259. }
  91260. reqHeaders.Set("User-Agent", c.s.userAgent())
  91261. if c.ifNoneMatch_ != "" {
  91262. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91263. }
  91264. var body io.Reader = nil
  91265. c.urlParams_.Set("alt", alt)
  91266. c.urlParams_.Set("prettyPrint", "false")
  91267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  91268. urls += "?" + c.urlParams_.Encode()
  91269. req, err := http.NewRequest("GET", urls, body)
  91270. if err != nil {
  91271. return nil, err
  91272. }
  91273. req.Header = reqHeaders
  91274. googleapi.Expand(req.URL, map[string]string{
  91275. "project": c.project,
  91276. "region": c.region,
  91277. "router": c.router,
  91278. })
  91279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91280. }
  91281. // Do executes the "compute.routers.getRouterStatus" call.
  91282. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  91283. // non-2xx status code is an error. Response headers are in either
  91284. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  91285. // returned at all) in error.(*googleapi.Error).Header. Use
  91286. // googleapi.IsNotModified to check whether the returned error was
  91287. // because http.StatusNotModified was returned.
  91288. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  91289. gensupport.SetOptions(c.urlParams_, opts...)
  91290. res, err := c.doRequest("json")
  91291. if res != nil && res.StatusCode == http.StatusNotModified {
  91292. if res.Body != nil {
  91293. res.Body.Close()
  91294. }
  91295. return nil, &googleapi.Error{
  91296. Code: res.StatusCode,
  91297. Header: res.Header,
  91298. }
  91299. }
  91300. if err != nil {
  91301. return nil, err
  91302. }
  91303. defer googleapi.CloseBody(res)
  91304. if err := googleapi.CheckResponse(res); err != nil {
  91305. return nil, err
  91306. }
  91307. ret := &RouterStatusResponse{
  91308. ServerResponse: googleapi.ServerResponse{
  91309. Header: res.Header,
  91310. HTTPStatusCode: res.StatusCode,
  91311. },
  91312. }
  91313. target := &ret
  91314. if err := gensupport.DecodeResponse(target, res); err != nil {
  91315. return nil, err
  91316. }
  91317. return ret, nil
  91318. // {
  91319. // "description": "Retrieves runtime information of the specified router.",
  91320. // "httpMethod": "GET",
  91321. // "id": "compute.routers.getRouterStatus",
  91322. // "parameterOrder": [
  91323. // "project",
  91324. // "region",
  91325. // "router"
  91326. // ],
  91327. // "parameters": {
  91328. // "project": {
  91329. // "description": "Project ID for this request.",
  91330. // "location": "path",
  91331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91332. // "required": true,
  91333. // "type": "string"
  91334. // },
  91335. // "region": {
  91336. // "description": "Name of the region for this request.",
  91337. // "location": "path",
  91338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91339. // "required": true,
  91340. // "type": "string"
  91341. // },
  91342. // "router": {
  91343. // "description": "Name of the Router resource to query.",
  91344. // "location": "path",
  91345. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91346. // "required": true,
  91347. // "type": "string"
  91348. // }
  91349. // },
  91350. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  91351. // "response": {
  91352. // "$ref": "RouterStatusResponse"
  91353. // },
  91354. // "scopes": [
  91355. // "https://www.googleapis.com/auth/cloud-platform",
  91356. // "https://www.googleapis.com/auth/compute",
  91357. // "https://www.googleapis.com/auth/compute.readonly"
  91358. // ]
  91359. // }
  91360. }
  91361. // method id "compute.routers.insert":
  91362. type RoutersInsertCall struct {
  91363. s *Service
  91364. project string
  91365. region string
  91366. router *Router
  91367. urlParams_ gensupport.URLParams
  91368. ctx_ context.Context
  91369. header_ http.Header
  91370. }
  91371. // Insert: Creates a Router resource in the specified project and region
  91372. // using the data included in the request.
  91373. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  91374. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91375. c.project = project
  91376. c.region = region
  91377. c.router = router
  91378. return c
  91379. }
  91380. // RequestId sets the optional parameter "requestId": An optional
  91381. // request ID to identify requests. Specify a unique request ID so that
  91382. // if you must retry your request, the server will know to ignore the
  91383. // request if it has already been completed.
  91384. //
  91385. // For example, consider a situation where you make an initial request
  91386. // and the request times out. If you make the request again with the
  91387. // same request ID, the server can check if original operation with the
  91388. // same request ID was received, and if so, will ignore the second
  91389. // request. This prevents clients from accidentally creating duplicate
  91390. // commitments.
  91391. //
  91392. // The request ID must be a valid UUID with the exception that zero UUID
  91393. // is not supported (00000000-0000-0000-0000-000000000000).
  91394. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  91395. c.urlParams_.Set("requestId", requestId)
  91396. return c
  91397. }
  91398. // Fields allows partial responses to be retrieved. See
  91399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91400. // for more information.
  91401. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  91402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91403. return c
  91404. }
  91405. // Context sets the context to be used in this call's Do method. Any
  91406. // pending HTTP request will be aborted if the provided context is
  91407. // canceled.
  91408. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  91409. c.ctx_ = ctx
  91410. return c
  91411. }
  91412. // Header returns an http.Header that can be modified by the caller to
  91413. // add HTTP headers to the request.
  91414. func (c *RoutersInsertCall) Header() http.Header {
  91415. if c.header_ == nil {
  91416. c.header_ = make(http.Header)
  91417. }
  91418. return c.header_
  91419. }
  91420. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  91421. reqHeaders := make(http.Header)
  91422. for k, v := range c.header_ {
  91423. reqHeaders[k] = v
  91424. }
  91425. reqHeaders.Set("User-Agent", c.s.userAgent())
  91426. var body io.Reader = nil
  91427. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  91428. if err != nil {
  91429. return nil, err
  91430. }
  91431. reqHeaders.Set("Content-Type", "application/json")
  91432. c.urlParams_.Set("alt", alt)
  91433. c.urlParams_.Set("prettyPrint", "false")
  91434. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  91435. urls += "?" + c.urlParams_.Encode()
  91436. req, err := http.NewRequest("POST", urls, body)
  91437. if err != nil {
  91438. return nil, err
  91439. }
  91440. req.Header = reqHeaders
  91441. googleapi.Expand(req.URL, map[string]string{
  91442. "project": c.project,
  91443. "region": c.region,
  91444. })
  91445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91446. }
  91447. // Do executes the "compute.routers.insert" call.
  91448. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91449. // status code is an error. Response headers are in either
  91450. // *Operation.ServerResponse.Header or (if a response was returned at
  91451. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91452. // to check whether the returned error was because
  91453. // http.StatusNotModified was returned.
  91454. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91455. gensupport.SetOptions(c.urlParams_, opts...)
  91456. res, err := c.doRequest("json")
  91457. if res != nil && res.StatusCode == http.StatusNotModified {
  91458. if res.Body != nil {
  91459. res.Body.Close()
  91460. }
  91461. return nil, &googleapi.Error{
  91462. Code: res.StatusCode,
  91463. Header: res.Header,
  91464. }
  91465. }
  91466. if err != nil {
  91467. return nil, err
  91468. }
  91469. defer googleapi.CloseBody(res)
  91470. if err := googleapi.CheckResponse(res); err != nil {
  91471. return nil, err
  91472. }
  91473. ret := &Operation{
  91474. ServerResponse: googleapi.ServerResponse{
  91475. Header: res.Header,
  91476. HTTPStatusCode: res.StatusCode,
  91477. },
  91478. }
  91479. target := &ret
  91480. if err := gensupport.DecodeResponse(target, res); err != nil {
  91481. return nil, err
  91482. }
  91483. return ret, nil
  91484. // {
  91485. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  91486. // "httpMethod": "POST",
  91487. // "id": "compute.routers.insert",
  91488. // "parameterOrder": [
  91489. // "project",
  91490. // "region"
  91491. // ],
  91492. // "parameters": {
  91493. // "project": {
  91494. // "description": "Project ID for this request.",
  91495. // "location": "path",
  91496. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91497. // "required": true,
  91498. // "type": "string"
  91499. // },
  91500. // "region": {
  91501. // "description": "Name of the region for 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. // "requestId": {
  91508. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91509. // "location": "query",
  91510. // "type": "string"
  91511. // }
  91512. // },
  91513. // "path": "{project}/regions/{region}/routers",
  91514. // "request": {
  91515. // "$ref": "Router"
  91516. // },
  91517. // "response": {
  91518. // "$ref": "Operation"
  91519. // },
  91520. // "scopes": [
  91521. // "https://www.googleapis.com/auth/cloud-platform",
  91522. // "https://www.googleapis.com/auth/compute"
  91523. // ]
  91524. // }
  91525. }
  91526. // method id "compute.routers.list":
  91527. type RoutersListCall struct {
  91528. s *Service
  91529. project string
  91530. region string
  91531. urlParams_ gensupport.URLParams
  91532. ifNoneMatch_ string
  91533. ctx_ context.Context
  91534. header_ http.Header
  91535. }
  91536. // List: Retrieves a list of Router resources available to the specified
  91537. // project.
  91538. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  91539. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91540. c.project = project
  91541. c.region = region
  91542. return c
  91543. }
  91544. // Filter sets the optional parameter "filter": A filter expression that
  91545. // filters resources listed in the response. The expression must specify
  91546. // the field name, a comparison operator, and the value that you want to
  91547. // use for filtering. The value must be a string, a number, or a
  91548. // boolean. The comparison operator must be either =, !=, >, or <.
  91549. //
  91550. // For example, if you are filtering Compute Engine instances, you can
  91551. // exclude instances named example-instance by specifying name !=
  91552. // example-instance.
  91553. //
  91554. // You can also filter nested fields. For example, you could specify
  91555. // scheduling.automaticRestart = false to include instances only if they
  91556. // are not scheduled for automatic restarts. You can use filtering on
  91557. // nested fields to filter based on resource labels.
  91558. //
  91559. // To filter on multiple expressions, provide each separate expression
  91560. // within parentheses. For example, (scheduling.automaticRestart = true)
  91561. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91562. // AND expression. However, you can include AND and OR expressions
  91563. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91564. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91565. // true).
  91566. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  91567. c.urlParams_.Set("filter", filter)
  91568. return c
  91569. }
  91570. // MaxResults sets the optional parameter "maxResults": The maximum
  91571. // number of results per page that should be returned. If the number of
  91572. // available results is larger than maxResults, Compute Engine returns a
  91573. // nextPageToken that can be used to get the next page of results in
  91574. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91575. // (Default: 500)
  91576. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  91577. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91578. return c
  91579. }
  91580. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91581. // a certain order. By default, results are returned in alphanumerical
  91582. // order based on the resource name.
  91583. //
  91584. // You can also sort results in descending order based on the creation
  91585. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91586. // based on the creationTimestamp field in reverse chronological order
  91587. // (newest result first). Use this to sort resources like operations so
  91588. // that the newest operation is returned first.
  91589. //
  91590. // Currently, only sorting by name or creationTimestamp desc is
  91591. // supported.
  91592. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  91593. c.urlParams_.Set("orderBy", orderBy)
  91594. return c
  91595. }
  91596. // PageToken sets the optional parameter "pageToken": Specifies a page
  91597. // token to use. Set pageToken to the nextPageToken returned by a
  91598. // previous list request to get the next page of results.
  91599. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  91600. c.urlParams_.Set("pageToken", pageToken)
  91601. return c
  91602. }
  91603. // Fields allows partial responses to be retrieved. See
  91604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91605. // for more information.
  91606. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  91607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91608. return c
  91609. }
  91610. // IfNoneMatch sets the optional parameter which makes the operation
  91611. // fail if the object's ETag matches the given value. This is useful for
  91612. // getting updates only after the object has changed since the last
  91613. // request. Use googleapi.IsNotModified to check whether the response
  91614. // error from Do is the result of In-None-Match.
  91615. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  91616. c.ifNoneMatch_ = entityTag
  91617. return c
  91618. }
  91619. // Context sets the context to be used in this call's Do method. Any
  91620. // pending HTTP request will be aborted if the provided context is
  91621. // canceled.
  91622. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  91623. c.ctx_ = ctx
  91624. return c
  91625. }
  91626. // Header returns an http.Header that can be modified by the caller to
  91627. // add HTTP headers to the request.
  91628. func (c *RoutersListCall) Header() http.Header {
  91629. if c.header_ == nil {
  91630. c.header_ = make(http.Header)
  91631. }
  91632. return c.header_
  91633. }
  91634. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  91635. reqHeaders := make(http.Header)
  91636. for k, v := range c.header_ {
  91637. reqHeaders[k] = v
  91638. }
  91639. reqHeaders.Set("User-Agent", c.s.userAgent())
  91640. if c.ifNoneMatch_ != "" {
  91641. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91642. }
  91643. var body io.Reader = nil
  91644. c.urlParams_.Set("alt", alt)
  91645. c.urlParams_.Set("prettyPrint", "false")
  91646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  91647. urls += "?" + c.urlParams_.Encode()
  91648. req, err := http.NewRequest("GET", urls, body)
  91649. if err != nil {
  91650. return nil, err
  91651. }
  91652. req.Header = reqHeaders
  91653. googleapi.Expand(req.URL, map[string]string{
  91654. "project": c.project,
  91655. "region": c.region,
  91656. })
  91657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91658. }
  91659. // Do executes the "compute.routers.list" call.
  91660. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  91661. // status code is an error. Response headers are in either
  91662. // *RouterList.ServerResponse.Header or (if a response was returned at
  91663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91664. // to check whether the returned error was because
  91665. // http.StatusNotModified was returned.
  91666. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  91667. gensupport.SetOptions(c.urlParams_, opts...)
  91668. res, err := c.doRequest("json")
  91669. if res != nil && res.StatusCode == http.StatusNotModified {
  91670. if res.Body != nil {
  91671. res.Body.Close()
  91672. }
  91673. return nil, &googleapi.Error{
  91674. Code: res.StatusCode,
  91675. Header: res.Header,
  91676. }
  91677. }
  91678. if err != nil {
  91679. return nil, err
  91680. }
  91681. defer googleapi.CloseBody(res)
  91682. if err := googleapi.CheckResponse(res); err != nil {
  91683. return nil, err
  91684. }
  91685. ret := &RouterList{
  91686. ServerResponse: googleapi.ServerResponse{
  91687. Header: res.Header,
  91688. HTTPStatusCode: res.StatusCode,
  91689. },
  91690. }
  91691. target := &ret
  91692. if err := gensupport.DecodeResponse(target, res); err != nil {
  91693. return nil, err
  91694. }
  91695. return ret, nil
  91696. // {
  91697. // "description": "Retrieves a list of Router resources available to the specified project.",
  91698. // "httpMethod": "GET",
  91699. // "id": "compute.routers.list",
  91700. // "parameterOrder": [
  91701. // "project",
  91702. // "region"
  91703. // ],
  91704. // "parameters": {
  91705. // "filter": {
  91706. // "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).",
  91707. // "location": "query",
  91708. // "type": "string"
  91709. // },
  91710. // "maxResults": {
  91711. // "default": "500",
  91712. // "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)",
  91713. // "format": "uint32",
  91714. // "location": "query",
  91715. // "minimum": "0",
  91716. // "type": "integer"
  91717. // },
  91718. // "orderBy": {
  91719. // "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.",
  91720. // "location": "query",
  91721. // "type": "string"
  91722. // },
  91723. // "pageToken": {
  91724. // "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.",
  91725. // "location": "query",
  91726. // "type": "string"
  91727. // },
  91728. // "project": {
  91729. // "description": "Project ID for this request.",
  91730. // "location": "path",
  91731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91732. // "required": true,
  91733. // "type": "string"
  91734. // },
  91735. // "region": {
  91736. // "description": "Name of the region for this request.",
  91737. // "location": "path",
  91738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91739. // "required": true,
  91740. // "type": "string"
  91741. // }
  91742. // },
  91743. // "path": "{project}/regions/{region}/routers",
  91744. // "response": {
  91745. // "$ref": "RouterList"
  91746. // },
  91747. // "scopes": [
  91748. // "https://www.googleapis.com/auth/cloud-platform",
  91749. // "https://www.googleapis.com/auth/compute",
  91750. // "https://www.googleapis.com/auth/compute.readonly"
  91751. // ]
  91752. // }
  91753. }
  91754. // Pages invokes f for each page of results.
  91755. // A non-nil error returned from f will halt the iteration.
  91756. // The provided context supersedes any context provided to the Context method.
  91757. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  91758. c.ctx_ = ctx
  91759. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91760. for {
  91761. x, err := c.Do()
  91762. if err != nil {
  91763. return err
  91764. }
  91765. if err := f(x); err != nil {
  91766. return err
  91767. }
  91768. if x.NextPageToken == "" {
  91769. return nil
  91770. }
  91771. c.PageToken(x.NextPageToken)
  91772. }
  91773. }
  91774. // method id "compute.routers.patch":
  91775. type RoutersPatchCall struct {
  91776. s *Service
  91777. project string
  91778. region string
  91779. router string
  91780. router2 *Router
  91781. urlParams_ gensupport.URLParams
  91782. ctx_ context.Context
  91783. header_ http.Header
  91784. }
  91785. // Patch: Patches the specified Router resource with the data included
  91786. // in the request. This method supports PATCH semantics and uses JSON
  91787. // merge patch format and processing rules.
  91788. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  91789. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91790. c.project = project
  91791. c.region = region
  91792. c.router = router
  91793. c.router2 = router2
  91794. return c
  91795. }
  91796. // RequestId sets the optional parameter "requestId": An optional
  91797. // request ID to identify requests. Specify a unique request ID so that
  91798. // if you must retry your request, the server will know to ignore the
  91799. // request if it has already been completed.
  91800. //
  91801. // For example, consider a situation where you make an initial request
  91802. // and the request times out. If you make the request again with the
  91803. // same request ID, the server can check if original operation with the
  91804. // same request ID was received, and if so, will ignore the second
  91805. // request. This prevents clients from accidentally creating duplicate
  91806. // commitments.
  91807. //
  91808. // The request ID must be a valid UUID with the exception that zero UUID
  91809. // is not supported (00000000-0000-0000-0000-000000000000).
  91810. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  91811. c.urlParams_.Set("requestId", requestId)
  91812. return c
  91813. }
  91814. // Fields allows partial responses to be retrieved. See
  91815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91816. // for more information.
  91817. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  91818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91819. return c
  91820. }
  91821. // Context sets the context to be used in this call's Do method. Any
  91822. // pending HTTP request will be aborted if the provided context is
  91823. // canceled.
  91824. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  91825. c.ctx_ = ctx
  91826. return c
  91827. }
  91828. // Header returns an http.Header that can be modified by the caller to
  91829. // add HTTP headers to the request.
  91830. func (c *RoutersPatchCall) Header() http.Header {
  91831. if c.header_ == nil {
  91832. c.header_ = make(http.Header)
  91833. }
  91834. return c.header_
  91835. }
  91836. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  91837. reqHeaders := make(http.Header)
  91838. for k, v := range c.header_ {
  91839. reqHeaders[k] = v
  91840. }
  91841. reqHeaders.Set("User-Agent", c.s.userAgent())
  91842. var body io.Reader = nil
  91843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  91844. if err != nil {
  91845. return nil, err
  91846. }
  91847. reqHeaders.Set("Content-Type", "application/json")
  91848. c.urlParams_.Set("alt", alt)
  91849. c.urlParams_.Set("prettyPrint", "false")
  91850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  91851. urls += "?" + c.urlParams_.Encode()
  91852. req, err := http.NewRequest("PATCH", urls, body)
  91853. if err != nil {
  91854. return nil, err
  91855. }
  91856. req.Header = reqHeaders
  91857. googleapi.Expand(req.URL, map[string]string{
  91858. "project": c.project,
  91859. "region": c.region,
  91860. "router": c.router,
  91861. })
  91862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91863. }
  91864. // Do executes the "compute.routers.patch" call.
  91865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91866. // status code is an error. Response headers are in either
  91867. // *Operation.ServerResponse.Header or (if a response was returned at
  91868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91869. // to check whether the returned error was because
  91870. // http.StatusNotModified was returned.
  91871. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91872. gensupport.SetOptions(c.urlParams_, opts...)
  91873. res, err := c.doRequest("json")
  91874. if res != nil && res.StatusCode == http.StatusNotModified {
  91875. if res.Body != nil {
  91876. res.Body.Close()
  91877. }
  91878. return nil, &googleapi.Error{
  91879. Code: res.StatusCode,
  91880. Header: res.Header,
  91881. }
  91882. }
  91883. if err != nil {
  91884. return nil, err
  91885. }
  91886. defer googleapi.CloseBody(res)
  91887. if err := googleapi.CheckResponse(res); err != nil {
  91888. return nil, err
  91889. }
  91890. ret := &Operation{
  91891. ServerResponse: googleapi.ServerResponse{
  91892. Header: res.Header,
  91893. HTTPStatusCode: res.StatusCode,
  91894. },
  91895. }
  91896. target := &ret
  91897. if err := gensupport.DecodeResponse(target, res); err != nil {
  91898. return nil, err
  91899. }
  91900. return ret, nil
  91901. // {
  91902. // "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.",
  91903. // "httpMethod": "PATCH",
  91904. // "id": "compute.routers.patch",
  91905. // "parameterOrder": [
  91906. // "project",
  91907. // "region",
  91908. // "router"
  91909. // ],
  91910. // "parameters": {
  91911. // "project": {
  91912. // "description": "Project ID for this request.",
  91913. // "location": "path",
  91914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91915. // "required": true,
  91916. // "type": "string"
  91917. // },
  91918. // "region": {
  91919. // "description": "Name of the region for this request.",
  91920. // "location": "path",
  91921. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91922. // "required": true,
  91923. // "type": "string"
  91924. // },
  91925. // "requestId": {
  91926. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91927. // "location": "query",
  91928. // "type": "string"
  91929. // },
  91930. // "router": {
  91931. // "description": "Name of the Router resource to patch.",
  91932. // "location": "path",
  91933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91934. // "required": true,
  91935. // "type": "string"
  91936. // }
  91937. // },
  91938. // "path": "{project}/regions/{region}/routers/{router}",
  91939. // "request": {
  91940. // "$ref": "Router"
  91941. // },
  91942. // "response": {
  91943. // "$ref": "Operation"
  91944. // },
  91945. // "scopes": [
  91946. // "https://www.googleapis.com/auth/cloud-platform",
  91947. // "https://www.googleapis.com/auth/compute"
  91948. // ]
  91949. // }
  91950. }
  91951. // method id "compute.routers.preview":
  91952. type RoutersPreviewCall struct {
  91953. s *Service
  91954. project string
  91955. region string
  91956. router string
  91957. router2 *Router
  91958. urlParams_ gensupport.URLParams
  91959. ctx_ context.Context
  91960. header_ http.Header
  91961. }
  91962. // Preview: Preview fields auto-generated during router create and
  91963. // update operations. Calling this method does NOT create or update the
  91964. // router.
  91965. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  91966. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91967. c.project = project
  91968. c.region = region
  91969. c.router = router
  91970. c.router2 = router2
  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 *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  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 *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  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 *RoutersPreviewCall) Header() http.Header {
  91990. if c.header_ == nil {
  91991. c.header_ = make(http.Header)
  91992. }
  91993. return c.header_
  91994. }
  91995. func (c *RoutersPreviewCall) 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.router2)
  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}/routers/{router}/preview")
  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. "router": c.router,
  92020. })
  92021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92022. }
  92023. // Do executes the "compute.routers.preview" call.
  92024. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  92025. // non-2xx status code is an error. Response headers are in either
  92026. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  92027. // returned at all) in error.(*googleapi.Error).Header. Use
  92028. // googleapi.IsNotModified to check whether the returned error was
  92029. // because http.StatusNotModified was returned.
  92030. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, 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 := &RoutersPreviewResponse{
  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": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  92062. // "httpMethod": "POST",
  92063. // "id": "compute.routers.preview",
  92064. // "parameterOrder": [
  92065. // "project",
  92066. // "region",
  92067. // "router"
  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 for 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. // "router": {
  92085. // "description": "Name of the Router resource to query.",
  92086. // "location": "path",
  92087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92088. // "required": true,
  92089. // "type": "string"
  92090. // }
  92091. // },
  92092. // "path": "{project}/regions/{region}/routers/{router}/preview",
  92093. // "request": {
  92094. // "$ref": "Router"
  92095. // },
  92096. // "response": {
  92097. // "$ref": "RoutersPreviewResponse"
  92098. // },
  92099. // "scopes": [
  92100. // "https://www.googleapis.com/auth/cloud-platform",
  92101. // "https://www.googleapis.com/auth/compute",
  92102. // "https://www.googleapis.com/auth/compute.readonly"
  92103. // ]
  92104. // }
  92105. }
  92106. // method id "compute.routers.testIamPermissions":
  92107. type RoutersTestIamPermissionsCall struct {
  92108. s *Service
  92109. project string
  92110. region string
  92111. resource string
  92112. testpermissionsrequest *TestPermissionsRequest
  92113. urlParams_ gensupport.URLParams
  92114. ctx_ context.Context
  92115. header_ http.Header
  92116. }
  92117. // TestIamPermissions: Returns permissions that a caller has on the
  92118. // specified resource.
  92119. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  92120. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92121. c.project = project
  92122. c.region = region
  92123. c.resource = resource
  92124. c.testpermissionsrequest = testpermissionsrequest
  92125. return c
  92126. }
  92127. // Fields allows partial responses to be retrieved. See
  92128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92129. // for more information.
  92130. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  92131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92132. return c
  92133. }
  92134. // Context sets the context to be used in this call's Do method. Any
  92135. // pending HTTP request will be aborted if the provided context is
  92136. // canceled.
  92137. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  92138. c.ctx_ = ctx
  92139. return c
  92140. }
  92141. // Header returns an http.Header that can be modified by the caller to
  92142. // add HTTP headers to the request.
  92143. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  92144. if c.header_ == nil {
  92145. c.header_ = make(http.Header)
  92146. }
  92147. return c.header_
  92148. }
  92149. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92150. reqHeaders := make(http.Header)
  92151. for k, v := range c.header_ {
  92152. reqHeaders[k] = v
  92153. }
  92154. reqHeaders.Set("User-Agent", c.s.userAgent())
  92155. var body io.Reader = nil
  92156. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92157. if err != nil {
  92158. return nil, err
  92159. }
  92160. reqHeaders.Set("Content-Type", "application/json")
  92161. c.urlParams_.Set("alt", alt)
  92162. c.urlParams_.Set("prettyPrint", "false")
  92163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  92164. urls += "?" + c.urlParams_.Encode()
  92165. req, err := http.NewRequest("POST", urls, body)
  92166. if err != nil {
  92167. return nil, err
  92168. }
  92169. req.Header = reqHeaders
  92170. googleapi.Expand(req.URL, map[string]string{
  92171. "project": c.project,
  92172. "region": c.region,
  92173. "resource": c.resource,
  92174. })
  92175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92176. }
  92177. // Do executes the "compute.routers.testIamPermissions" call.
  92178. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92179. // non-2xx status code is an error. Response headers are in either
  92180. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92181. // returned at all) in error.(*googleapi.Error).Header. Use
  92182. // googleapi.IsNotModified to check whether the returned error was
  92183. // because http.StatusNotModified was returned.
  92184. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92185. gensupport.SetOptions(c.urlParams_, opts...)
  92186. res, err := c.doRequest("json")
  92187. if res != nil && res.StatusCode == http.StatusNotModified {
  92188. if res.Body != nil {
  92189. res.Body.Close()
  92190. }
  92191. return nil, &googleapi.Error{
  92192. Code: res.StatusCode,
  92193. Header: res.Header,
  92194. }
  92195. }
  92196. if err != nil {
  92197. return nil, err
  92198. }
  92199. defer googleapi.CloseBody(res)
  92200. if err := googleapi.CheckResponse(res); err != nil {
  92201. return nil, err
  92202. }
  92203. ret := &TestPermissionsResponse{
  92204. ServerResponse: googleapi.ServerResponse{
  92205. Header: res.Header,
  92206. HTTPStatusCode: res.StatusCode,
  92207. },
  92208. }
  92209. target := &ret
  92210. if err := gensupport.DecodeResponse(target, res); err != nil {
  92211. return nil, err
  92212. }
  92213. return ret, nil
  92214. // {
  92215. // "description": "Returns permissions that a caller has on the specified resource.",
  92216. // "httpMethod": "POST",
  92217. // "id": "compute.routers.testIamPermissions",
  92218. // "parameterOrder": [
  92219. // "project",
  92220. // "region",
  92221. // "resource"
  92222. // ],
  92223. // "parameters": {
  92224. // "project": {
  92225. // "description": "Project ID for this request.",
  92226. // "location": "path",
  92227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92228. // "required": true,
  92229. // "type": "string"
  92230. // },
  92231. // "region": {
  92232. // "description": "The name of the region for this request.",
  92233. // "location": "path",
  92234. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92235. // "required": true,
  92236. // "type": "string"
  92237. // },
  92238. // "resource": {
  92239. // "description": "Name or id of the resource for this request.",
  92240. // "location": "path",
  92241. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92242. // "required": true,
  92243. // "type": "string"
  92244. // }
  92245. // },
  92246. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  92247. // "request": {
  92248. // "$ref": "TestPermissionsRequest"
  92249. // },
  92250. // "response": {
  92251. // "$ref": "TestPermissionsResponse"
  92252. // },
  92253. // "scopes": [
  92254. // "https://www.googleapis.com/auth/cloud-platform",
  92255. // "https://www.googleapis.com/auth/compute",
  92256. // "https://www.googleapis.com/auth/compute.readonly"
  92257. // ]
  92258. // }
  92259. }
  92260. // method id "compute.routers.update":
  92261. type RoutersUpdateCall struct {
  92262. s *Service
  92263. project string
  92264. region string
  92265. router string
  92266. router2 *Router
  92267. urlParams_ gensupport.URLParams
  92268. ctx_ context.Context
  92269. header_ http.Header
  92270. }
  92271. // Update: Updates the specified Router resource with the data included
  92272. // in the request.
  92273. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  92274. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92275. c.project = project
  92276. c.region = region
  92277. c.router = router
  92278. c.router2 = router2
  92279. return c
  92280. }
  92281. // RequestId sets the optional parameter "requestId": An optional
  92282. // request ID to identify requests. Specify a unique request ID so that
  92283. // if you must retry your request, the server will know to ignore the
  92284. // request if it has already been completed.
  92285. //
  92286. // For example, consider a situation where you make an initial request
  92287. // and the request times out. If you make the request again with the
  92288. // same request ID, the server can check if original operation with the
  92289. // same request ID was received, and if so, will ignore the second
  92290. // request. This prevents clients from accidentally creating duplicate
  92291. // commitments.
  92292. //
  92293. // The request ID must be a valid UUID with the exception that zero UUID
  92294. // is not supported (00000000-0000-0000-0000-000000000000).
  92295. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  92296. c.urlParams_.Set("requestId", requestId)
  92297. return c
  92298. }
  92299. // Fields allows partial responses to be retrieved. See
  92300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92301. // for more information.
  92302. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  92303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92304. return c
  92305. }
  92306. // Context sets the context to be used in this call's Do method. Any
  92307. // pending HTTP request will be aborted if the provided context is
  92308. // canceled.
  92309. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  92310. c.ctx_ = ctx
  92311. return c
  92312. }
  92313. // Header returns an http.Header that can be modified by the caller to
  92314. // add HTTP headers to the request.
  92315. func (c *RoutersUpdateCall) Header() http.Header {
  92316. if c.header_ == nil {
  92317. c.header_ = make(http.Header)
  92318. }
  92319. return c.header_
  92320. }
  92321. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  92322. reqHeaders := make(http.Header)
  92323. for k, v := range c.header_ {
  92324. reqHeaders[k] = v
  92325. }
  92326. reqHeaders.Set("User-Agent", c.s.userAgent())
  92327. var body io.Reader = nil
  92328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  92329. if err != nil {
  92330. return nil, err
  92331. }
  92332. reqHeaders.Set("Content-Type", "application/json")
  92333. c.urlParams_.Set("alt", alt)
  92334. c.urlParams_.Set("prettyPrint", "false")
  92335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  92336. urls += "?" + c.urlParams_.Encode()
  92337. req, err := http.NewRequest("PUT", urls, body)
  92338. if err != nil {
  92339. return nil, err
  92340. }
  92341. req.Header = reqHeaders
  92342. googleapi.Expand(req.URL, map[string]string{
  92343. "project": c.project,
  92344. "region": c.region,
  92345. "router": c.router,
  92346. })
  92347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92348. }
  92349. // Do executes the "compute.routers.update" call.
  92350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92351. // status code is an error. Response headers are in either
  92352. // *Operation.ServerResponse.Header or (if a response was returned at
  92353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92354. // to check whether the returned error was because
  92355. // http.StatusNotModified was returned.
  92356. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92357. gensupport.SetOptions(c.urlParams_, opts...)
  92358. res, err := c.doRequest("json")
  92359. if res != nil && res.StatusCode == http.StatusNotModified {
  92360. if res.Body != nil {
  92361. res.Body.Close()
  92362. }
  92363. return nil, &googleapi.Error{
  92364. Code: res.StatusCode,
  92365. Header: res.Header,
  92366. }
  92367. }
  92368. if err != nil {
  92369. return nil, err
  92370. }
  92371. defer googleapi.CloseBody(res)
  92372. if err := googleapi.CheckResponse(res); err != nil {
  92373. return nil, err
  92374. }
  92375. ret := &Operation{
  92376. ServerResponse: googleapi.ServerResponse{
  92377. Header: res.Header,
  92378. HTTPStatusCode: res.StatusCode,
  92379. },
  92380. }
  92381. target := &ret
  92382. if err := gensupport.DecodeResponse(target, res); err != nil {
  92383. return nil, err
  92384. }
  92385. return ret, nil
  92386. // {
  92387. // "description": "Updates the specified Router resource with the data included in the request.",
  92388. // "httpMethod": "PUT",
  92389. // "id": "compute.routers.update",
  92390. // "parameterOrder": [
  92391. // "project",
  92392. // "region",
  92393. // "router"
  92394. // ],
  92395. // "parameters": {
  92396. // "project": {
  92397. // "description": "Project ID for this request.",
  92398. // "location": "path",
  92399. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92400. // "required": true,
  92401. // "type": "string"
  92402. // },
  92403. // "region": {
  92404. // "description": "Name of the region for this request.",
  92405. // "location": "path",
  92406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92407. // "required": true,
  92408. // "type": "string"
  92409. // },
  92410. // "requestId": {
  92411. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92412. // "location": "query",
  92413. // "type": "string"
  92414. // },
  92415. // "router": {
  92416. // "description": "Name of the Router resource to update.",
  92417. // "location": "path",
  92418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92419. // "required": true,
  92420. // "type": "string"
  92421. // }
  92422. // },
  92423. // "path": "{project}/regions/{region}/routers/{router}",
  92424. // "request": {
  92425. // "$ref": "Router"
  92426. // },
  92427. // "response": {
  92428. // "$ref": "Operation"
  92429. // },
  92430. // "scopes": [
  92431. // "https://www.googleapis.com/auth/cloud-platform",
  92432. // "https://www.googleapis.com/auth/compute"
  92433. // ]
  92434. // }
  92435. }
  92436. // method id "compute.routes.delete":
  92437. type RoutesDeleteCall struct {
  92438. s *Service
  92439. project string
  92440. route string
  92441. urlParams_ gensupport.URLParams
  92442. ctx_ context.Context
  92443. header_ http.Header
  92444. }
  92445. // Delete: Deletes the specified Route resource.
  92446. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  92447. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  92448. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92449. c.project = project
  92450. c.route = route
  92451. return c
  92452. }
  92453. // RequestId sets the optional parameter "requestId": An optional
  92454. // request ID to identify requests. Specify a unique request ID so that
  92455. // if you must retry your request, the server will know to ignore the
  92456. // request if it has already been completed.
  92457. //
  92458. // For example, consider a situation where you make an initial request
  92459. // and the request times out. If you make the request again with the
  92460. // same request ID, the server can check if original operation with the
  92461. // same request ID was received, and if so, will ignore the second
  92462. // request. This prevents clients from accidentally creating duplicate
  92463. // commitments.
  92464. //
  92465. // The request ID must be a valid UUID with the exception that zero UUID
  92466. // is not supported (00000000-0000-0000-0000-000000000000).
  92467. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  92468. c.urlParams_.Set("requestId", requestId)
  92469. return c
  92470. }
  92471. // Fields allows partial responses to be retrieved. See
  92472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92473. // for more information.
  92474. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  92475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92476. return c
  92477. }
  92478. // Context sets the context to be used in this call's Do method. Any
  92479. // pending HTTP request will be aborted if the provided context is
  92480. // canceled.
  92481. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  92482. c.ctx_ = ctx
  92483. return c
  92484. }
  92485. // Header returns an http.Header that can be modified by the caller to
  92486. // add HTTP headers to the request.
  92487. func (c *RoutesDeleteCall) Header() http.Header {
  92488. if c.header_ == nil {
  92489. c.header_ = make(http.Header)
  92490. }
  92491. return c.header_
  92492. }
  92493. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  92494. reqHeaders := make(http.Header)
  92495. for k, v := range c.header_ {
  92496. reqHeaders[k] = v
  92497. }
  92498. reqHeaders.Set("User-Agent", c.s.userAgent())
  92499. var body io.Reader = nil
  92500. c.urlParams_.Set("alt", alt)
  92501. c.urlParams_.Set("prettyPrint", "false")
  92502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  92503. urls += "?" + c.urlParams_.Encode()
  92504. req, err := http.NewRequest("DELETE", urls, body)
  92505. if err != nil {
  92506. return nil, err
  92507. }
  92508. req.Header = reqHeaders
  92509. googleapi.Expand(req.URL, map[string]string{
  92510. "project": c.project,
  92511. "route": c.route,
  92512. })
  92513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92514. }
  92515. // Do executes the "compute.routes.delete" call.
  92516. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92517. // status code is an error. Response headers are in either
  92518. // *Operation.ServerResponse.Header or (if a response was returned at
  92519. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92520. // to check whether the returned error was because
  92521. // http.StatusNotModified was returned.
  92522. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92523. gensupport.SetOptions(c.urlParams_, opts...)
  92524. res, err := c.doRequest("json")
  92525. if res != nil && res.StatusCode == http.StatusNotModified {
  92526. if res.Body != nil {
  92527. res.Body.Close()
  92528. }
  92529. return nil, &googleapi.Error{
  92530. Code: res.StatusCode,
  92531. Header: res.Header,
  92532. }
  92533. }
  92534. if err != nil {
  92535. return nil, err
  92536. }
  92537. defer googleapi.CloseBody(res)
  92538. if err := googleapi.CheckResponse(res); err != nil {
  92539. return nil, err
  92540. }
  92541. ret := &Operation{
  92542. ServerResponse: googleapi.ServerResponse{
  92543. Header: res.Header,
  92544. HTTPStatusCode: res.StatusCode,
  92545. },
  92546. }
  92547. target := &ret
  92548. if err := gensupport.DecodeResponse(target, res); err != nil {
  92549. return nil, err
  92550. }
  92551. return ret, nil
  92552. // {
  92553. // "description": "Deletes the specified Route resource.",
  92554. // "httpMethod": "DELETE",
  92555. // "id": "compute.routes.delete",
  92556. // "parameterOrder": [
  92557. // "project",
  92558. // "route"
  92559. // ],
  92560. // "parameters": {
  92561. // "project": {
  92562. // "description": "Project ID for this request.",
  92563. // "location": "path",
  92564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92565. // "required": true,
  92566. // "type": "string"
  92567. // },
  92568. // "requestId": {
  92569. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92570. // "location": "query",
  92571. // "type": "string"
  92572. // },
  92573. // "route": {
  92574. // "description": "Name of the Route resource to delete.",
  92575. // "location": "path",
  92576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92577. // "required": true,
  92578. // "type": "string"
  92579. // }
  92580. // },
  92581. // "path": "{project}/global/routes/{route}",
  92582. // "response": {
  92583. // "$ref": "Operation"
  92584. // },
  92585. // "scopes": [
  92586. // "https://www.googleapis.com/auth/cloud-platform",
  92587. // "https://www.googleapis.com/auth/compute"
  92588. // ]
  92589. // }
  92590. }
  92591. // method id "compute.routes.get":
  92592. type RoutesGetCall struct {
  92593. s *Service
  92594. project string
  92595. route string
  92596. urlParams_ gensupport.URLParams
  92597. ifNoneMatch_ string
  92598. ctx_ context.Context
  92599. header_ http.Header
  92600. }
  92601. // Get: Returns the specified Route resource. Gets a list of available
  92602. // routes by making a list() request.
  92603. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  92604. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  92605. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92606. c.project = project
  92607. c.route = route
  92608. return c
  92609. }
  92610. // Fields allows partial responses to be retrieved. See
  92611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92612. // for more information.
  92613. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  92614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92615. return c
  92616. }
  92617. // IfNoneMatch sets the optional parameter which makes the operation
  92618. // fail if the object's ETag matches the given value. This is useful for
  92619. // getting updates only after the object has changed since the last
  92620. // request. Use googleapi.IsNotModified to check whether the response
  92621. // error from Do is the result of In-None-Match.
  92622. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  92623. c.ifNoneMatch_ = entityTag
  92624. return c
  92625. }
  92626. // Context sets the context to be used in this call's Do method. Any
  92627. // pending HTTP request will be aborted if the provided context is
  92628. // canceled.
  92629. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  92630. c.ctx_ = ctx
  92631. return c
  92632. }
  92633. // Header returns an http.Header that can be modified by the caller to
  92634. // add HTTP headers to the request.
  92635. func (c *RoutesGetCall) Header() http.Header {
  92636. if c.header_ == nil {
  92637. c.header_ = make(http.Header)
  92638. }
  92639. return c.header_
  92640. }
  92641. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  92642. reqHeaders := make(http.Header)
  92643. for k, v := range c.header_ {
  92644. reqHeaders[k] = v
  92645. }
  92646. reqHeaders.Set("User-Agent", c.s.userAgent())
  92647. if c.ifNoneMatch_ != "" {
  92648. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92649. }
  92650. var body io.Reader = nil
  92651. c.urlParams_.Set("alt", alt)
  92652. c.urlParams_.Set("prettyPrint", "false")
  92653. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  92654. urls += "?" + c.urlParams_.Encode()
  92655. req, err := http.NewRequest("GET", urls, body)
  92656. if err != nil {
  92657. return nil, err
  92658. }
  92659. req.Header = reqHeaders
  92660. googleapi.Expand(req.URL, map[string]string{
  92661. "project": c.project,
  92662. "route": c.route,
  92663. })
  92664. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92665. }
  92666. // Do executes the "compute.routes.get" call.
  92667. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  92668. // code is an error. Response headers are in either
  92669. // *Route.ServerResponse.Header or (if a response was returned at all)
  92670. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  92671. // check whether the returned error was because http.StatusNotModified
  92672. // was returned.
  92673. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  92674. gensupport.SetOptions(c.urlParams_, opts...)
  92675. res, err := c.doRequest("json")
  92676. if res != nil && res.StatusCode == http.StatusNotModified {
  92677. if res.Body != nil {
  92678. res.Body.Close()
  92679. }
  92680. return nil, &googleapi.Error{
  92681. Code: res.StatusCode,
  92682. Header: res.Header,
  92683. }
  92684. }
  92685. if err != nil {
  92686. return nil, err
  92687. }
  92688. defer googleapi.CloseBody(res)
  92689. if err := googleapi.CheckResponse(res); err != nil {
  92690. return nil, err
  92691. }
  92692. ret := &Route{
  92693. ServerResponse: googleapi.ServerResponse{
  92694. Header: res.Header,
  92695. HTTPStatusCode: res.StatusCode,
  92696. },
  92697. }
  92698. target := &ret
  92699. if err := gensupport.DecodeResponse(target, res); err != nil {
  92700. return nil, err
  92701. }
  92702. return ret, nil
  92703. // {
  92704. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  92705. // "httpMethod": "GET",
  92706. // "id": "compute.routes.get",
  92707. // "parameterOrder": [
  92708. // "project",
  92709. // "route"
  92710. // ],
  92711. // "parameters": {
  92712. // "project": {
  92713. // "description": "Project ID for this request.",
  92714. // "location": "path",
  92715. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92716. // "required": true,
  92717. // "type": "string"
  92718. // },
  92719. // "route": {
  92720. // "description": "Name of the Route resource to return.",
  92721. // "location": "path",
  92722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92723. // "required": true,
  92724. // "type": "string"
  92725. // }
  92726. // },
  92727. // "path": "{project}/global/routes/{route}",
  92728. // "response": {
  92729. // "$ref": "Route"
  92730. // },
  92731. // "scopes": [
  92732. // "https://www.googleapis.com/auth/cloud-platform",
  92733. // "https://www.googleapis.com/auth/compute",
  92734. // "https://www.googleapis.com/auth/compute.readonly"
  92735. // ]
  92736. // }
  92737. }
  92738. // method id "compute.routes.insert":
  92739. type RoutesInsertCall struct {
  92740. s *Service
  92741. project string
  92742. route *Route
  92743. urlParams_ gensupport.URLParams
  92744. ctx_ context.Context
  92745. header_ http.Header
  92746. }
  92747. // Insert: Creates a Route resource in the specified project using the
  92748. // data included in the request.
  92749. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  92750. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  92751. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92752. c.project = project
  92753. c.route = route
  92754. return c
  92755. }
  92756. // RequestId sets the optional parameter "requestId": An optional
  92757. // request ID to identify requests. Specify a unique request ID so that
  92758. // if you must retry your request, the server will know to ignore the
  92759. // request if it has already been completed.
  92760. //
  92761. // For example, consider a situation where you make an initial request
  92762. // and the request times out. If you make the request again with the
  92763. // same request ID, the server can check if original operation with the
  92764. // same request ID was received, and if so, will ignore the second
  92765. // request. This prevents clients from accidentally creating duplicate
  92766. // commitments.
  92767. //
  92768. // The request ID must be a valid UUID with the exception that zero UUID
  92769. // is not supported (00000000-0000-0000-0000-000000000000).
  92770. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  92771. c.urlParams_.Set("requestId", requestId)
  92772. return c
  92773. }
  92774. // Fields allows partial responses to be retrieved. See
  92775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92776. // for more information.
  92777. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  92778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92779. return c
  92780. }
  92781. // Context sets the context to be used in this call's Do method. Any
  92782. // pending HTTP request will be aborted if the provided context is
  92783. // canceled.
  92784. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  92785. c.ctx_ = ctx
  92786. return c
  92787. }
  92788. // Header returns an http.Header that can be modified by the caller to
  92789. // add HTTP headers to the request.
  92790. func (c *RoutesInsertCall) Header() http.Header {
  92791. if c.header_ == nil {
  92792. c.header_ = make(http.Header)
  92793. }
  92794. return c.header_
  92795. }
  92796. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  92797. reqHeaders := make(http.Header)
  92798. for k, v := range c.header_ {
  92799. reqHeaders[k] = v
  92800. }
  92801. reqHeaders.Set("User-Agent", c.s.userAgent())
  92802. var body io.Reader = nil
  92803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  92804. if err != nil {
  92805. return nil, err
  92806. }
  92807. reqHeaders.Set("Content-Type", "application/json")
  92808. c.urlParams_.Set("alt", alt)
  92809. c.urlParams_.Set("prettyPrint", "false")
  92810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  92811. urls += "?" + c.urlParams_.Encode()
  92812. req, err := http.NewRequest("POST", urls, body)
  92813. if err != nil {
  92814. return nil, err
  92815. }
  92816. req.Header = reqHeaders
  92817. googleapi.Expand(req.URL, map[string]string{
  92818. "project": c.project,
  92819. })
  92820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92821. }
  92822. // Do executes the "compute.routes.insert" call.
  92823. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92824. // status code is an error. Response headers are in either
  92825. // *Operation.ServerResponse.Header or (if a response was returned at
  92826. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92827. // to check whether the returned error was because
  92828. // http.StatusNotModified was returned.
  92829. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92830. gensupport.SetOptions(c.urlParams_, opts...)
  92831. res, err := c.doRequest("json")
  92832. if res != nil && res.StatusCode == http.StatusNotModified {
  92833. if res.Body != nil {
  92834. res.Body.Close()
  92835. }
  92836. return nil, &googleapi.Error{
  92837. Code: res.StatusCode,
  92838. Header: res.Header,
  92839. }
  92840. }
  92841. if err != nil {
  92842. return nil, err
  92843. }
  92844. defer googleapi.CloseBody(res)
  92845. if err := googleapi.CheckResponse(res); err != nil {
  92846. return nil, err
  92847. }
  92848. ret := &Operation{
  92849. ServerResponse: googleapi.ServerResponse{
  92850. Header: res.Header,
  92851. HTTPStatusCode: res.StatusCode,
  92852. },
  92853. }
  92854. target := &ret
  92855. if err := gensupport.DecodeResponse(target, res); err != nil {
  92856. return nil, err
  92857. }
  92858. return ret, nil
  92859. // {
  92860. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  92861. // "httpMethod": "POST",
  92862. // "id": "compute.routes.insert",
  92863. // "parameterOrder": [
  92864. // "project"
  92865. // ],
  92866. // "parameters": {
  92867. // "project": {
  92868. // "description": "Project ID for this request.",
  92869. // "location": "path",
  92870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92871. // "required": true,
  92872. // "type": "string"
  92873. // },
  92874. // "requestId": {
  92875. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92876. // "location": "query",
  92877. // "type": "string"
  92878. // }
  92879. // },
  92880. // "path": "{project}/global/routes",
  92881. // "request": {
  92882. // "$ref": "Route"
  92883. // },
  92884. // "response": {
  92885. // "$ref": "Operation"
  92886. // },
  92887. // "scopes": [
  92888. // "https://www.googleapis.com/auth/cloud-platform",
  92889. // "https://www.googleapis.com/auth/compute"
  92890. // ]
  92891. // }
  92892. }
  92893. // method id "compute.routes.list":
  92894. type RoutesListCall struct {
  92895. s *Service
  92896. project string
  92897. urlParams_ gensupport.URLParams
  92898. ifNoneMatch_ string
  92899. ctx_ context.Context
  92900. header_ http.Header
  92901. }
  92902. // List: Retrieves the list of Route resources available to the
  92903. // specified project.
  92904. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  92905. func (r *RoutesService) List(project string) *RoutesListCall {
  92906. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92907. c.project = project
  92908. return c
  92909. }
  92910. // Filter sets the optional parameter "filter": A filter expression that
  92911. // filters resources listed in the response. The expression must specify
  92912. // the field name, a comparison operator, and the value that you want to
  92913. // use for filtering. The value must be a string, a number, or a
  92914. // boolean. The comparison operator must be either =, !=, >, or <.
  92915. //
  92916. // For example, if you are filtering Compute Engine instances, you can
  92917. // exclude instances named example-instance by specifying name !=
  92918. // example-instance.
  92919. //
  92920. // You can also filter nested fields. For example, you could specify
  92921. // scheduling.automaticRestart = false to include instances only if they
  92922. // are not scheduled for automatic restarts. You can use filtering on
  92923. // nested fields to filter based on resource labels.
  92924. //
  92925. // To filter on multiple expressions, provide each separate expression
  92926. // within parentheses. For example, (scheduling.automaticRestart = true)
  92927. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92928. // AND expression. However, you can include AND and OR expressions
  92929. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92930. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92931. // true).
  92932. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  92933. c.urlParams_.Set("filter", filter)
  92934. return c
  92935. }
  92936. // MaxResults sets the optional parameter "maxResults": The maximum
  92937. // number of results per page that should be returned. If the number of
  92938. // available results is larger than maxResults, Compute Engine returns a
  92939. // nextPageToken that can be used to get the next page of results in
  92940. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92941. // (Default: 500)
  92942. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  92943. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92944. return c
  92945. }
  92946. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92947. // a certain order. By default, results are returned in alphanumerical
  92948. // order based on the resource name.
  92949. //
  92950. // You can also sort results in descending order based on the creation
  92951. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92952. // based on the creationTimestamp field in reverse chronological order
  92953. // (newest result first). Use this to sort resources like operations so
  92954. // that the newest operation is returned first.
  92955. //
  92956. // Currently, only sorting by name or creationTimestamp desc is
  92957. // supported.
  92958. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  92959. c.urlParams_.Set("orderBy", orderBy)
  92960. return c
  92961. }
  92962. // PageToken sets the optional parameter "pageToken": Specifies a page
  92963. // token to use. Set pageToken to the nextPageToken returned by a
  92964. // previous list request to get the next page of results.
  92965. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  92966. c.urlParams_.Set("pageToken", pageToken)
  92967. return c
  92968. }
  92969. // Fields allows partial responses to be retrieved. See
  92970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92971. // for more information.
  92972. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  92973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92974. return c
  92975. }
  92976. // IfNoneMatch sets the optional parameter which makes the operation
  92977. // fail if the object's ETag matches the given value. This is useful for
  92978. // getting updates only after the object has changed since the last
  92979. // request. Use googleapi.IsNotModified to check whether the response
  92980. // error from Do is the result of In-None-Match.
  92981. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  92982. c.ifNoneMatch_ = entityTag
  92983. return c
  92984. }
  92985. // Context sets the context to be used in this call's Do method. Any
  92986. // pending HTTP request will be aborted if the provided context is
  92987. // canceled.
  92988. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  92989. c.ctx_ = ctx
  92990. return c
  92991. }
  92992. // Header returns an http.Header that can be modified by the caller to
  92993. // add HTTP headers to the request.
  92994. func (c *RoutesListCall) Header() http.Header {
  92995. if c.header_ == nil {
  92996. c.header_ = make(http.Header)
  92997. }
  92998. return c.header_
  92999. }
  93000. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  93001. reqHeaders := make(http.Header)
  93002. for k, v := range c.header_ {
  93003. reqHeaders[k] = v
  93004. }
  93005. reqHeaders.Set("User-Agent", c.s.userAgent())
  93006. if c.ifNoneMatch_ != "" {
  93007. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93008. }
  93009. var body io.Reader = nil
  93010. c.urlParams_.Set("alt", alt)
  93011. c.urlParams_.Set("prettyPrint", "false")
  93012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  93013. urls += "?" + c.urlParams_.Encode()
  93014. req, err := http.NewRequest("GET", urls, body)
  93015. if err != nil {
  93016. return nil, err
  93017. }
  93018. req.Header = reqHeaders
  93019. googleapi.Expand(req.URL, map[string]string{
  93020. "project": c.project,
  93021. })
  93022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93023. }
  93024. // Do executes the "compute.routes.list" call.
  93025. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  93026. // status code is an error. Response headers are in either
  93027. // *RouteList.ServerResponse.Header or (if a response was returned at
  93028. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93029. // to check whether the returned error was because
  93030. // http.StatusNotModified was returned.
  93031. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  93032. gensupport.SetOptions(c.urlParams_, opts...)
  93033. res, err := c.doRequest("json")
  93034. if res != nil && res.StatusCode == http.StatusNotModified {
  93035. if res.Body != nil {
  93036. res.Body.Close()
  93037. }
  93038. return nil, &googleapi.Error{
  93039. Code: res.StatusCode,
  93040. Header: res.Header,
  93041. }
  93042. }
  93043. if err != nil {
  93044. return nil, err
  93045. }
  93046. defer googleapi.CloseBody(res)
  93047. if err := googleapi.CheckResponse(res); err != nil {
  93048. return nil, err
  93049. }
  93050. ret := &RouteList{
  93051. ServerResponse: googleapi.ServerResponse{
  93052. Header: res.Header,
  93053. HTTPStatusCode: res.StatusCode,
  93054. },
  93055. }
  93056. target := &ret
  93057. if err := gensupport.DecodeResponse(target, res); err != nil {
  93058. return nil, err
  93059. }
  93060. return ret, nil
  93061. // {
  93062. // "description": "Retrieves the list of Route resources available to the specified project.",
  93063. // "httpMethod": "GET",
  93064. // "id": "compute.routes.list",
  93065. // "parameterOrder": [
  93066. // "project"
  93067. // ],
  93068. // "parameters": {
  93069. // "filter": {
  93070. // "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).",
  93071. // "location": "query",
  93072. // "type": "string"
  93073. // },
  93074. // "maxResults": {
  93075. // "default": "500",
  93076. // "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)",
  93077. // "format": "uint32",
  93078. // "location": "query",
  93079. // "minimum": "0",
  93080. // "type": "integer"
  93081. // },
  93082. // "orderBy": {
  93083. // "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.",
  93084. // "location": "query",
  93085. // "type": "string"
  93086. // },
  93087. // "pageToken": {
  93088. // "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.",
  93089. // "location": "query",
  93090. // "type": "string"
  93091. // },
  93092. // "project": {
  93093. // "description": "Project ID for this request.",
  93094. // "location": "path",
  93095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93096. // "required": true,
  93097. // "type": "string"
  93098. // }
  93099. // },
  93100. // "path": "{project}/global/routes",
  93101. // "response": {
  93102. // "$ref": "RouteList"
  93103. // },
  93104. // "scopes": [
  93105. // "https://www.googleapis.com/auth/cloud-platform",
  93106. // "https://www.googleapis.com/auth/compute",
  93107. // "https://www.googleapis.com/auth/compute.readonly"
  93108. // ]
  93109. // }
  93110. }
  93111. // Pages invokes f for each page of results.
  93112. // A non-nil error returned from f will halt the iteration.
  93113. // The provided context supersedes any context provided to the Context method.
  93114. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  93115. c.ctx_ = ctx
  93116. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93117. for {
  93118. x, err := c.Do()
  93119. if err != nil {
  93120. return err
  93121. }
  93122. if err := f(x); err != nil {
  93123. return err
  93124. }
  93125. if x.NextPageToken == "" {
  93126. return nil
  93127. }
  93128. c.PageToken(x.NextPageToken)
  93129. }
  93130. }
  93131. // method id "compute.routes.testIamPermissions":
  93132. type RoutesTestIamPermissionsCall struct {
  93133. s *Service
  93134. project string
  93135. resource string
  93136. testpermissionsrequest *TestPermissionsRequest
  93137. urlParams_ gensupport.URLParams
  93138. ctx_ context.Context
  93139. header_ http.Header
  93140. }
  93141. // TestIamPermissions: Returns permissions that a caller has on the
  93142. // specified resource.
  93143. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  93144. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93145. c.project = project
  93146. c.resource = resource
  93147. c.testpermissionsrequest = testpermissionsrequest
  93148. return c
  93149. }
  93150. // Fields allows partial responses to be retrieved. See
  93151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93152. // for more information.
  93153. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  93154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93155. return c
  93156. }
  93157. // Context sets the context to be used in this call's Do method. Any
  93158. // pending HTTP request will be aborted if the provided context is
  93159. // canceled.
  93160. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  93161. c.ctx_ = ctx
  93162. return c
  93163. }
  93164. // Header returns an http.Header that can be modified by the caller to
  93165. // add HTTP headers to the request.
  93166. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  93167. if c.header_ == nil {
  93168. c.header_ = make(http.Header)
  93169. }
  93170. return c.header_
  93171. }
  93172. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  93173. reqHeaders := make(http.Header)
  93174. for k, v := range c.header_ {
  93175. reqHeaders[k] = v
  93176. }
  93177. reqHeaders.Set("User-Agent", c.s.userAgent())
  93178. var body io.Reader = nil
  93179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  93180. if err != nil {
  93181. return nil, err
  93182. }
  93183. reqHeaders.Set("Content-Type", "application/json")
  93184. c.urlParams_.Set("alt", alt)
  93185. c.urlParams_.Set("prettyPrint", "false")
  93186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  93187. urls += "?" + c.urlParams_.Encode()
  93188. req, err := http.NewRequest("POST", urls, body)
  93189. if err != nil {
  93190. return nil, err
  93191. }
  93192. req.Header = reqHeaders
  93193. googleapi.Expand(req.URL, map[string]string{
  93194. "project": c.project,
  93195. "resource": c.resource,
  93196. })
  93197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93198. }
  93199. // Do executes the "compute.routes.testIamPermissions" call.
  93200. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  93201. // non-2xx status code is an error. Response headers are in either
  93202. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  93203. // returned at all) in error.(*googleapi.Error).Header. Use
  93204. // googleapi.IsNotModified to check whether the returned error was
  93205. // because http.StatusNotModified was returned.
  93206. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  93207. gensupport.SetOptions(c.urlParams_, opts...)
  93208. res, err := c.doRequest("json")
  93209. if res != nil && res.StatusCode == http.StatusNotModified {
  93210. if res.Body != nil {
  93211. res.Body.Close()
  93212. }
  93213. return nil, &googleapi.Error{
  93214. Code: res.StatusCode,
  93215. Header: res.Header,
  93216. }
  93217. }
  93218. if err != nil {
  93219. return nil, err
  93220. }
  93221. defer googleapi.CloseBody(res)
  93222. if err := googleapi.CheckResponse(res); err != nil {
  93223. return nil, err
  93224. }
  93225. ret := &TestPermissionsResponse{
  93226. ServerResponse: googleapi.ServerResponse{
  93227. Header: res.Header,
  93228. HTTPStatusCode: res.StatusCode,
  93229. },
  93230. }
  93231. target := &ret
  93232. if err := gensupport.DecodeResponse(target, res); err != nil {
  93233. return nil, err
  93234. }
  93235. return ret, nil
  93236. // {
  93237. // "description": "Returns permissions that a caller has on the specified resource.",
  93238. // "httpMethod": "POST",
  93239. // "id": "compute.routes.testIamPermissions",
  93240. // "parameterOrder": [
  93241. // "project",
  93242. // "resource"
  93243. // ],
  93244. // "parameters": {
  93245. // "project": {
  93246. // "description": "Project ID for this request.",
  93247. // "location": "path",
  93248. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93249. // "required": true,
  93250. // "type": "string"
  93251. // },
  93252. // "resource": {
  93253. // "description": "Name or id of the resource for this request.",
  93254. // "location": "path",
  93255. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93256. // "required": true,
  93257. // "type": "string"
  93258. // }
  93259. // },
  93260. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  93261. // "request": {
  93262. // "$ref": "TestPermissionsRequest"
  93263. // },
  93264. // "response": {
  93265. // "$ref": "TestPermissionsResponse"
  93266. // },
  93267. // "scopes": [
  93268. // "https://www.googleapis.com/auth/cloud-platform",
  93269. // "https://www.googleapis.com/auth/compute",
  93270. // "https://www.googleapis.com/auth/compute.readonly"
  93271. // ]
  93272. // }
  93273. }
  93274. // method id "compute.securityPolicies.addRule":
  93275. type SecurityPoliciesAddRuleCall struct {
  93276. s *Service
  93277. project string
  93278. securityPolicy string
  93279. securitypolicyrule *SecurityPolicyRule
  93280. urlParams_ gensupport.URLParams
  93281. ctx_ context.Context
  93282. header_ http.Header
  93283. }
  93284. // AddRule: Inserts a rule into a security policy.
  93285. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  93286. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93287. c.project = project
  93288. c.securityPolicy = securityPolicy
  93289. c.securitypolicyrule = securitypolicyrule
  93290. return c
  93291. }
  93292. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  93293. // request will not be committed.
  93294. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  93295. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  93296. return c
  93297. }
  93298. // Fields allows partial responses to be retrieved. See
  93299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93300. // for more information.
  93301. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  93302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93303. return c
  93304. }
  93305. // Context sets the context to be used in this call's Do method. Any
  93306. // pending HTTP request will be aborted if the provided context is
  93307. // canceled.
  93308. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  93309. c.ctx_ = ctx
  93310. return c
  93311. }
  93312. // Header returns an http.Header that can be modified by the caller to
  93313. // add HTTP headers to the request.
  93314. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  93315. if c.header_ == nil {
  93316. c.header_ = make(http.Header)
  93317. }
  93318. return c.header_
  93319. }
  93320. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  93321. reqHeaders := make(http.Header)
  93322. for k, v := range c.header_ {
  93323. reqHeaders[k] = v
  93324. }
  93325. reqHeaders.Set("User-Agent", c.s.userAgent())
  93326. var body io.Reader = nil
  93327. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  93328. if err != nil {
  93329. return nil, err
  93330. }
  93331. reqHeaders.Set("Content-Type", "application/json")
  93332. c.urlParams_.Set("alt", alt)
  93333. c.urlParams_.Set("prettyPrint", "false")
  93334. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  93335. urls += "?" + c.urlParams_.Encode()
  93336. req, err := http.NewRequest("POST", urls, body)
  93337. if err != nil {
  93338. return nil, err
  93339. }
  93340. req.Header = reqHeaders
  93341. googleapi.Expand(req.URL, map[string]string{
  93342. "project": c.project,
  93343. "securityPolicy": c.securityPolicy,
  93344. })
  93345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93346. }
  93347. // Do executes the "compute.securityPolicies.addRule" call.
  93348. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93349. // status code is an error. Response headers are in either
  93350. // *Operation.ServerResponse.Header or (if a response was returned at
  93351. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93352. // to check whether the returned error was because
  93353. // http.StatusNotModified was returned.
  93354. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93355. gensupport.SetOptions(c.urlParams_, opts...)
  93356. res, err := c.doRequest("json")
  93357. if res != nil && res.StatusCode == http.StatusNotModified {
  93358. if res.Body != nil {
  93359. res.Body.Close()
  93360. }
  93361. return nil, &googleapi.Error{
  93362. Code: res.StatusCode,
  93363. Header: res.Header,
  93364. }
  93365. }
  93366. if err != nil {
  93367. return nil, err
  93368. }
  93369. defer googleapi.CloseBody(res)
  93370. if err := googleapi.CheckResponse(res); err != nil {
  93371. return nil, err
  93372. }
  93373. ret := &Operation{
  93374. ServerResponse: googleapi.ServerResponse{
  93375. Header: res.Header,
  93376. HTTPStatusCode: res.StatusCode,
  93377. },
  93378. }
  93379. target := &ret
  93380. if err := gensupport.DecodeResponse(target, res); err != nil {
  93381. return nil, err
  93382. }
  93383. return ret, nil
  93384. // {
  93385. // "description": "Inserts a rule into a security policy.",
  93386. // "httpMethod": "POST",
  93387. // "id": "compute.securityPolicies.addRule",
  93388. // "parameterOrder": [
  93389. // "project",
  93390. // "securityPolicy"
  93391. // ],
  93392. // "parameters": {
  93393. // "project": {
  93394. // "description": "Project ID for this request.",
  93395. // "location": "path",
  93396. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93397. // "required": true,
  93398. // "type": "string"
  93399. // },
  93400. // "securityPolicy": {
  93401. // "description": "Name of the security policy to update.",
  93402. // "location": "path",
  93403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93404. // "required": true,
  93405. // "type": "string"
  93406. // },
  93407. // "validateOnly": {
  93408. // "description": "If true, the request will not be committed.",
  93409. // "location": "query",
  93410. // "type": "boolean"
  93411. // }
  93412. // },
  93413. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  93414. // "request": {
  93415. // "$ref": "SecurityPolicyRule"
  93416. // },
  93417. // "response": {
  93418. // "$ref": "Operation"
  93419. // },
  93420. // "scopes": [
  93421. // "https://www.googleapis.com/auth/cloud-platform",
  93422. // "https://www.googleapis.com/auth/compute"
  93423. // ]
  93424. // }
  93425. }
  93426. // method id "compute.securityPolicies.delete":
  93427. type SecurityPoliciesDeleteCall struct {
  93428. s *Service
  93429. project string
  93430. securityPolicy string
  93431. urlParams_ gensupport.URLParams
  93432. ctx_ context.Context
  93433. header_ http.Header
  93434. }
  93435. // Delete: Deletes the specified policy.
  93436. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  93437. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93438. c.project = project
  93439. c.securityPolicy = securityPolicy
  93440. return c
  93441. }
  93442. // RequestId sets the optional parameter "requestId": An optional
  93443. // request ID to identify requests. Specify a unique request ID so that
  93444. // if you must retry your request, the server will know to ignore the
  93445. // request if it has already been completed.
  93446. //
  93447. // For example, consider a situation where you make an initial request
  93448. // and the request times out. If you make the request again with the
  93449. // same request ID, the server can check if original operation with the
  93450. // same request ID was received, and if so, will ignore the second
  93451. // request. This prevents clients from accidentally creating duplicate
  93452. // commitments.
  93453. //
  93454. // The request ID must be a valid UUID with the exception that zero UUID
  93455. // is not supported (00000000-0000-0000-0000-000000000000).
  93456. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  93457. c.urlParams_.Set("requestId", requestId)
  93458. return c
  93459. }
  93460. // Fields allows partial responses to be retrieved. See
  93461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93462. // for more information.
  93463. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  93464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93465. return c
  93466. }
  93467. // Context sets the context to be used in this call's Do method. Any
  93468. // pending HTTP request will be aborted if the provided context is
  93469. // canceled.
  93470. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  93471. c.ctx_ = ctx
  93472. return c
  93473. }
  93474. // Header returns an http.Header that can be modified by the caller to
  93475. // add HTTP headers to the request.
  93476. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  93477. if c.header_ == nil {
  93478. c.header_ = make(http.Header)
  93479. }
  93480. return c.header_
  93481. }
  93482. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  93483. reqHeaders := make(http.Header)
  93484. for k, v := range c.header_ {
  93485. reqHeaders[k] = v
  93486. }
  93487. reqHeaders.Set("User-Agent", c.s.userAgent())
  93488. var body io.Reader = nil
  93489. c.urlParams_.Set("alt", alt)
  93490. c.urlParams_.Set("prettyPrint", "false")
  93491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  93492. urls += "?" + c.urlParams_.Encode()
  93493. req, err := http.NewRequest("DELETE", urls, body)
  93494. if err != nil {
  93495. return nil, err
  93496. }
  93497. req.Header = reqHeaders
  93498. googleapi.Expand(req.URL, map[string]string{
  93499. "project": c.project,
  93500. "securityPolicy": c.securityPolicy,
  93501. })
  93502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93503. }
  93504. // Do executes the "compute.securityPolicies.delete" call.
  93505. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93506. // status code is an error. Response headers are in either
  93507. // *Operation.ServerResponse.Header or (if a response was returned at
  93508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93509. // to check whether the returned error was because
  93510. // http.StatusNotModified was returned.
  93511. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93512. gensupport.SetOptions(c.urlParams_, opts...)
  93513. res, err := c.doRequest("json")
  93514. if res != nil && res.StatusCode == http.StatusNotModified {
  93515. if res.Body != nil {
  93516. res.Body.Close()
  93517. }
  93518. return nil, &googleapi.Error{
  93519. Code: res.StatusCode,
  93520. Header: res.Header,
  93521. }
  93522. }
  93523. if err != nil {
  93524. return nil, err
  93525. }
  93526. defer googleapi.CloseBody(res)
  93527. if err := googleapi.CheckResponse(res); err != nil {
  93528. return nil, err
  93529. }
  93530. ret := &Operation{
  93531. ServerResponse: googleapi.ServerResponse{
  93532. Header: res.Header,
  93533. HTTPStatusCode: res.StatusCode,
  93534. },
  93535. }
  93536. target := &ret
  93537. if err := gensupport.DecodeResponse(target, res); err != nil {
  93538. return nil, err
  93539. }
  93540. return ret, nil
  93541. // {
  93542. // "description": "Deletes the specified policy.",
  93543. // "httpMethod": "DELETE",
  93544. // "id": "compute.securityPolicies.delete",
  93545. // "parameterOrder": [
  93546. // "project",
  93547. // "securityPolicy"
  93548. // ],
  93549. // "parameters": {
  93550. // "project": {
  93551. // "description": "Project ID for this request.",
  93552. // "location": "path",
  93553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93554. // "required": true,
  93555. // "type": "string"
  93556. // },
  93557. // "requestId": {
  93558. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93559. // "location": "query",
  93560. // "type": "string"
  93561. // },
  93562. // "securityPolicy": {
  93563. // "description": "Name of the security policy to delete.",
  93564. // "location": "path",
  93565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93566. // "required": true,
  93567. // "type": "string"
  93568. // }
  93569. // },
  93570. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  93571. // "response": {
  93572. // "$ref": "Operation"
  93573. // },
  93574. // "scopes": [
  93575. // "https://www.googleapis.com/auth/cloud-platform",
  93576. // "https://www.googleapis.com/auth/compute"
  93577. // ]
  93578. // }
  93579. }
  93580. // method id "compute.securityPolicies.get":
  93581. type SecurityPoliciesGetCall struct {
  93582. s *Service
  93583. project string
  93584. securityPolicy string
  93585. urlParams_ gensupport.URLParams
  93586. ifNoneMatch_ string
  93587. ctx_ context.Context
  93588. header_ http.Header
  93589. }
  93590. // Get: List all of the ordered rules present in a single specified
  93591. // policy.
  93592. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  93593. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93594. c.project = project
  93595. c.securityPolicy = securityPolicy
  93596. return c
  93597. }
  93598. // Fields allows partial responses to be retrieved. See
  93599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93600. // for more information.
  93601. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  93602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93603. return c
  93604. }
  93605. // IfNoneMatch sets the optional parameter which makes the operation
  93606. // fail if the object's ETag matches the given value. This is useful for
  93607. // getting updates only after the object has changed since the last
  93608. // request. Use googleapi.IsNotModified to check whether the response
  93609. // error from Do is the result of In-None-Match.
  93610. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  93611. c.ifNoneMatch_ = entityTag
  93612. return c
  93613. }
  93614. // Context sets the context to be used in this call's Do method. Any
  93615. // pending HTTP request will be aborted if the provided context is
  93616. // canceled.
  93617. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  93618. c.ctx_ = ctx
  93619. return c
  93620. }
  93621. // Header returns an http.Header that can be modified by the caller to
  93622. // add HTTP headers to the request.
  93623. func (c *SecurityPoliciesGetCall) Header() http.Header {
  93624. if c.header_ == nil {
  93625. c.header_ = make(http.Header)
  93626. }
  93627. return c.header_
  93628. }
  93629. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  93630. reqHeaders := make(http.Header)
  93631. for k, v := range c.header_ {
  93632. reqHeaders[k] = v
  93633. }
  93634. reqHeaders.Set("User-Agent", c.s.userAgent())
  93635. if c.ifNoneMatch_ != "" {
  93636. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93637. }
  93638. var body io.Reader = nil
  93639. c.urlParams_.Set("alt", alt)
  93640. c.urlParams_.Set("prettyPrint", "false")
  93641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  93642. urls += "?" + c.urlParams_.Encode()
  93643. req, err := http.NewRequest("GET", urls, body)
  93644. if err != nil {
  93645. return nil, err
  93646. }
  93647. req.Header = reqHeaders
  93648. googleapi.Expand(req.URL, map[string]string{
  93649. "project": c.project,
  93650. "securityPolicy": c.securityPolicy,
  93651. })
  93652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93653. }
  93654. // Do executes the "compute.securityPolicies.get" call.
  93655. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  93656. // status code is an error. Response headers are in either
  93657. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  93658. // at all) in error.(*googleapi.Error).Header. Use
  93659. // googleapi.IsNotModified to check whether the returned error was
  93660. // because http.StatusNotModified was returned.
  93661. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  93662. gensupport.SetOptions(c.urlParams_, opts...)
  93663. res, err := c.doRequest("json")
  93664. if res != nil && res.StatusCode == http.StatusNotModified {
  93665. if res.Body != nil {
  93666. res.Body.Close()
  93667. }
  93668. return nil, &googleapi.Error{
  93669. Code: res.StatusCode,
  93670. Header: res.Header,
  93671. }
  93672. }
  93673. if err != nil {
  93674. return nil, err
  93675. }
  93676. defer googleapi.CloseBody(res)
  93677. if err := googleapi.CheckResponse(res); err != nil {
  93678. return nil, err
  93679. }
  93680. ret := &SecurityPolicy{
  93681. ServerResponse: googleapi.ServerResponse{
  93682. Header: res.Header,
  93683. HTTPStatusCode: res.StatusCode,
  93684. },
  93685. }
  93686. target := &ret
  93687. if err := gensupport.DecodeResponse(target, res); err != nil {
  93688. return nil, err
  93689. }
  93690. return ret, nil
  93691. // {
  93692. // "description": "List all of the ordered rules present in a single specified policy.",
  93693. // "httpMethod": "GET",
  93694. // "id": "compute.securityPolicies.get",
  93695. // "parameterOrder": [
  93696. // "project",
  93697. // "securityPolicy"
  93698. // ],
  93699. // "parameters": {
  93700. // "project": {
  93701. // "description": "Project ID for this request.",
  93702. // "location": "path",
  93703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93704. // "required": true,
  93705. // "type": "string"
  93706. // },
  93707. // "securityPolicy": {
  93708. // "description": "Name of the security policy to get.",
  93709. // "location": "path",
  93710. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93711. // "required": true,
  93712. // "type": "string"
  93713. // }
  93714. // },
  93715. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  93716. // "response": {
  93717. // "$ref": "SecurityPolicy"
  93718. // },
  93719. // "scopes": [
  93720. // "https://www.googleapis.com/auth/cloud-platform",
  93721. // "https://www.googleapis.com/auth/compute",
  93722. // "https://www.googleapis.com/auth/compute.readonly"
  93723. // ]
  93724. // }
  93725. }
  93726. // method id "compute.securityPolicies.getRule":
  93727. type SecurityPoliciesGetRuleCall struct {
  93728. s *Service
  93729. project string
  93730. securityPolicy string
  93731. urlParams_ gensupport.URLParams
  93732. ifNoneMatch_ string
  93733. ctx_ context.Context
  93734. header_ http.Header
  93735. }
  93736. // GetRule: Gets a rule at the specified priority.
  93737. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  93738. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93739. c.project = project
  93740. c.securityPolicy = securityPolicy
  93741. return c
  93742. }
  93743. // Priority sets the optional parameter "priority": The priority of the
  93744. // rule to get from the security policy.
  93745. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  93746. c.urlParams_.Set("priority", fmt.Sprint(priority))
  93747. return c
  93748. }
  93749. // Fields allows partial responses to be retrieved. See
  93750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93751. // for more information.
  93752. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  93753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93754. return c
  93755. }
  93756. // IfNoneMatch sets the optional parameter which makes the operation
  93757. // fail if the object's ETag matches the given value. This is useful for
  93758. // getting updates only after the object has changed since the last
  93759. // request. Use googleapi.IsNotModified to check whether the response
  93760. // error from Do is the result of In-None-Match.
  93761. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  93762. c.ifNoneMatch_ = entityTag
  93763. return c
  93764. }
  93765. // Context sets the context to be used in this call's Do method. Any
  93766. // pending HTTP request will be aborted if the provided context is
  93767. // canceled.
  93768. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  93769. c.ctx_ = ctx
  93770. return c
  93771. }
  93772. // Header returns an http.Header that can be modified by the caller to
  93773. // add HTTP headers to the request.
  93774. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  93775. if c.header_ == nil {
  93776. c.header_ = make(http.Header)
  93777. }
  93778. return c.header_
  93779. }
  93780. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  93781. reqHeaders := make(http.Header)
  93782. for k, v := range c.header_ {
  93783. reqHeaders[k] = v
  93784. }
  93785. reqHeaders.Set("User-Agent", c.s.userAgent())
  93786. if c.ifNoneMatch_ != "" {
  93787. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93788. }
  93789. var body io.Reader = nil
  93790. c.urlParams_.Set("alt", alt)
  93791. c.urlParams_.Set("prettyPrint", "false")
  93792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  93793. urls += "?" + c.urlParams_.Encode()
  93794. req, err := http.NewRequest("GET", urls, body)
  93795. if err != nil {
  93796. return nil, err
  93797. }
  93798. req.Header = reqHeaders
  93799. googleapi.Expand(req.URL, map[string]string{
  93800. "project": c.project,
  93801. "securityPolicy": c.securityPolicy,
  93802. })
  93803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93804. }
  93805. // Do executes the "compute.securityPolicies.getRule" call.
  93806. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  93807. // non-2xx status code is an error. Response headers are in either
  93808. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  93809. // returned at all) in error.(*googleapi.Error).Header. Use
  93810. // googleapi.IsNotModified to check whether the returned error was
  93811. // because http.StatusNotModified was returned.
  93812. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  93813. gensupport.SetOptions(c.urlParams_, opts...)
  93814. res, err := c.doRequest("json")
  93815. if res != nil && res.StatusCode == http.StatusNotModified {
  93816. if res.Body != nil {
  93817. res.Body.Close()
  93818. }
  93819. return nil, &googleapi.Error{
  93820. Code: res.StatusCode,
  93821. Header: res.Header,
  93822. }
  93823. }
  93824. if err != nil {
  93825. return nil, err
  93826. }
  93827. defer googleapi.CloseBody(res)
  93828. if err := googleapi.CheckResponse(res); err != nil {
  93829. return nil, err
  93830. }
  93831. ret := &SecurityPolicyRule{
  93832. ServerResponse: googleapi.ServerResponse{
  93833. Header: res.Header,
  93834. HTTPStatusCode: res.StatusCode,
  93835. },
  93836. }
  93837. target := &ret
  93838. if err := gensupport.DecodeResponse(target, res); err != nil {
  93839. return nil, err
  93840. }
  93841. return ret, nil
  93842. // {
  93843. // "description": "Gets a rule at the specified priority.",
  93844. // "httpMethod": "GET",
  93845. // "id": "compute.securityPolicies.getRule",
  93846. // "parameterOrder": [
  93847. // "project",
  93848. // "securityPolicy"
  93849. // ],
  93850. // "parameters": {
  93851. // "priority": {
  93852. // "description": "The priority of the rule to get from the security policy.",
  93853. // "format": "int32",
  93854. // "location": "query",
  93855. // "type": "integer"
  93856. // },
  93857. // "project": {
  93858. // "description": "Project ID for this request.",
  93859. // "location": "path",
  93860. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93861. // "required": true,
  93862. // "type": "string"
  93863. // },
  93864. // "securityPolicy": {
  93865. // "description": "Name of the security policy to which the queried rule belongs.",
  93866. // "location": "path",
  93867. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93868. // "required": true,
  93869. // "type": "string"
  93870. // }
  93871. // },
  93872. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  93873. // "response": {
  93874. // "$ref": "SecurityPolicyRule"
  93875. // },
  93876. // "scopes": [
  93877. // "https://www.googleapis.com/auth/cloud-platform",
  93878. // "https://www.googleapis.com/auth/compute",
  93879. // "https://www.googleapis.com/auth/compute.readonly"
  93880. // ]
  93881. // }
  93882. }
  93883. // method id "compute.securityPolicies.insert":
  93884. type SecurityPoliciesInsertCall struct {
  93885. s *Service
  93886. project string
  93887. securitypolicy *SecurityPolicy
  93888. urlParams_ gensupport.URLParams
  93889. ctx_ context.Context
  93890. header_ http.Header
  93891. }
  93892. // Insert: Creates a new policy in the specified project using the data
  93893. // included in the request.
  93894. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  93895. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93896. c.project = project
  93897. c.securitypolicy = securitypolicy
  93898. return c
  93899. }
  93900. // RequestId sets the optional parameter "requestId": An optional
  93901. // request ID to identify requests. Specify a unique request ID so that
  93902. // if you must retry your request, the server will know to ignore the
  93903. // request if it has already been completed.
  93904. //
  93905. // For example, consider a situation where you make an initial request
  93906. // and the request times out. If you make the request again with the
  93907. // same request ID, the server can check if original operation with the
  93908. // same request ID was received, and if so, will ignore the second
  93909. // request. This prevents clients from accidentally creating duplicate
  93910. // commitments.
  93911. //
  93912. // The request ID must be a valid UUID with the exception that zero UUID
  93913. // is not supported (00000000-0000-0000-0000-000000000000).
  93914. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  93915. c.urlParams_.Set("requestId", requestId)
  93916. return c
  93917. }
  93918. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  93919. // request will not be committed.
  93920. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  93921. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  93922. return c
  93923. }
  93924. // Fields allows partial responses to be retrieved. See
  93925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93926. // for more information.
  93927. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  93928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93929. return c
  93930. }
  93931. // Context sets the context to be used in this call's Do method. Any
  93932. // pending HTTP request will be aborted if the provided context is
  93933. // canceled.
  93934. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  93935. c.ctx_ = ctx
  93936. return c
  93937. }
  93938. // Header returns an http.Header that can be modified by the caller to
  93939. // add HTTP headers to the request.
  93940. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  93941. if c.header_ == nil {
  93942. c.header_ = make(http.Header)
  93943. }
  93944. return c.header_
  93945. }
  93946. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  93947. reqHeaders := make(http.Header)
  93948. for k, v := range c.header_ {
  93949. reqHeaders[k] = v
  93950. }
  93951. reqHeaders.Set("User-Agent", c.s.userAgent())
  93952. var body io.Reader = nil
  93953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  93954. if err != nil {
  93955. return nil, err
  93956. }
  93957. reqHeaders.Set("Content-Type", "application/json")
  93958. c.urlParams_.Set("alt", alt)
  93959. c.urlParams_.Set("prettyPrint", "false")
  93960. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  93961. urls += "?" + c.urlParams_.Encode()
  93962. req, err := http.NewRequest("POST", urls, body)
  93963. if err != nil {
  93964. return nil, err
  93965. }
  93966. req.Header = reqHeaders
  93967. googleapi.Expand(req.URL, map[string]string{
  93968. "project": c.project,
  93969. })
  93970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93971. }
  93972. // Do executes the "compute.securityPolicies.insert" call.
  93973. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93974. // status code is an error. Response headers are in either
  93975. // *Operation.ServerResponse.Header or (if a response was returned at
  93976. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93977. // to check whether the returned error was because
  93978. // http.StatusNotModified was returned.
  93979. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93980. gensupport.SetOptions(c.urlParams_, opts...)
  93981. res, err := c.doRequest("json")
  93982. if res != nil && res.StatusCode == http.StatusNotModified {
  93983. if res.Body != nil {
  93984. res.Body.Close()
  93985. }
  93986. return nil, &googleapi.Error{
  93987. Code: res.StatusCode,
  93988. Header: res.Header,
  93989. }
  93990. }
  93991. if err != nil {
  93992. return nil, err
  93993. }
  93994. defer googleapi.CloseBody(res)
  93995. if err := googleapi.CheckResponse(res); err != nil {
  93996. return nil, err
  93997. }
  93998. ret := &Operation{
  93999. ServerResponse: googleapi.ServerResponse{
  94000. Header: res.Header,
  94001. HTTPStatusCode: res.StatusCode,
  94002. },
  94003. }
  94004. target := &ret
  94005. if err := gensupport.DecodeResponse(target, res); err != nil {
  94006. return nil, err
  94007. }
  94008. return ret, nil
  94009. // {
  94010. // "description": "Creates a new policy in the specified project using the data included in the request.",
  94011. // "httpMethod": "POST",
  94012. // "id": "compute.securityPolicies.insert",
  94013. // "parameterOrder": [
  94014. // "project"
  94015. // ],
  94016. // "parameters": {
  94017. // "project": {
  94018. // "description": "Project ID for this request.",
  94019. // "location": "path",
  94020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94021. // "required": true,
  94022. // "type": "string"
  94023. // },
  94024. // "requestId": {
  94025. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94026. // "location": "query",
  94027. // "type": "string"
  94028. // },
  94029. // "validateOnly": {
  94030. // "description": "If true, the request will not be committed.",
  94031. // "location": "query",
  94032. // "type": "boolean"
  94033. // }
  94034. // },
  94035. // "path": "{project}/global/securityPolicies",
  94036. // "request": {
  94037. // "$ref": "SecurityPolicy"
  94038. // },
  94039. // "response": {
  94040. // "$ref": "Operation"
  94041. // },
  94042. // "scopes": [
  94043. // "https://www.googleapis.com/auth/cloud-platform",
  94044. // "https://www.googleapis.com/auth/compute"
  94045. // ]
  94046. // }
  94047. }
  94048. // method id "compute.securityPolicies.list":
  94049. type SecurityPoliciesListCall struct {
  94050. s *Service
  94051. project string
  94052. urlParams_ gensupport.URLParams
  94053. ifNoneMatch_ string
  94054. ctx_ context.Context
  94055. header_ http.Header
  94056. }
  94057. // List: List all the policies that have been configured for the
  94058. // specified project.
  94059. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  94060. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94061. c.project = project
  94062. return c
  94063. }
  94064. // Filter sets the optional parameter "filter": A filter expression that
  94065. // filters resources listed in the response. The expression must specify
  94066. // the field name, a comparison operator, and the value that you want to
  94067. // use for filtering. The value must be a string, a number, or a
  94068. // boolean. The comparison operator must be either =, !=, >, or <.
  94069. //
  94070. // For example, if you are filtering Compute Engine instances, you can
  94071. // exclude instances named example-instance by specifying name !=
  94072. // example-instance.
  94073. //
  94074. // You can also filter nested fields. For example, you could specify
  94075. // scheduling.automaticRestart = false to include instances only if they
  94076. // are not scheduled for automatic restarts. You can use filtering on
  94077. // nested fields to filter based on resource labels.
  94078. //
  94079. // To filter on multiple expressions, provide each separate expression
  94080. // within parentheses. For example, (scheduling.automaticRestart = true)
  94081. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94082. // AND expression. However, you can include AND and OR expressions
  94083. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94084. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94085. // true).
  94086. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  94087. c.urlParams_.Set("filter", filter)
  94088. return c
  94089. }
  94090. // MaxResults sets the optional parameter "maxResults": The maximum
  94091. // number of results per page that should be returned. If the number of
  94092. // available results is larger than maxResults, Compute Engine returns a
  94093. // nextPageToken that can be used to get the next page of results in
  94094. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94095. // (Default: 500)
  94096. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  94097. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94098. return c
  94099. }
  94100. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94101. // a certain order. By default, results are returned in alphanumerical
  94102. // order based on the resource name.
  94103. //
  94104. // You can also sort results in descending order based on the creation
  94105. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94106. // based on the creationTimestamp field in reverse chronological order
  94107. // (newest result first). Use this to sort resources like operations so
  94108. // that the newest operation is returned first.
  94109. //
  94110. // Currently, only sorting by name or creationTimestamp desc is
  94111. // supported.
  94112. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  94113. c.urlParams_.Set("orderBy", orderBy)
  94114. return c
  94115. }
  94116. // PageToken sets the optional parameter "pageToken": Specifies a page
  94117. // token to use. Set pageToken to the nextPageToken returned by a
  94118. // previous list request to get the next page of results.
  94119. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  94120. c.urlParams_.Set("pageToken", pageToken)
  94121. return c
  94122. }
  94123. // Fields allows partial responses to be retrieved. See
  94124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94125. // for more information.
  94126. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  94127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94128. return c
  94129. }
  94130. // IfNoneMatch sets the optional parameter which makes the operation
  94131. // fail if the object's ETag matches the given value. This is useful for
  94132. // getting updates only after the object has changed since the last
  94133. // request. Use googleapi.IsNotModified to check whether the response
  94134. // error from Do is the result of In-None-Match.
  94135. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  94136. c.ifNoneMatch_ = entityTag
  94137. return c
  94138. }
  94139. // Context sets the context to be used in this call's Do method. Any
  94140. // pending HTTP request will be aborted if the provided context is
  94141. // canceled.
  94142. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  94143. c.ctx_ = ctx
  94144. return c
  94145. }
  94146. // Header returns an http.Header that can be modified by the caller to
  94147. // add HTTP headers to the request.
  94148. func (c *SecurityPoliciesListCall) Header() http.Header {
  94149. if c.header_ == nil {
  94150. c.header_ = make(http.Header)
  94151. }
  94152. return c.header_
  94153. }
  94154. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  94155. reqHeaders := make(http.Header)
  94156. for k, v := range c.header_ {
  94157. reqHeaders[k] = v
  94158. }
  94159. reqHeaders.Set("User-Agent", c.s.userAgent())
  94160. if c.ifNoneMatch_ != "" {
  94161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94162. }
  94163. var body io.Reader = nil
  94164. c.urlParams_.Set("alt", alt)
  94165. c.urlParams_.Set("prettyPrint", "false")
  94166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  94167. urls += "?" + c.urlParams_.Encode()
  94168. req, err := http.NewRequest("GET", urls, body)
  94169. if err != nil {
  94170. return nil, err
  94171. }
  94172. req.Header = reqHeaders
  94173. googleapi.Expand(req.URL, map[string]string{
  94174. "project": c.project,
  94175. })
  94176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94177. }
  94178. // Do executes the "compute.securityPolicies.list" call.
  94179. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  94180. // non-2xx status code is an error. Response headers are in either
  94181. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  94182. // returned at all) in error.(*googleapi.Error).Header. Use
  94183. // googleapi.IsNotModified to check whether the returned error was
  94184. // because http.StatusNotModified was returned.
  94185. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  94186. gensupport.SetOptions(c.urlParams_, opts...)
  94187. res, err := c.doRequest("json")
  94188. if res != nil && res.StatusCode == http.StatusNotModified {
  94189. if res.Body != nil {
  94190. res.Body.Close()
  94191. }
  94192. return nil, &googleapi.Error{
  94193. Code: res.StatusCode,
  94194. Header: res.Header,
  94195. }
  94196. }
  94197. if err != nil {
  94198. return nil, err
  94199. }
  94200. defer googleapi.CloseBody(res)
  94201. if err := googleapi.CheckResponse(res); err != nil {
  94202. return nil, err
  94203. }
  94204. ret := &SecurityPolicyList{
  94205. ServerResponse: googleapi.ServerResponse{
  94206. Header: res.Header,
  94207. HTTPStatusCode: res.StatusCode,
  94208. },
  94209. }
  94210. target := &ret
  94211. if err := gensupport.DecodeResponse(target, res); err != nil {
  94212. return nil, err
  94213. }
  94214. return ret, nil
  94215. // {
  94216. // "description": "List all the policies that have been configured for the specified project.",
  94217. // "httpMethod": "GET",
  94218. // "id": "compute.securityPolicies.list",
  94219. // "parameterOrder": [
  94220. // "project"
  94221. // ],
  94222. // "parameters": {
  94223. // "filter": {
  94224. // "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).",
  94225. // "location": "query",
  94226. // "type": "string"
  94227. // },
  94228. // "maxResults": {
  94229. // "default": "500",
  94230. // "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)",
  94231. // "format": "uint32",
  94232. // "location": "query",
  94233. // "minimum": "0",
  94234. // "type": "integer"
  94235. // },
  94236. // "orderBy": {
  94237. // "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.",
  94238. // "location": "query",
  94239. // "type": "string"
  94240. // },
  94241. // "pageToken": {
  94242. // "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.",
  94243. // "location": "query",
  94244. // "type": "string"
  94245. // },
  94246. // "project": {
  94247. // "description": "Project ID for this request.",
  94248. // "location": "path",
  94249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94250. // "required": true,
  94251. // "type": "string"
  94252. // }
  94253. // },
  94254. // "path": "{project}/global/securityPolicies",
  94255. // "response": {
  94256. // "$ref": "SecurityPolicyList"
  94257. // },
  94258. // "scopes": [
  94259. // "https://www.googleapis.com/auth/cloud-platform",
  94260. // "https://www.googleapis.com/auth/compute",
  94261. // "https://www.googleapis.com/auth/compute.readonly"
  94262. // ]
  94263. // }
  94264. }
  94265. // Pages invokes f for each page of results.
  94266. // A non-nil error returned from f will halt the iteration.
  94267. // The provided context supersedes any context provided to the Context method.
  94268. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  94269. c.ctx_ = ctx
  94270. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94271. for {
  94272. x, err := c.Do()
  94273. if err != nil {
  94274. return err
  94275. }
  94276. if err := f(x); err != nil {
  94277. return err
  94278. }
  94279. if x.NextPageToken == "" {
  94280. return nil
  94281. }
  94282. c.PageToken(x.NextPageToken)
  94283. }
  94284. }
  94285. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  94286. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  94287. s *Service
  94288. project string
  94289. urlParams_ gensupport.URLParams
  94290. ifNoneMatch_ string
  94291. ctx_ context.Context
  94292. header_ http.Header
  94293. }
  94294. // ListPreconfiguredExpressionSets: Gets the current list of
  94295. // preconfigured Web Application Firewall (WAF) expressions.
  94296. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94297. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94298. c.project = project
  94299. return c
  94300. }
  94301. // Filter sets the optional parameter "filter": A filter expression that
  94302. // filters resources listed in the response. The expression must specify
  94303. // the field name, a comparison operator, and the value that you want to
  94304. // use for filtering. The value must be a string, a number, or a
  94305. // boolean. The comparison operator must be either =, !=, >, or <.
  94306. //
  94307. // For example, if you are filtering Compute Engine instances, you can
  94308. // exclude instances named example-instance by specifying name !=
  94309. // example-instance.
  94310. //
  94311. // You can also filter nested fields. For example, you could specify
  94312. // scheduling.automaticRestart = false to include instances only if they
  94313. // are not scheduled for automatic restarts. You can use filtering on
  94314. // nested fields to filter based on resource labels.
  94315. //
  94316. // To filter on multiple expressions, provide each separate expression
  94317. // within parentheses. For example, (scheduling.automaticRestart = true)
  94318. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94319. // AND expression. However, you can include AND and OR expressions
  94320. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94321. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94322. // true).
  94323. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94324. c.urlParams_.Set("filter", filter)
  94325. return c
  94326. }
  94327. // MaxResults sets the optional parameter "maxResults": The maximum
  94328. // number of results per page that should be returned. If the number of
  94329. // available results is larger than maxResults, Compute Engine returns a
  94330. // nextPageToken that can be used to get the next page of results in
  94331. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94332. // (Default: 500)
  94333. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94334. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94335. return c
  94336. }
  94337. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94338. // a certain order. By default, results are returned in alphanumerical
  94339. // order based on the resource name.
  94340. //
  94341. // You can also sort results in descending order based on the creation
  94342. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94343. // based on the creationTimestamp field in reverse chronological order
  94344. // (newest result first). Use this to sort resources like operations so
  94345. // that the newest operation is returned first.
  94346. //
  94347. // Currently, only sorting by name or creationTimestamp desc is
  94348. // supported.
  94349. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94350. c.urlParams_.Set("orderBy", orderBy)
  94351. return c
  94352. }
  94353. // PageToken sets the optional parameter "pageToken": Specifies a page
  94354. // token to use. Set pageToken to the nextPageToken returned by a
  94355. // previous list request to get the next page of results.
  94356. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94357. c.urlParams_.Set("pageToken", pageToken)
  94358. return c
  94359. }
  94360. // Fields allows partial responses to be retrieved. See
  94361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94362. // for more information.
  94363. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94365. return c
  94366. }
  94367. // IfNoneMatch sets the optional parameter which makes the operation
  94368. // fail if the object's ETag matches the given value. This is useful for
  94369. // getting updates only after the object has changed since the last
  94370. // request. Use googleapi.IsNotModified to check whether the response
  94371. // error from Do is the result of In-None-Match.
  94372. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94373. c.ifNoneMatch_ = entityTag
  94374. return c
  94375. }
  94376. // Context sets the context to be used in this call's Do method. Any
  94377. // pending HTTP request will be aborted if the provided context is
  94378. // canceled.
  94379. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  94380. c.ctx_ = ctx
  94381. return c
  94382. }
  94383. // Header returns an http.Header that can be modified by the caller to
  94384. // add HTTP headers to the request.
  94385. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  94386. if c.header_ == nil {
  94387. c.header_ = make(http.Header)
  94388. }
  94389. return c.header_
  94390. }
  94391. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  94392. reqHeaders := make(http.Header)
  94393. for k, v := range c.header_ {
  94394. reqHeaders[k] = v
  94395. }
  94396. reqHeaders.Set("User-Agent", c.s.userAgent())
  94397. if c.ifNoneMatch_ != "" {
  94398. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94399. }
  94400. var body io.Reader = nil
  94401. c.urlParams_.Set("alt", alt)
  94402. c.urlParams_.Set("prettyPrint", "false")
  94403. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  94404. urls += "?" + c.urlParams_.Encode()
  94405. req, err := http.NewRequest("GET", urls, body)
  94406. if err != nil {
  94407. return nil, err
  94408. }
  94409. req.Header = reqHeaders
  94410. googleapi.Expand(req.URL, map[string]string{
  94411. "project": c.project,
  94412. })
  94413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94414. }
  94415. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  94416. // Exactly one of
  94417. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  94418. // will be non-nil. Any non-2xx status code is an error. Response
  94419. // headers are in either
  94420. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  94421. // e.Header or (if a response was returned at all) in
  94422. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  94423. // whether the returned error was because http.StatusNotModified was
  94424. // returned.
  94425. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  94426. gensupport.SetOptions(c.urlParams_, opts...)
  94427. res, err := c.doRequest("json")
  94428. if res != nil && res.StatusCode == http.StatusNotModified {
  94429. if res.Body != nil {
  94430. res.Body.Close()
  94431. }
  94432. return nil, &googleapi.Error{
  94433. Code: res.StatusCode,
  94434. Header: res.Header,
  94435. }
  94436. }
  94437. if err != nil {
  94438. return nil, err
  94439. }
  94440. defer googleapi.CloseBody(res)
  94441. if err := googleapi.CheckResponse(res); err != nil {
  94442. return nil, err
  94443. }
  94444. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  94445. ServerResponse: googleapi.ServerResponse{
  94446. Header: res.Header,
  94447. HTTPStatusCode: res.StatusCode,
  94448. },
  94449. }
  94450. target := &ret
  94451. if err := gensupport.DecodeResponse(target, res); err != nil {
  94452. return nil, err
  94453. }
  94454. return ret, nil
  94455. // {
  94456. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  94457. // "httpMethod": "GET",
  94458. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  94459. // "parameterOrder": [
  94460. // "project"
  94461. // ],
  94462. // "parameters": {
  94463. // "filter": {
  94464. // "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).",
  94465. // "location": "query",
  94466. // "type": "string"
  94467. // },
  94468. // "maxResults": {
  94469. // "default": "500",
  94470. // "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)",
  94471. // "format": "uint32",
  94472. // "location": "query",
  94473. // "minimum": "0",
  94474. // "type": "integer"
  94475. // },
  94476. // "orderBy": {
  94477. // "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.",
  94478. // "location": "query",
  94479. // "type": "string"
  94480. // },
  94481. // "pageToken": {
  94482. // "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.",
  94483. // "location": "query",
  94484. // "type": "string"
  94485. // },
  94486. // "project": {
  94487. // "description": "Project ID for this request.",
  94488. // "location": "path",
  94489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94490. // "required": true,
  94491. // "type": "string"
  94492. // }
  94493. // },
  94494. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  94495. // "response": {
  94496. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  94497. // },
  94498. // "scopes": [
  94499. // "https://www.googleapis.com/auth/cloud-platform",
  94500. // "https://www.googleapis.com/auth/compute"
  94501. // ]
  94502. // }
  94503. }
  94504. // method id "compute.securityPolicies.patch":
  94505. type SecurityPoliciesPatchCall struct {
  94506. s *Service
  94507. project string
  94508. securityPolicy string
  94509. securitypolicy *SecurityPolicy
  94510. urlParams_ gensupport.URLParams
  94511. ctx_ context.Context
  94512. header_ http.Header
  94513. }
  94514. // Patch: Patches the specified policy with the data included in the
  94515. // request.
  94516. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  94517. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94518. c.project = project
  94519. c.securityPolicy = securityPolicy
  94520. c.securitypolicy = securitypolicy
  94521. return c
  94522. }
  94523. // RequestId sets the optional parameter "requestId": An optional
  94524. // request ID to identify requests. Specify a unique request ID so that
  94525. // if you must retry your request, the server will know to ignore the
  94526. // request if it has already been completed.
  94527. //
  94528. // For example, consider a situation where you make an initial request
  94529. // and the request times out. If you make the request again with the
  94530. // same request ID, the server can check if original operation with the
  94531. // same request ID was received, and if so, will ignore the second
  94532. // request. This prevents clients from accidentally creating duplicate
  94533. // commitments.
  94534. //
  94535. // The request ID must be a valid UUID with the exception that zero UUID
  94536. // is not supported (00000000-0000-0000-0000-000000000000).
  94537. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  94538. c.urlParams_.Set("requestId", requestId)
  94539. return c
  94540. }
  94541. // Fields allows partial responses to be retrieved. See
  94542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94543. // for more information.
  94544. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  94545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94546. return c
  94547. }
  94548. // Context sets the context to be used in this call's Do method. Any
  94549. // pending HTTP request will be aborted if the provided context is
  94550. // canceled.
  94551. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  94552. c.ctx_ = ctx
  94553. return c
  94554. }
  94555. // Header returns an http.Header that can be modified by the caller to
  94556. // add HTTP headers to the request.
  94557. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  94558. if c.header_ == nil {
  94559. c.header_ = make(http.Header)
  94560. }
  94561. return c.header_
  94562. }
  94563. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  94564. reqHeaders := make(http.Header)
  94565. for k, v := range c.header_ {
  94566. reqHeaders[k] = v
  94567. }
  94568. reqHeaders.Set("User-Agent", c.s.userAgent())
  94569. var body io.Reader = nil
  94570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  94571. if err != nil {
  94572. return nil, err
  94573. }
  94574. reqHeaders.Set("Content-Type", "application/json")
  94575. c.urlParams_.Set("alt", alt)
  94576. c.urlParams_.Set("prettyPrint", "false")
  94577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  94578. urls += "?" + c.urlParams_.Encode()
  94579. req, err := http.NewRequest("PATCH", urls, body)
  94580. if err != nil {
  94581. return nil, err
  94582. }
  94583. req.Header = reqHeaders
  94584. googleapi.Expand(req.URL, map[string]string{
  94585. "project": c.project,
  94586. "securityPolicy": c.securityPolicy,
  94587. })
  94588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94589. }
  94590. // Do executes the "compute.securityPolicies.patch" call.
  94591. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94592. // status code is an error. Response headers are in either
  94593. // *Operation.ServerResponse.Header or (if a response was returned at
  94594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94595. // to check whether the returned error was because
  94596. // http.StatusNotModified was returned.
  94597. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94598. gensupport.SetOptions(c.urlParams_, opts...)
  94599. res, err := c.doRequest("json")
  94600. if res != nil && res.StatusCode == http.StatusNotModified {
  94601. if res.Body != nil {
  94602. res.Body.Close()
  94603. }
  94604. return nil, &googleapi.Error{
  94605. Code: res.StatusCode,
  94606. Header: res.Header,
  94607. }
  94608. }
  94609. if err != nil {
  94610. return nil, err
  94611. }
  94612. defer googleapi.CloseBody(res)
  94613. if err := googleapi.CheckResponse(res); err != nil {
  94614. return nil, err
  94615. }
  94616. ret := &Operation{
  94617. ServerResponse: googleapi.ServerResponse{
  94618. Header: res.Header,
  94619. HTTPStatusCode: res.StatusCode,
  94620. },
  94621. }
  94622. target := &ret
  94623. if err := gensupport.DecodeResponse(target, res); err != nil {
  94624. return nil, err
  94625. }
  94626. return ret, nil
  94627. // {
  94628. // "description": "Patches the specified policy with the data included in the request.",
  94629. // "httpMethod": "PATCH",
  94630. // "id": "compute.securityPolicies.patch",
  94631. // "parameterOrder": [
  94632. // "project",
  94633. // "securityPolicy"
  94634. // ],
  94635. // "parameters": {
  94636. // "project": {
  94637. // "description": "Project ID for this request.",
  94638. // "location": "path",
  94639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94640. // "required": true,
  94641. // "type": "string"
  94642. // },
  94643. // "requestId": {
  94644. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94645. // "location": "query",
  94646. // "type": "string"
  94647. // },
  94648. // "securityPolicy": {
  94649. // "description": "Name of the security policy to update.",
  94650. // "location": "path",
  94651. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94652. // "required": true,
  94653. // "type": "string"
  94654. // }
  94655. // },
  94656. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  94657. // "request": {
  94658. // "$ref": "SecurityPolicy"
  94659. // },
  94660. // "response": {
  94661. // "$ref": "Operation"
  94662. // },
  94663. // "scopes": [
  94664. // "https://www.googleapis.com/auth/cloud-platform",
  94665. // "https://www.googleapis.com/auth/compute"
  94666. // ]
  94667. // }
  94668. }
  94669. // method id "compute.securityPolicies.patchRule":
  94670. type SecurityPoliciesPatchRuleCall struct {
  94671. s *Service
  94672. project string
  94673. securityPolicy string
  94674. securitypolicyrule *SecurityPolicyRule
  94675. urlParams_ gensupport.URLParams
  94676. ctx_ context.Context
  94677. header_ http.Header
  94678. }
  94679. // PatchRule: Patches a rule at the specified priority.
  94680. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  94681. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94682. c.project = project
  94683. c.securityPolicy = securityPolicy
  94684. c.securitypolicyrule = securitypolicyrule
  94685. return c
  94686. }
  94687. // Priority sets the optional parameter "priority": The priority of the
  94688. // rule to patch.
  94689. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  94690. c.urlParams_.Set("priority", fmt.Sprint(priority))
  94691. return c
  94692. }
  94693. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  94694. // request will not be committed.
  94695. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  94696. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  94697. return c
  94698. }
  94699. // Fields allows partial responses to be retrieved. See
  94700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94701. // for more information.
  94702. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  94703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94704. return c
  94705. }
  94706. // Context sets the context to be used in this call's Do method. Any
  94707. // pending HTTP request will be aborted if the provided context is
  94708. // canceled.
  94709. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  94710. c.ctx_ = ctx
  94711. return c
  94712. }
  94713. // Header returns an http.Header that can be modified by the caller to
  94714. // add HTTP headers to the request.
  94715. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  94716. if c.header_ == nil {
  94717. c.header_ = make(http.Header)
  94718. }
  94719. return c.header_
  94720. }
  94721. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  94722. reqHeaders := make(http.Header)
  94723. for k, v := range c.header_ {
  94724. reqHeaders[k] = v
  94725. }
  94726. reqHeaders.Set("User-Agent", c.s.userAgent())
  94727. var body io.Reader = nil
  94728. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  94729. if err != nil {
  94730. return nil, err
  94731. }
  94732. reqHeaders.Set("Content-Type", "application/json")
  94733. c.urlParams_.Set("alt", alt)
  94734. c.urlParams_.Set("prettyPrint", "false")
  94735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  94736. urls += "?" + c.urlParams_.Encode()
  94737. req, err := http.NewRequest("POST", urls, body)
  94738. if err != nil {
  94739. return nil, err
  94740. }
  94741. req.Header = reqHeaders
  94742. googleapi.Expand(req.URL, map[string]string{
  94743. "project": c.project,
  94744. "securityPolicy": c.securityPolicy,
  94745. })
  94746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94747. }
  94748. // Do executes the "compute.securityPolicies.patchRule" call.
  94749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94750. // status code is an error. Response headers are in either
  94751. // *Operation.ServerResponse.Header or (if a response was returned at
  94752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94753. // to check whether the returned error was because
  94754. // http.StatusNotModified was returned.
  94755. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94756. gensupport.SetOptions(c.urlParams_, opts...)
  94757. res, err := c.doRequest("json")
  94758. if res != nil && res.StatusCode == http.StatusNotModified {
  94759. if res.Body != nil {
  94760. res.Body.Close()
  94761. }
  94762. return nil, &googleapi.Error{
  94763. Code: res.StatusCode,
  94764. Header: res.Header,
  94765. }
  94766. }
  94767. if err != nil {
  94768. return nil, err
  94769. }
  94770. defer googleapi.CloseBody(res)
  94771. if err := googleapi.CheckResponse(res); err != nil {
  94772. return nil, err
  94773. }
  94774. ret := &Operation{
  94775. ServerResponse: googleapi.ServerResponse{
  94776. Header: res.Header,
  94777. HTTPStatusCode: res.StatusCode,
  94778. },
  94779. }
  94780. target := &ret
  94781. if err := gensupport.DecodeResponse(target, res); err != nil {
  94782. return nil, err
  94783. }
  94784. return ret, nil
  94785. // {
  94786. // "description": "Patches a rule at the specified priority.",
  94787. // "httpMethod": "POST",
  94788. // "id": "compute.securityPolicies.patchRule",
  94789. // "parameterOrder": [
  94790. // "project",
  94791. // "securityPolicy"
  94792. // ],
  94793. // "parameters": {
  94794. // "priority": {
  94795. // "description": "The priority of the rule to patch.",
  94796. // "format": "int32",
  94797. // "location": "query",
  94798. // "type": "integer"
  94799. // },
  94800. // "project": {
  94801. // "description": "Project ID for this request.",
  94802. // "location": "path",
  94803. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94804. // "required": true,
  94805. // "type": "string"
  94806. // },
  94807. // "securityPolicy": {
  94808. // "description": "Name of the security policy to update.",
  94809. // "location": "path",
  94810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94811. // "required": true,
  94812. // "type": "string"
  94813. // },
  94814. // "validateOnly": {
  94815. // "description": "If true, the request will not be committed.",
  94816. // "location": "query",
  94817. // "type": "boolean"
  94818. // }
  94819. // },
  94820. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  94821. // "request": {
  94822. // "$ref": "SecurityPolicyRule"
  94823. // },
  94824. // "response": {
  94825. // "$ref": "Operation"
  94826. // },
  94827. // "scopes": [
  94828. // "https://www.googleapis.com/auth/cloud-platform",
  94829. // "https://www.googleapis.com/auth/compute"
  94830. // ]
  94831. // }
  94832. }
  94833. // method id "compute.securityPolicies.removeRule":
  94834. type SecurityPoliciesRemoveRuleCall struct {
  94835. s *Service
  94836. project string
  94837. securityPolicy string
  94838. urlParams_ gensupport.URLParams
  94839. ctx_ context.Context
  94840. header_ http.Header
  94841. }
  94842. // RemoveRule: Deletes a rule at the specified priority.
  94843. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  94844. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94845. c.project = project
  94846. c.securityPolicy = securityPolicy
  94847. return c
  94848. }
  94849. // Priority sets the optional parameter "priority": The priority of the
  94850. // rule to remove from the security policy.
  94851. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  94852. c.urlParams_.Set("priority", fmt.Sprint(priority))
  94853. return c
  94854. }
  94855. // Fields allows partial responses to be retrieved. See
  94856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94857. // for more information.
  94858. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  94859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94860. return c
  94861. }
  94862. // Context sets the context to be used in this call's Do method. Any
  94863. // pending HTTP request will be aborted if the provided context is
  94864. // canceled.
  94865. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  94866. c.ctx_ = ctx
  94867. return c
  94868. }
  94869. // Header returns an http.Header that can be modified by the caller to
  94870. // add HTTP headers to the request.
  94871. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  94872. if c.header_ == nil {
  94873. c.header_ = make(http.Header)
  94874. }
  94875. return c.header_
  94876. }
  94877. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  94878. reqHeaders := make(http.Header)
  94879. for k, v := range c.header_ {
  94880. reqHeaders[k] = v
  94881. }
  94882. reqHeaders.Set("User-Agent", c.s.userAgent())
  94883. var body io.Reader = nil
  94884. c.urlParams_.Set("alt", alt)
  94885. c.urlParams_.Set("prettyPrint", "false")
  94886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  94887. urls += "?" + c.urlParams_.Encode()
  94888. req, err := http.NewRequest("POST", urls, body)
  94889. if err != nil {
  94890. return nil, err
  94891. }
  94892. req.Header = reqHeaders
  94893. googleapi.Expand(req.URL, map[string]string{
  94894. "project": c.project,
  94895. "securityPolicy": c.securityPolicy,
  94896. })
  94897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94898. }
  94899. // Do executes the "compute.securityPolicies.removeRule" call.
  94900. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94901. // status code is an error. Response headers are in either
  94902. // *Operation.ServerResponse.Header or (if a response was returned at
  94903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94904. // to check whether the returned error was because
  94905. // http.StatusNotModified was returned.
  94906. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94907. gensupport.SetOptions(c.urlParams_, opts...)
  94908. res, err := c.doRequest("json")
  94909. if res != nil && res.StatusCode == http.StatusNotModified {
  94910. if res.Body != nil {
  94911. res.Body.Close()
  94912. }
  94913. return nil, &googleapi.Error{
  94914. Code: res.StatusCode,
  94915. Header: res.Header,
  94916. }
  94917. }
  94918. if err != nil {
  94919. return nil, err
  94920. }
  94921. defer googleapi.CloseBody(res)
  94922. if err := googleapi.CheckResponse(res); err != nil {
  94923. return nil, err
  94924. }
  94925. ret := &Operation{
  94926. ServerResponse: googleapi.ServerResponse{
  94927. Header: res.Header,
  94928. HTTPStatusCode: res.StatusCode,
  94929. },
  94930. }
  94931. target := &ret
  94932. if err := gensupport.DecodeResponse(target, res); err != nil {
  94933. return nil, err
  94934. }
  94935. return ret, nil
  94936. // {
  94937. // "description": "Deletes a rule at the specified priority.",
  94938. // "httpMethod": "POST",
  94939. // "id": "compute.securityPolicies.removeRule",
  94940. // "parameterOrder": [
  94941. // "project",
  94942. // "securityPolicy"
  94943. // ],
  94944. // "parameters": {
  94945. // "priority": {
  94946. // "description": "The priority of the rule to remove from the security policy.",
  94947. // "format": "int32",
  94948. // "location": "query",
  94949. // "type": "integer"
  94950. // },
  94951. // "project": {
  94952. // "description": "Project ID for this request.",
  94953. // "location": "path",
  94954. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94955. // "required": true,
  94956. // "type": "string"
  94957. // },
  94958. // "securityPolicy": {
  94959. // "description": "Name of the security policy to update.",
  94960. // "location": "path",
  94961. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94962. // "required": true,
  94963. // "type": "string"
  94964. // }
  94965. // },
  94966. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  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.securityPolicies.setLabels":
  94977. type SecurityPoliciesSetLabelsCall struct {
  94978. s *Service
  94979. project string
  94980. resource string
  94981. globalsetlabelsrequest *GlobalSetLabelsRequest
  94982. urlParams_ gensupport.URLParams
  94983. ctx_ context.Context
  94984. header_ http.Header
  94985. }
  94986. // SetLabels: Sets the labels on a security policy. To learn more about
  94987. // labels, read the Labeling Resources documentation.
  94988. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  94989. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94990. c.project = project
  94991. c.resource = resource
  94992. c.globalsetlabelsrequest = globalsetlabelsrequest
  94993. return c
  94994. }
  94995. // Fields allows partial responses to be retrieved. See
  94996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94997. // for more information.
  94998. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  94999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95000. return c
  95001. }
  95002. // Context sets the context to be used in this call's Do method. Any
  95003. // pending HTTP request will be aborted if the provided context is
  95004. // canceled.
  95005. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  95006. c.ctx_ = ctx
  95007. return c
  95008. }
  95009. // Header returns an http.Header that can be modified by the caller to
  95010. // add HTTP headers to the request.
  95011. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  95012. if c.header_ == nil {
  95013. c.header_ = make(http.Header)
  95014. }
  95015. return c.header_
  95016. }
  95017. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  95018. reqHeaders := make(http.Header)
  95019. for k, v := range c.header_ {
  95020. reqHeaders[k] = v
  95021. }
  95022. reqHeaders.Set("User-Agent", c.s.userAgent())
  95023. var body io.Reader = nil
  95024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  95025. if err != nil {
  95026. return nil, err
  95027. }
  95028. reqHeaders.Set("Content-Type", "application/json")
  95029. c.urlParams_.Set("alt", alt)
  95030. c.urlParams_.Set("prettyPrint", "false")
  95031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  95032. urls += "?" + c.urlParams_.Encode()
  95033. req, err := http.NewRequest("POST", urls, body)
  95034. if err != nil {
  95035. return nil, err
  95036. }
  95037. req.Header = reqHeaders
  95038. googleapi.Expand(req.URL, map[string]string{
  95039. "project": c.project,
  95040. "resource": c.resource,
  95041. })
  95042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95043. }
  95044. // Do executes the "compute.securityPolicies.setLabels" call.
  95045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95046. // status code is an error. Response headers are in either
  95047. // *Operation.ServerResponse.Header or (if a response was returned at
  95048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95049. // to check whether the returned error was because
  95050. // http.StatusNotModified was returned.
  95051. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95052. gensupport.SetOptions(c.urlParams_, opts...)
  95053. res, err := c.doRequest("json")
  95054. if res != nil && res.StatusCode == http.StatusNotModified {
  95055. if res.Body != nil {
  95056. res.Body.Close()
  95057. }
  95058. return nil, &googleapi.Error{
  95059. Code: res.StatusCode,
  95060. Header: res.Header,
  95061. }
  95062. }
  95063. if err != nil {
  95064. return nil, err
  95065. }
  95066. defer googleapi.CloseBody(res)
  95067. if err := googleapi.CheckResponse(res); err != nil {
  95068. return nil, err
  95069. }
  95070. ret := &Operation{
  95071. ServerResponse: googleapi.ServerResponse{
  95072. Header: res.Header,
  95073. HTTPStatusCode: res.StatusCode,
  95074. },
  95075. }
  95076. target := &ret
  95077. if err := gensupport.DecodeResponse(target, res); err != nil {
  95078. return nil, err
  95079. }
  95080. return ret, nil
  95081. // {
  95082. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  95083. // "httpMethod": "POST",
  95084. // "id": "compute.securityPolicies.setLabels",
  95085. // "parameterOrder": [
  95086. // "project",
  95087. // "resource"
  95088. // ],
  95089. // "parameters": {
  95090. // "project": {
  95091. // "description": "Project ID for this request.",
  95092. // "location": "path",
  95093. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95094. // "required": true,
  95095. // "type": "string"
  95096. // },
  95097. // "resource": {
  95098. // "description": "Name or id of the resource for this request.",
  95099. // "location": "path",
  95100. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95101. // "required": true,
  95102. // "type": "string"
  95103. // }
  95104. // },
  95105. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  95106. // "request": {
  95107. // "$ref": "GlobalSetLabelsRequest"
  95108. // },
  95109. // "response": {
  95110. // "$ref": "Operation"
  95111. // },
  95112. // "scopes": [
  95113. // "https://www.googleapis.com/auth/cloud-platform",
  95114. // "https://www.googleapis.com/auth/compute"
  95115. // ]
  95116. // }
  95117. }
  95118. // method id "compute.securityPolicies.testIamPermissions":
  95119. type SecurityPoliciesTestIamPermissionsCall struct {
  95120. s *Service
  95121. project string
  95122. resource string
  95123. testpermissionsrequest *TestPermissionsRequest
  95124. urlParams_ gensupport.URLParams
  95125. ctx_ context.Context
  95126. header_ http.Header
  95127. }
  95128. // TestIamPermissions: Returns permissions that a caller has on the
  95129. // specified resource.
  95130. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  95131. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95132. c.project = project
  95133. c.resource = resource
  95134. c.testpermissionsrequest = testpermissionsrequest
  95135. return c
  95136. }
  95137. // Fields allows partial responses to be retrieved. See
  95138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95139. // for more information.
  95140. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  95141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95142. return c
  95143. }
  95144. // Context sets the context to be used in this call's Do method. Any
  95145. // pending HTTP request will be aborted if the provided context is
  95146. // canceled.
  95147. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  95148. c.ctx_ = ctx
  95149. return c
  95150. }
  95151. // Header returns an http.Header that can be modified by the caller to
  95152. // add HTTP headers to the request.
  95153. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  95154. if c.header_ == nil {
  95155. c.header_ = make(http.Header)
  95156. }
  95157. return c.header_
  95158. }
  95159. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  95160. reqHeaders := make(http.Header)
  95161. for k, v := range c.header_ {
  95162. reqHeaders[k] = v
  95163. }
  95164. reqHeaders.Set("User-Agent", c.s.userAgent())
  95165. var body io.Reader = nil
  95166. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  95167. if err != nil {
  95168. return nil, err
  95169. }
  95170. reqHeaders.Set("Content-Type", "application/json")
  95171. c.urlParams_.Set("alt", alt)
  95172. c.urlParams_.Set("prettyPrint", "false")
  95173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  95174. urls += "?" + c.urlParams_.Encode()
  95175. req, err := http.NewRequest("POST", urls, body)
  95176. if err != nil {
  95177. return nil, err
  95178. }
  95179. req.Header = reqHeaders
  95180. googleapi.Expand(req.URL, map[string]string{
  95181. "project": c.project,
  95182. "resource": c.resource,
  95183. })
  95184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95185. }
  95186. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  95187. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  95188. // non-2xx status code is an error. Response headers are in either
  95189. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  95190. // returned at all) in error.(*googleapi.Error).Header. Use
  95191. // googleapi.IsNotModified to check whether the returned error was
  95192. // because http.StatusNotModified was returned.
  95193. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  95194. gensupport.SetOptions(c.urlParams_, opts...)
  95195. res, err := c.doRequest("json")
  95196. if res != nil && res.StatusCode == http.StatusNotModified {
  95197. if res.Body != nil {
  95198. res.Body.Close()
  95199. }
  95200. return nil, &googleapi.Error{
  95201. Code: res.StatusCode,
  95202. Header: res.Header,
  95203. }
  95204. }
  95205. if err != nil {
  95206. return nil, err
  95207. }
  95208. defer googleapi.CloseBody(res)
  95209. if err := googleapi.CheckResponse(res); err != nil {
  95210. return nil, err
  95211. }
  95212. ret := &TestPermissionsResponse{
  95213. ServerResponse: googleapi.ServerResponse{
  95214. Header: res.Header,
  95215. HTTPStatusCode: res.StatusCode,
  95216. },
  95217. }
  95218. target := &ret
  95219. if err := gensupport.DecodeResponse(target, res); err != nil {
  95220. return nil, err
  95221. }
  95222. return ret, nil
  95223. // {
  95224. // "description": "Returns permissions that a caller has on the specified resource.",
  95225. // "httpMethod": "POST",
  95226. // "id": "compute.securityPolicies.testIamPermissions",
  95227. // "parameterOrder": [
  95228. // "project",
  95229. // "resource"
  95230. // ],
  95231. // "parameters": {
  95232. // "project": {
  95233. // "description": "Project ID for this request.",
  95234. // "location": "path",
  95235. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95236. // "required": true,
  95237. // "type": "string"
  95238. // },
  95239. // "resource": {
  95240. // "description": "Name or id of the resource for this request.",
  95241. // "location": "path",
  95242. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95243. // "required": true,
  95244. // "type": "string"
  95245. // }
  95246. // },
  95247. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  95248. // "request": {
  95249. // "$ref": "TestPermissionsRequest"
  95250. // },
  95251. // "response": {
  95252. // "$ref": "TestPermissionsResponse"
  95253. // },
  95254. // "scopes": [
  95255. // "https://www.googleapis.com/auth/cloud-platform",
  95256. // "https://www.googleapis.com/auth/compute",
  95257. // "https://www.googleapis.com/auth/compute.readonly"
  95258. // ]
  95259. // }
  95260. }
  95261. // method id "compute.snapshots.delete":
  95262. type SnapshotsDeleteCall struct {
  95263. s *Service
  95264. project string
  95265. snapshot string
  95266. urlParams_ gensupport.URLParams
  95267. ctx_ context.Context
  95268. header_ http.Header
  95269. }
  95270. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  95271. // deleting a single snapshot might not necessarily delete all the data
  95272. // on that snapshot. If any data on the snapshot that is marked for
  95273. // deletion is needed for subsequent snapshots, the data will be moved
  95274. // to the next corresponding snapshot.
  95275. //
  95276. // For more information, see Deleting snapshots.
  95277. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  95278. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  95279. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95280. c.project = project
  95281. c.snapshot = snapshot
  95282. return c
  95283. }
  95284. // RequestId sets the optional parameter "requestId": An optional
  95285. // request ID to identify requests. Specify a unique request ID so that
  95286. // if you must retry your request, the server will know to ignore the
  95287. // request if it has already been completed.
  95288. //
  95289. // For example, consider a situation where you make an initial request
  95290. // and the request times out. If you make the request again with the
  95291. // same request ID, the server can check if original operation with the
  95292. // same request ID was received, and if so, will ignore the second
  95293. // request. This prevents clients from accidentally creating duplicate
  95294. // commitments.
  95295. //
  95296. // The request ID must be a valid UUID with the exception that zero UUID
  95297. // is not supported (00000000-0000-0000-0000-000000000000).
  95298. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  95299. c.urlParams_.Set("requestId", requestId)
  95300. return c
  95301. }
  95302. // Fields allows partial responses to be retrieved. See
  95303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95304. // for more information.
  95305. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  95306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95307. return c
  95308. }
  95309. // Context sets the context to be used in this call's Do method. Any
  95310. // pending HTTP request will be aborted if the provided context is
  95311. // canceled.
  95312. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  95313. c.ctx_ = ctx
  95314. return c
  95315. }
  95316. // Header returns an http.Header that can be modified by the caller to
  95317. // add HTTP headers to the request.
  95318. func (c *SnapshotsDeleteCall) Header() http.Header {
  95319. if c.header_ == nil {
  95320. c.header_ = make(http.Header)
  95321. }
  95322. return c.header_
  95323. }
  95324. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  95325. reqHeaders := make(http.Header)
  95326. for k, v := range c.header_ {
  95327. reqHeaders[k] = v
  95328. }
  95329. reqHeaders.Set("User-Agent", c.s.userAgent())
  95330. var body io.Reader = nil
  95331. c.urlParams_.Set("alt", alt)
  95332. c.urlParams_.Set("prettyPrint", "false")
  95333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  95334. urls += "?" + c.urlParams_.Encode()
  95335. req, err := http.NewRequest("DELETE", urls, body)
  95336. if err != nil {
  95337. return nil, err
  95338. }
  95339. req.Header = reqHeaders
  95340. googleapi.Expand(req.URL, map[string]string{
  95341. "project": c.project,
  95342. "snapshot": c.snapshot,
  95343. })
  95344. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95345. }
  95346. // Do executes the "compute.snapshots.delete" call.
  95347. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95348. // status code is an error. Response headers are in either
  95349. // *Operation.ServerResponse.Header or (if a response was returned at
  95350. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95351. // to check whether the returned error was because
  95352. // http.StatusNotModified was returned.
  95353. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95354. gensupport.SetOptions(c.urlParams_, opts...)
  95355. res, err := c.doRequest("json")
  95356. if res != nil && res.StatusCode == http.StatusNotModified {
  95357. if res.Body != nil {
  95358. res.Body.Close()
  95359. }
  95360. return nil, &googleapi.Error{
  95361. Code: res.StatusCode,
  95362. Header: res.Header,
  95363. }
  95364. }
  95365. if err != nil {
  95366. return nil, err
  95367. }
  95368. defer googleapi.CloseBody(res)
  95369. if err := googleapi.CheckResponse(res); err != nil {
  95370. return nil, err
  95371. }
  95372. ret := &Operation{
  95373. ServerResponse: googleapi.ServerResponse{
  95374. Header: res.Header,
  95375. HTTPStatusCode: res.StatusCode,
  95376. },
  95377. }
  95378. target := &ret
  95379. if err := gensupport.DecodeResponse(target, res); err != nil {
  95380. return nil, err
  95381. }
  95382. return ret, nil
  95383. // {
  95384. // "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.",
  95385. // "httpMethod": "DELETE",
  95386. // "id": "compute.snapshots.delete",
  95387. // "parameterOrder": [
  95388. // "project",
  95389. // "snapshot"
  95390. // ],
  95391. // "parameters": {
  95392. // "project": {
  95393. // "description": "Project ID for this request.",
  95394. // "location": "path",
  95395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95396. // "required": true,
  95397. // "type": "string"
  95398. // },
  95399. // "requestId": {
  95400. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95401. // "location": "query",
  95402. // "type": "string"
  95403. // },
  95404. // "snapshot": {
  95405. // "description": "Name of the Snapshot resource to delete.",
  95406. // "location": "path",
  95407. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95408. // "required": true,
  95409. // "type": "string"
  95410. // }
  95411. // },
  95412. // "path": "{project}/global/snapshots/{snapshot}",
  95413. // "response": {
  95414. // "$ref": "Operation"
  95415. // },
  95416. // "scopes": [
  95417. // "https://www.googleapis.com/auth/cloud-platform",
  95418. // "https://www.googleapis.com/auth/compute"
  95419. // ]
  95420. // }
  95421. }
  95422. // method id "compute.snapshots.get":
  95423. type SnapshotsGetCall struct {
  95424. s *Service
  95425. project string
  95426. snapshot string
  95427. urlParams_ gensupport.URLParams
  95428. ifNoneMatch_ string
  95429. ctx_ context.Context
  95430. header_ http.Header
  95431. }
  95432. // Get: Returns the specified Snapshot resource. Gets a list of
  95433. // available snapshots by making a list() request.
  95434. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  95435. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  95436. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95437. c.project = project
  95438. c.snapshot = snapshot
  95439. return c
  95440. }
  95441. // Fields allows partial responses to be retrieved. See
  95442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95443. // for more information.
  95444. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  95445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95446. return c
  95447. }
  95448. // IfNoneMatch sets the optional parameter which makes the operation
  95449. // fail if the object's ETag matches the given value. This is useful for
  95450. // getting updates only after the object has changed since the last
  95451. // request. Use googleapi.IsNotModified to check whether the response
  95452. // error from Do is the result of In-None-Match.
  95453. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  95454. c.ifNoneMatch_ = entityTag
  95455. return c
  95456. }
  95457. // Context sets the context to be used in this call's Do method. Any
  95458. // pending HTTP request will be aborted if the provided context is
  95459. // canceled.
  95460. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  95461. c.ctx_ = ctx
  95462. return c
  95463. }
  95464. // Header returns an http.Header that can be modified by the caller to
  95465. // add HTTP headers to the request.
  95466. func (c *SnapshotsGetCall) Header() http.Header {
  95467. if c.header_ == nil {
  95468. c.header_ = make(http.Header)
  95469. }
  95470. return c.header_
  95471. }
  95472. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  95473. reqHeaders := make(http.Header)
  95474. for k, v := range c.header_ {
  95475. reqHeaders[k] = v
  95476. }
  95477. reqHeaders.Set("User-Agent", c.s.userAgent())
  95478. if c.ifNoneMatch_ != "" {
  95479. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95480. }
  95481. var body io.Reader = nil
  95482. c.urlParams_.Set("alt", alt)
  95483. c.urlParams_.Set("prettyPrint", "false")
  95484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  95485. urls += "?" + c.urlParams_.Encode()
  95486. req, err := http.NewRequest("GET", urls, body)
  95487. if err != nil {
  95488. return nil, err
  95489. }
  95490. req.Header = reqHeaders
  95491. googleapi.Expand(req.URL, map[string]string{
  95492. "project": c.project,
  95493. "snapshot": c.snapshot,
  95494. })
  95495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95496. }
  95497. // Do executes the "compute.snapshots.get" call.
  95498. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  95499. // code is an error. Response headers are in either
  95500. // *Snapshot.ServerResponse.Header or (if a response was returned at
  95501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95502. // to check whether the returned error was because
  95503. // http.StatusNotModified was returned.
  95504. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  95505. gensupport.SetOptions(c.urlParams_, opts...)
  95506. res, err := c.doRequest("json")
  95507. if res != nil && res.StatusCode == http.StatusNotModified {
  95508. if res.Body != nil {
  95509. res.Body.Close()
  95510. }
  95511. return nil, &googleapi.Error{
  95512. Code: res.StatusCode,
  95513. Header: res.Header,
  95514. }
  95515. }
  95516. if err != nil {
  95517. return nil, err
  95518. }
  95519. defer googleapi.CloseBody(res)
  95520. if err := googleapi.CheckResponse(res); err != nil {
  95521. return nil, err
  95522. }
  95523. ret := &Snapshot{
  95524. ServerResponse: googleapi.ServerResponse{
  95525. Header: res.Header,
  95526. HTTPStatusCode: res.StatusCode,
  95527. },
  95528. }
  95529. target := &ret
  95530. if err := gensupport.DecodeResponse(target, res); err != nil {
  95531. return nil, err
  95532. }
  95533. return ret, nil
  95534. // {
  95535. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  95536. // "httpMethod": "GET",
  95537. // "id": "compute.snapshots.get",
  95538. // "parameterOrder": [
  95539. // "project",
  95540. // "snapshot"
  95541. // ],
  95542. // "parameters": {
  95543. // "project": {
  95544. // "description": "Project ID for this request.",
  95545. // "location": "path",
  95546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95547. // "required": true,
  95548. // "type": "string"
  95549. // },
  95550. // "snapshot": {
  95551. // "description": "Name of the Snapshot resource to return.",
  95552. // "location": "path",
  95553. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95554. // "required": true,
  95555. // "type": "string"
  95556. // }
  95557. // },
  95558. // "path": "{project}/global/snapshots/{snapshot}",
  95559. // "response": {
  95560. // "$ref": "Snapshot"
  95561. // },
  95562. // "scopes": [
  95563. // "https://www.googleapis.com/auth/cloud-platform",
  95564. // "https://www.googleapis.com/auth/compute",
  95565. // "https://www.googleapis.com/auth/compute.readonly"
  95566. // ]
  95567. // }
  95568. }
  95569. // method id "compute.snapshots.getIamPolicy":
  95570. type SnapshotsGetIamPolicyCall struct {
  95571. s *Service
  95572. project string
  95573. resource string
  95574. urlParams_ gensupport.URLParams
  95575. ifNoneMatch_ string
  95576. ctx_ context.Context
  95577. header_ http.Header
  95578. }
  95579. // GetIamPolicy: Gets the access control policy for a resource. May be
  95580. // empty if no such policy or resource exists.
  95581. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  95582. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95583. c.project = project
  95584. c.resource = resource
  95585. return c
  95586. }
  95587. // Fields allows partial responses to be retrieved. See
  95588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95589. // for more information.
  95590. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  95591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95592. return c
  95593. }
  95594. // IfNoneMatch sets the optional parameter which makes the operation
  95595. // fail if the object's ETag matches the given value. This is useful for
  95596. // getting updates only after the object has changed since the last
  95597. // request. Use googleapi.IsNotModified to check whether the response
  95598. // error from Do is the result of In-None-Match.
  95599. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  95600. c.ifNoneMatch_ = entityTag
  95601. return c
  95602. }
  95603. // Context sets the context to be used in this call's Do method. Any
  95604. // pending HTTP request will be aborted if the provided context is
  95605. // canceled.
  95606. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  95607. c.ctx_ = ctx
  95608. return c
  95609. }
  95610. // Header returns an http.Header that can be modified by the caller to
  95611. // add HTTP headers to the request.
  95612. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  95613. if c.header_ == nil {
  95614. c.header_ = make(http.Header)
  95615. }
  95616. return c.header_
  95617. }
  95618. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  95619. reqHeaders := make(http.Header)
  95620. for k, v := range c.header_ {
  95621. reqHeaders[k] = v
  95622. }
  95623. reqHeaders.Set("User-Agent", c.s.userAgent())
  95624. if c.ifNoneMatch_ != "" {
  95625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95626. }
  95627. var body io.Reader = nil
  95628. c.urlParams_.Set("alt", alt)
  95629. c.urlParams_.Set("prettyPrint", "false")
  95630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  95631. urls += "?" + c.urlParams_.Encode()
  95632. req, err := http.NewRequest("GET", urls, body)
  95633. if err != nil {
  95634. return nil, err
  95635. }
  95636. req.Header = reqHeaders
  95637. googleapi.Expand(req.URL, map[string]string{
  95638. "project": c.project,
  95639. "resource": c.resource,
  95640. })
  95641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95642. }
  95643. // Do executes the "compute.snapshots.getIamPolicy" call.
  95644. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  95645. // code is an error. Response headers are in either
  95646. // *Policy.ServerResponse.Header or (if a response was returned at all)
  95647. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  95648. // check whether the returned error was because http.StatusNotModified
  95649. // was returned.
  95650. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  95651. gensupport.SetOptions(c.urlParams_, opts...)
  95652. res, err := c.doRequest("json")
  95653. if res != nil && res.StatusCode == http.StatusNotModified {
  95654. if res.Body != nil {
  95655. res.Body.Close()
  95656. }
  95657. return nil, &googleapi.Error{
  95658. Code: res.StatusCode,
  95659. Header: res.Header,
  95660. }
  95661. }
  95662. if err != nil {
  95663. return nil, err
  95664. }
  95665. defer googleapi.CloseBody(res)
  95666. if err := googleapi.CheckResponse(res); err != nil {
  95667. return nil, err
  95668. }
  95669. ret := &Policy{
  95670. ServerResponse: googleapi.ServerResponse{
  95671. Header: res.Header,
  95672. HTTPStatusCode: res.StatusCode,
  95673. },
  95674. }
  95675. target := &ret
  95676. if err := gensupport.DecodeResponse(target, res); err != nil {
  95677. return nil, err
  95678. }
  95679. return ret, nil
  95680. // {
  95681. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  95682. // "httpMethod": "GET",
  95683. // "id": "compute.snapshots.getIamPolicy",
  95684. // "parameterOrder": [
  95685. // "project",
  95686. // "resource"
  95687. // ],
  95688. // "parameters": {
  95689. // "project": {
  95690. // "description": "Project ID for this request.",
  95691. // "location": "path",
  95692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95693. // "required": true,
  95694. // "type": "string"
  95695. // },
  95696. // "resource": {
  95697. // "description": "Name or id of the resource for this request.",
  95698. // "location": "path",
  95699. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95700. // "required": true,
  95701. // "type": "string"
  95702. // }
  95703. // },
  95704. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  95705. // "response": {
  95706. // "$ref": "Policy"
  95707. // },
  95708. // "scopes": [
  95709. // "https://www.googleapis.com/auth/cloud-platform",
  95710. // "https://www.googleapis.com/auth/compute",
  95711. // "https://www.googleapis.com/auth/compute.readonly"
  95712. // ]
  95713. // }
  95714. }
  95715. // method id "compute.snapshots.list":
  95716. type SnapshotsListCall struct {
  95717. s *Service
  95718. project string
  95719. urlParams_ gensupport.URLParams
  95720. ifNoneMatch_ string
  95721. ctx_ context.Context
  95722. header_ http.Header
  95723. }
  95724. // List: Retrieves the list of Snapshot resources contained within the
  95725. // specified project.
  95726. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  95727. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  95728. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95729. c.project = project
  95730. return c
  95731. }
  95732. // Filter sets the optional parameter "filter": A filter expression that
  95733. // filters resources listed in the response. The expression must specify
  95734. // the field name, a comparison operator, and the value that you want to
  95735. // use for filtering. The value must be a string, a number, or a
  95736. // boolean. The comparison operator must be either =, !=, >, or <.
  95737. //
  95738. // For example, if you are filtering Compute Engine instances, you can
  95739. // exclude instances named example-instance by specifying name !=
  95740. // example-instance.
  95741. //
  95742. // You can also filter nested fields. For example, you could specify
  95743. // scheduling.automaticRestart = false to include instances only if they
  95744. // are not scheduled for automatic restarts. You can use filtering on
  95745. // nested fields to filter based on resource labels.
  95746. //
  95747. // To filter on multiple expressions, provide each separate expression
  95748. // within parentheses. For example, (scheduling.automaticRestart = true)
  95749. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95750. // AND expression. However, you can include AND and OR expressions
  95751. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95752. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95753. // true).
  95754. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  95755. c.urlParams_.Set("filter", filter)
  95756. return c
  95757. }
  95758. // MaxResults sets the optional parameter "maxResults": The maximum
  95759. // number of results per page that should be returned. If the number of
  95760. // available results is larger than maxResults, Compute Engine returns a
  95761. // nextPageToken that can be used to get the next page of results in
  95762. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95763. // (Default: 500)
  95764. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  95765. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95766. return c
  95767. }
  95768. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95769. // a certain order. By default, results are returned in alphanumerical
  95770. // order based on the resource name.
  95771. //
  95772. // You can also sort results in descending order based on the creation
  95773. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95774. // based on the creationTimestamp field in reverse chronological order
  95775. // (newest result first). Use this to sort resources like operations so
  95776. // that the newest operation is returned first.
  95777. //
  95778. // Currently, only sorting by name or creationTimestamp desc is
  95779. // supported.
  95780. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  95781. c.urlParams_.Set("orderBy", orderBy)
  95782. return c
  95783. }
  95784. // PageToken sets the optional parameter "pageToken": Specifies a page
  95785. // token to use. Set pageToken to the nextPageToken returned by a
  95786. // previous list request to get the next page of results.
  95787. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  95788. c.urlParams_.Set("pageToken", pageToken)
  95789. return c
  95790. }
  95791. // Fields allows partial responses to be retrieved. See
  95792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95793. // for more information.
  95794. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  95795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95796. return c
  95797. }
  95798. // IfNoneMatch sets the optional parameter which makes the operation
  95799. // fail if the object's ETag matches the given value. This is useful for
  95800. // getting updates only after the object has changed since the last
  95801. // request. Use googleapi.IsNotModified to check whether the response
  95802. // error from Do is the result of In-None-Match.
  95803. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  95804. c.ifNoneMatch_ = entityTag
  95805. return c
  95806. }
  95807. // Context sets the context to be used in this call's Do method. Any
  95808. // pending HTTP request will be aborted if the provided context is
  95809. // canceled.
  95810. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  95811. c.ctx_ = ctx
  95812. return c
  95813. }
  95814. // Header returns an http.Header that can be modified by the caller to
  95815. // add HTTP headers to the request.
  95816. func (c *SnapshotsListCall) Header() http.Header {
  95817. if c.header_ == nil {
  95818. c.header_ = make(http.Header)
  95819. }
  95820. return c.header_
  95821. }
  95822. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  95823. reqHeaders := make(http.Header)
  95824. for k, v := range c.header_ {
  95825. reqHeaders[k] = v
  95826. }
  95827. reqHeaders.Set("User-Agent", c.s.userAgent())
  95828. if c.ifNoneMatch_ != "" {
  95829. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95830. }
  95831. var body io.Reader = nil
  95832. c.urlParams_.Set("alt", alt)
  95833. c.urlParams_.Set("prettyPrint", "false")
  95834. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  95835. urls += "?" + c.urlParams_.Encode()
  95836. req, err := http.NewRequest("GET", urls, body)
  95837. if err != nil {
  95838. return nil, err
  95839. }
  95840. req.Header = reqHeaders
  95841. googleapi.Expand(req.URL, map[string]string{
  95842. "project": c.project,
  95843. })
  95844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95845. }
  95846. // Do executes the "compute.snapshots.list" call.
  95847. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  95848. // status code is an error. Response headers are in either
  95849. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  95850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95851. // to check whether the returned error was because
  95852. // http.StatusNotModified was returned.
  95853. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  95854. gensupport.SetOptions(c.urlParams_, opts...)
  95855. res, err := c.doRequest("json")
  95856. if res != nil && res.StatusCode == http.StatusNotModified {
  95857. if res.Body != nil {
  95858. res.Body.Close()
  95859. }
  95860. return nil, &googleapi.Error{
  95861. Code: res.StatusCode,
  95862. Header: res.Header,
  95863. }
  95864. }
  95865. if err != nil {
  95866. return nil, err
  95867. }
  95868. defer googleapi.CloseBody(res)
  95869. if err := googleapi.CheckResponse(res); err != nil {
  95870. return nil, err
  95871. }
  95872. ret := &SnapshotList{
  95873. ServerResponse: googleapi.ServerResponse{
  95874. Header: res.Header,
  95875. HTTPStatusCode: res.StatusCode,
  95876. },
  95877. }
  95878. target := &ret
  95879. if err := gensupport.DecodeResponse(target, res); err != nil {
  95880. return nil, err
  95881. }
  95882. return ret, nil
  95883. // {
  95884. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  95885. // "httpMethod": "GET",
  95886. // "id": "compute.snapshots.list",
  95887. // "parameterOrder": [
  95888. // "project"
  95889. // ],
  95890. // "parameters": {
  95891. // "filter": {
  95892. // "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).",
  95893. // "location": "query",
  95894. // "type": "string"
  95895. // },
  95896. // "maxResults": {
  95897. // "default": "500",
  95898. // "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)",
  95899. // "format": "uint32",
  95900. // "location": "query",
  95901. // "minimum": "0",
  95902. // "type": "integer"
  95903. // },
  95904. // "orderBy": {
  95905. // "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.",
  95906. // "location": "query",
  95907. // "type": "string"
  95908. // },
  95909. // "pageToken": {
  95910. // "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.",
  95911. // "location": "query",
  95912. // "type": "string"
  95913. // },
  95914. // "project": {
  95915. // "description": "Project ID for this request.",
  95916. // "location": "path",
  95917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95918. // "required": true,
  95919. // "type": "string"
  95920. // }
  95921. // },
  95922. // "path": "{project}/global/snapshots",
  95923. // "response": {
  95924. // "$ref": "SnapshotList"
  95925. // },
  95926. // "scopes": [
  95927. // "https://www.googleapis.com/auth/cloud-platform",
  95928. // "https://www.googleapis.com/auth/compute",
  95929. // "https://www.googleapis.com/auth/compute.readonly"
  95930. // ]
  95931. // }
  95932. }
  95933. // Pages invokes f for each page of results.
  95934. // A non-nil error returned from f will halt the iteration.
  95935. // The provided context supersedes any context provided to the Context method.
  95936. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  95937. c.ctx_ = ctx
  95938. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95939. for {
  95940. x, err := c.Do()
  95941. if err != nil {
  95942. return err
  95943. }
  95944. if err := f(x); err != nil {
  95945. return err
  95946. }
  95947. if x.NextPageToken == "" {
  95948. return nil
  95949. }
  95950. c.PageToken(x.NextPageToken)
  95951. }
  95952. }
  95953. // method id "compute.snapshots.setIamPolicy":
  95954. type SnapshotsSetIamPolicyCall struct {
  95955. s *Service
  95956. project string
  95957. resource string
  95958. globalsetpolicyrequest *GlobalSetPolicyRequest
  95959. urlParams_ gensupport.URLParams
  95960. ctx_ context.Context
  95961. header_ http.Header
  95962. }
  95963. // SetIamPolicy: Sets the access control policy on the specified
  95964. // resource. Replaces any existing policy.
  95965. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  95966. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95967. c.project = project
  95968. c.resource = resource
  95969. c.globalsetpolicyrequest = globalsetpolicyrequest
  95970. return c
  95971. }
  95972. // Fields allows partial responses to be retrieved. See
  95973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95974. // for more information.
  95975. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  95976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95977. return c
  95978. }
  95979. // Context sets the context to be used in this call's Do method. Any
  95980. // pending HTTP request will be aborted if the provided context is
  95981. // canceled.
  95982. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  95983. c.ctx_ = ctx
  95984. return c
  95985. }
  95986. // Header returns an http.Header that can be modified by the caller to
  95987. // add HTTP headers to the request.
  95988. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  95989. if c.header_ == nil {
  95990. c.header_ = make(http.Header)
  95991. }
  95992. return c.header_
  95993. }
  95994. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  95995. reqHeaders := make(http.Header)
  95996. for k, v := range c.header_ {
  95997. reqHeaders[k] = v
  95998. }
  95999. reqHeaders.Set("User-Agent", c.s.userAgent())
  96000. var body io.Reader = nil
  96001. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  96002. if err != nil {
  96003. return nil, err
  96004. }
  96005. reqHeaders.Set("Content-Type", "application/json")
  96006. c.urlParams_.Set("alt", alt)
  96007. c.urlParams_.Set("prettyPrint", "false")
  96008. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  96009. urls += "?" + c.urlParams_.Encode()
  96010. req, err := http.NewRequest("POST", urls, body)
  96011. if err != nil {
  96012. return nil, err
  96013. }
  96014. req.Header = reqHeaders
  96015. googleapi.Expand(req.URL, map[string]string{
  96016. "project": c.project,
  96017. "resource": c.resource,
  96018. })
  96019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96020. }
  96021. // Do executes the "compute.snapshots.setIamPolicy" call.
  96022. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  96023. // code is an error. Response headers are in either
  96024. // *Policy.ServerResponse.Header or (if a response was returned at all)
  96025. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  96026. // check whether the returned error was because http.StatusNotModified
  96027. // was returned.
  96028. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  96029. gensupport.SetOptions(c.urlParams_, opts...)
  96030. res, err := c.doRequest("json")
  96031. if res != nil && res.StatusCode == http.StatusNotModified {
  96032. if res.Body != nil {
  96033. res.Body.Close()
  96034. }
  96035. return nil, &googleapi.Error{
  96036. Code: res.StatusCode,
  96037. Header: res.Header,
  96038. }
  96039. }
  96040. if err != nil {
  96041. return nil, err
  96042. }
  96043. defer googleapi.CloseBody(res)
  96044. if err := googleapi.CheckResponse(res); err != nil {
  96045. return nil, err
  96046. }
  96047. ret := &Policy{
  96048. ServerResponse: googleapi.ServerResponse{
  96049. Header: res.Header,
  96050. HTTPStatusCode: res.StatusCode,
  96051. },
  96052. }
  96053. target := &ret
  96054. if err := gensupport.DecodeResponse(target, res); err != nil {
  96055. return nil, err
  96056. }
  96057. return ret, nil
  96058. // {
  96059. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  96060. // "httpMethod": "POST",
  96061. // "id": "compute.snapshots.setIamPolicy",
  96062. // "parameterOrder": [
  96063. // "project",
  96064. // "resource"
  96065. // ],
  96066. // "parameters": {
  96067. // "project": {
  96068. // "description": "Project ID for this request.",
  96069. // "location": "path",
  96070. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96071. // "required": true,
  96072. // "type": "string"
  96073. // },
  96074. // "resource": {
  96075. // "description": "Name or id of the resource for this request.",
  96076. // "location": "path",
  96077. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96078. // "required": true,
  96079. // "type": "string"
  96080. // }
  96081. // },
  96082. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  96083. // "request": {
  96084. // "$ref": "GlobalSetPolicyRequest"
  96085. // },
  96086. // "response": {
  96087. // "$ref": "Policy"
  96088. // },
  96089. // "scopes": [
  96090. // "https://www.googleapis.com/auth/cloud-platform",
  96091. // "https://www.googleapis.com/auth/compute"
  96092. // ]
  96093. // }
  96094. }
  96095. // method id "compute.snapshots.setLabels":
  96096. type SnapshotsSetLabelsCall struct {
  96097. s *Service
  96098. project string
  96099. resource string
  96100. globalsetlabelsrequest *GlobalSetLabelsRequest
  96101. urlParams_ gensupport.URLParams
  96102. ctx_ context.Context
  96103. header_ http.Header
  96104. }
  96105. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  96106. // read the Labeling Resources documentation.
  96107. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  96108. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96109. c.project = project
  96110. c.resource = resource
  96111. c.globalsetlabelsrequest = globalsetlabelsrequest
  96112. return c
  96113. }
  96114. // Fields allows partial responses to be retrieved. See
  96115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96116. // for more information.
  96117. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  96118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96119. return c
  96120. }
  96121. // Context sets the context to be used in this call's Do method. Any
  96122. // pending HTTP request will be aborted if the provided context is
  96123. // canceled.
  96124. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  96125. c.ctx_ = ctx
  96126. return c
  96127. }
  96128. // Header returns an http.Header that can be modified by the caller to
  96129. // add HTTP headers to the request.
  96130. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  96131. if c.header_ == nil {
  96132. c.header_ = make(http.Header)
  96133. }
  96134. return c.header_
  96135. }
  96136. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  96137. reqHeaders := make(http.Header)
  96138. for k, v := range c.header_ {
  96139. reqHeaders[k] = v
  96140. }
  96141. reqHeaders.Set("User-Agent", c.s.userAgent())
  96142. var body io.Reader = nil
  96143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  96144. if err != nil {
  96145. return nil, err
  96146. }
  96147. reqHeaders.Set("Content-Type", "application/json")
  96148. c.urlParams_.Set("alt", alt)
  96149. c.urlParams_.Set("prettyPrint", "false")
  96150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  96151. urls += "?" + c.urlParams_.Encode()
  96152. req, err := http.NewRequest("POST", urls, body)
  96153. if err != nil {
  96154. return nil, err
  96155. }
  96156. req.Header = reqHeaders
  96157. googleapi.Expand(req.URL, map[string]string{
  96158. "project": c.project,
  96159. "resource": c.resource,
  96160. })
  96161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96162. }
  96163. // Do executes the "compute.snapshots.setLabels" call.
  96164. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96165. // status code is an error. Response headers are in either
  96166. // *Operation.ServerResponse.Header or (if a response was returned at
  96167. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96168. // to check whether the returned error was because
  96169. // http.StatusNotModified was returned.
  96170. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96171. gensupport.SetOptions(c.urlParams_, opts...)
  96172. res, err := c.doRequest("json")
  96173. if res != nil && res.StatusCode == http.StatusNotModified {
  96174. if res.Body != nil {
  96175. res.Body.Close()
  96176. }
  96177. return nil, &googleapi.Error{
  96178. Code: res.StatusCode,
  96179. Header: res.Header,
  96180. }
  96181. }
  96182. if err != nil {
  96183. return nil, err
  96184. }
  96185. defer googleapi.CloseBody(res)
  96186. if err := googleapi.CheckResponse(res); err != nil {
  96187. return nil, err
  96188. }
  96189. ret := &Operation{
  96190. ServerResponse: googleapi.ServerResponse{
  96191. Header: res.Header,
  96192. HTTPStatusCode: res.StatusCode,
  96193. },
  96194. }
  96195. target := &ret
  96196. if err := gensupport.DecodeResponse(target, res); err != nil {
  96197. return nil, err
  96198. }
  96199. return ret, nil
  96200. // {
  96201. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  96202. // "httpMethod": "POST",
  96203. // "id": "compute.snapshots.setLabels",
  96204. // "parameterOrder": [
  96205. // "project",
  96206. // "resource"
  96207. // ],
  96208. // "parameters": {
  96209. // "project": {
  96210. // "description": "Project ID for this request.",
  96211. // "location": "path",
  96212. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96213. // "required": true,
  96214. // "type": "string"
  96215. // },
  96216. // "resource": {
  96217. // "description": "Name or id of the resource for this request.",
  96218. // "location": "path",
  96219. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96220. // "required": true,
  96221. // "type": "string"
  96222. // }
  96223. // },
  96224. // "path": "{project}/global/snapshots/{resource}/setLabels",
  96225. // "request": {
  96226. // "$ref": "GlobalSetLabelsRequest"
  96227. // },
  96228. // "response": {
  96229. // "$ref": "Operation"
  96230. // },
  96231. // "scopes": [
  96232. // "https://www.googleapis.com/auth/cloud-platform",
  96233. // "https://www.googleapis.com/auth/compute"
  96234. // ]
  96235. // }
  96236. }
  96237. // method id "compute.snapshots.testIamPermissions":
  96238. type SnapshotsTestIamPermissionsCall struct {
  96239. s *Service
  96240. project string
  96241. resource string
  96242. testpermissionsrequest *TestPermissionsRequest
  96243. urlParams_ gensupport.URLParams
  96244. ctx_ context.Context
  96245. header_ http.Header
  96246. }
  96247. // TestIamPermissions: Returns permissions that a caller has on the
  96248. // specified resource.
  96249. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  96250. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96251. c.project = project
  96252. c.resource = resource
  96253. c.testpermissionsrequest = testpermissionsrequest
  96254. return c
  96255. }
  96256. // Fields allows partial responses to be retrieved. See
  96257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96258. // for more information.
  96259. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  96260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96261. return c
  96262. }
  96263. // Context sets the context to be used in this call's Do method. Any
  96264. // pending HTTP request will be aborted if the provided context is
  96265. // canceled.
  96266. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  96267. c.ctx_ = ctx
  96268. return c
  96269. }
  96270. // Header returns an http.Header that can be modified by the caller to
  96271. // add HTTP headers to the request.
  96272. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  96273. if c.header_ == nil {
  96274. c.header_ = make(http.Header)
  96275. }
  96276. return c.header_
  96277. }
  96278. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  96279. reqHeaders := make(http.Header)
  96280. for k, v := range c.header_ {
  96281. reqHeaders[k] = v
  96282. }
  96283. reqHeaders.Set("User-Agent", c.s.userAgent())
  96284. var body io.Reader = nil
  96285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  96286. if err != nil {
  96287. return nil, err
  96288. }
  96289. reqHeaders.Set("Content-Type", "application/json")
  96290. c.urlParams_.Set("alt", alt)
  96291. c.urlParams_.Set("prettyPrint", "false")
  96292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  96293. urls += "?" + c.urlParams_.Encode()
  96294. req, err := http.NewRequest("POST", urls, body)
  96295. if err != nil {
  96296. return nil, err
  96297. }
  96298. req.Header = reqHeaders
  96299. googleapi.Expand(req.URL, map[string]string{
  96300. "project": c.project,
  96301. "resource": c.resource,
  96302. })
  96303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96304. }
  96305. // Do executes the "compute.snapshots.testIamPermissions" call.
  96306. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  96307. // non-2xx status code is an error. Response headers are in either
  96308. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  96309. // returned at all) in error.(*googleapi.Error).Header. Use
  96310. // googleapi.IsNotModified to check whether the returned error was
  96311. // because http.StatusNotModified was returned.
  96312. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  96313. gensupport.SetOptions(c.urlParams_, opts...)
  96314. res, err := c.doRequest("json")
  96315. if res != nil && res.StatusCode == http.StatusNotModified {
  96316. if res.Body != nil {
  96317. res.Body.Close()
  96318. }
  96319. return nil, &googleapi.Error{
  96320. Code: res.StatusCode,
  96321. Header: res.Header,
  96322. }
  96323. }
  96324. if err != nil {
  96325. return nil, err
  96326. }
  96327. defer googleapi.CloseBody(res)
  96328. if err := googleapi.CheckResponse(res); err != nil {
  96329. return nil, err
  96330. }
  96331. ret := &TestPermissionsResponse{
  96332. ServerResponse: googleapi.ServerResponse{
  96333. Header: res.Header,
  96334. HTTPStatusCode: res.StatusCode,
  96335. },
  96336. }
  96337. target := &ret
  96338. if err := gensupport.DecodeResponse(target, res); err != nil {
  96339. return nil, err
  96340. }
  96341. return ret, nil
  96342. // {
  96343. // "description": "Returns permissions that a caller has on the specified resource.",
  96344. // "httpMethod": "POST",
  96345. // "id": "compute.snapshots.testIamPermissions",
  96346. // "parameterOrder": [
  96347. // "project",
  96348. // "resource"
  96349. // ],
  96350. // "parameters": {
  96351. // "project": {
  96352. // "description": "Project ID for this request.",
  96353. // "location": "path",
  96354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96355. // "required": true,
  96356. // "type": "string"
  96357. // },
  96358. // "resource": {
  96359. // "description": "Name or id of the resource for this request.",
  96360. // "location": "path",
  96361. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96362. // "required": true,
  96363. // "type": "string"
  96364. // }
  96365. // },
  96366. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  96367. // "request": {
  96368. // "$ref": "TestPermissionsRequest"
  96369. // },
  96370. // "response": {
  96371. // "$ref": "TestPermissionsResponse"
  96372. // },
  96373. // "scopes": [
  96374. // "https://www.googleapis.com/auth/cloud-platform",
  96375. // "https://www.googleapis.com/auth/compute",
  96376. // "https://www.googleapis.com/auth/compute.readonly"
  96377. // ]
  96378. // }
  96379. }
  96380. // method id "compute.sslCertificates.delete":
  96381. type SslCertificatesDeleteCall struct {
  96382. s *Service
  96383. project string
  96384. sslCertificate string
  96385. urlParams_ gensupport.URLParams
  96386. ctx_ context.Context
  96387. header_ http.Header
  96388. }
  96389. // Delete: Deletes the specified SslCertificate resource.
  96390. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  96391. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96392. c.project = project
  96393. c.sslCertificate = sslCertificate
  96394. return c
  96395. }
  96396. // RequestId sets the optional parameter "requestId": An optional
  96397. // request ID to identify requests. Specify a unique request ID so that
  96398. // if you must retry your request, the server will know to ignore the
  96399. // request if it has already been completed.
  96400. //
  96401. // For example, consider a situation where you make an initial request
  96402. // and the request times out. If you make the request again with the
  96403. // same request ID, the server can check if original operation with the
  96404. // same request ID was received, and if so, will ignore the second
  96405. // request. This prevents clients from accidentally creating duplicate
  96406. // commitments.
  96407. //
  96408. // The request ID must be a valid UUID with the exception that zero UUID
  96409. // is not supported (00000000-0000-0000-0000-000000000000).
  96410. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  96411. c.urlParams_.Set("requestId", requestId)
  96412. return c
  96413. }
  96414. // Fields allows partial responses to be retrieved. See
  96415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96416. // for more information.
  96417. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  96418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96419. return c
  96420. }
  96421. // Context sets the context to be used in this call's Do method. Any
  96422. // pending HTTP request will be aborted if the provided context is
  96423. // canceled.
  96424. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  96425. c.ctx_ = ctx
  96426. return c
  96427. }
  96428. // Header returns an http.Header that can be modified by the caller to
  96429. // add HTTP headers to the request.
  96430. func (c *SslCertificatesDeleteCall) Header() http.Header {
  96431. if c.header_ == nil {
  96432. c.header_ = make(http.Header)
  96433. }
  96434. return c.header_
  96435. }
  96436. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  96437. reqHeaders := make(http.Header)
  96438. for k, v := range c.header_ {
  96439. reqHeaders[k] = v
  96440. }
  96441. reqHeaders.Set("User-Agent", c.s.userAgent())
  96442. var body io.Reader = nil
  96443. c.urlParams_.Set("alt", alt)
  96444. c.urlParams_.Set("prettyPrint", "false")
  96445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  96446. urls += "?" + c.urlParams_.Encode()
  96447. req, err := http.NewRequest("DELETE", urls, body)
  96448. if err != nil {
  96449. return nil, err
  96450. }
  96451. req.Header = reqHeaders
  96452. googleapi.Expand(req.URL, map[string]string{
  96453. "project": c.project,
  96454. "sslCertificate": c.sslCertificate,
  96455. })
  96456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96457. }
  96458. // Do executes the "compute.sslCertificates.delete" call.
  96459. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96460. // status code is an error. Response headers are in either
  96461. // *Operation.ServerResponse.Header or (if a response was returned at
  96462. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96463. // to check whether the returned error was because
  96464. // http.StatusNotModified was returned.
  96465. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96466. gensupport.SetOptions(c.urlParams_, opts...)
  96467. res, err := c.doRequest("json")
  96468. if res != nil && res.StatusCode == http.StatusNotModified {
  96469. if res.Body != nil {
  96470. res.Body.Close()
  96471. }
  96472. return nil, &googleapi.Error{
  96473. Code: res.StatusCode,
  96474. Header: res.Header,
  96475. }
  96476. }
  96477. if err != nil {
  96478. return nil, err
  96479. }
  96480. defer googleapi.CloseBody(res)
  96481. if err := googleapi.CheckResponse(res); err != nil {
  96482. return nil, err
  96483. }
  96484. ret := &Operation{
  96485. ServerResponse: googleapi.ServerResponse{
  96486. Header: res.Header,
  96487. HTTPStatusCode: res.StatusCode,
  96488. },
  96489. }
  96490. target := &ret
  96491. if err := gensupport.DecodeResponse(target, res); err != nil {
  96492. return nil, err
  96493. }
  96494. return ret, nil
  96495. // {
  96496. // "description": "Deletes the specified SslCertificate resource.",
  96497. // "httpMethod": "DELETE",
  96498. // "id": "compute.sslCertificates.delete",
  96499. // "parameterOrder": [
  96500. // "project",
  96501. // "sslCertificate"
  96502. // ],
  96503. // "parameters": {
  96504. // "project": {
  96505. // "description": "Project ID for this request.",
  96506. // "location": "path",
  96507. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96508. // "required": true,
  96509. // "type": "string"
  96510. // },
  96511. // "requestId": {
  96512. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96513. // "location": "query",
  96514. // "type": "string"
  96515. // },
  96516. // "sslCertificate": {
  96517. // "description": "Name of the SslCertificate resource to delete.",
  96518. // "location": "path",
  96519. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96520. // "required": true,
  96521. // "type": "string"
  96522. // }
  96523. // },
  96524. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  96525. // "response": {
  96526. // "$ref": "Operation"
  96527. // },
  96528. // "scopes": [
  96529. // "https://www.googleapis.com/auth/cloud-platform",
  96530. // "https://www.googleapis.com/auth/compute"
  96531. // ]
  96532. // }
  96533. }
  96534. // method id "compute.sslCertificates.get":
  96535. type SslCertificatesGetCall struct {
  96536. s *Service
  96537. project string
  96538. sslCertificate string
  96539. urlParams_ gensupport.URLParams
  96540. ifNoneMatch_ string
  96541. ctx_ context.Context
  96542. header_ http.Header
  96543. }
  96544. // Get: Returns the specified SslCertificate resource. Gets a list of
  96545. // available SSL certificates by making a list() request.
  96546. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  96547. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96548. c.project = project
  96549. c.sslCertificate = sslCertificate
  96550. return c
  96551. }
  96552. // Fields allows partial responses to be retrieved. See
  96553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96554. // for more information.
  96555. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  96556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96557. return c
  96558. }
  96559. // IfNoneMatch sets the optional parameter which makes the operation
  96560. // fail if the object's ETag matches the given value. This is useful for
  96561. // getting updates only after the object has changed since the last
  96562. // request. Use googleapi.IsNotModified to check whether the response
  96563. // error from Do is the result of In-None-Match.
  96564. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  96565. c.ifNoneMatch_ = entityTag
  96566. return c
  96567. }
  96568. // Context sets the context to be used in this call's Do method. Any
  96569. // pending HTTP request will be aborted if the provided context is
  96570. // canceled.
  96571. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  96572. c.ctx_ = ctx
  96573. return c
  96574. }
  96575. // Header returns an http.Header that can be modified by the caller to
  96576. // add HTTP headers to the request.
  96577. func (c *SslCertificatesGetCall) Header() http.Header {
  96578. if c.header_ == nil {
  96579. c.header_ = make(http.Header)
  96580. }
  96581. return c.header_
  96582. }
  96583. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  96584. reqHeaders := make(http.Header)
  96585. for k, v := range c.header_ {
  96586. reqHeaders[k] = v
  96587. }
  96588. reqHeaders.Set("User-Agent", c.s.userAgent())
  96589. if c.ifNoneMatch_ != "" {
  96590. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96591. }
  96592. var body io.Reader = nil
  96593. c.urlParams_.Set("alt", alt)
  96594. c.urlParams_.Set("prettyPrint", "false")
  96595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  96596. urls += "?" + c.urlParams_.Encode()
  96597. req, err := http.NewRequest("GET", urls, body)
  96598. if err != nil {
  96599. return nil, err
  96600. }
  96601. req.Header = reqHeaders
  96602. googleapi.Expand(req.URL, map[string]string{
  96603. "project": c.project,
  96604. "sslCertificate": c.sslCertificate,
  96605. })
  96606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96607. }
  96608. // Do executes the "compute.sslCertificates.get" call.
  96609. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  96610. // status code is an error. Response headers are in either
  96611. // *SslCertificate.ServerResponse.Header or (if a response was returned
  96612. // at all) in error.(*googleapi.Error).Header. Use
  96613. // googleapi.IsNotModified to check whether the returned error was
  96614. // because http.StatusNotModified was returned.
  96615. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  96616. gensupport.SetOptions(c.urlParams_, opts...)
  96617. res, err := c.doRequest("json")
  96618. if res != nil && res.StatusCode == http.StatusNotModified {
  96619. if res.Body != nil {
  96620. res.Body.Close()
  96621. }
  96622. return nil, &googleapi.Error{
  96623. Code: res.StatusCode,
  96624. Header: res.Header,
  96625. }
  96626. }
  96627. if err != nil {
  96628. return nil, err
  96629. }
  96630. defer googleapi.CloseBody(res)
  96631. if err := googleapi.CheckResponse(res); err != nil {
  96632. return nil, err
  96633. }
  96634. ret := &SslCertificate{
  96635. ServerResponse: googleapi.ServerResponse{
  96636. Header: res.Header,
  96637. HTTPStatusCode: res.StatusCode,
  96638. },
  96639. }
  96640. target := &ret
  96641. if err := gensupport.DecodeResponse(target, res); err != nil {
  96642. return nil, err
  96643. }
  96644. return ret, nil
  96645. // {
  96646. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  96647. // "httpMethod": "GET",
  96648. // "id": "compute.sslCertificates.get",
  96649. // "parameterOrder": [
  96650. // "project",
  96651. // "sslCertificate"
  96652. // ],
  96653. // "parameters": {
  96654. // "project": {
  96655. // "description": "Project ID for this request.",
  96656. // "location": "path",
  96657. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96658. // "required": true,
  96659. // "type": "string"
  96660. // },
  96661. // "sslCertificate": {
  96662. // "description": "Name of the SslCertificate resource to return.",
  96663. // "location": "path",
  96664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96665. // "required": true,
  96666. // "type": "string"
  96667. // }
  96668. // },
  96669. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  96670. // "response": {
  96671. // "$ref": "SslCertificate"
  96672. // },
  96673. // "scopes": [
  96674. // "https://www.googleapis.com/auth/cloud-platform",
  96675. // "https://www.googleapis.com/auth/compute",
  96676. // "https://www.googleapis.com/auth/compute.readonly"
  96677. // ]
  96678. // }
  96679. }
  96680. // method id "compute.sslCertificates.insert":
  96681. type SslCertificatesInsertCall struct {
  96682. s *Service
  96683. project string
  96684. sslcertificate *SslCertificate
  96685. urlParams_ gensupport.URLParams
  96686. ctx_ context.Context
  96687. header_ http.Header
  96688. }
  96689. // Insert: Creates a SslCertificate resource in the specified project
  96690. // using the data included in the request.
  96691. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  96692. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96693. c.project = project
  96694. c.sslcertificate = sslcertificate
  96695. return c
  96696. }
  96697. // RequestId sets the optional parameter "requestId": An optional
  96698. // request ID to identify requests. Specify a unique request ID so that
  96699. // if you must retry your request, the server will know to ignore the
  96700. // request if it has already been completed.
  96701. //
  96702. // For example, consider a situation where you make an initial request
  96703. // and the request times out. If you make the request again with the
  96704. // same request ID, the server can check if original operation with the
  96705. // same request ID was received, and if so, will ignore the second
  96706. // request. This prevents clients from accidentally creating duplicate
  96707. // commitments.
  96708. //
  96709. // The request ID must be a valid UUID with the exception that zero UUID
  96710. // is not supported (00000000-0000-0000-0000-000000000000).
  96711. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  96712. c.urlParams_.Set("requestId", requestId)
  96713. return c
  96714. }
  96715. // Fields allows partial responses to be retrieved. See
  96716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96717. // for more information.
  96718. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  96719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96720. return c
  96721. }
  96722. // Context sets the context to be used in this call's Do method. Any
  96723. // pending HTTP request will be aborted if the provided context is
  96724. // canceled.
  96725. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  96726. c.ctx_ = ctx
  96727. return c
  96728. }
  96729. // Header returns an http.Header that can be modified by the caller to
  96730. // add HTTP headers to the request.
  96731. func (c *SslCertificatesInsertCall) Header() http.Header {
  96732. if c.header_ == nil {
  96733. c.header_ = make(http.Header)
  96734. }
  96735. return c.header_
  96736. }
  96737. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  96738. reqHeaders := make(http.Header)
  96739. for k, v := range c.header_ {
  96740. reqHeaders[k] = v
  96741. }
  96742. reqHeaders.Set("User-Agent", c.s.userAgent())
  96743. var body io.Reader = nil
  96744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  96745. if err != nil {
  96746. return nil, err
  96747. }
  96748. reqHeaders.Set("Content-Type", "application/json")
  96749. c.urlParams_.Set("alt", alt)
  96750. c.urlParams_.Set("prettyPrint", "false")
  96751. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  96752. urls += "?" + c.urlParams_.Encode()
  96753. req, err := http.NewRequest("POST", urls, body)
  96754. if err != nil {
  96755. return nil, err
  96756. }
  96757. req.Header = reqHeaders
  96758. googleapi.Expand(req.URL, map[string]string{
  96759. "project": c.project,
  96760. })
  96761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96762. }
  96763. // Do executes the "compute.sslCertificates.insert" call.
  96764. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96765. // status code is an error. Response headers are in either
  96766. // *Operation.ServerResponse.Header or (if a response was returned at
  96767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96768. // to check whether the returned error was because
  96769. // http.StatusNotModified was returned.
  96770. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96771. gensupport.SetOptions(c.urlParams_, opts...)
  96772. res, err := c.doRequest("json")
  96773. if res != nil && res.StatusCode == http.StatusNotModified {
  96774. if res.Body != nil {
  96775. res.Body.Close()
  96776. }
  96777. return nil, &googleapi.Error{
  96778. Code: res.StatusCode,
  96779. Header: res.Header,
  96780. }
  96781. }
  96782. if err != nil {
  96783. return nil, err
  96784. }
  96785. defer googleapi.CloseBody(res)
  96786. if err := googleapi.CheckResponse(res); err != nil {
  96787. return nil, err
  96788. }
  96789. ret := &Operation{
  96790. ServerResponse: googleapi.ServerResponse{
  96791. Header: res.Header,
  96792. HTTPStatusCode: res.StatusCode,
  96793. },
  96794. }
  96795. target := &ret
  96796. if err := gensupport.DecodeResponse(target, res); err != nil {
  96797. return nil, err
  96798. }
  96799. return ret, nil
  96800. // {
  96801. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  96802. // "httpMethod": "POST",
  96803. // "id": "compute.sslCertificates.insert",
  96804. // "parameterOrder": [
  96805. // "project"
  96806. // ],
  96807. // "parameters": {
  96808. // "project": {
  96809. // "description": "Project ID for this request.",
  96810. // "location": "path",
  96811. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96812. // "required": true,
  96813. // "type": "string"
  96814. // },
  96815. // "requestId": {
  96816. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96817. // "location": "query",
  96818. // "type": "string"
  96819. // }
  96820. // },
  96821. // "path": "{project}/global/sslCertificates",
  96822. // "request": {
  96823. // "$ref": "SslCertificate"
  96824. // },
  96825. // "response": {
  96826. // "$ref": "Operation"
  96827. // },
  96828. // "scopes": [
  96829. // "https://www.googleapis.com/auth/cloud-platform",
  96830. // "https://www.googleapis.com/auth/compute"
  96831. // ]
  96832. // }
  96833. }
  96834. // method id "compute.sslCertificates.list":
  96835. type SslCertificatesListCall struct {
  96836. s *Service
  96837. project string
  96838. urlParams_ gensupport.URLParams
  96839. ifNoneMatch_ string
  96840. ctx_ context.Context
  96841. header_ http.Header
  96842. }
  96843. // List: Retrieves the list of SslCertificate resources available to the
  96844. // specified project.
  96845. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  96846. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96847. c.project = project
  96848. return c
  96849. }
  96850. // Filter sets the optional parameter "filter": A filter expression that
  96851. // filters resources listed in the response. The expression must specify
  96852. // the field name, a comparison operator, and the value that you want to
  96853. // use for filtering. The value must be a string, a number, or a
  96854. // boolean. The comparison operator must be either =, !=, >, or <.
  96855. //
  96856. // For example, if you are filtering Compute Engine instances, you can
  96857. // exclude instances named example-instance by specifying name !=
  96858. // example-instance.
  96859. //
  96860. // You can also filter nested fields. For example, you could specify
  96861. // scheduling.automaticRestart = false to include instances only if they
  96862. // are not scheduled for automatic restarts. You can use filtering on
  96863. // nested fields to filter based on resource labels.
  96864. //
  96865. // To filter on multiple expressions, provide each separate expression
  96866. // within parentheses. For example, (scheduling.automaticRestart = true)
  96867. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96868. // AND expression. However, you can include AND and OR expressions
  96869. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96870. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96871. // true).
  96872. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  96873. c.urlParams_.Set("filter", filter)
  96874. return c
  96875. }
  96876. // MaxResults sets the optional parameter "maxResults": The maximum
  96877. // number of results per page that should be returned. If the number of
  96878. // available results is larger than maxResults, Compute Engine returns a
  96879. // nextPageToken that can be used to get the next page of results in
  96880. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96881. // (Default: 500)
  96882. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  96883. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96884. return c
  96885. }
  96886. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96887. // a certain order. By default, results are returned in alphanumerical
  96888. // order based on the resource name.
  96889. //
  96890. // You can also sort results in descending order based on the creation
  96891. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96892. // based on the creationTimestamp field in reverse chronological order
  96893. // (newest result first). Use this to sort resources like operations so
  96894. // that the newest operation is returned first.
  96895. //
  96896. // Currently, only sorting by name or creationTimestamp desc is
  96897. // supported.
  96898. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  96899. c.urlParams_.Set("orderBy", orderBy)
  96900. return c
  96901. }
  96902. // PageToken sets the optional parameter "pageToken": Specifies a page
  96903. // token to use. Set pageToken to the nextPageToken returned by a
  96904. // previous list request to get the next page of results.
  96905. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  96906. c.urlParams_.Set("pageToken", pageToken)
  96907. return c
  96908. }
  96909. // Fields allows partial responses to be retrieved. See
  96910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96911. // for more information.
  96912. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  96913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96914. return c
  96915. }
  96916. // IfNoneMatch sets the optional parameter which makes the operation
  96917. // fail if the object's ETag matches the given value. This is useful for
  96918. // getting updates only after the object has changed since the last
  96919. // request. Use googleapi.IsNotModified to check whether the response
  96920. // error from Do is the result of In-None-Match.
  96921. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  96922. c.ifNoneMatch_ = entityTag
  96923. return c
  96924. }
  96925. // Context sets the context to be used in this call's Do method. Any
  96926. // pending HTTP request will be aborted if the provided context is
  96927. // canceled.
  96928. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  96929. c.ctx_ = ctx
  96930. return c
  96931. }
  96932. // Header returns an http.Header that can be modified by the caller to
  96933. // add HTTP headers to the request.
  96934. func (c *SslCertificatesListCall) Header() http.Header {
  96935. if c.header_ == nil {
  96936. c.header_ = make(http.Header)
  96937. }
  96938. return c.header_
  96939. }
  96940. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  96941. reqHeaders := make(http.Header)
  96942. for k, v := range c.header_ {
  96943. reqHeaders[k] = v
  96944. }
  96945. reqHeaders.Set("User-Agent", c.s.userAgent())
  96946. if c.ifNoneMatch_ != "" {
  96947. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96948. }
  96949. var body io.Reader = nil
  96950. c.urlParams_.Set("alt", alt)
  96951. c.urlParams_.Set("prettyPrint", "false")
  96952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  96953. urls += "?" + c.urlParams_.Encode()
  96954. req, err := http.NewRequest("GET", urls, body)
  96955. if err != nil {
  96956. return nil, err
  96957. }
  96958. req.Header = reqHeaders
  96959. googleapi.Expand(req.URL, map[string]string{
  96960. "project": c.project,
  96961. })
  96962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96963. }
  96964. // Do executes the "compute.sslCertificates.list" call.
  96965. // Exactly one of *SslCertificateList or error will be non-nil. Any
  96966. // non-2xx status code is an error. Response headers are in either
  96967. // *SslCertificateList.ServerResponse.Header or (if a response was
  96968. // returned at all) in error.(*googleapi.Error).Header. Use
  96969. // googleapi.IsNotModified to check whether the returned error was
  96970. // because http.StatusNotModified was returned.
  96971. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  96972. gensupport.SetOptions(c.urlParams_, opts...)
  96973. res, err := c.doRequest("json")
  96974. if res != nil && res.StatusCode == http.StatusNotModified {
  96975. if res.Body != nil {
  96976. res.Body.Close()
  96977. }
  96978. return nil, &googleapi.Error{
  96979. Code: res.StatusCode,
  96980. Header: res.Header,
  96981. }
  96982. }
  96983. if err != nil {
  96984. return nil, err
  96985. }
  96986. defer googleapi.CloseBody(res)
  96987. if err := googleapi.CheckResponse(res); err != nil {
  96988. return nil, err
  96989. }
  96990. ret := &SslCertificateList{
  96991. ServerResponse: googleapi.ServerResponse{
  96992. Header: res.Header,
  96993. HTTPStatusCode: res.StatusCode,
  96994. },
  96995. }
  96996. target := &ret
  96997. if err := gensupport.DecodeResponse(target, res); err != nil {
  96998. return nil, err
  96999. }
  97000. return ret, nil
  97001. // {
  97002. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  97003. // "httpMethod": "GET",
  97004. // "id": "compute.sslCertificates.list",
  97005. // "parameterOrder": [
  97006. // "project"
  97007. // ],
  97008. // "parameters": {
  97009. // "filter": {
  97010. // "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).",
  97011. // "location": "query",
  97012. // "type": "string"
  97013. // },
  97014. // "maxResults": {
  97015. // "default": "500",
  97016. // "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)",
  97017. // "format": "uint32",
  97018. // "location": "query",
  97019. // "minimum": "0",
  97020. // "type": "integer"
  97021. // },
  97022. // "orderBy": {
  97023. // "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.",
  97024. // "location": "query",
  97025. // "type": "string"
  97026. // },
  97027. // "pageToken": {
  97028. // "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.",
  97029. // "location": "query",
  97030. // "type": "string"
  97031. // },
  97032. // "project": {
  97033. // "description": "Project ID for this request.",
  97034. // "location": "path",
  97035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97036. // "required": true,
  97037. // "type": "string"
  97038. // }
  97039. // },
  97040. // "path": "{project}/global/sslCertificates",
  97041. // "response": {
  97042. // "$ref": "SslCertificateList"
  97043. // },
  97044. // "scopes": [
  97045. // "https://www.googleapis.com/auth/cloud-platform",
  97046. // "https://www.googleapis.com/auth/compute",
  97047. // "https://www.googleapis.com/auth/compute.readonly"
  97048. // ]
  97049. // }
  97050. }
  97051. // Pages invokes f for each page of results.
  97052. // A non-nil error returned from f will halt the iteration.
  97053. // The provided context supersedes any context provided to the Context method.
  97054. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  97055. c.ctx_ = ctx
  97056. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97057. for {
  97058. x, err := c.Do()
  97059. if err != nil {
  97060. return err
  97061. }
  97062. if err := f(x); err != nil {
  97063. return err
  97064. }
  97065. if x.NextPageToken == "" {
  97066. return nil
  97067. }
  97068. c.PageToken(x.NextPageToken)
  97069. }
  97070. }
  97071. // method id "compute.sslCertificates.testIamPermissions":
  97072. type SslCertificatesTestIamPermissionsCall struct {
  97073. s *Service
  97074. project string
  97075. resource string
  97076. testpermissionsrequest *TestPermissionsRequest
  97077. urlParams_ gensupport.URLParams
  97078. ctx_ context.Context
  97079. header_ http.Header
  97080. }
  97081. // TestIamPermissions: Returns permissions that a caller has on the
  97082. // specified resource.
  97083. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  97084. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97085. c.project = project
  97086. c.resource = resource
  97087. c.testpermissionsrequest = testpermissionsrequest
  97088. return c
  97089. }
  97090. // Fields allows partial responses to be retrieved. See
  97091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97092. // for more information.
  97093. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  97094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97095. return c
  97096. }
  97097. // Context sets the context to be used in this call's Do method. Any
  97098. // pending HTTP request will be aborted if the provided context is
  97099. // canceled.
  97100. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  97101. c.ctx_ = ctx
  97102. return c
  97103. }
  97104. // Header returns an http.Header that can be modified by the caller to
  97105. // add HTTP headers to the request.
  97106. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  97107. if c.header_ == nil {
  97108. c.header_ = make(http.Header)
  97109. }
  97110. return c.header_
  97111. }
  97112. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  97113. reqHeaders := make(http.Header)
  97114. for k, v := range c.header_ {
  97115. reqHeaders[k] = v
  97116. }
  97117. reqHeaders.Set("User-Agent", c.s.userAgent())
  97118. var body io.Reader = nil
  97119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  97120. if err != nil {
  97121. return nil, err
  97122. }
  97123. reqHeaders.Set("Content-Type", "application/json")
  97124. c.urlParams_.Set("alt", alt)
  97125. c.urlParams_.Set("prettyPrint", "false")
  97126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  97127. urls += "?" + c.urlParams_.Encode()
  97128. req, err := http.NewRequest("POST", urls, body)
  97129. if err != nil {
  97130. return nil, err
  97131. }
  97132. req.Header = reqHeaders
  97133. googleapi.Expand(req.URL, map[string]string{
  97134. "project": c.project,
  97135. "resource": c.resource,
  97136. })
  97137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97138. }
  97139. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  97140. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  97141. // non-2xx status code is an error. Response headers are in either
  97142. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  97143. // returned at all) in error.(*googleapi.Error).Header. Use
  97144. // googleapi.IsNotModified to check whether the returned error was
  97145. // because http.StatusNotModified was returned.
  97146. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  97147. gensupport.SetOptions(c.urlParams_, opts...)
  97148. res, err := c.doRequest("json")
  97149. if res != nil && res.StatusCode == http.StatusNotModified {
  97150. if res.Body != nil {
  97151. res.Body.Close()
  97152. }
  97153. return nil, &googleapi.Error{
  97154. Code: res.StatusCode,
  97155. Header: res.Header,
  97156. }
  97157. }
  97158. if err != nil {
  97159. return nil, err
  97160. }
  97161. defer googleapi.CloseBody(res)
  97162. if err := googleapi.CheckResponse(res); err != nil {
  97163. return nil, err
  97164. }
  97165. ret := &TestPermissionsResponse{
  97166. ServerResponse: googleapi.ServerResponse{
  97167. Header: res.Header,
  97168. HTTPStatusCode: res.StatusCode,
  97169. },
  97170. }
  97171. target := &ret
  97172. if err := gensupport.DecodeResponse(target, res); err != nil {
  97173. return nil, err
  97174. }
  97175. return ret, nil
  97176. // {
  97177. // "description": "Returns permissions that a caller has on the specified resource.",
  97178. // "httpMethod": "POST",
  97179. // "id": "compute.sslCertificates.testIamPermissions",
  97180. // "parameterOrder": [
  97181. // "project",
  97182. // "resource"
  97183. // ],
  97184. // "parameters": {
  97185. // "project": {
  97186. // "description": "Project ID for this request.",
  97187. // "location": "path",
  97188. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97189. // "required": true,
  97190. // "type": "string"
  97191. // },
  97192. // "resource": {
  97193. // "description": "Name or id of the resource for this request.",
  97194. // "location": "path",
  97195. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97196. // "required": true,
  97197. // "type": "string"
  97198. // }
  97199. // },
  97200. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  97201. // "request": {
  97202. // "$ref": "TestPermissionsRequest"
  97203. // },
  97204. // "response": {
  97205. // "$ref": "TestPermissionsResponse"
  97206. // },
  97207. // "scopes": [
  97208. // "https://www.googleapis.com/auth/cloud-platform",
  97209. // "https://www.googleapis.com/auth/compute",
  97210. // "https://www.googleapis.com/auth/compute.readonly"
  97211. // ]
  97212. // }
  97213. }
  97214. // method id "compute.sslPolicies.delete":
  97215. type SslPoliciesDeleteCall struct {
  97216. s *Service
  97217. project string
  97218. sslPolicy string
  97219. urlParams_ gensupport.URLParams
  97220. ctx_ context.Context
  97221. header_ http.Header
  97222. }
  97223. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  97224. // be deleted only if it is not in use by any TargetHttpsProxy or
  97225. // TargetSslProxy resources.
  97226. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  97227. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97228. c.project = project
  97229. c.sslPolicy = sslPolicy
  97230. return c
  97231. }
  97232. // RequestId sets the optional parameter "requestId": An optional
  97233. // request ID to identify requests. Specify a unique request ID so that
  97234. // if you must retry your request, the server will know to ignore the
  97235. // request if it has already been completed.
  97236. //
  97237. // For example, consider a situation where you make an initial request
  97238. // and the request times out. If you make the request again with the
  97239. // same request ID, the server can check if original operation with the
  97240. // same request ID was received, and if so, will ignore the second
  97241. // request. This prevents clients from accidentally creating duplicate
  97242. // commitments.
  97243. //
  97244. // The request ID must be a valid UUID with the exception that zero UUID
  97245. // is not supported (00000000-0000-0000-0000-000000000000).
  97246. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  97247. c.urlParams_.Set("requestId", requestId)
  97248. return c
  97249. }
  97250. // Fields allows partial responses to be retrieved. See
  97251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97252. // for more information.
  97253. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  97254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97255. return c
  97256. }
  97257. // Context sets the context to be used in this call's Do method. Any
  97258. // pending HTTP request will be aborted if the provided context is
  97259. // canceled.
  97260. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  97261. c.ctx_ = ctx
  97262. return c
  97263. }
  97264. // Header returns an http.Header that can be modified by the caller to
  97265. // add HTTP headers to the request.
  97266. func (c *SslPoliciesDeleteCall) Header() http.Header {
  97267. if c.header_ == nil {
  97268. c.header_ = make(http.Header)
  97269. }
  97270. return c.header_
  97271. }
  97272. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  97273. reqHeaders := make(http.Header)
  97274. for k, v := range c.header_ {
  97275. reqHeaders[k] = v
  97276. }
  97277. reqHeaders.Set("User-Agent", c.s.userAgent())
  97278. var body io.Reader = nil
  97279. c.urlParams_.Set("alt", alt)
  97280. c.urlParams_.Set("prettyPrint", "false")
  97281. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  97282. urls += "?" + c.urlParams_.Encode()
  97283. req, err := http.NewRequest("DELETE", urls, body)
  97284. if err != nil {
  97285. return nil, err
  97286. }
  97287. req.Header = reqHeaders
  97288. googleapi.Expand(req.URL, map[string]string{
  97289. "project": c.project,
  97290. "sslPolicy": c.sslPolicy,
  97291. })
  97292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97293. }
  97294. // Do executes the "compute.sslPolicies.delete" call.
  97295. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97296. // status code is an error. Response headers are in either
  97297. // *Operation.ServerResponse.Header or (if a response was returned at
  97298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97299. // to check whether the returned error was because
  97300. // http.StatusNotModified was returned.
  97301. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97302. gensupport.SetOptions(c.urlParams_, opts...)
  97303. res, err := c.doRequest("json")
  97304. if res != nil && res.StatusCode == http.StatusNotModified {
  97305. if res.Body != nil {
  97306. res.Body.Close()
  97307. }
  97308. return nil, &googleapi.Error{
  97309. Code: res.StatusCode,
  97310. Header: res.Header,
  97311. }
  97312. }
  97313. if err != nil {
  97314. return nil, err
  97315. }
  97316. defer googleapi.CloseBody(res)
  97317. if err := googleapi.CheckResponse(res); err != nil {
  97318. return nil, err
  97319. }
  97320. ret := &Operation{
  97321. ServerResponse: googleapi.ServerResponse{
  97322. Header: res.Header,
  97323. HTTPStatusCode: res.StatusCode,
  97324. },
  97325. }
  97326. target := &ret
  97327. if err := gensupport.DecodeResponse(target, res); err != nil {
  97328. return nil, err
  97329. }
  97330. return ret, nil
  97331. // {
  97332. // "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.",
  97333. // "httpMethod": "DELETE",
  97334. // "id": "compute.sslPolicies.delete",
  97335. // "parameterOrder": [
  97336. // "project",
  97337. // "sslPolicy"
  97338. // ],
  97339. // "parameters": {
  97340. // "project": {
  97341. // "description": "Project ID for this request.",
  97342. // "location": "path",
  97343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97344. // "required": true,
  97345. // "type": "string"
  97346. // },
  97347. // "requestId": {
  97348. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97349. // "location": "query",
  97350. // "type": "string"
  97351. // },
  97352. // "sslPolicy": {
  97353. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  97354. // "location": "path",
  97355. // "required": true,
  97356. // "type": "string"
  97357. // }
  97358. // },
  97359. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  97360. // "response": {
  97361. // "$ref": "Operation"
  97362. // },
  97363. // "scopes": [
  97364. // "https://www.googleapis.com/auth/cloud-platform",
  97365. // "https://www.googleapis.com/auth/compute"
  97366. // ]
  97367. // }
  97368. }
  97369. // method id "compute.sslPolicies.get":
  97370. type SslPoliciesGetCall struct {
  97371. s *Service
  97372. project string
  97373. sslPolicy string
  97374. urlParams_ gensupport.URLParams
  97375. ifNoneMatch_ string
  97376. ctx_ context.Context
  97377. header_ http.Header
  97378. }
  97379. // Get: Lists all of the ordered rules present in a single specified
  97380. // policy.
  97381. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  97382. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97383. c.project = project
  97384. c.sslPolicy = sslPolicy
  97385. return c
  97386. }
  97387. // Fields allows partial responses to be retrieved. See
  97388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97389. // for more information.
  97390. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  97391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97392. return c
  97393. }
  97394. // IfNoneMatch sets the optional parameter which makes the operation
  97395. // fail if the object's ETag matches the given value. This is useful for
  97396. // getting updates only after the object has changed since the last
  97397. // request. Use googleapi.IsNotModified to check whether the response
  97398. // error from Do is the result of In-None-Match.
  97399. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  97400. c.ifNoneMatch_ = entityTag
  97401. return c
  97402. }
  97403. // Context sets the context to be used in this call's Do method. Any
  97404. // pending HTTP request will be aborted if the provided context is
  97405. // canceled.
  97406. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  97407. c.ctx_ = ctx
  97408. return c
  97409. }
  97410. // Header returns an http.Header that can be modified by the caller to
  97411. // add HTTP headers to the request.
  97412. func (c *SslPoliciesGetCall) Header() http.Header {
  97413. if c.header_ == nil {
  97414. c.header_ = make(http.Header)
  97415. }
  97416. return c.header_
  97417. }
  97418. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  97419. reqHeaders := make(http.Header)
  97420. for k, v := range c.header_ {
  97421. reqHeaders[k] = v
  97422. }
  97423. reqHeaders.Set("User-Agent", c.s.userAgent())
  97424. if c.ifNoneMatch_ != "" {
  97425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97426. }
  97427. var body io.Reader = nil
  97428. c.urlParams_.Set("alt", alt)
  97429. c.urlParams_.Set("prettyPrint", "false")
  97430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  97431. urls += "?" + c.urlParams_.Encode()
  97432. req, err := http.NewRequest("GET", urls, body)
  97433. if err != nil {
  97434. return nil, err
  97435. }
  97436. req.Header = reqHeaders
  97437. googleapi.Expand(req.URL, map[string]string{
  97438. "project": c.project,
  97439. "sslPolicy": c.sslPolicy,
  97440. })
  97441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97442. }
  97443. // Do executes the "compute.sslPolicies.get" call.
  97444. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  97445. // status code is an error. Response headers are in either
  97446. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  97447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97448. // to check whether the returned error was because
  97449. // http.StatusNotModified was returned.
  97450. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  97451. gensupport.SetOptions(c.urlParams_, opts...)
  97452. res, err := c.doRequest("json")
  97453. if res != nil && res.StatusCode == http.StatusNotModified {
  97454. if res.Body != nil {
  97455. res.Body.Close()
  97456. }
  97457. return nil, &googleapi.Error{
  97458. Code: res.StatusCode,
  97459. Header: res.Header,
  97460. }
  97461. }
  97462. if err != nil {
  97463. return nil, err
  97464. }
  97465. defer googleapi.CloseBody(res)
  97466. if err := googleapi.CheckResponse(res); err != nil {
  97467. return nil, err
  97468. }
  97469. ret := &SslPolicy{
  97470. ServerResponse: googleapi.ServerResponse{
  97471. Header: res.Header,
  97472. HTTPStatusCode: res.StatusCode,
  97473. },
  97474. }
  97475. target := &ret
  97476. if err := gensupport.DecodeResponse(target, res); err != nil {
  97477. return nil, err
  97478. }
  97479. return ret, nil
  97480. // {
  97481. // "description": "Lists all of the ordered rules present in a single specified policy.",
  97482. // "httpMethod": "GET",
  97483. // "id": "compute.sslPolicies.get",
  97484. // "parameterOrder": [
  97485. // "project",
  97486. // "sslPolicy"
  97487. // ],
  97488. // "parameters": {
  97489. // "project": {
  97490. // "description": "Project ID for this request.",
  97491. // "location": "path",
  97492. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97493. // "required": true,
  97494. // "type": "string"
  97495. // },
  97496. // "sslPolicy": {
  97497. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  97498. // "location": "path",
  97499. // "required": true,
  97500. // "type": "string"
  97501. // }
  97502. // },
  97503. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  97504. // "response": {
  97505. // "$ref": "SslPolicy"
  97506. // },
  97507. // "scopes": [
  97508. // "https://www.googleapis.com/auth/cloud-platform",
  97509. // "https://www.googleapis.com/auth/compute",
  97510. // "https://www.googleapis.com/auth/compute.readonly"
  97511. // ]
  97512. // }
  97513. }
  97514. // method id "compute.sslPolicies.insert":
  97515. type SslPoliciesInsertCall struct {
  97516. s *Service
  97517. project string
  97518. sslpolicy *SslPolicy
  97519. urlParams_ gensupport.URLParams
  97520. ctx_ context.Context
  97521. header_ http.Header
  97522. }
  97523. // Insert: Returns the specified SSL policy resource. Gets a list of
  97524. // available SSL policies by making a list() request.
  97525. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  97526. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97527. c.project = project
  97528. c.sslpolicy = sslpolicy
  97529. return c
  97530. }
  97531. // RequestId sets the optional parameter "requestId": An optional
  97532. // request ID to identify requests. Specify a unique request ID so that
  97533. // if you must retry your request, the server will know to ignore the
  97534. // request if it has already been completed.
  97535. //
  97536. // For example, consider a situation where you make an initial request
  97537. // and the request times out. If you make the request again with the
  97538. // same request ID, the server can check if original operation with the
  97539. // same request ID was received, and if so, will ignore the second
  97540. // request. This prevents clients from accidentally creating duplicate
  97541. // commitments.
  97542. //
  97543. // The request ID must be a valid UUID with the exception that zero UUID
  97544. // is not supported (00000000-0000-0000-0000-000000000000).
  97545. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  97546. c.urlParams_.Set("requestId", requestId)
  97547. return c
  97548. }
  97549. // Fields allows partial responses to be retrieved. See
  97550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97551. // for more information.
  97552. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  97553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97554. return c
  97555. }
  97556. // Context sets the context to be used in this call's Do method. Any
  97557. // pending HTTP request will be aborted if the provided context is
  97558. // canceled.
  97559. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  97560. c.ctx_ = ctx
  97561. return c
  97562. }
  97563. // Header returns an http.Header that can be modified by the caller to
  97564. // add HTTP headers to the request.
  97565. func (c *SslPoliciesInsertCall) Header() http.Header {
  97566. if c.header_ == nil {
  97567. c.header_ = make(http.Header)
  97568. }
  97569. return c.header_
  97570. }
  97571. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  97572. reqHeaders := make(http.Header)
  97573. for k, v := range c.header_ {
  97574. reqHeaders[k] = v
  97575. }
  97576. reqHeaders.Set("User-Agent", c.s.userAgent())
  97577. var body io.Reader = nil
  97578. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  97579. if err != nil {
  97580. return nil, err
  97581. }
  97582. reqHeaders.Set("Content-Type", "application/json")
  97583. c.urlParams_.Set("alt", alt)
  97584. c.urlParams_.Set("prettyPrint", "false")
  97585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  97586. urls += "?" + c.urlParams_.Encode()
  97587. req, err := http.NewRequest("POST", urls, body)
  97588. if err != nil {
  97589. return nil, err
  97590. }
  97591. req.Header = reqHeaders
  97592. googleapi.Expand(req.URL, map[string]string{
  97593. "project": c.project,
  97594. })
  97595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97596. }
  97597. // Do executes the "compute.sslPolicies.insert" call.
  97598. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97599. // status code is an error. Response headers are in either
  97600. // *Operation.ServerResponse.Header or (if a response was returned at
  97601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97602. // to check whether the returned error was because
  97603. // http.StatusNotModified was returned.
  97604. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97605. gensupport.SetOptions(c.urlParams_, opts...)
  97606. res, err := c.doRequest("json")
  97607. if res != nil && res.StatusCode == http.StatusNotModified {
  97608. if res.Body != nil {
  97609. res.Body.Close()
  97610. }
  97611. return nil, &googleapi.Error{
  97612. Code: res.StatusCode,
  97613. Header: res.Header,
  97614. }
  97615. }
  97616. if err != nil {
  97617. return nil, err
  97618. }
  97619. defer googleapi.CloseBody(res)
  97620. if err := googleapi.CheckResponse(res); err != nil {
  97621. return nil, err
  97622. }
  97623. ret := &Operation{
  97624. ServerResponse: googleapi.ServerResponse{
  97625. Header: res.Header,
  97626. HTTPStatusCode: res.StatusCode,
  97627. },
  97628. }
  97629. target := &ret
  97630. if err := gensupport.DecodeResponse(target, res); err != nil {
  97631. return nil, err
  97632. }
  97633. return ret, nil
  97634. // {
  97635. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  97636. // "httpMethod": "POST",
  97637. // "id": "compute.sslPolicies.insert",
  97638. // "parameterOrder": [
  97639. // "project"
  97640. // ],
  97641. // "parameters": {
  97642. // "project": {
  97643. // "description": "Project ID for this request.",
  97644. // "location": "path",
  97645. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97646. // "required": true,
  97647. // "type": "string"
  97648. // },
  97649. // "requestId": {
  97650. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97651. // "location": "query",
  97652. // "type": "string"
  97653. // }
  97654. // },
  97655. // "path": "{project}/global/sslPolicies",
  97656. // "request": {
  97657. // "$ref": "SslPolicy"
  97658. // },
  97659. // "response": {
  97660. // "$ref": "Operation"
  97661. // },
  97662. // "scopes": [
  97663. // "https://www.googleapis.com/auth/cloud-platform",
  97664. // "https://www.googleapis.com/auth/compute"
  97665. // ]
  97666. // }
  97667. }
  97668. // method id "compute.sslPolicies.list":
  97669. type SslPoliciesListCall struct {
  97670. s *Service
  97671. project string
  97672. urlParams_ gensupport.URLParams
  97673. ifNoneMatch_ string
  97674. ctx_ context.Context
  97675. header_ http.Header
  97676. }
  97677. // List: Lists all the SSL policies that have been configured for the
  97678. // specified project.
  97679. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  97680. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97681. c.project = project
  97682. return c
  97683. }
  97684. // Filter sets the optional parameter "filter": A filter expression that
  97685. // filters resources listed in the response. The expression must specify
  97686. // the field name, a comparison operator, and the value that you want to
  97687. // use for filtering. The value must be a string, a number, or a
  97688. // boolean. The comparison operator must be either =, !=, >, or <.
  97689. //
  97690. // For example, if you are filtering Compute Engine instances, you can
  97691. // exclude instances named example-instance by specifying name !=
  97692. // example-instance.
  97693. //
  97694. // You can also filter nested fields. For example, you could specify
  97695. // scheduling.automaticRestart = false to include instances only if they
  97696. // are not scheduled for automatic restarts. You can use filtering on
  97697. // nested fields to filter based on resource labels.
  97698. //
  97699. // To filter on multiple expressions, provide each separate expression
  97700. // within parentheses. For example, (scheduling.automaticRestart = true)
  97701. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97702. // AND expression. However, you can include AND and OR expressions
  97703. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97704. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97705. // true).
  97706. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  97707. c.urlParams_.Set("filter", filter)
  97708. return c
  97709. }
  97710. // MaxResults sets the optional parameter "maxResults": The maximum
  97711. // number of results per page that should be returned. If the number of
  97712. // available results is larger than maxResults, Compute Engine returns a
  97713. // nextPageToken that can be used to get the next page of results in
  97714. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97715. // (Default: 500)
  97716. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  97717. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97718. return c
  97719. }
  97720. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97721. // a certain order. By default, results are returned in alphanumerical
  97722. // order based on the resource name.
  97723. //
  97724. // You can also sort results in descending order based on the creation
  97725. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97726. // based on the creationTimestamp field in reverse chronological order
  97727. // (newest result first). Use this to sort resources like operations so
  97728. // that the newest operation is returned first.
  97729. //
  97730. // Currently, only sorting by name or creationTimestamp desc is
  97731. // supported.
  97732. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  97733. c.urlParams_.Set("orderBy", orderBy)
  97734. return c
  97735. }
  97736. // PageToken sets the optional parameter "pageToken": Specifies a page
  97737. // token to use. Set pageToken to the nextPageToken returned by a
  97738. // previous list request to get the next page of results.
  97739. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  97740. c.urlParams_.Set("pageToken", pageToken)
  97741. return c
  97742. }
  97743. // Fields allows partial responses to be retrieved. See
  97744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97745. // for more information.
  97746. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  97747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97748. return c
  97749. }
  97750. // IfNoneMatch sets the optional parameter which makes the operation
  97751. // fail if the object's ETag matches the given value. This is useful for
  97752. // getting updates only after the object has changed since the last
  97753. // request. Use googleapi.IsNotModified to check whether the response
  97754. // error from Do is the result of In-None-Match.
  97755. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  97756. c.ifNoneMatch_ = entityTag
  97757. return c
  97758. }
  97759. // Context sets the context to be used in this call's Do method. Any
  97760. // pending HTTP request will be aborted if the provided context is
  97761. // canceled.
  97762. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  97763. c.ctx_ = ctx
  97764. return c
  97765. }
  97766. // Header returns an http.Header that can be modified by the caller to
  97767. // add HTTP headers to the request.
  97768. func (c *SslPoliciesListCall) Header() http.Header {
  97769. if c.header_ == nil {
  97770. c.header_ = make(http.Header)
  97771. }
  97772. return c.header_
  97773. }
  97774. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  97775. reqHeaders := make(http.Header)
  97776. for k, v := range c.header_ {
  97777. reqHeaders[k] = v
  97778. }
  97779. reqHeaders.Set("User-Agent", c.s.userAgent())
  97780. if c.ifNoneMatch_ != "" {
  97781. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97782. }
  97783. var body io.Reader = nil
  97784. c.urlParams_.Set("alt", alt)
  97785. c.urlParams_.Set("prettyPrint", "false")
  97786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  97787. urls += "?" + c.urlParams_.Encode()
  97788. req, err := http.NewRequest("GET", urls, body)
  97789. if err != nil {
  97790. return nil, err
  97791. }
  97792. req.Header = reqHeaders
  97793. googleapi.Expand(req.URL, map[string]string{
  97794. "project": c.project,
  97795. })
  97796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97797. }
  97798. // Do executes the "compute.sslPolicies.list" call.
  97799. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  97800. // status code is an error. Response headers are in either
  97801. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  97802. // at all) in error.(*googleapi.Error).Header. Use
  97803. // googleapi.IsNotModified to check whether the returned error was
  97804. // because http.StatusNotModified was returned.
  97805. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  97806. gensupport.SetOptions(c.urlParams_, opts...)
  97807. res, err := c.doRequest("json")
  97808. if res != nil && res.StatusCode == http.StatusNotModified {
  97809. if res.Body != nil {
  97810. res.Body.Close()
  97811. }
  97812. return nil, &googleapi.Error{
  97813. Code: res.StatusCode,
  97814. Header: res.Header,
  97815. }
  97816. }
  97817. if err != nil {
  97818. return nil, err
  97819. }
  97820. defer googleapi.CloseBody(res)
  97821. if err := googleapi.CheckResponse(res); err != nil {
  97822. return nil, err
  97823. }
  97824. ret := &SslPoliciesList{
  97825. ServerResponse: googleapi.ServerResponse{
  97826. Header: res.Header,
  97827. HTTPStatusCode: res.StatusCode,
  97828. },
  97829. }
  97830. target := &ret
  97831. if err := gensupport.DecodeResponse(target, res); err != nil {
  97832. return nil, err
  97833. }
  97834. return ret, nil
  97835. // {
  97836. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  97837. // "httpMethod": "GET",
  97838. // "id": "compute.sslPolicies.list",
  97839. // "parameterOrder": [
  97840. // "project"
  97841. // ],
  97842. // "parameters": {
  97843. // "filter": {
  97844. // "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).",
  97845. // "location": "query",
  97846. // "type": "string"
  97847. // },
  97848. // "maxResults": {
  97849. // "default": "500",
  97850. // "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)",
  97851. // "format": "uint32",
  97852. // "location": "query",
  97853. // "minimum": "0",
  97854. // "type": "integer"
  97855. // },
  97856. // "orderBy": {
  97857. // "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.",
  97858. // "location": "query",
  97859. // "type": "string"
  97860. // },
  97861. // "pageToken": {
  97862. // "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.",
  97863. // "location": "query",
  97864. // "type": "string"
  97865. // },
  97866. // "project": {
  97867. // "description": "Project ID for this request.",
  97868. // "location": "path",
  97869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97870. // "required": true,
  97871. // "type": "string"
  97872. // }
  97873. // },
  97874. // "path": "{project}/global/sslPolicies",
  97875. // "response": {
  97876. // "$ref": "SslPoliciesList"
  97877. // },
  97878. // "scopes": [
  97879. // "https://www.googleapis.com/auth/cloud-platform",
  97880. // "https://www.googleapis.com/auth/compute",
  97881. // "https://www.googleapis.com/auth/compute.readonly"
  97882. // ]
  97883. // }
  97884. }
  97885. // Pages invokes f for each page of results.
  97886. // A non-nil error returned from f will halt the iteration.
  97887. // The provided context supersedes any context provided to the Context method.
  97888. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  97889. c.ctx_ = ctx
  97890. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97891. for {
  97892. x, err := c.Do()
  97893. if err != nil {
  97894. return err
  97895. }
  97896. if err := f(x); err != nil {
  97897. return err
  97898. }
  97899. if x.NextPageToken == "" {
  97900. return nil
  97901. }
  97902. c.PageToken(x.NextPageToken)
  97903. }
  97904. }
  97905. // method id "compute.sslPolicies.listAvailableFeatures":
  97906. type SslPoliciesListAvailableFeaturesCall struct {
  97907. s *Service
  97908. project string
  97909. urlParams_ gensupport.URLParams
  97910. ifNoneMatch_ string
  97911. ctx_ context.Context
  97912. header_ http.Header
  97913. }
  97914. // ListAvailableFeatures: Lists all features that can be specified in
  97915. // the SSL policy when using custom profile.
  97916. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  97917. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97918. c.project = project
  97919. return c
  97920. }
  97921. // Filter sets the optional parameter "filter": A filter expression that
  97922. // filters resources listed in the response. The expression must specify
  97923. // the field name, a comparison operator, and the value that you want to
  97924. // use for filtering. The value must be a string, a number, or a
  97925. // boolean. The comparison operator must be either =, !=, >, or <.
  97926. //
  97927. // For example, if you are filtering Compute Engine instances, you can
  97928. // exclude instances named example-instance by specifying name !=
  97929. // example-instance.
  97930. //
  97931. // You can also filter nested fields. For example, you could specify
  97932. // scheduling.automaticRestart = false to include instances only if they
  97933. // are not scheduled for automatic restarts. You can use filtering on
  97934. // nested fields to filter based on resource labels.
  97935. //
  97936. // To filter on multiple expressions, provide each separate expression
  97937. // within parentheses. For example, (scheduling.automaticRestart = true)
  97938. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97939. // AND expression. However, you can include AND and OR expressions
  97940. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97941. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97942. // true).
  97943. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  97944. c.urlParams_.Set("filter", filter)
  97945. return c
  97946. }
  97947. // MaxResults sets the optional parameter "maxResults": The maximum
  97948. // number of results per page that should be returned. If the number of
  97949. // available results is larger than maxResults, Compute Engine returns a
  97950. // nextPageToken that can be used to get the next page of results in
  97951. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97952. // (Default: 500)
  97953. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  97954. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97955. return c
  97956. }
  97957. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97958. // a certain order. By default, results are returned in alphanumerical
  97959. // order based on the resource name.
  97960. //
  97961. // You can also sort results in descending order based on the creation
  97962. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97963. // based on the creationTimestamp field in reverse chronological order
  97964. // (newest result first). Use this to sort resources like operations so
  97965. // that the newest operation is returned first.
  97966. //
  97967. // Currently, only sorting by name or creationTimestamp desc is
  97968. // supported.
  97969. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  97970. c.urlParams_.Set("orderBy", orderBy)
  97971. return c
  97972. }
  97973. // PageToken sets the optional parameter "pageToken": Specifies a page
  97974. // token to use. Set pageToken to the nextPageToken returned by a
  97975. // previous list request to get the next page of results.
  97976. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  97977. c.urlParams_.Set("pageToken", pageToken)
  97978. return c
  97979. }
  97980. // Fields allows partial responses to be retrieved. See
  97981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97982. // for more information.
  97983. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  97984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97985. return c
  97986. }
  97987. // IfNoneMatch sets the optional parameter which makes the operation
  97988. // fail if the object's ETag matches the given value. This is useful for
  97989. // getting updates only after the object has changed since the last
  97990. // request. Use googleapi.IsNotModified to check whether the response
  97991. // error from Do is the result of In-None-Match.
  97992. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  97993. c.ifNoneMatch_ = entityTag
  97994. return c
  97995. }
  97996. // Context sets the context to be used in this call's Do method. Any
  97997. // pending HTTP request will be aborted if the provided context is
  97998. // canceled.
  97999. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  98000. c.ctx_ = ctx
  98001. return c
  98002. }
  98003. // Header returns an http.Header that can be modified by the caller to
  98004. // add HTTP headers to the request.
  98005. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  98006. if c.header_ == nil {
  98007. c.header_ = make(http.Header)
  98008. }
  98009. return c.header_
  98010. }
  98011. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  98012. reqHeaders := make(http.Header)
  98013. for k, v := range c.header_ {
  98014. reqHeaders[k] = v
  98015. }
  98016. reqHeaders.Set("User-Agent", c.s.userAgent())
  98017. if c.ifNoneMatch_ != "" {
  98018. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98019. }
  98020. var body io.Reader = nil
  98021. c.urlParams_.Set("alt", alt)
  98022. c.urlParams_.Set("prettyPrint", "false")
  98023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  98024. urls += "?" + c.urlParams_.Encode()
  98025. req, err := http.NewRequest("GET", urls, body)
  98026. if err != nil {
  98027. return nil, err
  98028. }
  98029. req.Header = reqHeaders
  98030. googleapi.Expand(req.URL, map[string]string{
  98031. "project": c.project,
  98032. })
  98033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98034. }
  98035. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  98036. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  98037. // will be non-nil. Any non-2xx status code is an error. Response
  98038. // headers are in either
  98039. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  98040. // (if a response was returned at all) in
  98041. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  98042. // whether the returned error was because http.StatusNotModified was
  98043. // returned.
  98044. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  98045. gensupport.SetOptions(c.urlParams_, opts...)
  98046. res, err := c.doRequest("json")
  98047. if res != nil && res.StatusCode == http.StatusNotModified {
  98048. if res.Body != nil {
  98049. res.Body.Close()
  98050. }
  98051. return nil, &googleapi.Error{
  98052. Code: res.StatusCode,
  98053. Header: res.Header,
  98054. }
  98055. }
  98056. if err != nil {
  98057. return nil, err
  98058. }
  98059. defer googleapi.CloseBody(res)
  98060. if err := googleapi.CheckResponse(res); err != nil {
  98061. return nil, err
  98062. }
  98063. ret := &SslPoliciesListAvailableFeaturesResponse{
  98064. ServerResponse: googleapi.ServerResponse{
  98065. Header: res.Header,
  98066. HTTPStatusCode: res.StatusCode,
  98067. },
  98068. }
  98069. target := &ret
  98070. if err := gensupport.DecodeResponse(target, res); err != nil {
  98071. return nil, err
  98072. }
  98073. return ret, nil
  98074. // {
  98075. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  98076. // "httpMethod": "GET",
  98077. // "id": "compute.sslPolicies.listAvailableFeatures",
  98078. // "parameterOrder": [
  98079. // "project"
  98080. // ],
  98081. // "parameters": {
  98082. // "filter": {
  98083. // "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).",
  98084. // "location": "query",
  98085. // "type": "string"
  98086. // },
  98087. // "maxResults": {
  98088. // "default": "500",
  98089. // "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)",
  98090. // "format": "uint32",
  98091. // "location": "query",
  98092. // "minimum": "0",
  98093. // "type": "integer"
  98094. // },
  98095. // "orderBy": {
  98096. // "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.",
  98097. // "location": "query",
  98098. // "type": "string"
  98099. // },
  98100. // "pageToken": {
  98101. // "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.",
  98102. // "location": "query",
  98103. // "type": "string"
  98104. // },
  98105. // "project": {
  98106. // "description": "Project ID for this request.",
  98107. // "location": "path",
  98108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98109. // "required": true,
  98110. // "type": "string"
  98111. // }
  98112. // },
  98113. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  98114. // "response": {
  98115. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  98116. // },
  98117. // "scopes": [
  98118. // "https://www.googleapis.com/auth/cloud-platform",
  98119. // "https://www.googleapis.com/auth/compute",
  98120. // "https://www.googleapis.com/auth/compute.readonly"
  98121. // ]
  98122. // }
  98123. }
  98124. // method id "compute.sslPolicies.patch":
  98125. type SslPoliciesPatchCall struct {
  98126. s *Service
  98127. project string
  98128. sslPolicy string
  98129. sslpolicy *SslPolicy
  98130. urlParams_ gensupport.URLParams
  98131. ctx_ context.Context
  98132. header_ http.Header
  98133. }
  98134. // Patch: Patches the specified SSL policy with the data included in the
  98135. // request.
  98136. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  98137. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98138. c.project = project
  98139. c.sslPolicy = sslPolicy
  98140. c.sslpolicy = sslpolicy
  98141. return c
  98142. }
  98143. // RequestId sets the optional parameter "requestId": An optional
  98144. // request ID to identify requests. Specify a unique request ID so that
  98145. // if you must retry your request, the server will know to ignore the
  98146. // request if it has already been completed.
  98147. //
  98148. // For example, consider a situation where you make an initial request
  98149. // and the request times out. If you make the request again with the
  98150. // same request ID, the server can check if original operation with the
  98151. // same request ID was received, and if so, will ignore the second
  98152. // request. This prevents clients from accidentally creating duplicate
  98153. // commitments.
  98154. //
  98155. // The request ID must be a valid UUID with the exception that zero UUID
  98156. // is not supported (00000000-0000-0000-0000-000000000000).
  98157. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  98158. c.urlParams_.Set("requestId", requestId)
  98159. return c
  98160. }
  98161. // Fields allows partial responses to be retrieved. See
  98162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98163. // for more information.
  98164. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  98165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98166. return c
  98167. }
  98168. // Context sets the context to be used in this call's Do method. Any
  98169. // pending HTTP request will be aborted if the provided context is
  98170. // canceled.
  98171. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  98172. c.ctx_ = ctx
  98173. return c
  98174. }
  98175. // Header returns an http.Header that can be modified by the caller to
  98176. // add HTTP headers to the request.
  98177. func (c *SslPoliciesPatchCall) Header() http.Header {
  98178. if c.header_ == nil {
  98179. c.header_ = make(http.Header)
  98180. }
  98181. return c.header_
  98182. }
  98183. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  98184. reqHeaders := make(http.Header)
  98185. for k, v := range c.header_ {
  98186. reqHeaders[k] = v
  98187. }
  98188. reqHeaders.Set("User-Agent", c.s.userAgent())
  98189. var body io.Reader = nil
  98190. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  98191. if err != nil {
  98192. return nil, err
  98193. }
  98194. reqHeaders.Set("Content-Type", "application/json")
  98195. c.urlParams_.Set("alt", alt)
  98196. c.urlParams_.Set("prettyPrint", "false")
  98197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  98198. urls += "?" + c.urlParams_.Encode()
  98199. req, err := http.NewRequest("PATCH", urls, body)
  98200. if err != nil {
  98201. return nil, err
  98202. }
  98203. req.Header = reqHeaders
  98204. googleapi.Expand(req.URL, map[string]string{
  98205. "project": c.project,
  98206. "sslPolicy": c.sslPolicy,
  98207. })
  98208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98209. }
  98210. // Do executes the "compute.sslPolicies.patch" call.
  98211. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98212. // status code is an error. Response headers are in either
  98213. // *Operation.ServerResponse.Header or (if a response was returned at
  98214. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98215. // to check whether the returned error was because
  98216. // http.StatusNotModified was returned.
  98217. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98218. gensupport.SetOptions(c.urlParams_, opts...)
  98219. res, err := c.doRequest("json")
  98220. if res != nil && res.StatusCode == http.StatusNotModified {
  98221. if res.Body != nil {
  98222. res.Body.Close()
  98223. }
  98224. return nil, &googleapi.Error{
  98225. Code: res.StatusCode,
  98226. Header: res.Header,
  98227. }
  98228. }
  98229. if err != nil {
  98230. return nil, err
  98231. }
  98232. defer googleapi.CloseBody(res)
  98233. if err := googleapi.CheckResponse(res); err != nil {
  98234. return nil, err
  98235. }
  98236. ret := &Operation{
  98237. ServerResponse: googleapi.ServerResponse{
  98238. Header: res.Header,
  98239. HTTPStatusCode: res.StatusCode,
  98240. },
  98241. }
  98242. target := &ret
  98243. if err := gensupport.DecodeResponse(target, res); err != nil {
  98244. return nil, err
  98245. }
  98246. return ret, nil
  98247. // {
  98248. // "description": "Patches the specified SSL policy with the data included in the request.",
  98249. // "httpMethod": "PATCH",
  98250. // "id": "compute.sslPolicies.patch",
  98251. // "parameterOrder": [
  98252. // "project",
  98253. // "sslPolicy"
  98254. // ],
  98255. // "parameters": {
  98256. // "project": {
  98257. // "description": "Project ID for this request.",
  98258. // "location": "path",
  98259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98260. // "required": true,
  98261. // "type": "string"
  98262. // },
  98263. // "requestId": {
  98264. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98265. // "location": "query",
  98266. // "type": "string"
  98267. // },
  98268. // "sslPolicy": {
  98269. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  98270. // "location": "path",
  98271. // "required": true,
  98272. // "type": "string"
  98273. // }
  98274. // },
  98275. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  98276. // "request": {
  98277. // "$ref": "SslPolicy"
  98278. // },
  98279. // "response": {
  98280. // "$ref": "Operation"
  98281. // },
  98282. // "scopes": [
  98283. // "https://www.googleapis.com/auth/cloud-platform",
  98284. // "https://www.googleapis.com/auth/compute"
  98285. // ]
  98286. // }
  98287. }
  98288. // method id "compute.sslPolicies.testIamPermissions":
  98289. type SslPoliciesTestIamPermissionsCall struct {
  98290. s *Service
  98291. project string
  98292. resource string
  98293. testpermissionsrequest *TestPermissionsRequest
  98294. urlParams_ gensupport.URLParams
  98295. ctx_ context.Context
  98296. header_ http.Header
  98297. }
  98298. // TestIamPermissions: Returns permissions that a caller has on the
  98299. // specified resource.
  98300. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  98301. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98302. c.project = project
  98303. c.resource = resource
  98304. c.testpermissionsrequest = testpermissionsrequest
  98305. return c
  98306. }
  98307. // Fields allows partial responses to be retrieved. See
  98308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98309. // for more information.
  98310. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  98311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98312. return c
  98313. }
  98314. // Context sets the context to be used in this call's Do method. Any
  98315. // pending HTTP request will be aborted if the provided context is
  98316. // canceled.
  98317. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  98318. c.ctx_ = ctx
  98319. return c
  98320. }
  98321. // Header returns an http.Header that can be modified by the caller to
  98322. // add HTTP headers to the request.
  98323. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  98324. if c.header_ == nil {
  98325. c.header_ = make(http.Header)
  98326. }
  98327. return c.header_
  98328. }
  98329. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  98330. reqHeaders := make(http.Header)
  98331. for k, v := range c.header_ {
  98332. reqHeaders[k] = v
  98333. }
  98334. reqHeaders.Set("User-Agent", c.s.userAgent())
  98335. var body io.Reader = nil
  98336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  98337. if err != nil {
  98338. return nil, err
  98339. }
  98340. reqHeaders.Set("Content-Type", "application/json")
  98341. c.urlParams_.Set("alt", alt)
  98342. c.urlParams_.Set("prettyPrint", "false")
  98343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  98344. urls += "?" + c.urlParams_.Encode()
  98345. req, err := http.NewRequest("POST", urls, body)
  98346. if err != nil {
  98347. return nil, err
  98348. }
  98349. req.Header = reqHeaders
  98350. googleapi.Expand(req.URL, map[string]string{
  98351. "project": c.project,
  98352. "resource": c.resource,
  98353. })
  98354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98355. }
  98356. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  98357. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  98358. // non-2xx status code is an error. Response headers are in either
  98359. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  98360. // returned at all) in error.(*googleapi.Error).Header. Use
  98361. // googleapi.IsNotModified to check whether the returned error was
  98362. // because http.StatusNotModified was returned.
  98363. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  98364. gensupport.SetOptions(c.urlParams_, opts...)
  98365. res, err := c.doRequest("json")
  98366. if res != nil && res.StatusCode == http.StatusNotModified {
  98367. if res.Body != nil {
  98368. res.Body.Close()
  98369. }
  98370. return nil, &googleapi.Error{
  98371. Code: res.StatusCode,
  98372. Header: res.Header,
  98373. }
  98374. }
  98375. if err != nil {
  98376. return nil, err
  98377. }
  98378. defer googleapi.CloseBody(res)
  98379. if err := googleapi.CheckResponse(res); err != nil {
  98380. return nil, err
  98381. }
  98382. ret := &TestPermissionsResponse{
  98383. ServerResponse: googleapi.ServerResponse{
  98384. Header: res.Header,
  98385. HTTPStatusCode: res.StatusCode,
  98386. },
  98387. }
  98388. target := &ret
  98389. if err := gensupport.DecodeResponse(target, res); err != nil {
  98390. return nil, err
  98391. }
  98392. return ret, nil
  98393. // {
  98394. // "description": "Returns permissions that a caller has on the specified resource.",
  98395. // "httpMethod": "POST",
  98396. // "id": "compute.sslPolicies.testIamPermissions",
  98397. // "parameterOrder": [
  98398. // "project",
  98399. // "resource"
  98400. // ],
  98401. // "parameters": {
  98402. // "project": {
  98403. // "description": "Project ID for this request.",
  98404. // "location": "path",
  98405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98406. // "required": true,
  98407. // "type": "string"
  98408. // },
  98409. // "resource": {
  98410. // "description": "Name or id of the resource for this request.",
  98411. // "location": "path",
  98412. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98413. // "required": true,
  98414. // "type": "string"
  98415. // }
  98416. // },
  98417. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  98418. // "request": {
  98419. // "$ref": "TestPermissionsRequest"
  98420. // },
  98421. // "response": {
  98422. // "$ref": "TestPermissionsResponse"
  98423. // },
  98424. // "scopes": [
  98425. // "https://www.googleapis.com/auth/cloud-platform",
  98426. // "https://www.googleapis.com/auth/compute",
  98427. // "https://www.googleapis.com/auth/compute.readonly"
  98428. // ]
  98429. // }
  98430. }
  98431. // method id "compute.subnetworks.aggregatedList":
  98432. type SubnetworksAggregatedListCall struct {
  98433. s *Service
  98434. project string
  98435. urlParams_ gensupport.URLParams
  98436. ifNoneMatch_ string
  98437. ctx_ context.Context
  98438. header_ http.Header
  98439. }
  98440. // AggregatedList: Retrieves an aggregated list of subnetworks.
  98441. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  98442. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98443. c.project = project
  98444. return c
  98445. }
  98446. // Filter sets the optional parameter "filter": A filter expression that
  98447. // filters resources listed in the response. The expression must specify
  98448. // the field name, a comparison operator, and the value that you want to
  98449. // use for filtering. The value must be a string, a number, or a
  98450. // boolean. The comparison operator must be either =, !=, >, or <.
  98451. //
  98452. // For example, if you are filtering Compute Engine instances, you can
  98453. // exclude instances named example-instance by specifying name !=
  98454. // example-instance.
  98455. //
  98456. // You can also filter nested fields. For example, you could specify
  98457. // scheduling.automaticRestart = false to include instances only if they
  98458. // are not scheduled for automatic restarts. You can use filtering on
  98459. // nested fields to filter based on resource labels.
  98460. //
  98461. // To filter on multiple expressions, provide each separate expression
  98462. // within parentheses. For example, (scheduling.automaticRestart = true)
  98463. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98464. // AND expression. However, you can include AND and OR expressions
  98465. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98466. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98467. // true).
  98468. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  98469. c.urlParams_.Set("filter", filter)
  98470. return c
  98471. }
  98472. // MaxResults sets the optional parameter "maxResults": The maximum
  98473. // number of results per page that should be returned. If the number of
  98474. // available results is larger than maxResults, Compute Engine returns a
  98475. // nextPageToken that can be used to get the next page of results in
  98476. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98477. // (Default: 500)
  98478. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  98479. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98480. return c
  98481. }
  98482. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98483. // a certain order. By default, results are returned in alphanumerical
  98484. // order based on the resource name.
  98485. //
  98486. // You can also sort results in descending order based on the creation
  98487. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98488. // based on the creationTimestamp field in reverse chronological order
  98489. // (newest result first). Use this to sort resources like operations so
  98490. // that the newest operation is returned first.
  98491. //
  98492. // Currently, only sorting by name or creationTimestamp desc is
  98493. // supported.
  98494. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  98495. c.urlParams_.Set("orderBy", orderBy)
  98496. return c
  98497. }
  98498. // PageToken sets the optional parameter "pageToken": Specifies a page
  98499. // token to use. Set pageToken to the nextPageToken returned by a
  98500. // previous list request to get the next page of results.
  98501. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  98502. c.urlParams_.Set("pageToken", pageToken)
  98503. return c
  98504. }
  98505. // Fields allows partial responses to be retrieved. See
  98506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98507. // for more information.
  98508. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  98509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98510. return c
  98511. }
  98512. // IfNoneMatch sets the optional parameter which makes the operation
  98513. // fail if the object's ETag matches the given value. This is useful for
  98514. // getting updates only after the object has changed since the last
  98515. // request. Use googleapi.IsNotModified to check whether the response
  98516. // error from Do is the result of In-None-Match.
  98517. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  98518. c.ifNoneMatch_ = entityTag
  98519. return c
  98520. }
  98521. // Context sets the context to be used in this call's Do method. Any
  98522. // pending HTTP request will be aborted if the provided context is
  98523. // canceled.
  98524. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  98525. c.ctx_ = ctx
  98526. return c
  98527. }
  98528. // Header returns an http.Header that can be modified by the caller to
  98529. // add HTTP headers to the request.
  98530. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  98531. if c.header_ == nil {
  98532. c.header_ = make(http.Header)
  98533. }
  98534. return c.header_
  98535. }
  98536. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  98537. reqHeaders := make(http.Header)
  98538. for k, v := range c.header_ {
  98539. reqHeaders[k] = v
  98540. }
  98541. reqHeaders.Set("User-Agent", c.s.userAgent())
  98542. if c.ifNoneMatch_ != "" {
  98543. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98544. }
  98545. var body io.Reader = nil
  98546. c.urlParams_.Set("alt", alt)
  98547. c.urlParams_.Set("prettyPrint", "false")
  98548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  98549. urls += "?" + c.urlParams_.Encode()
  98550. req, err := http.NewRequest("GET", urls, body)
  98551. if err != nil {
  98552. return nil, err
  98553. }
  98554. req.Header = reqHeaders
  98555. googleapi.Expand(req.URL, map[string]string{
  98556. "project": c.project,
  98557. })
  98558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98559. }
  98560. // Do executes the "compute.subnetworks.aggregatedList" call.
  98561. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  98562. // Any non-2xx status code is an error. Response headers are in either
  98563. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  98564. // returned at all) in error.(*googleapi.Error).Header. Use
  98565. // googleapi.IsNotModified to check whether the returned error was
  98566. // because http.StatusNotModified was returned.
  98567. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  98568. gensupport.SetOptions(c.urlParams_, opts...)
  98569. res, err := c.doRequest("json")
  98570. if res != nil && res.StatusCode == http.StatusNotModified {
  98571. if res.Body != nil {
  98572. res.Body.Close()
  98573. }
  98574. return nil, &googleapi.Error{
  98575. Code: res.StatusCode,
  98576. Header: res.Header,
  98577. }
  98578. }
  98579. if err != nil {
  98580. return nil, err
  98581. }
  98582. defer googleapi.CloseBody(res)
  98583. if err := googleapi.CheckResponse(res); err != nil {
  98584. return nil, err
  98585. }
  98586. ret := &SubnetworkAggregatedList{
  98587. ServerResponse: googleapi.ServerResponse{
  98588. Header: res.Header,
  98589. HTTPStatusCode: res.StatusCode,
  98590. },
  98591. }
  98592. target := &ret
  98593. if err := gensupport.DecodeResponse(target, res); err != nil {
  98594. return nil, err
  98595. }
  98596. return ret, nil
  98597. // {
  98598. // "description": "Retrieves an aggregated list of subnetworks.",
  98599. // "httpMethod": "GET",
  98600. // "id": "compute.subnetworks.aggregatedList",
  98601. // "parameterOrder": [
  98602. // "project"
  98603. // ],
  98604. // "parameters": {
  98605. // "filter": {
  98606. // "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).",
  98607. // "location": "query",
  98608. // "type": "string"
  98609. // },
  98610. // "maxResults": {
  98611. // "default": "500",
  98612. // "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)",
  98613. // "format": "uint32",
  98614. // "location": "query",
  98615. // "minimum": "0",
  98616. // "type": "integer"
  98617. // },
  98618. // "orderBy": {
  98619. // "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.",
  98620. // "location": "query",
  98621. // "type": "string"
  98622. // },
  98623. // "pageToken": {
  98624. // "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.",
  98625. // "location": "query",
  98626. // "type": "string"
  98627. // },
  98628. // "project": {
  98629. // "description": "Project ID for this request.",
  98630. // "location": "path",
  98631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98632. // "required": true,
  98633. // "type": "string"
  98634. // }
  98635. // },
  98636. // "path": "{project}/aggregated/subnetworks",
  98637. // "response": {
  98638. // "$ref": "SubnetworkAggregatedList"
  98639. // },
  98640. // "scopes": [
  98641. // "https://www.googleapis.com/auth/cloud-platform",
  98642. // "https://www.googleapis.com/auth/compute",
  98643. // "https://www.googleapis.com/auth/compute.readonly"
  98644. // ]
  98645. // }
  98646. }
  98647. // Pages invokes f for each page of results.
  98648. // A non-nil error returned from f will halt the iteration.
  98649. // The provided context supersedes any context provided to the Context method.
  98650. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  98651. c.ctx_ = ctx
  98652. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98653. for {
  98654. x, err := c.Do()
  98655. if err != nil {
  98656. return err
  98657. }
  98658. if err := f(x); err != nil {
  98659. return err
  98660. }
  98661. if x.NextPageToken == "" {
  98662. return nil
  98663. }
  98664. c.PageToken(x.NextPageToken)
  98665. }
  98666. }
  98667. // method id "compute.subnetworks.delete":
  98668. type SubnetworksDeleteCall struct {
  98669. s *Service
  98670. project string
  98671. region string
  98672. subnetwork string
  98673. urlParams_ gensupport.URLParams
  98674. ctx_ context.Context
  98675. header_ http.Header
  98676. }
  98677. // Delete: Deletes the specified subnetwork.
  98678. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  98679. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98680. c.project = project
  98681. c.region = region
  98682. c.subnetwork = subnetwork
  98683. return c
  98684. }
  98685. // RequestId sets the optional parameter "requestId": An optional
  98686. // request ID to identify requests. Specify a unique request ID so that
  98687. // if you must retry your request, the server will know to ignore the
  98688. // request if it has already been completed.
  98689. //
  98690. // For example, consider a situation where you make an initial request
  98691. // and the request times out. If you make the request again with the
  98692. // same request ID, the server can check if original operation with the
  98693. // same request ID was received, and if so, will ignore the second
  98694. // request. This prevents clients from accidentally creating duplicate
  98695. // commitments.
  98696. //
  98697. // The request ID must be a valid UUID with the exception that zero UUID
  98698. // is not supported (00000000-0000-0000-0000-000000000000).
  98699. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  98700. c.urlParams_.Set("requestId", requestId)
  98701. return c
  98702. }
  98703. // Fields allows partial responses to be retrieved. See
  98704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98705. // for more information.
  98706. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  98707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98708. return c
  98709. }
  98710. // Context sets the context to be used in this call's Do method. Any
  98711. // pending HTTP request will be aborted if the provided context is
  98712. // canceled.
  98713. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  98714. c.ctx_ = ctx
  98715. return c
  98716. }
  98717. // Header returns an http.Header that can be modified by the caller to
  98718. // add HTTP headers to the request.
  98719. func (c *SubnetworksDeleteCall) Header() http.Header {
  98720. if c.header_ == nil {
  98721. c.header_ = make(http.Header)
  98722. }
  98723. return c.header_
  98724. }
  98725. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  98726. reqHeaders := make(http.Header)
  98727. for k, v := range c.header_ {
  98728. reqHeaders[k] = v
  98729. }
  98730. reqHeaders.Set("User-Agent", c.s.userAgent())
  98731. var body io.Reader = nil
  98732. c.urlParams_.Set("alt", alt)
  98733. c.urlParams_.Set("prettyPrint", "false")
  98734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  98735. urls += "?" + c.urlParams_.Encode()
  98736. req, err := http.NewRequest("DELETE", urls, body)
  98737. if err != nil {
  98738. return nil, err
  98739. }
  98740. req.Header = reqHeaders
  98741. googleapi.Expand(req.URL, map[string]string{
  98742. "project": c.project,
  98743. "region": c.region,
  98744. "subnetwork": c.subnetwork,
  98745. })
  98746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98747. }
  98748. // Do executes the "compute.subnetworks.delete" call.
  98749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98750. // status code is an error. Response headers are in either
  98751. // *Operation.ServerResponse.Header or (if a response was returned at
  98752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98753. // to check whether the returned error was because
  98754. // http.StatusNotModified was returned.
  98755. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98756. gensupport.SetOptions(c.urlParams_, opts...)
  98757. res, err := c.doRequest("json")
  98758. if res != nil && res.StatusCode == http.StatusNotModified {
  98759. if res.Body != nil {
  98760. res.Body.Close()
  98761. }
  98762. return nil, &googleapi.Error{
  98763. Code: res.StatusCode,
  98764. Header: res.Header,
  98765. }
  98766. }
  98767. if err != nil {
  98768. return nil, err
  98769. }
  98770. defer googleapi.CloseBody(res)
  98771. if err := googleapi.CheckResponse(res); err != nil {
  98772. return nil, err
  98773. }
  98774. ret := &Operation{
  98775. ServerResponse: googleapi.ServerResponse{
  98776. Header: res.Header,
  98777. HTTPStatusCode: res.StatusCode,
  98778. },
  98779. }
  98780. target := &ret
  98781. if err := gensupport.DecodeResponse(target, res); err != nil {
  98782. return nil, err
  98783. }
  98784. return ret, nil
  98785. // {
  98786. // "description": "Deletes the specified subnetwork.",
  98787. // "httpMethod": "DELETE",
  98788. // "id": "compute.subnetworks.delete",
  98789. // "parameterOrder": [
  98790. // "project",
  98791. // "region",
  98792. // "subnetwork"
  98793. // ],
  98794. // "parameters": {
  98795. // "project": {
  98796. // "description": "Project ID for this request.",
  98797. // "location": "path",
  98798. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98799. // "required": true,
  98800. // "type": "string"
  98801. // },
  98802. // "region": {
  98803. // "description": "Name of the region scoping this request.",
  98804. // "location": "path",
  98805. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98806. // "required": true,
  98807. // "type": "string"
  98808. // },
  98809. // "requestId": {
  98810. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98811. // "location": "query",
  98812. // "type": "string"
  98813. // },
  98814. // "subnetwork": {
  98815. // "description": "Name of the Subnetwork resource to delete.",
  98816. // "location": "path",
  98817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98818. // "required": true,
  98819. // "type": "string"
  98820. // }
  98821. // },
  98822. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  98823. // "response": {
  98824. // "$ref": "Operation"
  98825. // },
  98826. // "scopes": [
  98827. // "https://www.googleapis.com/auth/cloud-platform",
  98828. // "https://www.googleapis.com/auth/compute"
  98829. // ]
  98830. // }
  98831. }
  98832. // method id "compute.subnetworks.expandIpCidrRange":
  98833. type SubnetworksExpandIpCidrRangeCall struct {
  98834. s *Service
  98835. project string
  98836. region string
  98837. subnetwork string
  98838. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  98839. urlParams_ gensupport.URLParams
  98840. ctx_ context.Context
  98841. header_ http.Header
  98842. }
  98843. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  98844. // specified value.
  98845. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  98846. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98847. c.project = project
  98848. c.region = region
  98849. c.subnetwork = subnetwork
  98850. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  98851. return c
  98852. }
  98853. // RequestId sets the optional parameter "requestId": An optional
  98854. // request ID to identify requests. Specify a unique request ID so that
  98855. // if you must retry your request, the server will know to ignore the
  98856. // request if it has already been completed.
  98857. //
  98858. // For example, consider a situation where you make an initial request
  98859. // and the request times out. If you make the request again with the
  98860. // same request ID, the server can check if original operation with the
  98861. // same request ID was received, and if so, will ignore the second
  98862. // request. This prevents clients from accidentally creating duplicate
  98863. // commitments.
  98864. //
  98865. // The request ID must be a valid UUID with the exception that zero UUID
  98866. // is not supported (00000000-0000-0000-0000-000000000000).
  98867. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  98868. c.urlParams_.Set("requestId", requestId)
  98869. return c
  98870. }
  98871. // Fields allows partial responses to be retrieved. See
  98872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98873. // for more information.
  98874. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  98875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98876. return c
  98877. }
  98878. // Context sets the context to be used in this call's Do method. Any
  98879. // pending HTTP request will be aborted if the provided context is
  98880. // canceled.
  98881. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  98882. c.ctx_ = ctx
  98883. return c
  98884. }
  98885. // Header returns an http.Header that can be modified by the caller to
  98886. // add HTTP headers to the request.
  98887. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  98888. if c.header_ == nil {
  98889. c.header_ = make(http.Header)
  98890. }
  98891. return c.header_
  98892. }
  98893. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  98894. reqHeaders := make(http.Header)
  98895. for k, v := range c.header_ {
  98896. reqHeaders[k] = v
  98897. }
  98898. reqHeaders.Set("User-Agent", c.s.userAgent())
  98899. var body io.Reader = nil
  98900. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  98901. if err != nil {
  98902. return nil, err
  98903. }
  98904. reqHeaders.Set("Content-Type", "application/json")
  98905. c.urlParams_.Set("alt", alt)
  98906. c.urlParams_.Set("prettyPrint", "false")
  98907. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  98908. urls += "?" + c.urlParams_.Encode()
  98909. req, err := http.NewRequest("POST", urls, body)
  98910. if err != nil {
  98911. return nil, err
  98912. }
  98913. req.Header = reqHeaders
  98914. googleapi.Expand(req.URL, map[string]string{
  98915. "project": c.project,
  98916. "region": c.region,
  98917. "subnetwork": c.subnetwork,
  98918. })
  98919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98920. }
  98921. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  98922. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98923. // status code is an error. Response headers are in either
  98924. // *Operation.ServerResponse.Header or (if a response was returned at
  98925. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98926. // to check whether the returned error was because
  98927. // http.StatusNotModified was returned.
  98928. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98929. gensupport.SetOptions(c.urlParams_, opts...)
  98930. res, err := c.doRequest("json")
  98931. if res != nil && res.StatusCode == http.StatusNotModified {
  98932. if res.Body != nil {
  98933. res.Body.Close()
  98934. }
  98935. return nil, &googleapi.Error{
  98936. Code: res.StatusCode,
  98937. Header: res.Header,
  98938. }
  98939. }
  98940. if err != nil {
  98941. return nil, err
  98942. }
  98943. defer googleapi.CloseBody(res)
  98944. if err := googleapi.CheckResponse(res); err != nil {
  98945. return nil, err
  98946. }
  98947. ret := &Operation{
  98948. ServerResponse: googleapi.ServerResponse{
  98949. Header: res.Header,
  98950. HTTPStatusCode: res.StatusCode,
  98951. },
  98952. }
  98953. target := &ret
  98954. if err := gensupport.DecodeResponse(target, res); err != nil {
  98955. return nil, err
  98956. }
  98957. return ret, nil
  98958. // {
  98959. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  98960. // "httpMethod": "POST",
  98961. // "id": "compute.subnetworks.expandIpCidrRange",
  98962. // "parameterOrder": [
  98963. // "project",
  98964. // "region",
  98965. // "subnetwork"
  98966. // ],
  98967. // "parameters": {
  98968. // "project": {
  98969. // "description": "Project ID for this request.",
  98970. // "location": "path",
  98971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98972. // "required": true,
  98973. // "type": "string"
  98974. // },
  98975. // "region": {
  98976. // "description": "Name of the region scoping this request.",
  98977. // "location": "path",
  98978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98979. // "required": true,
  98980. // "type": "string"
  98981. // },
  98982. // "requestId": {
  98983. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98984. // "location": "query",
  98985. // "type": "string"
  98986. // },
  98987. // "subnetwork": {
  98988. // "description": "Name of the Subnetwork resource to update.",
  98989. // "location": "path",
  98990. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98991. // "required": true,
  98992. // "type": "string"
  98993. // }
  98994. // },
  98995. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  98996. // "request": {
  98997. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  98998. // },
  98999. // "response": {
  99000. // "$ref": "Operation"
  99001. // },
  99002. // "scopes": [
  99003. // "https://www.googleapis.com/auth/cloud-platform",
  99004. // "https://www.googleapis.com/auth/compute"
  99005. // ]
  99006. // }
  99007. }
  99008. // method id "compute.subnetworks.get":
  99009. type SubnetworksGetCall struct {
  99010. s *Service
  99011. project string
  99012. region string
  99013. subnetwork string
  99014. urlParams_ gensupport.URLParams
  99015. ifNoneMatch_ string
  99016. ctx_ context.Context
  99017. header_ http.Header
  99018. }
  99019. // Get: Returns the specified subnetwork. Gets a list of available
  99020. // subnetworks list() request.
  99021. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  99022. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99023. c.project = project
  99024. c.region = region
  99025. c.subnetwork = subnetwork
  99026. return c
  99027. }
  99028. // Fields allows partial responses to be retrieved. See
  99029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99030. // for more information.
  99031. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  99032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99033. return c
  99034. }
  99035. // IfNoneMatch sets the optional parameter which makes the operation
  99036. // fail if the object's ETag matches the given value. This is useful for
  99037. // getting updates only after the object has changed since the last
  99038. // request. Use googleapi.IsNotModified to check whether the response
  99039. // error from Do is the result of In-None-Match.
  99040. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  99041. c.ifNoneMatch_ = entityTag
  99042. return c
  99043. }
  99044. // Context sets the context to be used in this call's Do method. Any
  99045. // pending HTTP request will be aborted if the provided context is
  99046. // canceled.
  99047. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  99048. c.ctx_ = ctx
  99049. return c
  99050. }
  99051. // Header returns an http.Header that can be modified by the caller to
  99052. // add HTTP headers to the request.
  99053. func (c *SubnetworksGetCall) Header() http.Header {
  99054. if c.header_ == nil {
  99055. c.header_ = make(http.Header)
  99056. }
  99057. return c.header_
  99058. }
  99059. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  99060. reqHeaders := make(http.Header)
  99061. for k, v := range c.header_ {
  99062. reqHeaders[k] = v
  99063. }
  99064. reqHeaders.Set("User-Agent", c.s.userAgent())
  99065. if c.ifNoneMatch_ != "" {
  99066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99067. }
  99068. var body io.Reader = nil
  99069. c.urlParams_.Set("alt", alt)
  99070. c.urlParams_.Set("prettyPrint", "false")
  99071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  99072. urls += "?" + c.urlParams_.Encode()
  99073. req, err := http.NewRequest("GET", urls, body)
  99074. if err != nil {
  99075. return nil, err
  99076. }
  99077. req.Header = reqHeaders
  99078. googleapi.Expand(req.URL, map[string]string{
  99079. "project": c.project,
  99080. "region": c.region,
  99081. "subnetwork": c.subnetwork,
  99082. })
  99083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99084. }
  99085. // Do executes the "compute.subnetworks.get" call.
  99086. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  99087. // status code is an error. Response headers are in either
  99088. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  99089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99090. // to check whether the returned error was because
  99091. // http.StatusNotModified was returned.
  99092. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  99093. gensupport.SetOptions(c.urlParams_, opts...)
  99094. res, err := c.doRequest("json")
  99095. if res != nil && res.StatusCode == http.StatusNotModified {
  99096. if res.Body != nil {
  99097. res.Body.Close()
  99098. }
  99099. return nil, &googleapi.Error{
  99100. Code: res.StatusCode,
  99101. Header: res.Header,
  99102. }
  99103. }
  99104. if err != nil {
  99105. return nil, err
  99106. }
  99107. defer googleapi.CloseBody(res)
  99108. if err := googleapi.CheckResponse(res); err != nil {
  99109. return nil, err
  99110. }
  99111. ret := &Subnetwork{
  99112. ServerResponse: googleapi.ServerResponse{
  99113. Header: res.Header,
  99114. HTTPStatusCode: res.StatusCode,
  99115. },
  99116. }
  99117. target := &ret
  99118. if err := gensupport.DecodeResponse(target, res); err != nil {
  99119. return nil, err
  99120. }
  99121. return ret, nil
  99122. // {
  99123. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  99124. // "httpMethod": "GET",
  99125. // "id": "compute.subnetworks.get",
  99126. // "parameterOrder": [
  99127. // "project",
  99128. // "region",
  99129. // "subnetwork"
  99130. // ],
  99131. // "parameters": {
  99132. // "project": {
  99133. // "description": "Project ID for this request.",
  99134. // "location": "path",
  99135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99136. // "required": true,
  99137. // "type": "string"
  99138. // },
  99139. // "region": {
  99140. // "description": "Name of the region scoping this request.",
  99141. // "location": "path",
  99142. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99143. // "required": true,
  99144. // "type": "string"
  99145. // },
  99146. // "subnetwork": {
  99147. // "description": "Name of the Subnetwork resource to return.",
  99148. // "location": "path",
  99149. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99150. // "required": true,
  99151. // "type": "string"
  99152. // }
  99153. // },
  99154. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  99155. // "response": {
  99156. // "$ref": "Subnetwork"
  99157. // },
  99158. // "scopes": [
  99159. // "https://www.googleapis.com/auth/cloud-platform",
  99160. // "https://www.googleapis.com/auth/compute",
  99161. // "https://www.googleapis.com/auth/compute.readonly"
  99162. // ]
  99163. // }
  99164. }
  99165. // method id "compute.subnetworks.getIamPolicy":
  99166. type SubnetworksGetIamPolicyCall struct {
  99167. s *Service
  99168. project string
  99169. region string
  99170. resource string
  99171. urlParams_ gensupport.URLParams
  99172. ifNoneMatch_ string
  99173. ctx_ context.Context
  99174. header_ http.Header
  99175. }
  99176. // GetIamPolicy: Gets the access control policy for a resource. May be
  99177. // empty if no such policy or resource exists.
  99178. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  99179. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99180. c.project = project
  99181. c.region = region
  99182. c.resource = resource
  99183. return c
  99184. }
  99185. // Fields allows partial responses to be retrieved. See
  99186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99187. // for more information.
  99188. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  99189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99190. return c
  99191. }
  99192. // IfNoneMatch sets the optional parameter which makes the operation
  99193. // fail if the object's ETag matches the given value. This is useful for
  99194. // getting updates only after the object has changed since the last
  99195. // request. Use googleapi.IsNotModified to check whether the response
  99196. // error from Do is the result of In-None-Match.
  99197. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  99198. c.ifNoneMatch_ = entityTag
  99199. return c
  99200. }
  99201. // Context sets the context to be used in this call's Do method. Any
  99202. // pending HTTP request will be aborted if the provided context is
  99203. // canceled.
  99204. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  99205. c.ctx_ = ctx
  99206. return c
  99207. }
  99208. // Header returns an http.Header that can be modified by the caller to
  99209. // add HTTP headers to the request.
  99210. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  99211. if c.header_ == nil {
  99212. c.header_ = make(http.Header)
  99213. }
  99214. return c.header_
  99215. }
  99216. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  99217. reqHeaders := make(http.Header)
  99218. for k, v := range c.header_ {
  99219. reqHeaders[k] = v
  99220. }
  99221. reqHeaders.Set("User-Agent", c.s.userAgent())
  99222. if c.ifNoneMatch_ != "" {
  99223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99224. }
  99225. var body io.Reader = nil
  99226. c.urlParams_.Set("alt", alt)
  99227. c.urlParams_.Set("prettyPrint", "false")
  99228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  99229. urls += "?" + c.urlParams_.Encode()
  99230. req, err := http.NewRequest("GET", urls, body)
  99231. if err != nil {
  99232. return nil, err
  99233. }
  99234. req.Header = reqHeaders
  99235. googleapi.Expand(req.URL, map[string]string{
  99236. "project": c.project,
  99237. "region": c.region,
  99238. "resource": c.resource,
  99239. })
  99240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99241. }
  99242. // Do executes the "compute.subnetworks.getIamPolicy" call.
  99243. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  99244. // code is an error. Response headers are in either
  99245. // *Policy.ServerResponse.Header or (if a response was returned at all)
  99246. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  99247. // check whether the returned error was because http.StatusNotModified
  99248. // was returned.
  99249. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  99250. gensupport.SetOptions(c.urlParams_, opts...)
  99251. res, err := c.doRequest("json")
  99252. if res != nil && res.StatusCode == http.StatusNotModified {
  99253. if res.Body != nil {
  99254. res.Body.Close()
  99255. }
  99256. return nil, &googleapi.Error{
  99257. Code: res.StatusCode,
  99258. Header: res.Header,
  99259. }
  99260. }
  99261. if err != nil {
  99262. return nil, err
  99263. }
  99264. defer googleapi.CloseBody(res)
  99265. if err := googleapi.CheckResponse(res); err != nil {
  99266. return nil, err
  99267. }
  99268. ret := &Policy{
  99269. ServerResponse: googleapi.ServerResponse{
  99270. Header: res.Header,
  99271. HTTPStatusCode: res.StatusCode,
  99272. },
  99273. }
  99274. target := &ret
  99275. if err := gensupport.DecodeResponse(target, res); err != nil {
  99276. return nil, err
  99277. }
  99278. return ret, nil
  99279. // {
  99280. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  99281. // "httpMethod": "GET",
  99282. // "id": "compute.subnetworks.getIamPolicy",
  99283. // "parameterOrder": [
  99284. // "project",
  99285. // "region",
  99286. // "resource"
  99287. // ],
  99288. // "parameters": {
  99289. // "project": {
  99290. // "description": "Project ID for this request.",
  99291. // "location": "path",
  99292. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99293. // "required": true,
  99294. // "type": "string"
  99295. // },
  99296. // "region": {
  99297. // "description": "The name of the region for this request.",
  99298. // "location": "path",
  99299. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99300. // "required": true,
  99301. // "type": "string"
  99302. // },
  99303. // "resource": {
  99304. // "description": "Name or id of the resource for this request.",
  99305. // "location": "path",
  99306. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99307. // "required": true,
  99308. // "type": "string"
  99309. // }
  99310. // },
  99311. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  99312. // "response": {
  99313. // "$ref": "Policy"
  99314. // },
  99315. // "scopes": [
  99316. // "https://www.googleapis.com/auth/cloud-platform",
  99317. // "https://www.googleapis.com/auth/compute",
  99318. // "https://www.googleapis.com/auth/compute.readonly"
  99319. // ]
  99320. // }
  99321. }
  99322. // method id "compute.subnetworks.insert":
  99323. type SubnetworksInsertCall struct {
  99324. s *Service
  99325. project string
  99326. region string
  99327. subnetwork *Subnetwork
  99328. urlParams_ gensupport.URLParams
  99329. ctx_ context.Context
  99330. header_ http.Header
  99331. }
  99332. // Insert: Creates a subnetwork in the specified project using the data
  99333. // included in the request.
  99334. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  99335. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99336. c.project = project
  99337. c.region = region
  99338. c.subnetwork = subnetwork
  99339. return c
  99340. }
  99341. // RequestId sets the optional parameter "requestId": An optional
  99342. // request ID to identify requests. Specify a unique request ID so that
  99343. // if you must retry your request, the server will know to ignore the
  99344. // request if it has already been completed.
  99345. //
  99346. // For example, consider a situation where you make an initial request
  99347. // and the request times out. If you make the request again with the
  99348. // same request ID, the server can check if original operation with the
  99349. // same request ID was received, and if so, will ignore the second
  99350. // request. This prevents clients from accidentally creating duplicate
  99351. // commitments.
  99352. //
  99353. // The request ID must be a valid UUID with the exception that zero UUID
  99354. // is not supported (00000000-0000-0000-0000-000000000000).
  99355. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  99356. c.urlParams_.Set("requestId", requestId)
  99357. return c
  99358. }
  99359. // Fields allows partial responses to be retrieved. See
  99360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99361. // for more information.
  99362. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  99363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99364. return c
  99365. }
  99366. // Context sets the context to be used in this call's Do method. Any
  99367. // pending HTTP request will be aborted if the provided context is
  99368. // canceled.
  99369. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  99370. c.ctx_ = ctx
  99371. return c
  99372. }
  99373. // Header returns an http.Header that can be modified by the caller to
  99374. // add HTTP headers to the request.
  99375. func (c *SubnetworksInsertCall) Header() http.Header {
  99376. if c.header_ == nil {
  99377. c.header_ = make(http.Header)
  99378. }
  99379. return c.header_
  99380. }
  99381. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  99382. reqHeaders := make(http.Header)
  99383. for k, v := range c.header_ {
  99384. reqHeaders[k] = v
  99385. }
  99386. reqHeaders.Set("User-Agent", c.s.userAgent())
  99387. var body io.Reader = nil
  99388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  99389. if err != nil {
  99390. return nil, err
  99391. }
  99392. reqHeaders.Set("Content-Type", "application/json")
  99393. c.urlParams_.Set("alt", alt)
  99394. c.urlParams_.Set("prettyPrint", "false")
  99395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  99396. urls += "?" + c.urlParams_.Encode()
  99397. req, err := http.NewRequest("POST", urls, body)
  99398. if err != nil {
  99399. return nil, err
  99400. }
  99401. req.Header = reqHeaders
  99402. googleapi.Expand(req.URL, map[string]string{
  99403. "project": c.project,
  99404. "region": c.region,
  99405. })
  99406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99407. }
  99408. // Do executes the "compute.subnetworks.insert" call.
  99409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99410. // status code is an error. Response headers are in either
  99411. // *Operation.ServerResponse.Header or (if a response was returned at
  99412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99413. // to check whether the returned error was because
  99414. // http.StatusNotModified was returned.
  99415. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99416. gensupport.SetOptions(c.urlParams_, opts...)
  99417. res, err := c.doRequest("json")
  99418. if res != nil && res.StatusCode == http.StatusNotModified {
  99419. if res.Body != nil {
  99420. res.Body.Close()
  99421. }
  99422. return nil, &googleapi.Error{
  99423. Code: res.StatusCode,
  99424. Header: res.Header,
  99425. }
  99426. }
  99427. if err != nil {
  99428. return nil, err
  99429. }
  99430. defer googleapi.CloseBody(res)
  99431. if err := googleapi.CheckResponse(res); err != nil {
  99432. return nil, err
  99433. }
  99434. ret := &Operation{
  99435. ServerResponse: googleapi.ServerResponse{
  99436. Header: res.Header,
  99437. HTTPStatusCode: res.StatusCode,
  99438. },
  99439. }
  99440. target := &ret
  99441. if err := gensupport.DecodeResponse(target, res); err != nil {
  99442. return nil, err
  99443. }
  99444. return ret, nil
  99445. // {
  99446. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  99447. // "httpMethod": "POST",
  99448. // "id": "compute.subnetworks.insert",
  99449. // "parameterOrder": [
  99450. // "project",
  99451. // "region"
  99452. // ],
  99453. // "parameters": {
  99454. // "project": {
  99455. // "description": "Project ID for this request.",
  99456. // "location": "path",
  99457. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99458. // "required": true,
  99459. // "type": "string"
  99460. // },
  99461. // "region": {
  99462. // "description": "Name of the region scoping this request.",
  99463. // "location": "path",
  99464. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99465. // "required": true,
  99466. // "type": "string"
  99467. // },
  99468. // "requestId": {
  99469. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99470. // "location": "query",
  99471. // "type": "string"
  99472. // }
  99473. // },
  99474. // "path": "{project}/regions/{region}/subnetworks",
  99475. // "request": {
  99476. // "$ref": "Subnetwork"
  99477. // },
  99478. // "response": {
  99479. // "$ref": "Operation"
  99480. // },
  99481. // "scopes": [
  99482. // "https://www.googleapis.com/auth/cloud-platform",
  99483. // "https://www.googleapis.com/auth/compute"
  99484. // ]
  99485. // }
  99486. }
  99487. // method id "compute.subnetworks.list":
  99488. type SubnetworksListCall struct {
  99489. s *Service
  99490. project string
  99491. region string
  99492. urlParams_ gensupport.URLParams
  99493. ifNoneMatch_ string
  99494. ctx_ context.Context
  99495. header_ http.Header
  99496. }
  99497. // List: Retrieves a list of subnetworks available to the specified
  99498. // project.
  99499. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  99500. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99501. c.project = project
  99502. c.region = region
  99503. return c
  99504. }
  99505. // Filter sets the optional parameter "filter": A filter expression that
  99506. // filters resources listed in the response. The expression must specify
  99507. // the field name, a comparison operator, and the value that you want to
  99508. // use for filtering. The value must be a string, a number, or a
  99509. // boolean. The comparison operator must be either =, !=, >, or <.
  99510. //
  99511. // For example, if you are filtering Compute Engine instances, you can
  99512. // exclude instances named example-instance by specifying name !=
  99513. // example-instance.
  99514. //
  99515. // You can also filter nested fields. For example, you could specify
  99516. // scheduling.automaticRestart = false to include instances only if they
  99517. // are not scheduled for automatic restarts. You can use filtering on
  99518. // nested fields to filter based on resource labels.
  99519. //
  99520. // To filter on multiple expressions, provide each separate expression
  99521. // within parentheses. For example, (scheduling.automaticRestart = true)
  99522. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99523. // AND expression. However, you can include AND and OR expressions
  99524. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99525. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99526. // true).
  99527. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  99528. c.urlParams_.Set("filter", filter)
  99529. return c
  99530. }
  99531. // MaxResults sets the optional parameter "maxResults": The maximum
  99532. // number of results per page that should be returned. If the number of
  99533. // available results is larger than maxResults, Compute Engine returns a
  99534. // nextPageToken that can be used to get the next page of results in
  99535. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99536. // (Default: 500)
  99537. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  99538. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99539. return c
  99540. }
  99541. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99542. // a certain order. By default, results are returned in alphanumerical
  99543. // order based on the resource name.
  99544. //
  99545. // You can also sort results in descending order based on the creation
  99546. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99547. // based on the creationTimestamp field in reverse chronological order
  99548. // (newest result first). Use this to sort resources like operations so
  99549. // that the newest operation is returned first.
  99550. //
  99551. // Currently, only sorting by name or creationTimestamp desc is
  99552. // supported.
  99553. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  99554. c.urlParams_.Set("orderBy", orderBy)
  99555. return c
  99556. }
  99557. // PageToken sets the optional parameter "pageToken": Specifies a page
  99558. // token to use. Set pageToken to the nextPageToken returned by a
  99559. // previous list request to get the next page of results.
  99560. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  99561. c.urlParams_.Set("pageToken", pageToken)
  99562. return c
  99563. }
  99564. // Fields allows partial responses to be retrieved. See
  99565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99566. // for more information.
  99567. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  99568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99569. return c
  99570. }
  99571. // IfNoneMatch sets the optional parameter which makes the operation
  99572. // fail if the object's ETag matches the given value. This is useful for
  99573. // getting updates only after the object has changed since the last
  99574. // request. Use googleapi.IsNotModified to check whether the response
  99575. // error from Do is the result of In-None-Match.
  99576. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  99577. c.ifNoneMatch_ = entityTag
  99578. return c
  99579. }
  99580. // Context sets the context to be used in this call's Do method. Any
  99581. // pending HTTP request will be aborted if the provided context is
  99582. // canceled.
  99583. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  99584. c.ctx_ = ctx
  99585. return c
  99586. }
  99587. // Header returns an http.Header that can be modified by the caller to
  99588. // add HTTP headers to the request.
  99589. func (c *SubnetworksListCall) Header() http.Header {
  99590. if c.header_ == nil {
  99591. c.header_ = make(http.Header)
  99592. }
  99593. return c.header_
  99594. }
  99595. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  99596. reqHeaders := make(http.Header)
  99597. for k, v := range c.header_ {
  99598. reqHeaders[k] = v
  99599. }
  99600. reqHeaders.Set("User-Agent", c.s.userAgent())
  99601. if c.ifNoneMatch_ != "" {
  99602. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99603. }
  99604. var body io.Reader = nil
  99605. c.urlParams_.Set("alt", alt)
  99606. c.urlParams_.Set("prettyPrint", "false")
  99607. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  99608. urls += "?" + c.urlParams_.Encode()
  99609. req, err := http.NewRequest("GET", urls, body)
  99610. if err != nil {
  99611. return nil, err
  99612. }
  99613. req.Header = reqHeaders
  99614. googleapi.Expand(req.URL, map[string]string{
  99615. "project": c.project,
  99616. "region": c.region,
  99617. })
  99618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99619. }
  99620. // Do executes the "compute.subnetworks.list" call.
  99621. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  99622. // status code is an error. Response headers are in either
  99623. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  99624. // at all) in error.(*googleapi.Error).Header. Use
  99625. // googleapi.IsNotModified to check whether the returned error was
  99626. // because http.StatusNotModified was returned.
  99627. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  99628. gensupport.SetOptions(c.urlParams_, opts...)
  99629. res, err := c.doRequest("json")
  99630. if res != nil && res.StatusCode == http.StatusNotModified {
  99631. if res.Body != nil {
  99632. res.Body.Close()
  99633. }
  99634. return nil, &googleapi.Error{
  99635. Code: res.StatusCode,
  99636. Header: res.Header,
  99637. }
  99638. }
  99639. if err != nil {
  99640. return nil, err
  99641. }
  99642. defer googleapi.CloseBody(res)
  99643. if err := googleapi.CheckResponse(res); err != nil {
  99644. return nil, err
  99645. }
  99646. ret := &SubnetworkList{
  99647. ServerResponse: googleapi.ServerResponse{
  99648. Header: res.Header,
  99649. HTTPStatusCode: res.StatusCode,
  99650. },
  99651. }
  99652. target := &ret
  99653. if err := gensupport.DecodeResponse(target, res); err != nil {
  99654. return nil, err
  99655. }
  99656. return ret, nil
  99657. // {
  99658. // "description": "Retrieves a list of subnetworks available to the specified project.",
  99659. // "httpMethod": "GET",
  99660. // "id": "compute.subnetworks.list",
  99661. // "parameterOrder": [
  99662. // "project",
  99663. // "region"
  99664. // ],
  99665. // "parameters": {
  99666. // "filter": {
  99667. // "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).",
  99668. // "location": "query",
  99669. // "type": "string"
  99670. // },
  99671. // "maxResults": {
  99672. // "default": "500",
  99673. // "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)",
  99674. // "format": "uint32",
  99675. // "location": "query",
  99676. // "minimum": "0",
  99677. // "type": "integer"
  99678. // },
  99679. // "orderBy": {
  99680. // "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.",
  99681. // "location": "query",
  99682. // "type": "string"
  99683. // },
  99684. // "pageToken": {
  99685. // "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.",
  99686. // "location": "query",
  99687. // "type": "string"
  99688. // },
  99689. // "project": {
  99690. // "description": "Project ID for this request.",
  99691. // "location": "path",
  99692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99693. // "required": true,
  99694. // "type": "string"
  99695. // },
  99696. // "region": {
  99697. // "description": "Name of the region scoping this request.",
  99698. // "location": "path",
  99699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99700. // "required": true,
  99701. // "type": "string"
  99702. // }
  99703. // },
  99704. // "path": "{project}/regions/{region}/subnetworks",
  99705. // "response": {
  99706. // "$ref": "SubnetworkList"
  99707. // },
  99708. // "scopes": [
  99709. // "https://www.googleapis.com/auth/cloud-platform",
  99710. // "https://www.googleapis.com/auth/compute",
  99711. // "https://www.googleapis.com/auth/compute.readonly"
  99712. // ]
  99713. // }
  99714. }
  99715. // Pages invokes f for each page of results.
  99716. // A non-nil error returned from f will halt the iteration.
  99717. // The provided context supersedes any context provided to the Context method.
  99718. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  99719. c.ctx_ = ctx
  99720. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99721. for {
  99722. x, err := c.Do()
  99723. if err != nil {
  99724. return err
  99725. }
  99726. if err := f(x); err != nil {
  99727. return err
  99728. }
  99729. if x.NextPageToken == "" {
  99730. return nil
  99731. }
  99732. c.PageToken(x.NextPageToken)
  99733. }
  99734. }
  99735. // method id "compute.subnetworks.listUsable":
  99736. type SubnetworksListUsableCall struct {
  99737. s *Service
  99738. project string
  99739. urlParams_ gensupport.URLParams
  99740. ifNoneMatch_ string
  99741. ctx_ context.Context
  99742. header_ http.Header
  99743. }
  99744. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  99745. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  99746. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99747. c.project = project
  99748. return c
  99749. }
  99750. // Filter sets the optional parameter "filter": A filter expression that
  99751. // filters resources listed in the response. The expression must specify
  99752. // the field name, a comparison operator, and the value that you want to
  99753. // use for filtering. The value must be a string, a number, or a
  99754. // boolean. The comparison operator must be either =, !=, >, or <.
  99755. //
  99756. // For example, if you are filtering Compute Engine instances, you can
  99757. // exclude instances named example-instance by specifying name !=
  99758. // example-instance.
  99759. //
  99760. // You can also filter nested fields. For example, you could specify
  99761. // scheduling.automaticRestart = false to include instances only if they
  99762. // are not scheduled for automatic restarts. You can use filtering on
  99763. // nested fields to filter based on resource labels.
  99764. //
  99765. // To filter on multiple expressions, provide each separate expression
  99766. // within parentheses. For example, (scheduling.automaticRestart = true)
  99767. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99768. // AND expression. However, you can include AND and OR expressions
  99769. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99770. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99771. // true).
  99772. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  99773. c.urlParams_.Set("filter", filter)
  99774. return c
  99775. }
  99776. // MaxResults sets the optional parameter "maxResults": The maximum
  99777. // number of results per page that should be returned. If the number of
  99778. // available results is larger than maxResults, Compute Engine returns a
  99779. // nextPageToken that can be used to get the next page of results in
  99780. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99781. // (Default: 500)
  99782. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  99783. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99784. return c
  99785. }
  99786. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99787. // a certain order. By default, results are returned in alphanumerical
  99788. // order based on the resource name.
  99789. //
  99790. // You can also sort results in descending order based on the creation
  99791. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99792. // based on the creationTimestamp field in reverse chronological order
  99793. // (newest result first). Use this to sort resources like operations so
  99794. // that the newest operation is returned first.
  99795. //
  99796. // Currently, only sorting by name or creationTimestamp desc is
  99797. // supported.
  99798. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  99799. c.urlParams_.Set("orderBy", orderBy)
  99800. return c
  99801. }
  99802. // PageToken sets the optional parameter "pageToken": Specifies a page
  99803. // token to use. Set pageToken to the nextPageToken returned by a
  99804. // previous list request to get the next page of results.
  99805. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  99806. c.urlParams_.Set("pageToken", pageToken)
  99807. return c
  99808. }
  99809. // Fields allows partial responses to be retrieved. See
  99810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99811. // for more information.
  99812. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  99813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99814. return c
  99815. }
  99816. // IfNoneMatch sets the optional parameter which makes the operation
  99817. // fail if the object's ETag matches the given value. This is useful for
  99818. // getting updates only after the object has changed since the last
  99819. // request. Use googleapi.IsNotModified to check whether the response
  99820. // error from Do is the result of In-None-Match.
  99821. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  99822. c.ifNoneMatch_ = entityTag
  99823. return c
  99824. }
  99825. // Context sets the context to be used in this call's Do method. Any
  99826. // pending HTTP request will be aborted if the provided context is
  99827. // canceled.
  99828. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  99829. c.ctx_ = ctx
  99830. return c
  99831. }
  99832. // Header returns an http.Header that can be modified by the caller to
  99833. // add HTTP headers to the request.
  99834. func (c *SubnetworksListUsableCall) Header() http.Header {
  99835. if c.header_ == nil {
  99836. c.header_ = make(http.Header)
  99837. }
  99838. return c.header_
  99839. }
  99840. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  99841. reqHeaders := make(http.Header)
  99842. for k, v := range c.header_ {
  99843. reqHeaders[k] = v
  99844. }
  99845. reqHeaders.Set("User-Agent", c.s.userAgent())
  99846. if c.ifNoneMatch_ != "" {
  99847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99848. }
  99849. var body io.Reader = nil
  99850. c.urlParams_.Set("alt", alt)
  99851. c.urlParams_.Set("prettyPrint", "false")
  99852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  99853. urls += "?" + c.urlParams_.Encode()
  99854. req, err := http.NewRequest("GET", urls, body)
  99855. if err != nil {
  99856. return nil, err
  99857. }
  99858. req.Header = reqHeaders
  99859. googleapi.Expand(req.URL, map[string]string{
  99860. "project": c.project,
  99861. })
  99862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99863. }
  99864. // Do executes the "compute.subnetworks.listUsable" call.
  99865. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  99866. // non-nil. Any non-2xx status code is an error. Response headers are in
  99867. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  99868. // a response was returned at all) in error.(*googleapi.Error).Header.
  99869. // Use googleapi.IsNotModified to check whether the returned error was
  99870. // because http.StatusNotModified was returned.
  99871. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  99872. gensupport.SetOptions(c.urlParams_, opts...)
  99873. res, err := c.doRequest("json")
  99874. if res != nil && res.StatusCode == http.StatusNotModified {
  99875. if res.Body != nil {
  99876. res.Body.Close()
  99877. }
  99878. return nil, &googleapi.Error{
  99879. Code: res.StatusCode,
  99880. Header: res.Header,
  99881. }
  99882. }
  99883. if err != nil {
  99884. return nil, err
  99885. }
  99886. defer googleapi.CloseBody(res)
  99887. if err := googleapi.CheckResponse(res); err != nil {
  99888. return nil, err
  99889. }
  99890. ret := &UsableSubnetworksAggregatedList{
  99891. ServerResponse: googleapi.ServerResponse{
  99892. Header: res.Header,
  99893. HTTPStatusCode: res.StatusCode,
  99894. },
  99895. }
  99896. target := &ret
  99897. if err := gensupport.DecodeResponse(target, res); err != nil {
  99898. return nil, err
  99899. }
  99900. return ret, nil
  99901. // {
  99902. // "description": "Retrieves an aggregated list of usable subnetworks.",
  99903. // "httpMethod": "GET",
  99904. // "id": "compute.subnetworks.listUsable",
  99905. // "parameterOrder": [
  99906. // "project"
  99907. // ],
  99908. // "parameters": {
  99909. // "filter": {
  99910. // "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).",
  99911. // "location": "query",
  99912. // "type": "string"
  99913. // },
  99914. // "maxResults": {
  99915. // "default": "500",
  99916. // "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)",
  99917. // "format": "uint32",
  99918. // "location": "query",
  99919. // "minimum": "0",
  99920. // "type": "integer"
  99921. // },
  99922. // "orderBy": {
  99923. // "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.",
  99924. // "location": "query",
  99925. // "type": "string"
  99926. // },
  99927. // "pageToken": {
  99928. // "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.",
  99929. // "location": "query",
  99930. // "type": "string"
  99931. // },
  99932. // "project": {
  99933. // "description": "Project ID for this request.",
  99934. // "location": "path",
  99935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99936. // "required": true,
  99937. // "type": "string"
  99938. // }
  99939. // },
  99940. // "path": "{project}/aggregated/subnetworks/listUsable",
  99941. // "response": {
  99942. // "$ref": "UsableSubnetworksAggregatedList"
  99943. // },
  99944. // "scopes": [
  99945. // "https://www.googleapis.com/auth/cloud-platform",
  99946. // "https://www.googleapis.com/auth/compute",
  99947. // "https://www.googleapis.com/auth/compute.readonly"
  99948. // ]
  99949. // }
  99950. }
  99951. // Pages invokes f for each page of results.
  99952. // A non-nil error returned from f will halt the iteration.
  99953. // The provided context supersedes any context provided to the Context method.
  99954. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  99955. c.ctx_ = ctx
  99956. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99957. for {
  99958. x, err := c.Do()
  99959. if err != nil {
  99960. return err
  99961. }
  99962. if err := f(x); err != nil {
  99963. return err
  99964. }
  99965. if x.NextPageToken == "" {
  99966. return nil
  99967. }
  99968. c.PageToken(x.NextPageToken)
  99969. }
  99970. }
  99971. // method id "compute.subnetworks.patch":
  99972. type SubnetworksPatchCall struct {
  99973. s *Service
  99974. project string
  99975. region string
  99976. subnetwork string
  99977. subnetwork2 *Subnetwork
  99978. urlParams_ gensupport.URLParams
  99979. ctx_ context.Context
  99980. header_ http.Header
  99981. }
  99982. // Patch: Patches the specified subnetwork with the data included in the
  99983. // request. Only certain fields can up updated with a patch request as
  99984. // indicated in the field descriptions. You must specify the current
  99985. // fingeprint of the subnetwork resource being patched.
  99986. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  99987. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99988. c.project = project
  99989. c.region = region
  99990. c.subnetwork = subnetwork
  99991. c.subnetwork2 = subnetwork2
  99992. return c
  99993. }
  99994. // RequestId sets the optional parameter "requestId": An optional
  99995. // request ID to identify requests. Specify a unique request ID so that
  99996. // if you must retry your request, the server will know to ignore the
  99997. // request if it has already been completed.
  99998. //
  99999. // For example, consider a situation where you make an initial request
  100000. // and the request times out. If you make the request again with the
  100001. // same request ID, the server can check if original operation with the
  100002. // same request ID was received, and if so, will ignore the second
  100003. // request. This prevents clients from accidentally creating duplicate
  100004. // commitments.
  100005. //
  100006. // The request ID must be a valid UUID with the exception that zero UUID
  100007. // is not supported (00000000-0000-0000-0000-000000000000).
  100008. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  100009. c.urlParams_.Set("requestId", requestId)
  100010. return c
  100011. }
  100012. // Fields allows partial responses to be retrieved. See
  100013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100014. // for more information.
  100015. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  100016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100017. return c
  100018. }
  100019. // Context sets the context to be used in this call's Do method. Any
  100020. // pending HTTP request will be aborted if the provided context is
  100021. // canceled.
  100022. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  100023. c.ctx_ = ctx
  100024. return c
  100025. }
  100026. // Header returns an http.Header that can be modified by the caller to
  100027. // add HTTP headers to the request.
  100028. func (c *SubnetworksPatchCall) Header() http.Header {
  100029. if c.header_ == nil {
  100030. c.header_ = make(http.Header)
  100031. }
  100032. return c.header_
  100033. }
  100034. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  100035. reqHeaders := make(http.Header)
  100036. for k, v := range c.header_ {
  100037. reqHeaders[k] = v
  100038. }
  100039. reqHeaders.Set("User-Agent", c.s.userAgent())
  100040. var body io.Reader = nil
  100041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  100042. if err != nil {
  100043. return nil, err
  100044. }
  100045. reqHeaders.Set("Content-Type", "application/json")
  100046. c.urlParams_.Set("alt", alt)
  100047. c.urlParams_.Set("prettyPrint", "false")
  100048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  100049. urls += "?" + c.urlParams_.Encode()
  100050. req, err := http.NewRequest("PATCH", urls, body)
  100051. if err != nil {
  100052. return nil, err
  100053. }
  100054. req.Header = reqHeaders
  100055. googleapi.Expand(req.URL, map[string]string{
  100056. "project": c.project,
  100057. "region": c.region,
  100058. "subnetwork": c.subnetwork,
  100059. })
  100060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100061. }
  100062. // Do executes the "compute.subnetworks.patch" call.
  100063. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100064. // status code is an error. Response headers are in either
  100065. // *Operation.ServerResponse.Header or (if a response was returned at
  100066. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100067. // to check whether the returned error was because
  100068. // http.StatusNotModified was returned.
  100069. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100070. gensupport.SetOptions(c.urlParams_, opts...)
  100071. res, err := c.doRequest("json")
  100072. if res != nil && res.StatusCode == http.StatusNotModified {
  100073. if res.Body != nil {
  100074. res.Body.Close()
  100075. }
  100076. return nil, &googleapi.Error{
  100077. Code: res.StatusCode,
  100078. Header: res.Header,
  100079. }
  100080. }
  100081. if err != nil {
  100082. return nil, err
  100083. }
  100084. defer googleapi.CloseBody(res)
  100085. if err := googleapi.CheckResponse(res); err != nil {
  100086. return nil, err
  100087. }
  100088. ret := &Operation{
  100089. ServerResponse: googleapi.ServerResponse{
  100090. Header: res.Header,
  100091. HTTPStatusCode: res.StatusCode,
  100092. },
  100093. }
  100094. target := &ret
  100095. if err := gensupport.DecodeResponse(target, res); err != nil {
  100096. return nil, err
  100097. }
  100098. return ret, nil
  100099. // {
  100100. // "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.",
  100101. // "httpMethod": "PATCH",
  100102. // "id": "compute.subnetworks.patch",
  100103. // "parameterOrder": [
  100104. // "project",
  100105. // "region",
  100106. // "subnetwork"
  100107. // ],
  100108. // "parameters": {
  100109. // "project": {
  100110. // "description": "Project ID for this request.",
  100111. // "location": "path",
  100112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100113. // "required": true,
  100114. // "type": "string"
  100115. // },
  100116. // "region": {
  100117. // "description": "Name of the region scoping this request.",
  100118. // "location": "path",
  100119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100120. // "required": true,
  100121. // "type": "string"
  100122. // },
  100123. // "requestId": {
  100124. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100125. // "location": "query",
  100126. // "type": "string"
  100127. // },
  100128. // "subnetwork": {
  100129. // "description": "Name of the Subnetwork resource to patch.",
  100130. // "location": "path",
  100131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100132. // "required": true,
  100133. // "type": "string"
  100134. // }
  100135. // },
  100136. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  100137. // "request": {
  100138. // "$ref": "Subnetwork"
  100139. // },
  100140. // "response": {
  100141. // "$ref": "Operation"
  100142. // },
  100143. // "scopes": [
  100144. // "https://www.googleapis.com/auth/cloud-platform",
  100145. // "https://www.googleapis.com/auth/compute"
  100146. // ]
  100147. // }
  100148. }
  100149. // method id "compute.subnetworks.setIamPolicy":
  100150. type SubnetworksSetIamPolicyCall struct {
  100151. s *Service
  100152. project string
  100153. region string
  100154. resource string
  100155. regionsetpolicyrequest *RegionSetPolicyRequest
  100156. urlParams_ gensupport.URLParams
  100157. ctx_ context.Context
  100158. header_ http.Header
  100159. }
  100160. // SetIamPolicy: Sets the access control policy on the specified
  100161. // resource. Replaces any existing policy.
  100162. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  100163. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100164. c.project = project
  100165. c.region = region
  100166. c.resource = resource
  100167. c.regionsetpolicyrequest = regionsetpolicyrequest
  100168. return c
  100169. }
  100170. // Fields allows partial responses to be retrieved. See
  100171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100172. // for more information.
  100173. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  100174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100175. return c
  100176. }
  100177. // Context sets the context to be used in this call's Do method. Any
  100178. // pending HTTP request will be aborted if the provided context is
  100179. // canceled.
  100180. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  100181. c.ctx_ = ctx
  100182. return c
  100183. }
  100184. // Header returns an http.Header that can be modified by the caller to
  100185. // add HTTP headers to the request.
  100186. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  100187. if c.header_ == nil {
  100188. c.header_ = make(http.Header)
  100189. }
  100190. return c.header_
  100191. }
  100192. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  100193. reqHeaders := make(http.Header)
  100194. for k, v := range c.header_ {
  100195. reqHeaders[k] = v
  100196. }
  100197. reqHeaders.Set("User-Agent", c.s.userAgent())
  100198. var body io.Reader = nil
  100199. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  100200. if err != nil {
  100201. return nil, err
  100202. }
  100203. reqHeaders.Set("Content-Type", "application/json")
  100204. c.urlParams_.Set("alt", alt)
  100205. c.urlParams_.Set("prettyPrint", "false")
  100206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  100207. urls += "?" + c.urlParams_.Encode()
  100208. req, err := http.NewRequest("POST", urls, body)
  100209. if err != nil {
  100210. return nil, err
  100211. }
  100212. req.Header = reqHeaders
  100213. googleapi.Expand(req.URL, map[string]string{
  100214. "project": c.project,
  100215. "region": c.region,
  100216. "resource": c.resource,
  100217. })
  100218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100219. }
  100220. // Do executes the "compute.subnetworks.setIamPolicy" call.
  100221. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  100222. // code is an error. Response headers are in either
  100223. // *Policy.ServerResponse.Header or (if a response was returned at all)
  100224. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  100225. // check whether the returned error was because http.StatusNotModified
  100226. // was returned.
  100227. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  100228. gensupport.SetOptions(c.urlParams_, opts...)
  100229. res, err := c.doRequest("json")
  100230. if res != nil && res.StatusCode == http.StatusNotModified {
  100231. if res.Body != nil {
  100232. res.Body.Close()
  100233. }
  100234. return nil, &googleapi.Error{
  100235. Code: res.StatusCode,
  100236. Header: res.Header,
  100237. }
  100238. }
  100239. if err != nil {
  100240. return nil, err
  100241. }
  100242. defer googleapi.CloseBody(res)
  100243. if err := googleapi.CheckResponse(res); err != nil {
  100244. return nil, err
  100245. }
  100246. ret := &Policy{
  100247. ServerResponse: googleapi.ServerResponse{
  100248. Header: res.Header,
  100249. HTTPStatusCode: res.StatusCode,
  100250. },
  100251. }
  100252. target := &ret
  100253. if err := gensupport.DecodeResponse(target, res); err != nil {
  100254. return nil, err
  100255. }
  100256. return ret, nil
  100257. // {
  100258. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  100259. // "httpMethod": "POST",
  100260. // "id": "compute.subnetworks.setIamPolicy",
  100261. // "parameterOrder": [
  100262. // "project",
  100263. // "region",
  100264. // "resource"
  100265. // ],
  100266. // "parameters": {
  100267. // "project": {
  100268. // "description": "Project ID for this request.",
  100269. // "location": "path",
  100270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100271. // "required": true,
  100272. // "type": "string"
  100273. // },
  100274. // "region": {
  100275. // "description": "The name of the region for this request.",
  100276. // "location": "path",
  100277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100278. // "required": true,
  100279. // "type": "string"
  100280. // },
  100281. // "resource": {
  100282. // "description": "Name or id of the resource for this request.",
  100283. // "location": "path",
  100284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100285. // "required": true,
  100286. // "type": "string"
  100287. // }
  100288. // },
  100289. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  100290. // "request": {
  100291. // "$ref": "RegionSetPolicyRequest"
  100292. // },
  100293. // "response": {
  100294. // "$ref": "Policy"
  100295. // },
  100296. // "scopes": [
  100297. // "https://www.googleapis.com/auth/cloud-platform",
  100298. // "https://www.googleapis.com/auth/compute"
  100299. // ]
  100300. // }
  100301. }
  100302. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  100303. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  100304. s *Service
  100305. project string
  100306. region string
  100307. subnetwork string
  100308. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  100309. urlParams_ gensupport.URLParams
  100310. ctx_ context.Context
  100311. header_ http.Header
  100312. }
  100313. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  100314. // Google services without assigning external IP addresses through
  100315. // Private Google Access.
  100316. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  100317. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100318. c.project = project
  100319. c.region = region
  100320. c.subnetwork = subnetwork
  100321. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  100322. return c
  100323. }
  100324. // RequestId sets the optional parameter "requestId": An optional
  100325. // request ID to identify requests. Specify a unique request ID so that
  100326. // if you must retry your request, the server will know to ignore the
  100327. // request if it has already been completed.
  100328. //
  100329. // For example, consider a situation where you make an initial request
  100330. // and the request times out. If you make the request again with the
  100331. // same request ID, the server can check if original operation with the
  100332. // same request ID was received, and if so, will ignore the second
  100333. // request. This prevents clients from accidentally creating duplicate
  100334. // commitments.
  100335. //
  100336. // The request ID must be a valid UUID with the exception that zero UUID
  100337. // is not supported (00000000-0000-0000-0000-000000000000).
  100338. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  100339. c.urlParams_.Set("requestId", requestId)
  100340. return c
  100341. }
  100342. // Fields allows partial responses to be retrieved. See
  100343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100344. // for more information.
  100345. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  100346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100347. return c
  100348. }
  100349. // Context sets the context to be used in this call's Do method. Any
  100350. // pending HTTP request will be aborted if the provided context is
  100351. // canceled.
  100352. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  100353. c.ctx_ = ctx
  100354. return c
  100355. }
  100356. // Header returns an http.Header that can be modified by the caller to
  100357. // add HTTP headers to the request.
  100358. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  100359. if c.header_ == nil {
  100360. c.header_ = make(http.Header)
  100361. }
  100362. return c.header_
  100363. }
  100364. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  100365. reqHeaders := make(http.Header)
  100366. for k, v := range c.header_ {
  100367. reqHeaders[k] = v
  100368. }
  100369. reqHeaders.Set("User-Agent", c.s.userAgent())
  100370. var body io.Reader = nil
  100371. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  100372. if err != nil {
  100373. return nil, err
  100374. }
  100375. reqHeaders.Set("Content-Type", "application/json")
  100376. c.urlParams_.Set("alt", alt)
  100377. c.urlParams_.Set("prettyPrint", "false")
  100378. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  100379. urls += "?" + c.urlParams_.Encode()
  100380. req, err := http.NewRequest("POST", urls, body)
  100381. if err != nil {
  100382. return nil, err
  100383. }
  100384. req.Header = reqHeaders
  100385. googleapi.Expand(req.URL, map[string]string{
  100386. "project": c.project,
  100387. "region": c.region,
  100388. "subnetwork": c.subnetwork,
  100389. })
  100390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100391. }
  100392. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  100393. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100394. // status code is an error. Response headers are in either
  100395. // *Operation.ServerResponse.Header or (if a response was returned at
  100396. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100397. // to check whether the returned error was because
  100398. // http.StatusNotModified was returned.
  100399. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100400. gensupport.SetOptions(c.urlParams_, opts...)
  100401. res, err := c.doRequest("json")
  100402. if res != nil && res.StatusCode == http.StatusNotModified {
  100403. if res.Body != nil {
  100404. res.Body.Close()
  100405. }
  100406. return nil, &googleapi.Error{
  100407. Code: res.StatusCode,
  100408. Header: res.Header,
  100409. }
  100410. }
  100411. if err != nil {
  100412. return nil, err
  100413. }
  100414. defer googleapi.CloseBody(res)
  100415. if err := googleapi.CheckResponse(res); err != nil {
  100416. return nil, err
  100417. }
  100418. ret := &Operation{
  100419. ServerResponse: googleapi.ServerResponse{
  100420. Header: res.Header,
  100421. HTTPStatusCode: res.StatusCode,
  100422. },
  100423. }
  100424. target := &ret
  100425. if err := gensupport.DecodeResponse(target, res); err != nil {
  100426. return nil, err
  100427. }
  100428. return ret, nil
  100429. // {
  100430. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  100431. // "httpMethod": "POST",
  100432. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  100433. // "parameterOrder": [
  100434. // "project",
  100435. // "region",
  100436. // "subnetwork"
  100437. // ],
  100438. // "parameters": {
  100439. // "project": {
  100440. // "description": "Project ID for this request.",
  100441. // "location": "path",
  100442. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100443. // "required": true,
  100444. // "type": "string"
  100445. // },
  100446. // "region": {
  100447. // "description": "Name of the region scoping this request.",
  100448. // "location": "path",
  100449. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100450. // "required": true,
  100451. // "type": "string"
  100452. // },
  100453. // "requestId": {
  100454. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100455. // "location": "query",
  100456. // "type": "string"
  100457. // },
  100458. // "subnetwork": {
  100459. // "description": "Name of the Subnetwork resource.",
  100460. // "location": "path",
  100461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100462. // "required": true,
  100463. // "type": "string"
  100464. // }
  100465. // },
  100466. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  100467. // "request": {
  100468. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  100469. // },
  100470. // "response": {
  100471. // "$ref": "Operation"
  100472. // },
  100473. // "scopes": [
  100474. // "https://www.googleapis.com/auth/cloud-platform",
  100475. // "https://www.googleapis.com/auth/compute"
  100476. // ]
  100477. // }
  100478. }
  100479. // method id "compute.subnetworks.testIamPermissions":
  100480. type SubnetworksTestIamPermissionsCall struct {
  100481. s *Service
  100482. project string
  100483. region string
  100484. resource string
  100485. testpermissionsrequest *TestPermissionsRequest
  100486. urlParams_ gensupport.URLParams
  100487. ctx_ context.Context
  100488. header_ http.Header
  100489. }
  100490. // TestIamPermissions: Returns permissions that a caller has on the
  100491. // specified resource.
  100492. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  100493. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100494. c.project = project
  100495. c.region = region
  100496. c.resource = resource
  100497. c.testpermissionsrequest = testpermissionsrequest
  100498. return c
  100499. }
  100500. // Fields allows partial responses to be retrieved. See
  100501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100502. // for more information.
  100503. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  100504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100505. return c
  100506. }
  100507. // Context sets the context to be used in this call's Do method. Any
  100508. // pending HTTP request will be aborted if the provided context is
  100509. // canceled.
  100510. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  100511. c.ctx_ = ctx
  100512. return c
  100513. }
  100514. // Header returns an http.Header that can be modified by the caller to
  100515. // add HTTP headers to the request.
  100516. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  100517. if c.header_ == nil {
  100518. c.header_ = make(http.Header)
  100519. }
  100520. return c.header_
  100521. }
  100522. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  100523. reqHeaders := make(http.Header)
  100524. for k, v := range c.header_ {
  100525. reqHeaders[k] = v
  100526. }
  100527. reqHeaders.Set("User-Agent", c.s.userAgent())
  100528. var body io.Reader = nil
  100529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  100530. if err != nil {
  100531. return nil, err
  100532. }
  100533. reqHeaders.Set("Content-Type", "application/json")
  100534. c.urlParams_.Set("alt", alt)
  100535. c.urlParams_.Set("prettyPrint", "false")
  100536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  100537. urls += "?" + c.urlParams_.Encode()
  100538. req, err := http.NewRequest("POST", urls, body)
  100539. if err != nil {
  100540. return nil, err
  100541. }
  100542. req.Header = reqHeaders
  100543. googleapi.Expand(req.URL, map[string]string{
  100544. "project": c.project,
  100545. "region": c.region,
  100546. "resource": c.resource,
  100547. })
  100548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100549. }
  100550. // Do executes the "compute.subnetworks.testIamPermissions" call.
  100551. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  100552. // non-2xx status code is an error. Response headers are in either
  100553. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  100554. // returned at all) in error.(*googleapi.Error).Header. Use
  100555. // googleapi.IsNotModified to check whether the returned error was
  100556. // because http.StatusNotModified was returned.
  100557. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  100558. gensupport.SetOptions(c.urlParams_, opts...)
  100559. res, err := c.doRequest("json")
  100560. if res != nil && res.StatusCode == http.StatusNotModified {
  100561. if res.Body != nil {
  100562. res.Body.Close()
  100563. }
  100564. return nil, &googleapi.Error{
  100565. Code: res.StatusCode,
  100566. Header: res.Header,
  100567. }
  100568. }
  100569. if err != nil {
  100570. return nil, err
  100571. }
  100572. defer googleapi.CloseBody(res)
  100573. if err := googleapi.CheckResponse(res); err != nil {
  100574. return nil, err
  100575. }
  100576. ret := &TestPermissionsResponse{
  100577. ServerResponse: googleapi.ServerResponse{
  100578. Header: res.Header,
  100579. HTTPStatusCode: res.StatusCode,
  100580. },
  100581. }
  100582. target := &ret
  100583. if err := gensupport.DecodeResponse(target, res); err != nil {
  100584. return nil, err
  100585. }
  100586. return ret, nil
  100587. // {
  100588. // "description": "Returns permissions that a caller has on the specified resource.",
  100589. // "httpMethod": "POST",
  100590. // "id": "compute.subnetworks.testIamPermissions",
  100591. // "parameterOrder": [
  100592. // "project",
  100593. // "region",
  100594. // "resource"
  100595. // ],
  100596. // "parameters": {
  100597. // "project": {
  100598. // "description": "Project ID for this request.",
  100599. // "location": "path",
  100600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100601. // "required": true,
  100602. // "type": "string"
  100603. // },
  100604. // "region": {
  100605. // "description": "The name of the region for this request.",
  100606. // "location": "path",
  100607. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100608. // "required": true,
  100609. // "type": "string"
  100610. // },
  100611. // "resource": {
  100612. // "description": "Name or id of the resource for this request.",
  100613. // "location": "path",
  100614. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100615. // "required": true,
  100616. // "type": "string"
  100617. // }
  100618. // },
  100619. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  100620. // "request": {
  100621. // "$ref": "TestPermissionsRequest"
  100622. // },
  100623. // "response": {
  100624. // "$ref": "TestPermissionsResponse"
  100625. // },
  100626. // "scopes": [
  100627. // "https://www.googleapis.com/auth/cloud-platform",
  100628. // "https://www.googleapis.com/auth/compute",
  100629. // "https://www.googleapis.com/auth/compute.readonly"
  100630. // ]
  100631. // }
  100632. }
  100633. // method id "compute.targetHttpProxies.delete":
  100634. type TargetHttpProxiesDeleteCall struct {
  100635. s *Service
  100636. project string
  100637. targetHttpProxy string
  100638. urlParams_ gensupport.URLParams
  100639. ctx_ context.Context
  100640. header_ http.Header
  100641. }
  100642. // Delete: Deletes the specified TargetHttpProxy resource.
  100643. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  100644. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  100645. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100646. c.project = project
  100647. c.targetHttpProxy = targetHttpProxy
  100648. return c
  100649. }
  100650. // RequestId sets the optional parameter "requestId": An optional
  100651. // request ID to identify requests. Specify a unique request ID so that
  100652. // if you must retry your request, the server will know to ignore the
  100653. // request if it has already been completed.
  100654. //
  100655. // For example, consider a situation where you make an initial request
  100656. // and the request times out. If you make the request again with the
  100657. // same request ID, the server can check if original operation with the
  100658. // same request ID was received, and if so, will ignore the second
  100659. // request. This prevents clients from accidentally creating duplicate
  100660. // commitments.
  100661. //
  100662. // The request ID must be a valid UUID with the exception that zero UUID
  100663. // is not supported (00000000-0000-0000-0000-000000000000).
  100664. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  100665. c.urlParams_.Set("requestId", requestId)
  100666. return c
  100667. }
  100668. // Fields allows partial responses to be retrieved. See
  100669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100670. // for more information.
  100671. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  100672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100673. return c
  100674. }
  100675. // Context sets the context to be used in this call's Do method. Any
  100676. // pending HTTP request will be aborted if the provided context is
  100677. // canceled.
  100678. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  100679. c.ctx_ = ctx
  100680. return c
  100681. }
  100682. // Header returns an http.Header that can be modified by the caller to
  100683. // add HTTP headers to the request.
  100684. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  100685. if c.header_ == nil {
  100686. c.header_ = make(http.Header)
  100687. }
  100688. return c.header_
  100689. }
  100690. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  100691. reqHeaders := make(http.Header)
  100692. for k, v := range c.header_ {
  100693. reqHeaders[k] = v
  100694. }
  100695. reqHeaders.Set("User-Agent", c.s.userAgent())
  100696. var body io.Reader = nil
  100697. c.urlParams_.Set("alt", alt)
  100698. c.urlParams_.Set("prettyPrint", "false")
  100699. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  100700. urls += "?" + c.urlParams_.Encode()
  100701. req, err := http.NewRequest("DELETE", urls, body)
  100702. if err != nil {
  100703. return nil, err
  100704. }
  100705. req.Header = reqHeaders
  100706. googleapi.Expand(req.URL, map[string]string{
  100707. "project": c.project,
  100708. "targetHttpProxy": c.targetHttpProxy,
  100709. })
  100710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100711. }
  100712. // Do executes the "compute.targetHttpProxies.delete" call.
  100713. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100714. // status code is an error. Response headers are in either
  100715. // *Operation.ServerResponse.Header or (if a response was returned at
  100716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100717. // to check whether the returned error was because
  100718. // http.StatusNotModified was returned.
  100719. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100720. gensupport.SetOptions(c.urlParams_, opts...)
  100721. res, err := c.doRequest("json")
  100722. if res != nil && res.StatusCode == http.StatusNotModified {
  100723. if res.Body != nil {
  100724. res.Body.Close()
  100725. }
  100726. return nil, &googleapi.Error{
  100727. Code: res.StatusCode,
  100728. Header: res.Header,
  100729. }
  100730. }
  100731. if err != nil {
  100732. return nil, err
  100733. }
  100734. defer googleapi.CloseBody(res)
  100735. if err := googleapi.CheckResponse(res); err != nil {
  100736. return nil, err
  100737. }
  100738. ret := &Operation{
  100739. ServerResponse: googleapi.ServerResponse{
  100740. Header: res.Header,
  100741. HTTPStatusCode: res.StatusCode,
  100742. },
  100743. }
  100744. target := &ret
  100745. if err := gensupport.DecodeResponse(target, res); err != nil {
  100746. return nil, err
  100747. }
  100748. return ret, nil
  100749. // {
  100750. // "description": "Deletes the specified TargetHttpProxy resource.",
  100751. // "httpMethod": "DELETE",
  100752. // "id": "compute.targetHttpProxies.delete",
  100753. // "parameterOrder": [
  100754. // "project",
  100755. // "targetHttpProxy"
  100756. // ],
  100757. // "parameters": {
  100758. // "project": {
  100759. // "description": "Project ID for this request.",
  100760. // "location": "path",
  100761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100762. // "required": true,
  100763. // "type": "string"
  100764. // },
  100765. // "requestId": {
  100766. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100767. // "location": "query",
  100768. // "type": "string"
  100769. // },
  100770. // "targetHttpProxy": {
  100771. // "description": "Name of the TargetHttpProxy resource to delete.",
  100772. // "location": "path",
  100773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100774. // "required": true,
  100775. // "type": "string"
  100776. // }
  100777. // },
  100778. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  100779. // "response": {
  100780. // "$ref": "Operation"
  100781. // },
  100782. // "scopes": [
  100783. // "https://www.googleapis.com/auth/cloud-platform",
  100784. // "https://www.googleapis.com/auth/compute"
  100785. // ]
  100786. // }
  100787. }
  100788. // method id "compute.targetHttpProxies.get":
  100789. type TargetHttpProxiesGetCall struct {
  100790. s *Service
  100791. project string
  100792. targetHttpProxy string
  100793. urlParams_ gensupport.URLParams
  100794. ifNoneMatch_ string
  100795. ctx_ context.Context
  100796. header_ http.Header
  100797. }
  100798. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  100799. // available target HTTP proxies by making a list() request.
  100800. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  100801. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  100802. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100803. c.project = project
  100804. c.targetHttpProxy = targetHttpProxy
  100805. return c
  100806. }
  100807. // Fields allows partial responses to be retrieved. See
  100808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100809. // for more information.
  100810. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  100811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100812. return c
  100813. }
  100814. // IfNoneMatch sets the optional parameter which makes the operation
  100815. // fail if the object's ETag matches the given value. This is useful for
  100816. // getting updates only after the object has changed since the last
  100817. // request. Use googleapi.IsNotModified to check whether the response
  100818. // error from Do is the result of In-None-Match.
  100819. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  100820. c.ifNoneMatch_ = entityTag
  100821. return c
  100822. }
  100823. // Context sets the context to be used in this call's Do method. Any
  100824. // pending HTTP request will be aborted if the provided context is
  100825. // canceled.
  100826. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  100827. c.ctx_ = ctx
  100828. return c
  100829. }
  100830. // Header returns an http.Header that can be modified by the caller to
  100831. // add HTTP headers to the request.
  100832. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  100833. if c.header_ == nil {
  100834. c.header_ = make(http.Header)
  100835. }
  100836. return c.header_
  100837. }
  100838. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  100839. reqHeaders := make(http.Header)
  100840. for k, v := range c.header_ {
  100841. reqHeaders[k] = v
  100842. }
  100843. reqHeaders.Set("User-Agent", c.s.userAgent())
  100844. if c.ifNoneMatch_ != "" {
  100845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100846. }
  100847. var body io.Reader = nil
  100848. c.urlParams_.Set("alt", alt)
  100849. c.urlParams_.Set("prettyPrint", "false")
  100850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  100851. urls += "?" + c.urlParams_.Encode()
  100852. req, err := http.NewRequest("GET", urls, body)
  100853. if err != nil {
  100854. return nil, err
  100855. }
  100856. req.Header = reqHeaders
  100857. googleapi.Expand(req.URL, map[string]string{
  100858. "project": c.project,
  100859. "targetHttpProxy": c.targetHttpProxy,
  100860. })
  100861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100862. }
  100863. // Do executes the "compute.targetHttpProxies.get" call.
  100864. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  100865. // status code is an error. Response headers are in either
  100866. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  100867. // at all) in error.(*googleapi.Error).Header. Use
  100868. // googleapi.IsNotModified to check whether the returned error was
  100869. // because http.StatusNotModified was returned.
  100870. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  100871. gensupport.SetOptions(c.urlParams_, opts...)
  100872. res, err := c.doRequest("json")
  100873. if res != nil && res.StatusCode == http.StatusNotModified {
  100874. if res.Body != nil {
  100875. res.Body.Close()
  100876. }
  100877. return nil, &googleapi.Error{
  100878. Code: res.StatusCode,
  100879. Header: res.Header,
  100880. }
  100881. }
  100882. if err != nil {
  100883. return nil, err
  100884. }
  100885. defer googleapi.CloseBody(res)
  100886. if err := googleapi.CheckResponse(res); err != nil {
  100887. return nil, err
  100888. }
  100889. ret := &TargetHttpProxy{
  100890. ServerResponse: googleapi.ServerResponse{
  100891. Header: res.Header,
  100892. HTTPStatusCode: res.StatusCode,
  100893. },
  100894. }
  100895. target := &ret
  100896. if err := gensupport.DecodeResponse(target, res); err != nil {
  100897. return nil, err
  100898. }
  100899. return ret, nil
  100900. // {
  100901. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  100902. // "httpMethod": "GET",
  100903. // "id": "compute.targetHttpProxies.get",
  100904. // "parameterOrder": [
  100905. // "project",
  100906. // "targetHttpProxy"
  100907. // ],
  100908. // "parameters": {
  100909. // "project": {
  100910. // "description": "Project ID for this request.",
  100911. // "location": "path",
  100912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100913. // "required": true,
  100914. // "type": "string"
  100915. // },
  100916. // "targetHttpProxy": {
  100917. // "description": "Name of the TargetHttpProxy resource to return.",
  100918. // "location": "path",
  100919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100920. // "required": true,
  100921. // "type": "string"
  100922. // }
  100923. // },
  100924. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  100925. // "response": {
  100926. // "$ref": "TargetHttpProxy"
  100927. // },
  100928. // "scopes": [
  100929. // "https://www.googleapis.com/auth/cloud-platform",
  100930. // "https://www.googleapis.com/auth/compute",
  100931. // "https://www.googleapis.com/auth/compute.readonly"
  100932. // ]
  100933. // }
  100934. }
  100935. // method id "compute.targetHttpProxies.insert":
  100936. type TargetHttpProxiesInsertCall struct {
  100937. s *Service
  100938. project string
  100939. targethttpproxy *TargetHttpProxy
  100940. urlParams_ gensupport.URLParams
  100941. ctx_ context.Context
  100942. header_ http.Header
  100943. }
  100944. // Insert: Creates a TargetHttpProxy resource in the specified project
  100945. // using the data included in the request.
  100946. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  100947. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  100948. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100949. c.project = project
  100950. c.targethttpproxy = targethttpproxy
  100951. return c
  100952. }
  100953. // RequestId sets the optional parameter "requestId": An optional
  100954. // request ID to identify requests. Specify a unique request ID so that
  100955. // if you must retry your request, the server will know to ignore the
  100956. // request if it has already been completed.
  100957. //
  100958. // For example, consider a situation where you make an initial request
  100959. // and the request times out. If you make the request again with the
  100960. // same request ID, the server can check if original operation with the
  100961. // same request ID was received, and if so, will ignore the second
  100962. // request. This prevents clients from accidentally creating duplicate
  100963. // commitments.
  100964. //
  100965. // The request ID must be a valid UUID with the exception that zero UUID
  100966. // is not supported (00000000-0000-0000-0000-000000000000).
  100967. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  100968. c.urlParams_.Set("requestId", requestId)
  100969. return c
  100970. }
  100971. // Fields allows partial responses to be retrieved. See
  100972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100973. // for more information.
  100974. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  100975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100976. return c
  100977. }
  100978. // Context sets the context to be used in this call's Do method. Any
  100979. // pending HTTP request will be aborted if the provided context is
  100980. // canceled.
  100981. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  100982. c.ctx_ = ctx
  100983. return c
  100984. }
  100985. // Header returns an http.Header that can be modified by the caller to
  100986. // add HTTP headers to the request.
  100987. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  100988. if c.header_ == nil {
  100989. c.header_ = make(http.Header)
  100990. }
  100991. return c.header_
  100992. }
  100993. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  100994. reqHeaders := make(http.Header)
  100995. for k, v := range c.header_ {
  100996. reqHeaders[k] = v
  100997. }
  100998. reqHeaders.Set("User-Agent", c.s.userAgent())
  100999. var body io.Reader = nil
  101000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  101001. if err != nil {
  101002. return nil, err
  101003. }
  101004. reqHeaders.Set("Content-Type", "application/json")
  101005. c.urlParams_.Set("alt", alt)
  101006. c.urlParams_.Set("prettyPrint", "false")
  101007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  101008. urls += "?" + c.urlParams_.Encode()
  101009. req, err := http.NewRequest("POST", urls, body)
  101010. if err != nil {
  101011. return nil, err
  101012. }
  101013. req.Header = reqHeaders
  101014. googleapi.Expand(req.URL, map[string]string{
  101015. "project": c.project,
  101016. })
  101017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101018. }
  101019. // Do executes the "compute.targetHttpProxies.insert" call.
  101020. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101021. // status code is an error. Response headers are in either
  101022. // *Operation.ServerResponse.Header or (if a response was returned at
  101023. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101024. // to check whether the returned error was because
  101025. // http.StatusNotModified was returned.
  101026. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101027. gensupport.SetOptions(c.urlParams_, opts...)
  101028. res, err := c.doRequest("json")
  101029. if res != nil && res.StatusCode == http.StatusNotModified {
  101030. if res.Body != nil {
  101031. res.Body.Close()
  101032. }
  101033. return nil, &googleapi.Error{
  101034. Code: res.StatusCode,
  101035. Header: res.Header,
  101036. }
  101037. }
  101038. if err != nil {
  101039. return nil, err
  101040. }
  101041. defer googleapi.CloseBody(res)
  101042. if err := googleapi.CheckResponse(res); err != nil {
  101043. return nil, err
  101044. }
  101045. ret := &Operation{
  101046. ServerResponse: googleapi.ServerResponse{
  101047. Header: res.Header,
  101048. HTTPStatusCode: res.StatusCode,
  101049. },
  101050. }
  101051. target := &ret
  101052. if err := gensupport.DecodeResponse(target, res); err != nil {
  101053. return nil, err
  101054. }
  101055. return ret, nil
  101056. // {
  101057. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  101058. // "httpMethod": "POST",
  101059. // "id": "compute.targetHttpProxies.insert",
  101060. // "parameterOrder": [
  101061. // "project"
  101062. // ],
  101063. // "parameters": {
  101064. // "project": {
  101065. // "description": "Project ID for this request.",
  101066. // "location": "path",
  101067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101068. // "required": true,
  101069. // "type": "string"
  101070. // },
  101071. // "requestId": {
  101072. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101073. // "location": "query",
  101074. // "type": "string"
  101075. // }
  101076. // },
  101077. // "path": "{project}/global/targetHttpProxies",
  101078. // "request": {
  101079. // "$ref": "TargetHttpProxy"
  101080. // },
  101081. // "response": {
  101082. // "$ref": "Operation"
  101083. // },
  101084. // "scopes": [
  101085. // "https://www.googleapis.com/auth/cloud-platform",
  101086. // "https://www.googleapis.com/auth/compute"
  101087. // ]
  101088. // }
  101089. }
  101090. // method id "compute.targetHttpProxies.list":
  101091. type TargetHttpProxiesListCall struct {
  101092. s *Service
  101093. project string
  101094. urlParams_ gensupport.URLParams
  101095. ifNoneMatch_ string
  101096. ctx_ context.Context
  101097. header_ http.Header
  101098. }
  101099. // List: Retrieves the list of TargetHttpProxy resources available to
  101100. // the specified project.
  101101. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  101102. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  101103. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101104. c.project = project
  101105. return c
  101106. }
  101107. // Filter sets the optional parameter "filter": A filter expression that
  101108. // filters resources listed in the response. The expression must specify
  101109. // the field name, a comparison operator, and the value that you want to
  101110. // use for filtering. The value must be a string, a number, or a
  101111. // boolean. The comparison operator must be either =, !=, >, or <.
  101112. //
  101113. // For example, if you are filtering Compute Engine instances, you can
  101114. // exclude instances named example-instance by specifying name !=
  101115. // example-instance.
  101116. //
  101117. // You can also filter nested fields. For example, you could specify
  101118. // scheduling.automaticRestart = false to include instances only if they
  101119. // are not scheduled for automatic restarts. You can use filtering on
  101120. // nested fields to filter based on resource labels.
  101121. //
  101122. // To filter on multiple expressions, provide each separate expression
  101123. // within parentheses. For example, (scheduling.automaticRestart = true)
  101124. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101125. // AND expression. However, you can include AND and OR expressions
  101126. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101127. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101128. // true).
  101129. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  101130. c.urlParams_.Set("filter", filter)
  101131. return c
  101132. }
  101133. // MaxResults sets the optional parameter "maxResults": The maximum
  101134. // number of results per page that should be returned. If the number of
  101135. // available results is larger than maxResults, Compute Engine returns a
  101136. // nextPageToken that can be used to get the next page of results in
  101137. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101138. // (Default: 500)
  101139. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  101140. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101141. return c
  101142. }
  101143. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101144. // a certain order. By default, results are returned in alphanumerical
  101145. // order based on the resource name.
  101146. //
  101147. // You can also sort results in descending order based on the creation
  101148. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101149. // based on the creationTimestamp field in reverse chronological order
  101150. // (newest result first). Use this to sort resources like operations so
  101151. // that the newest operation is returned first.
  101152. //
  101153. // Currently, only sorting by name or creationTimestamp desc is
  101154. // supported.
  101155. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  101156. c.urlParams_.Set("orderBy", orderBy)
  101157. return c
  101158. }
  101159. // PageToken sets the optional parameter "pageToken": Specifies a page
  101160. // token to use. Set pageToken to the nextPageToken returned by a
  101161. // previous list request to get the next page of results.
  101162. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  101163. c.urlParams_.Set("pageToken", pageToken)
  101164. return c
  101165. }
  101166. // Fields allows partial responses to be retrieved. See
  101167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101168. // for more information.
  101169. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  101170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101171. return c
  101172. }
  101173. // IfNoneMatch sets the optional parameter which makes the operation
  101174. // fail if the object's ETag matches the given value. This is useful for
  101175. // getting updates only after the object has changed since the last
  101176. // request. Use googleapi.IsNotModified to check whether the response
  101177. // error from Do is the result of In-None-Match.
  101178. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  101179. c.ifNoneMatch_ = entityTag
  101180. return c
  101181. }
  101182. // Context sets the context to be used in this call's Do method. Any
  101183. // pending HTTP request will be aborted if the provided context is
  101184. // canceled.
  101185. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  101186. c.ctx_ = ctx
  101187. return c
  101188. }
  101189. // Header returns an http.Header that can be modified by the caller to
  101190. // add HTTP headers to the request.
  101191. func (c *TargetHttpProxiesListCall) Header() http.Header {
  101192. if c.header_ == nil {
  101193. c.header_ = make(http.Header)
  101194. }
  101195. return c.header_
  101196. }
  101197. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  101198. reqHeaders := make(http.Header)
  101199. for k, v := range c.header_ {
  101200. reqHeaders[k] = v
  101201. }
  101202. reqHeaders.Set("User-Agent", c.s.userAgent())
  101203. if c.ifNoneMatch_ != "" {
  101204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101205. }
  101206. var body io.Reader = nil
  101207. c.urlParams_.Set("alt", alt)
  101208. c.urlParams_.Set("prettyPrint", "false")
  101209. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  101210. urls += "?" + c.urlParams_.Encode()
  101211. req, err := http.NewRequest("GET", urls, body)
  101212. if err != nil {
  101213. return nil, err
  101214. }
  101215. req.Header = reqHeaders
  101216. googleapi.Expand(req.URL, map[string]string{
  101217. "project": c.project,
  101218. })
  101219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101220. }
  101221. // Do executes the "compute.targetHttpProxies.list" call.
  101222. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  101223. // non-2xx status code is an error. Response headers are in either
  101224. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  101225. // returned at all) in error.(*googleapi.Error).Header. Use
  101226. // googleapi.IsNotModified to check whether the returned error was
  101227. // because http.StatusNotModified was returned.
  101228. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  101229. gensupport.SetOptions(c.urlParams_, opts...)
  101230. res, err := c.doRequest("json")
  101231. if res != nil && res.StatusCode == http.StatusNotModified {
  101232. if res.Body != nil {
  101233. res.Body.Close()
  101234. }
  101235. return nil, &googleapi.Error{
  101236. Code: res.StatusCode,
  101237. Header: res.Header,
  101238. }
  101239. }
  101240. if err != nil {
  101241. return nil, err
  101242. }
  101243. defer googleapi.CloseBody(res)
  101244. if err := googleapi.CheckResponse(res); err != nil {
  101245. return nil, err
  101246. }
  101247. ret := &TargetHttpProxyList{
  101248. ServerResponse: googleapi.ServerResponse{
  101249. Header: res.Header,
  101250. HTTPStatusCode: res.StatusCode,
  101251. },
  101252. }
  101253. target := &ret
  101254. if err := gensupport.DecodeResponse(target, res); err != nil {
  101255. return nil, err
  101256. }
  101257. return ret, nil
  101258. // {
  101259. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  101260. // "httpMethod": "GET",
  101261. // "id": "compute.targetHttpProxies.list",
  101262. // "parameterOrder": [
  101263. // "project"
  101264. // ],
  101265. // "parameters": {
  101266. // "filter": {
  101267. // "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).",
  101268. // "location": "query",
  101269. // "type": "string"
  101270. // },
  101271. // "maxResults": {
  101272. // "default": "500",
  101273. // "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)",
  101274. // "format": "uint32",
  101275. // "location": "query",
  101276. // "minimum": "0",
  101277. // "type": "integer"
  101278. // },
  101279. // "orderBy": {
  101280. // "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.",
  101281. // "location": "query",
  101282. // "type": "string"
  101283. // },
  101284. // "pageToken": {
  101285. // "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.",
  101286. // "location": "query",
  101287. // "type": "string"
  101288. // },
  101289. // "project": {
  101290. // "description": "Project ID for this request.",
  101291. // "location": "path",
  101292. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101293. // "required": true,
  101294. // "type": "string"
  101295. // }
  101296. // },
  101297. // "path": "{project}/global/targetHttpProxies",
  101298. // "response": {
  101299. // "$ref": "TargetHttpProxyList"
  101300. // },
  101301. // "scopes": [
  101302. // "https://www.googleapis.com/auth/cloud-platform",
  101303. // "https://www.googleapis.com/auth/compute",
  101304. // "https://www.googleapis.com/auth/compute.readonly"
  101305. // ]
  101306. // }
  101307. }
  101308. // Pages invokes f for each page of results.
  101309. // A non-nil error returned from f will halt the iteration.
  101310. // The provided context supersedes any context provided to the Context method.
  101311. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  101312. c.ctx_ = ctx
  101313. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101314. for {
  101315. x, err := c.Do()
  101316. if err != nil {
  101317. return err
  101318. }
  101319. if err := f(x); err != nil {
  101320. return err
  101321. }
  101322. if x.NextPageToken == "" {
  101323. return nil
  101324. }
  101325. c.PageToken(x.NextPageToken)
  101326. }
  101327. }
  101328. // method id "compute.targetHttpProxies.setUrlMap":
  101329. type TargetHttpProxiesSetUrlMapCall struct {
  101330. s *Service
  101331. project string
  101332. targetHttpProxy string
  101333. urlmapreference *UrlMapReference
  101334. urlParams_ gensupport.URLParams
  101335. ctx_ context.Context
  101336. header_ http.Header
  101337. }
  101338. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  101339. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  101340. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  101341. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101342. c.project = project
  101343. c.targetHttpProxy = targetHttpProxy
  101344. c.urlmapreference = urlmapreference
  101345. return c
  101346. }
  101347. // RequestId sets the optional parameter "requestId": An optional
  101348. // request ID to identify requests. Specify a unique request ID so that
  101349. // if you must retry your request, the server will know to ignore the
  101350. // request if it has already been completed.
  101351. //
  101352. // For example, consider a situation where you make an initial request
  101353. // and the request times out. If you make the request again with the
  101354. // same request ID, the server can check if original operation with the
  101355. // same request ID was received, and if so, will ignore the second
  101356. // request. This prevents clients from accidentally creating duplicate
  101357. // commitments.
  101358. //
  101359. // The request ID must be a valid UUID with the exception that zero UUID
  101360. // is not supported (00000000-0000-0000-0000-000000000000).
  101361. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  101362. c.urlParams_.Set("requestId", requestId)
  101363. return c
  101364. }
  101365. // Fields allows partial responses to be retrieved. See
  101366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101367. // for more information.
  101368. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  101369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101370. return c
  101371. }
  101372. // Context sets the context to be used in this call's Do method. Any
  101373. // pending HTTP request will be aborted if the provided context is
  101374. // canceled.
  101375. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  101376. c.ctx_ = ctx
  101377. return c
  101378. }
  101379. // Header returns an http.Header that can be modified by the caller to
  101380. // add HTTP headers to the request.
  101381. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  101382. if c.header_ == nil {
  101383. c.header_ = make(http.Header)
  101384. }
  101385. return c.header_
  101386. }
  101387. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  101388. reqHeaders := make(http.Header)
  101389. for k, v := range c.header_ {
  101390. reqHeaders[k] = v
  101391. }
  101392. reqHeaders.Set("User-Agent", c.s.userAgent())
  101393. var body io.Reader = nil
  101394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  101395. if err != nil {
  101396. return nil, err
  101397. }
  101398. reqHeaders.Set("Content-Type", "application/json")
  101399. c.urlParams_.Set("alt", alt)
  101400. c.urlParams_.Set("prettyPrint", "false")
  101401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  101402. urls += "?" + c.urlParams_.Encode()
  101403. req, err := http.NewRequest("POST", urls, body)
  101404. if err != nil {
  101405. return nil, err
  101406. }
  101407. req.Header = reqHeaders
  101408. googleapi.Expand(req.URL, map[string]string{
  101409. "project": c.project,
  101410. "targetHttpProxy": c.targetHttpProxy,
  101411. })
  101412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101413. }
  101414. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  101415. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101416. // status code is an error. Response headers are in either
  101417. // *Operation.ServerResponse.Header or (if a response was returned at
  101418. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101419. // to check whether the returned error was because
  101420. // http.StatusNotModified was returned.
  101421. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101422. gensupport.SetOptions(c.urlParams_, opts...)
  101423. res, err := c.doRequest("json")
  101424. if res != nil && res.StatusCode == http.StatusNotModified {
  101425. if res.Body != nil {
  101426. res.Body.Close()
  101427. }
  101428. return nil, &googleapi.Error{
  101429. Code: res.StatusCode,
  101430. Header: res.Header,
  101431. }
  101432. }
  101433. if err != nil {
  101434. return nil, err
  101435. }
  101436. defer googleapi.CloseBody(res)
  101437. if err := googleapi.CheckResponse(res); err != nil {
  101438. return nil, err
  101439. }
  101440. ret := &Operation{
  101441. ServerResponse: googleapi.ServerResponse{
  101442. Header: res.Header,
  101443. HTTPStatusCode: res.StatusCode,
  101444. },
  101445. }
  101446. target := &ret
  101447. if err := gensupport.DecodeResponse(target, res); err != nil {
  101448. return nil, err
  101449. }
  101450. return ret, nil
  101451. // {
  101452. // "description": "Changes the URL map for TargetHttpProxy.",
  101453. // "httpMethod": "POST",
  101454. // "id": "compute.targetHttpProxies.setUrlMap",
  101455. // "parameterOrder": [
  101456. // "project",
  101457. // "targetHttpProxy"
  101458. // ],
  101459. // "parameters": {
  101460. // "project": {
  101461. // "description": "Project ID for this request.",
  101462. // "location": "path",
  101463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101464. // "required": true,
  101465. // "type": "string"
  101466. // },
  101467. // "requestId": {
  101468. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101469. // "location": "query",
  101470. // "type": "string"
  101471. // },
  101472. // "targetHttpProxy": {
  101473. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  101474. // "location": "path",
  101475. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101476. // "required": true,
  101477. // "type": "string"
  101478. // }
  101479. // },
  101480. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  101481. // "request": {
  101482. // "$ref": "UrlMapReference"
  101483. // },
  101484. // "response": {
  101485. // "$ref": "Operation"
  101486. // },
  101487. // "scopes": [
  101488. // "https://www.googleapis.com/auth/cloud-platform",
  101489. // "https://www.googleapis.com/auth/compute"
  101490. // ]
  101491. // }
  101492. }
  101493. // method id "compute.targetHttpProxies.testIamPermissions":
  101494. type TargetHttpProxiesTestIamPermissionsCall struct {
  101495. s *Service
  101496. project string
  101497. resource string
  101498. testpermissionsrequest *TestPermissionsRequest
  101499. urlParams_ gensupport.URLParams
  101500. ctx_ context.Context
  101501. header_ http.Header
  101502. }
  101503. // TestIamPermissions: Returns permissions that a caller has on the
  101504. // specified resource.
  101505. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  101506. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101507. c.project = project
  101508. c.resource = resource
  101509. c.testpermissionsrequest = testpermissionsrequest
  101510. return c
  101511. }
  101512. // Fields allows partial responses to be retrieved. See
  101513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101514. // for more information.
  101515. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  101516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101517. return c
  101518. }
  101519. // Context sets the context to be used in this call's Do method. Any
  101520. // pending HTTP request will be aborted if the provided context is
  101521. // canceled.
  101522. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  101523. c.ctx_ = ctx
  101524. return c
  101525. }
  101526. // Header returns an http.Header that can be modified by the caller to
  101527. // add HTTP headers to the request.
  101528. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  101529. if c.header_ == nil {
  101530. c.header_ = make(http.Header)
  101531. }
  101532. return c.header_
  101533. }
  101534. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101535. reqHeaders := make(http.Header)
  101536. for k, v := range c.header_ {
  101537. reqHeaders[k] = v
  101538. }
  101539. reqHeaders.Set("User-Agent", c.s.userAgent())
  101540. var body io.Reader = nil
  101541. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101542. if err != nil {
  101543. return nil, err
  101544. }
  101545. reqHeaders.Set("Content-Type", "application/json")
  101546. c.urlParams_.Set("alt", alt)
  101547. c.urlParams_.Set("prettyPrint", "false")
  101548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  101549. urls += "?" + c.urlParams_.Encode()
  101550. req, err := http.NewRequest("POST", urls, body)
  101551. if err != nil {
  101552. return nil, err
  101553. }
  101554. req.Header = reqHeaders
  101555. googleapi.Expand(req.URL, map[string]string{
  101556. "project": c.project,
  101557. "resource": c.resource,
  101558. })
  101559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101560. }
  101561. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  101562. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101563. // non-2xx status code is an error. Response headers are in either
  101564. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101565. // returned at all) in error.(*googleapi.Error).Header. Use
  101566. // googleapi.IsNotModified to check whether the returned error was
  101567. // because http.StatusNotModified was returned.
  101568. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  101569. gensupport.SetOptions(c.urlParams_, opts...)
  101570. res, err := c.doRequest("json")
  101571. if res != nil && res.StatusCode == http.StatusNotModified {
  101572. if res.Body != nil {
  101573. res.Body.Close()
  101574. }
  101575. return nil, &googleapi.Error{
  101576. Code: res.StatusCode,
  101577. Header: res.Header,
  101578. }
  101579. }
  101580. if err != nil {
  101581. return nil, err
  101582. }
  101583. defer googleapi.CloseBody(res)
  101584. if err := googleapi.CheckResponse(res); err != nil {
  101585. return nil, err
  101586. }
  101587. ret := &TestPermissionsResponse{
  101588. ServerResponse: googleapi.ServerResponse{
  101589. Header: res.Header,
  101590. HTTPStatusCode: res.StatusCode,
  101591. },
  101592. }
  101593. target := &ret
  101594. if err := gensupport.DecodeResponse(target, res); err != nil {
  101595. return nil, err
  101596. }
  101597. return ret, nil
  101598. // {
  101599. // "description": "Returns permissions that a caller has on the specified resource.",
  101600. // "httpMethod": "POST",
  101601. // "id": "compute.targetHttpProxies.testIamPermissions",
  101602. // "parameterOrder": [
  101603. // "project",
  101604. // "resource"
  101605. // ],
  101606. // "parameters": {
  101607. // "project": {
  101608. // "description": "Project ID for this request.",
  101609. // "location": "path",
  101610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101611. // "required": true,
  101612. // "type": "string"
  101613. // },
  101614. // "resource": {
  101615. // "description": "Name or id of the resource for this request.",
  101616. // "location": "path",
  101617. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101618. // "required": true,
  101619. // "type": "string"
  101620. // }
  101621. // },
  101622. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  101623. // "request": {
  101624. // "$ref": "TestPermissionsRequest"
  101625. // },
  101626. // "response": {
  101627. // "$ref": "TestPermissionsResponse"
  101628. // },
  101629. // "scopes": [
  101630. // "https://www.googleapis.com/auth/cloud-platform",
  101631. // "https://www.googleapis.com/auth/compute",
  101632. // "https://www.googleapis.com/auth/compute.readonly"
  101633. // ]
  101634. // }
  101635. }
  101636. // method id "compute.targetHttpsProxies.delete":
  101637. type TargetHttpsProxiesDeleteCall struct {
  101638. s *Service
  101639. project string
  101640. targetHttpsProxy string
  101641. urlParams_ gensupport.URLParams
  101642. ctx_ context.Context
  101643. header_ http.Header
  101644. }
  101645. // Delete: Deletes the specified TargetHttpsProxy resource.
  101646. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  101647. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101648. c.project = project
  101649. c.targetHttpsProxy = targetHttpsProxy
  101650. return c
  101651. }
  101652. // RequestId sets the optional parameter "requestId": An optional
  101653. // request ID to identify requests. Specify a unique request ID so that
  101654. // if you must retry your request, the server will know to ignore the
  101655. // request if it has already been completed.
  101656. //
  101657. // For example, consider a situation where you make an initial request
  101658. // and the request times out. If you make the request again with the
  101659. // same request ID, the server can check if original operation with the
  101660. // same request ID was received, and if so, will ignore the second
  101661. // request. This prevents clients from accidentally creating duplicate
  101662. // commitments.
  101663. //
  101664. // The request ID must be a valid UUID with the exception that zero UUID
  101665. // is not supported (00000000-0000-0000-0000-000000000000).
  101666. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  101667. c.urlParams_.Set("requestId", requestId)
  101668. return c
  101669. }
  101670. // Fields allows partial responses to be retrieved. See
  101671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101672. // for more information.
  101673. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  101674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101675. return c
  101676. }
  101677. // Context sets the context to be used in this call's Do method. Any
  101678. // pending HTTP request will be aborted if the provided context is
  101679. // canceled.
  101680. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  101681. c.ctx_ = ctx
  101682. return c
  101683. }
  101684. // Header returns an http.Header that can be modified by the caller to
  101685. // add HTTP headers to the request.
  101686. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  101687. if c.header_ == nil {
  101688. c.header_ = make(http.Header)
  101689. }
  101690. return c.header_
  101691. }
  101692. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  101693. reqHeaders := make(http.Header)
  101694. for k, v := range c.header_ {
  101695. reqHeaders[k] = v
  101696. }
  101697. reqHeaders.Set("User-Agent", c.s.userAgent())
  101698. var body io.Reader = nil
  101699. c.urlParams_.Set("alt", alt)
  101700. c.urlParams_.Set("prettyPrint", "false")
  101701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  101702. urls += "?" + c.urlParams_.Encode()
  101703. req, err := http.NewRequest("DELETE", urls, body)
  101704. if err != nil {
  101705. return nil, err
  101706. }
  101707. req.Header = reqHeaders
  101708. googleapi.Expand(req.URL, map[string]string{
  101709. "project": c.project,
  101710. "targetHttpsProxy": c.targetHttpsProxy,
  101711. })
  101712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101713. }
  101714. // Do executes the "compute.targetHttpsProxies.delete" call.
  101715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101716. // status code is an error. Response headers are in either
  101717. // *Operation.ServerResponse.Header or (if a response was returned at
  101718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101719. // to check whether the returned error was because
  101720. // http.StatusNotModified was returned.
  101721. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101722. gensupport.SetOptions(c.urlParams_, opts...)
  101723. res, err := c.doRequest("json")
  101724. if res != nil && res.StatusCode == http.StatusNotModified {
  101725. if res.Body != nil {
  101726. res.Body.Close()
  101727. }
  101728. return nil, &googleapi.Error{
  101729. Code: res.StatusCode,
  101730. Header: res.Header,
  101731. }
  101732. }
  101733. if err != nil {
  101734. return nil, err
  101735. }
  101736. defer googleapi.CloseBody(res)
  101737. if err := googleapi.CheckResponse(res); err != nil {
  101738. return nil, err
  101739. }
  101740. ret := &Operation{
  101741. ServerResponse: googleapi.ServerResponse{
  101742. Header: res.Header,
  101743. HTTPStatusCode: res.StatusCode,
  101744. },
  101745. }
  101746. target := &ret
  101747. if err := gensupport.DecodeResponse(target, res); err != nil {
  101748. return nil, err
  101749. }
  101750. return ret, nil
  101751. // {
  101752. // "description": "Deletes the specified TargetHttpsProxy resource.",
  101753. // "httpMethod": "DELETE",
  101754. // "id": "compute.targetHttpsProxies.delete",
  101755. // "parameterOrder": [
  101756. // "project",
  101757. // "targetHttpsProxy"
  101758. // ],
  101759. // "parameters": {
  101760. // "project": {
  101761. // "description": "Project ID for this request.",
  101762. // "location": "path",
  101763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101764. // "required": true,
  101765. // "type": "string"
  101766. // },
  101767. // "requestId": {
  101768. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101769. // "location": "query",
  101770. // "type": "string"
  101771. // },
  101772. // "targetHttpsProxy": {
  101773. // "description": "Name of the TargetHttpsProxy resource to delete.",
  101774. // "location": "path",
  101775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101776. // "required": true,
  101777. // "type": "string"
  101778. // }
  101779. // },
  101780. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  101781. // "response": {
  101782. // "$ref": "Operation"
  101783. // },
  101784. // "scopes": [
  101785. // "https://www.googleapis.com/auth/cloud-platform",
  101786. // "https://www.googleapis.com/auth/compute"
  101787. // ]
  101788. // }
  101789. }
  101790. // method id "compute.targetHttpsProxies.get":
  101791. type TargetHttpsProxiesGetCall struct {
  101792. s *Service
  101793. project string
  101794. targetHttpsProxy string
  101795. urlParams_ gensupport.URLParams
  101796. ifNoneMatch_ string
  101797. ctx_ context.Context
  101798. header_ http.Header
  101799. }
  101800. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  101801. // available target HTTPS proxies by making a list() request.
  101802. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  101803. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101804. c.project = project
  101805. c.targetHttpsProxy = targetHttpsProxy
  101806. return c
  101807. }
  101808. // Fields allows partial responses to be retrieved. See
  101809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101810. // for more information.
  101811. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  101812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101813. return c
  101814. }
  101815. // IfNoneMatch sets the optional parameter which makes the operation
  101816. // fail if the object's ETag matches the given value. This is useful for
  101817. // getting updates only after the object has changed since the last
  101818. // request. Use googleapi.IsNotModified to check whether the response
  101819. // error from Do is the result of In-None-Match.
  101820. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  101821. c.ifNoneMatch_ = entityTag
  101822. return c
  101823. }
  101824. // Context sets the context to be used in this call's Do method. Any
  101825. // pending HTTP request will be aborted if the provided context is
  101826. // canceled.
  101827. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  101828. c.ctx_ = ctx
  101829. return c
  101830. }
  101831. // Header returns an http.Header that can be modified by the caller to
  101832. // add HTTP headers to the request.
  101833. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  101834. if c.header_ == nil {
  101835. c.header_ = make(http.Header)
  101836. }
  101837. return c.header_
  101838. }
  101839. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  101840. reqHeaders := make(http.Header)
  101841. for k, v := range c.header_ {
  101842. reqHeaders[k] = v
  101843. }
  101844. reqHeaders.Set("User-Agent", c.s.userAgent())
  101845. if c.ifNoneMatch_ != "" {
  101846. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101847. }
  101848. var body io.Reader = nil
  101849. c.urlParams_.Set("alt", alt)
  101850. c.urlParams_.Set("prettyPrint", "false")
  101851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  101852. urls += "?" + c.urlParams_.Encode()
  101853. req, err := http.NewRequest("GET", urls, body)
  101854. if err != nil {
  101855. return nil, err
  101856. }
  101857. req.Header = reqHeaders
  101858. googleapi.Expand(req.URL, map[string]string{
  101859. "project": c.project,
  101860. "targetHttpsProxy": c.targetHttpsProxy,
  101861. })
  101862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101863. }
  101864. // Do executes the "compute.targetHttpsProxies.get" call.
  101865. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  101866. // non-2xx status code is an error. Response headers are in either
  101867. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  101868. // returned at all) in error.(*googleapi.Error).Header. Use
  101869. // googleapi.IsNotModified to check whether the returned error was
  101870. // because http.StatusNotModified was returned.
  101871. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  101872. gensupport.SetOptions(c.urlParams_, opts...)
  101873. res, err := c.doRequest("json")
  101874. if res != nil && res.StatusCode == http.StatusNotModified {
  101875. if res.Body != nil {
  101876. res.Body.Close()
  101877. }
  101878. return nil, &googleapi.Error{
  101879. Code: res.StatusCode,
  101880. Header: res.Header,
  101881. }
  101882. }
  101883. if err != nil {
  101884. return nil, err
  101885. }
  101886. defer googleapi.CloseBody(res)
  101887. if err := googleapi.CheckResponse(res); err != nil {
  101888. return nil, err
  101889. }
  101890. ret := &TargetHttpsProxy{
  101891. ServerResponse: googleapi.ServerResponse{
  101892. Header: res.Header,
  101893. HTTPStatusCode: res.StatusCode,
  101894. },
  101895. }
  101896. target := &ret
  101897. if err := gensupport.DecodeResponse(target, res); err != nil {
  101898. return nil, err
  101899. }
  101900. return ret, nil
  101901. // {
  101902. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  101903. // "httpMethod": "GET",
  101904. // "id": "compute.targetHttpsProxies.get",
  101905. // "parameterOrder": [
  101906. // "project",
  101907. // "targetHttpsProxy"
  101908. // ],
  101909. // "parameters": {
  101910. // "project": {
  101911. // "description": "Project ID for this request.",
  101912. // "location": "path",
  101913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101914. // "required": true,
  101915. // "type": "string"
  101916. // },
  101917. // "targetHttpsProxy": {
  101918. // "description": "Name of the TargetHttpsProxy resource to return.",
  101919. // "location": "path",
  101920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101921. // "required": true,
  101922. // "type": "string"
  101923. // }
  101924. // },
  101925. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  101926. // "response": {
  101927. // "$ref": "TargetHttpsProxy"
  101928. // },
  101929. // "scopes": [
  101930. // "https://www.googleapis.com/auth/cloud-platform",
  101931. // "https://www.googleapis.com/auth/compute",
  101932. // "https://www.googleapis.com/auth/compute.readonly"
  101933. // ]
  101934. // }
  101935. }
  101936. // method id "compute.targetHttpsProxies.insert":
  101937. type TargetHttpsProxiesInsertCall struct {
  101938. s *Service
  101939. project string
  101940. targethttpsproxy *TargetHttpsProxy
  101941. urlParams_ gensupport.URLParams
  101942. ctx_ context.Context
  101943. header_ http.Header
  101944. }
  101945. // Insert: Creates a TargetHttpsProxy resource in the specified project
  101946. // using the data included in the request.
  101947. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  101948. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101949. c.project = project
  101950. c.targethttpsproxy = targethttpsproxy
  101951. return c
  101952. }
  101953. // RequestId sets the optional parameter "requestId": An optional
  101954. // request ID to identify requests. Specify a unique request ID so that
  101955. // if you must retry your request, the server will know to ignore the
  101956. // request if it has already been completed.
  101957. //
  101958. // For example, consider a situation where you make an initial request
  101959. // and the request times out. If you make the request again with the
  101960. // same request ID, the server can check if original operation with the
  101961. // same request ID was received, and if so, will ignore the second
  101962. // request. This prevents clients from accidentally creating duplicate
  101963. // commitments.
  101964. //
  101965. // The request ID must be a valid UUID with the exception that zero UUID
  101966. // is not supported (00000000-0000-0000-0000-000000000000).
  101967. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  101968. c.urlParams_.Set("requestId", requestId)
  101969. return c
  101970. }
  101971. // Fields allows partial responses to be retrieved. See
  101972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101973. // for more information.
  101974. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  101975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101976. return c
  101977. }
  101978. // Context sets the context to be used in this call's Do method. Any
  101979. // pending HTTP request will be aborted if the provided context is
  101980. // canceled.
  101981. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  101982. c.ctx_ = ctx
  101983. return c
  101984. }
  101985. // Header returns an http.Header that can be modified by the caller to
  101986. // add HTTP headers to the request.
  101987. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  101988. if c.header_ == nil {
  101989. c.header_ = make(http.Header)
  101990. }
  101991. return c.header_
  101992. }
  101993. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  101994. reqHeaders := make(http.Header)
  101995. for k, v := range c.header_ {
  101996. reqHeaders[k] = v
  101997. }
  101998. reqHeaders.Set("User-Agent", c.s.userAgent())
  101999. var body io.Reader = nil
  102000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  102001. if err != nil {
  102002. return nil, err
  102003. }
  102004. reqHeaders.Set("Content-Type", "application/json")
  102005. c.urlParams_.Set("alt", alt)
  102006. c.urlParams_.Set("prettyPrint", "false")
  102007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  102008. urls += "?" + c.urlParams_.Encode()
  102009. req, err := http.NewRequest("POST", urls, body)
  102010. if err != nil {
  102011. return nil, err
  102012. }
  102013. req.Header = reqHeaders
  102014. googleapi.Expand(req.URL, map[string]string{
  102015. "project": c.project,
  102016. })
  102017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102018. }
  102019. // Do executes the "compute.targetHttpsProxies.insert" call.
  102020. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102021. // status code is an error. Response headers are in either
  102022. // *Operation.ServerResponse.Header or (if a response was returned at
  102023. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102024. // to check whether the returned error was because
  102025. // http.StatusNotModified was returned.
  102026. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102027. gensupport.SetOptions(c.urlParams_, opts...)
  102028. res, err := c.doRequest("json")
  102029. if res != nil && res.StatusCode == http.StatusNotModified {
  102030. if res.Body != nil {
  102031. res.Body.Close()
  102032. }
  102033. return nil, &googleapi.Error{
  102034. Code: res.StatusCode,
  102035. Header: res.Header,
  102036. }
  102037. }
  102038. if err != nil {
  102039. return nil, err
  102040. }
  102041. defer googleapi.CloseBody(res)
  102042. if err := googleapi.CheckResponse(res); err != nil {
  102043. return nil, err
  102044. }
  102045. ret := &Operation{
  102046. ServerResponse: googleapi.ServerResponse{
  102047. Header: res.Header,
  102048. HTTPStatusCode: res.StatusCode,
  102049. },
  102050. }
  102051. target := &ret
  102052. if err := gensupport.DecodeResponse(target, res); err != nil {
  102053. return nil, err
  102054. }
  102055. return ret, nil
  102056. // {
  102057. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  102058. // "httpMethod": "POST",
  102059. // "id": "compute.targetHttpsProxies.insert",
  102060. // "parameterOrder": [
  102061. // "project"
  102062. // ],
  102063. // "parameters": {
  102064. // "project": {
  102065. // "description": "Project ID for this request.",
  102066. // "location": "path",
  102067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102068. // "required": true,
  102069. // "type": "string"
  102070. // },
  102071. // "requestId": {
  102072. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102073. // "location": "query",
  102074. // "type": "string"
  102075. // }
  102076. // },
  102077. // "path": "{project}/global/targetHttpsProxies",
  102078. // "request": {
  102079. // "$ref": "TargetHttpsProxy"
  102080. // },
  102081. // "response": {
  102082. // "$ref": "Operation"
  102083. // },
  102084. // "scopes": [
  102085. // "https://www.googleapis.com/auth/cloud-platform",
  102086. // "https://www.googleapis.com/auth/compute"
  102087. // ]
  102088. // }
  102089. }
  102090. // method id "compute.targetHttpsProxies.list":
  102091. type TargetHttpsProxiesListCall struct {
  102092. s *Service
  102093. project string
  102094. urlParams_ gensupport.URLParams
  102095. ifNoneMatch_ string
  102096. ctx_ context.Context
  102097. header_ http.Header
  102098. }
  102099. // List: Retrieves the list of TargetHttpsProxy resources available to
  102100. // the specified project.
  102101. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  102102. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102103. c.project = project
  102104. return c
  102105. }
  102106. // Filter sets the optional parameter "filter": A filter expression that
  102107. // filters resources listed in the response. The expression must specify
  102108. // the field name, a comparison operator, and the value that you want to
  102109. // use for filtering. The value must be a string, a number, or a
  102110. // boolean. The comparison operator must be either =, !=, >, or <.
  102111. //
  102112. // For example, if you are filtering Compute Engine instances, you can
  102113. // exclude instances named example-instance by specifying name !=
  102114. // example-instance.
  102115. //
  102116. // You can also filter nested fields. For example, you could specify
  102117. // scheduling.automaticRestart = false to include instances only if they
  102118. // are not scheduled for automatic restarts. You can use filtering on
  102119. // nested fields to filter based on resource labels.
  102120. //
  102121. // To filter on multiple expressions, provide each separate expression
  102122. // within parentheses. For example, (scheduling.automaticRestart = true)
  102123. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102124. // AND expression. However, you can include AND and OR expressions
  102125. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102126. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102127. // true).
  102128. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  102129. c.urlParams_.Set("filter", filter)
  102130. return c
  102131. }
  102132. // MaxResults sets the optional parameter "maxResults": The maximum
  102133. // number of results per page that should be returned. If the number of
  102134. // available results is larger than maxResults, Compute Engine returns a
  102135. // nextPageToken that can be used to get the next page of results in
  102136. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102137. // (Default: 500)
  102138. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  102139. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102140. return c
  102141. }
  102142. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102143. // a certain order. By default, results are returned in alphanumerical
  102144. // order based on the resource name.
  102145. //
  102146. // You can also sort results in descending order based on the creation
  102147. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102148. // based on the creationTimestamp field in reverse chronological order
  102149. // (newest result first). Use this to sort resources like operations so
  102150. // that the newest operation is returned first.
  102151. //
  102152. // Currently, only sorting by name or creationTimestamp desc is
  102153. // supported.
  102154. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  102155. c.urlParams_.Set("orderBy", orderBy)
  102156. return c
  102157. }
  102158. // PageToken sets the optional parameter "pageToken": Specifies a page
  102159. // token to use. Set pageToken to the nextPageToken returned by a
  102160. // previous list request to get the next page of results.
  102161. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  102162. c.urlParams_.Set("pageToken", pageToken)
  102163. return c
  102164. }
  102165. // Fields allows partial responses to be retrieved. See
  102166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102167. // for more information.
  102168. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  102169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102170. return c
  102171. }
  102172. // IfNoneMatch sets the optional parameter which makes the operation
  102173. // fail if the object's ETag matches the given value. This is useful for
  102174. // getting updates only after the object has changed since the last
  102175. // request. Use googleapi.IsNotModified to check whether the response
  102176. // error from Do is the result of In-None-Match.
  102177. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  102178. c.ifNoneMatch_ = entityTag
  102179. return c
  102180. }
  102181. // Context sets the context to be used in this call's Do method. Any
  102182. // pending HTTP request will be aborted if the provided context is
  102183. // canceled.
  102184. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  102185. c.ctx_ = ctx
  102186. return c
  102187. }
  102188. // Header returns an http.Header that can be modified by the caller to
  102189. // add HTTP headers to the request.
  102190. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  102191. if c.header_ == nil {
  102192. c.header_ = make(http.Header)
  102193. }
  102194. return c.header_
  102195. }
  102196. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  102197. reqHeaders := make(http.Header)
  102198. for k, v := range c.header_ {
  102199. reqHeaders[k] = v
  102200. }
  102201. reqHeaders.Set("User-Agent", c.s.userAgent())
  102202. if c.ifNoneMatch_ != "" {
  102203. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102204. }
  102205. var body io.Reader = nil
  102206. c.urlParams_.Set("alt", alt)
  102207. c.urlParams_.Set("prettyPrint", "false")
  102208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  102209. urls += "?" + c.urlParams_.Encode()
  102210. req, err := http.NewRequest("GET", urls, body)
  102211. if err != nil {
  102212. return nil, err
  102213. }
  102214. req.Header = reqHeaders
  102215. googleapi.Expand(req.URL, map[string]string{
  102216. "project": c.project,
  102217. })
  102218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102219. }
  102220. // Do executes the "compute.targetHttpsProxies.list" call.
  102221. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  102222. // non-2xx status code is an error. Response headers are in either
  102223. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  102224. // returned at all) in error.(*googleapi.Error).Header. Use
  102225. // googleapi.IsNotModified to check whether the returned error was
  102226. // because http.StatusNotModified was returned.
  102227. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  102228. gensupport.SetOptions(c.urlParams_, opts...)
  102229. res, err := c.doRequest("json")
  102230. if res != nil && res.StatusCode == http.StatusNotModified {
  102231. if res.Body != nil {
  102232. res.Body.Close()
  102233. }
  102234. return nil, &googleapi.Error{
  102235. Code: res.StatusCode,
  102236. Header: res.Header,
  102237. }
  102238. }
  102239. if err != nil {
  102240. return nil, err
  102241. }
  102242. defer googleapi.CloseBody(res)
  102243. if err := googleapi.CheckResponse(res); err != nil {
  102244. return nil, err
  102245. }
  102246. ret := &TargetHttpsProxyList{
  102247. ServerResponse: googleapi.ServerResponse{
  102248. Header: res.Header,
  102249. HTTPStatusCode: res.StatusCode,
  102250. },
  102251. }
  102252. target := &ret
  102253. if err := gensupport.DecodeResponse(target, res); err != nil {
  102254. return nil, err
  102255. }
  102256. return ret, nil
  102257. // {
  102258. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  102259. // "httpMethod": "GET",
  102260. // "id": "compute.targetHttpsProxies.list",
  102261. // "parameterOrder": [
  102262. // "project"
  102263. // ],
  102264. // "parameters": {
  102265. // "filter": {
  102266. // "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).",
  102267. // "location": "query",
  102268. // "type": "string"
  102269. // },
  102270. // "maxResults": {
  102271. // "default": "500",
  102272. // "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)",
  102273. // "format": "uint32",
  102274. // "location": "query",
  102275. // "minimum": "0",
  102276. // "type": "integer"
  102277. // },
  102278. // "orderBy": {
  102279. // "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.",
  102280. // "location": "query",
  102281. // "type": "string"
  102282. // },
  102283. // "pageToken": {
  102284. // "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.",
  102285. // "location": "query",
  102286. // "type": "string"
  102287. // },
  102288. // "project": {
  102289. // "description": "Project ID for this request.",
  102290. // "location": "path",
  102291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102292. // "required": true,
  102293. // "type": "string"
  102294. // }
  102295. // },
  102296. // "path": "{project}/global/targetHttpsProxies",
  102297. // "response": {
  102298. // "$ref": "TargetHttpsProxyList"
  102299. // },
  102300. // "scopes": [
  102301. // "https://www.googleapis.com/auth/cloud-platform",
  102302. // "https://www.googleapis.com/auth/compute",
  102303. // "https://www.googleapis.com/auth/compute.readonly"
  102304. // ]
  102305. // }
  102306. }
  102307. // Pages invokes f for each page of results.
  102308. // A non-nil error returned from f will halt the iteration.
  102309. // The provided context supersedes any context provided to the Context method.
  102310. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  102311. c.ctx_ = ctx
  102312. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102313. for {
  102314. x, err := c.Do()
  102315. if err != nil {
  102316. return err
  102317. }
  102318. if err := f(x); err != nil {
  102319. return err
  102320. }
  102321. if x.NextPageToken == "" {
  102322. return nil
  102323. }
  102324. c.PageToken(x.NextPageToken)
  102325. }
  102326. }
  102327. // method id "compute.targetHttpsProxies.setQuicOverride":
  102328. type TargetHttpsProxiesSetQuicOverrideCall struct {
  102329. s *Service
  102330. project string
  102331. targetHttpsProxy string
  102332. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  102333. urlParams_ gensupport.URLParams
  102334. ctx_ context.Context
  102335. header_ http.Header
  102336. }
  102337. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  102338. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  102339. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102340. c.project = project
  102341. c.targetHttpsProxy = targetHttpsProxy
  102342. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  102343. return c
  102344. }
  102345. // RequestId sets the optional parameter "requestId": An optional
  102346. // request ID to identify requests. Specify a unique request ID so that
  102347. // if you must retry your request, the server will know to ignore the
  102348. // request if it has already been completed.
  102349. //
  102350. // For example, consider a situation where you make an initial request
  102351. // and the request times out. If you make the request again with the
  102352. // same request ID, the server can check if original operation with the
  102353. // same request ID was received, and if so, will ignore the second
  102354. // request. This prevents clients from accidentally creating duplicate
  102355. // commitments.
  102356. //
  102357. // The request ID must be a valid UUID with the exception that zero UUID
  102358. // is not supported (00000000-0000-0000-0000-000000000000).
  102359. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  102360. c.urlParams_.Set("requestId", requestId)
  102361. return c
  102362. }
  102363. // Fields allows partial responses to be retrieved. See
  102364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102365. // for more information.
  102366. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  102367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102368. return c
  102369. }
  102370. // Context sets the context to be used in this call's Do method. Any
  102371. // pending HTTP request will be aborted if the provided context is
  102372. // canceled.
  102373. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  102374. c.ctx_ = ctx
  102375. return c
  102376. }
  102377. // Header returns an http.Header that can be modified by the caller to
  102378. // add HTTP headers to the request.
  102379. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  102380. if c.header_ == nil {
  102381. c.header_ = make(http.Header)
  102382. }
  102383. return c.header_
  102384. }
  102385. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  102386. reqHeaders := make(http.Header)
  102387. for k, v := range c.header_ {
  102388. reqHeaders[k] = v
  102389. }
  102390. reqHeaders.Set("User-Agent", c.s.userAgent())
  102391. var body io.Reader = nil
  102392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  102393. if err != nil {
  102394. return nil, err
  102395. }
  102396. reqHeaders.Set("Content-Type", "application/json")
  102397. c.urlParams_.Set("alt", alt)
  102398. c.urlParams_.Set("prettyPrint", "false")
  102399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  102400. urls += "?" + c.urlParams_.Encode()
  102401. req, err := http.NewRequest("POST", urls, body)
  102402. if err != nil {
  102403. return nil, err
  102404. }
  102405. req.Header = reqHeaders
  102406. googleapi.Expand(req.URL, map[string]string{
  102407. "project": c.project,
  102408. "targetHttpsProxy": c.targetHttpsProxy,
  102409. })
  102410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102411. }
  102412. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  102413. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102414. // status code is an error. Response headers are in either
  102415. // *Operation.ServerResponse.Header or (if a response was returned at
  102416. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102417. // to check whether the returned error was because
  102418. // http.StatusNotModified was returned.
  102419. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102420. gensupport.SetOptions(c.urlParams_, opts...)
  102421. res, err := c.doRequest("json")
  102422. if res != nil && res.StatusCode == http.StatusNotModified {
  102423. if res.Body != nil {
  102424. res.Body.Close()
  102425. }
  102426. return nil, &googleapi.Error{
  102427. Code: res.StatusCode,
  102428. Header: res.Header,
  102429. }
  102430. }
  102431. if err != nil {
  102432. return nil, err
  102433. }
  102434. defer googleapi.CloseBody(res)
  102435. if err := googleapi.CheckResponse(res); err != nil {
  102436. return nil, err
  102437. }
  102438. ret := &Operation{
  102439. ServerResponse: googleapi.ServerResponse{
  102440. Header: res.Header,
  102441. HTTPStatusCode: res.StatusCode,
  102442. },
  102443. }
  102444. target := &ret
  102445. if err := gensupport.DecodeResponse(target, res); err != nil {
  102446. return nil, err
  102447. }
  102448. return ret, nil
  102449. // {
  102450. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  102451. // "httpMethod": "POST",
  102452. // "id": "compute.targetHttpsProxies.setQuicOverride",
  102453. // "parameterOrder": [
  102454. // "project",
  102455. // "targetHttpsProxy"
  102456. // ],
  102457. // "parameters": {
  102458. // "project": {
  102459. // "description": "Project ID for this request.",
  102460. // "location": "path",
  102461. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102462. // "required": true,
  102463. // "type": "string"
  102464. // },
  102465. // "requestId": {
  102466. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102467. // "location": "query",
  102468. // "type": "string"
  102469. // },
  102470. // "targetHttpsProxy": {
  102471. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  102472. // "location": "path",
  102473. // "required": true,
  102474. // "type": "string"
  102475. // }
  102476. // },
  102477. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  102478. // "request": {
  102479. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  102480. // },
  102481. // "response": {
  102482. // "$ref": "Operation"
  102483. // },
  102484. // "scopes": [
  102485. // "https://www.googleapis.com/auth/cloud-platform",
  102486. // "https://www.googleapis.com/auth/compute"
  102487. // ]
  102488. // }
  102489. }
  102490. // method id "compute.targetHttpsProxies.setSslCertificates":
  102491. type TargetHttpsProxiesSetSslCertificatesCall struct {
  102492. s *Service
  102493. project string
  102494. targetHttpsProxy string
  102495. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  102496. urlParams_ gensupport.URLParams
  102497. ctx_ context.Context
  102498. header_ http.Header
  102499. }
  102500. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  102501. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  102502. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102503. c.project = project
  102504. c.targetHttpsProxy = targetHttpsProxy
  102505. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  102506. return c
  102507. }
  102508. // RequestId sets the optional parameter "requestId": An optional
  102509. // request ID to identify requests. Specify a unique request ID so that
  102510. // if you must retry your request, the server will know to ignore the
  102511. // request if it has already been completed.
  102512. //
  102513. // For example, consider a situation where you make an initial request
  102514. // and the request times out. If you make the request again with the
  102515. // same request ID, the server can check if original operation with the
  102516. // same request ID was received, and if so, will ignore the second
  102517. // request. This prevents clients from accidentally creating duplicate
  102518. // commitments.
  102519. //
  102520. // The request ID must be a valid UUID with the exception that zero UUID
  102521. // is not supported (00000000-0000-0000-0000-000000000000).
  102522. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  102523. c.urlParams_.Set("requestId", requestId)
  102524. return c
  102525. }
  102526. // Fields allows partial responses to be retrieved. See
  102527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102528. // for more information.
  102529. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  102530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102531. return c
  102532. }
  102533. // Context sets the context to be used in this call's Do method. Any
  102534. // pending HTTP request will be aborted if the provided context is
  102535. // canceled.
  102536. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  102537. c.ctx_ = ctx
  102538. return c
  102539. }
  102540. // Header returns an http.Header that can be modified by the caller to
  102541. // add HTTP headers to the request.
  102542. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  102543. if c.header_ == nil {
  102544. c.header_ = make(http.Header)
  102545. }
  102546. return c.header_
  102547. }
  102548. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  102549. reqHeaders := make(http.Header)
  102550. for k, v := range c.header_ {
  102551. reqHeaders[k] = v
  102552. }
  102553. reqHeaders.Set("User-Agent", c.s.userAgent())
  102554. var body io.Reader = nil
  102555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  102556. if err != nil {
  102557. return nil, err
  102558. }
  102559. reqHeaders.Set("Content-Type", "application/json")
  102560. c.urlParams_.Set("alt", alt)
  102561. c.urlParams_.Set("prettyPrint", "false")
  102562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  102563. urls += "?" + c.urlParams_.Encode()
  102564. req, err := http.NewRequest("POST", urls, body)
  102565. if err != nil {
  102566. return nil, err
  102567. }
  102568. req.Header = reqHeaders
  102569. googleapi.Expand(req.URL, map[string]string{
  102570. "project": c.project,
  102571. "targetHttpsProxy": c.targetHttpsProxy,
  102572. })
  102573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102574. }
  102575. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  102576. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102577. // status code is an error. Response headers are in either
  102578. // *Operation.ServerResponse.Header or (if a response was returned at
  102579. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102580. // to check whether the returned error was because
  102581. // http.StatusNotModified was returned.
  102582. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102583. gensupport.SetOptions(c.urlParams_, opts...)
  102584. res, err := c.doRequest("json")
  102585. if res != nil && res.StatusCode == http.StatusNotModified {
  102586. if res.Body != nil {
  102587. res.Body.Close()
  102588. }
  102589. return nil, &googleapi.Error{
  102590. Code: res.StatusCode,
  102591. Header: res.Header,
  102592. }
  102593. }
  102594. if err != nil {
  102595. return nil, err
  102596. }
  102597. defer googleapi.CloseBody(res)
  102598. if err := googleapi.CheckResponse(res); err != nil {
  102599. return nil, err
  102600. }
  102601. ret := &Operation{
  102602. ServerResponse: googleapi.ServerResponse{
  102603. Header: res.Header,
  102604. HTTPStatusCode: res.StatusCode,
  102605. },
  102606. }
  102607. target := &ret
  102608. if err := gensupport.DecodeResponse(target, res); err != nil {
  102609. return nil, err
  102610. }
  102611. return ret, nil
  102612. // {
  102613. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  102614. // "httpMethod": "POST",
  102615. // "id": "compute.targetHttpsProxies.setSslCertificates",
  102616. // "parameterOrder": [
  102617. // "project",
  102618. // "targetHttpsProxy"
  102619. // ],
  102620. // "parameters": {
  102621. // "project": {
  102622. // "description": "Project ID for this request.",
  102623. // "location": "path",
  102624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102625. // "required": true,
  102626. // "type": "string"
  102627. // },
  102628. // "requestId": {
  102629. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102630. // "location": "query",
  102631. // "type": "string"
  102632. // },
  102633. // "targetHttpsProxy": {
  102634. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  102635. // "location": "path",
  102636. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102637. // "required": true,
  102638. // "type": "string"
  102639. // }
  102640. // },
  102641. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  102642. // "request": {
  102643. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  102644. // },
  102645. // "response": {
  102646. // "$ref": "Operation"
  102647. // },
  102648. // "scopes": [
  102649. // "https://www.googleapis.com/auth/cloud-platform",
  102650. // "https://www.googleapis.com/auth/compute"
  102651. // ]
  102652. // }
  102653. }
  102654. // method id "compute.targetHttpsProxies.setSslPolicy":
  102655. type TargetHttpsProxiesSetSslPolicyCall struct {
  102656. s *Service
  102657. project string
  102658. targetHttpsProxy string
  102659. sslpolicyreference *SslPolicyReference
  102660. urlParams_ gensupport.URLParams
  102661. ctx_ context.Context
  102662. header_ http.Header
  102663. }
  102664. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  102665. // policy specifies the server-side support for SSL features. This
  102666. // affects connections between clients and the HTTPS proxy load
  102667. // balancer. They do not affect the connection between the load balancer
  102668. // and the backends.
  102669. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  102670. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102671. c.project = project
  102672. c.targetHttpsProxy = targetHttpsProxy
  102673. c.sslpolicyreference = sslpolicyreference
  102674. return c
  102675. }
  102676. // RequestId sets the optional parameter "requestId": An optional
  102677. // request ID to identify requests. Specify a unique request ID so that
  102678. // if you must retry your request, the server will know to ignore the
  102679. // request if it has already been completed.
  102680. //
  102681. // For example, consider a situation where you make an initial request
  102682. // and the request times out. If you make the request again with the
  102683. // same request ID, the server can check if original operation with the
  102684. // same request ID was received, and if so, will ignore the second
  102685. // request. This prevents clients from accidentally creating duplicate
  102686. // commitments.
  102687. //
  102688. // The request ID must be a valid UUID with the exception that zero UUID
  102689. // is not supported (00000000-0000-0000-0000-000000000000).
  102690. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  102691. c.urlParams_.Set("requestId", requestId)
  102692. return c
  102693. }
  102694. // Fields allows partial responses to be retrieved. See
  102695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102696. // for more information.
  102697. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  102698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102699. return c
  102700. }
  102701. // Context sets the context to be used in this call's Do method. Any
  102702. // pending HTTP request will be aborted if the provided context is
  102703. // canceled.
  102704. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  102705. c.ctx_ = ctx
  102706. return c
  102707. }
  102708. // Header returns an http.Header that can be modified by the caller to
  102709. // add HTTP headers to the request.
  102710. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  102711. if c.header_ == nil {
  102712. c.header_ = make(http.Header)
  102713. }
  102714. return c.header_
  102715. }
  102716. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  102717. reqHeaders := make(http.Header)
  102718. for k, v := range c.header_ {
  102719. reqHeaders[k] = v
  102720. }
  102721. reqHeaders.Set("User-Agent", c.s.userAgent())
  102722. var body io.Reader = nil
  102723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  102724. if err != nil {
  102725. return nil, err
  102726. }
  102727. reqHeaders.Set("Content-Type", "application/json")
  102728. c.urlParams_.Set("alt", alt)
  102729. c.urlParams_.Set("prettyPrint", "false")
  102730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  102731. urls += "?" + c.urlParams_.Encode()
  102732. req, err := http.NewRequest("POST", urls, body)
  102733. if err != nil {
  102734. return nil, err
  102735. }
  102736. req.Header = reqHeaders
  102737. googleapi.Expand(req.URL, map[string]string{
  102738. "project": c.project,
  102739. "targetHttpsProxy": c.targetHttpsProxy,
  102740. })
  102741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102742. }
  102743. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  102744. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102745. // status code is an error. Response headers are in either
  102746. // *Operation.ServerResponse.Header or (if a response was returned at
  102747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102748. // to check whether the returned error was because
  102749. // http.StatusNotModified was returned.
  102750. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102751. gensupport.SetOptions(c.urlParams_, opts...)
  102752. res, err := c.doRequest("json")
  102753. if res != nil && res.StatusCode == http.StatusNotModified {
  102754. if res.Body != nil {
  102755. res.Body.Close()
  102756. }
  102757. return nil, &googleapi.Error{
  102758. Code: res.StatusCode,
  102759. Header: res.Header,
  102760. }
  102761. }
  102762. if err != nil {
  102763. return nil, err
  102764. }
  102765. defer googleapi.CloseBody(res)
  102766. if err := googleapi.CheckResponse(res); err != nil {
  102767. return nil, err
  102768. }
  102769. ret := &Operation{
  102770. ServerResponse: googleapi.ServerResponse{
  102771. Header: res.Header,
  102772. HTTPStatusCode: res.StatusCode,
  102773. },
  102774. }
  102775. target := &ret
  102776. if err := gensupport.DecodeResponse(target, res); err != nil {
  102777. return nil, err
  102778. }
  102779. return ret, nil
  102780. // {
  102781. // "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.",
  102782. // "httpMethod": "POST",
  102783. // "id": "compute.targetHttpsProxies.setSslPolicy",
  102784. // "parameterOrder": [
  102785. // "project",
  102786. // "targetHttpsProxy"
  102787. // ],
  102788. // "parameters": {
  102789. // "project": {
  102790. // "description": "Project ID for this request.",
  102791. // "location": "path",
  102792. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102793. // "required": true,
  102794. // "type": "string"
  102795. // },
  102796. // "requestId": {
  102797. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102798. // "location": "query",
  102799. // "type": "string"
  102800. // },
  102801. // "targetHttpsProxy": {
  102802. // "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.",
  102803. // "location": "path",
  102804. // "required": true,
  102805. // "type": "string"
  102806. // }
  102807. // },
  102808. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  102809. // "request": {
  102810. // "$ref": "SslPolicyReference"
  102811. // },
  102812. // "response": {
  102813. // "$ref": "Operation"
  102814. // },
  102815. // "scopes": [
  102816. // "https://www.googleapis.com/auth/cloud-platform",
  102817. // "https://www.googleapis.com/auth/compute"
  102818. // ]
  102819. // }
  102820. }
  102821. // method id "compute.targetHttpsProxies.setUrlMap":
  102822. type TargetHttpsProxiesSetUrlMapCall struct {
  102823. s *Service
  102824. project string
  102825. targetHttpsProxy string
  102826. urlmapreference *UrlMapReference
  102827. urlParams_ gensupport.URLParams
  102828. ctx_ context.Context
  102829. header_ http.Header
  102830. }
  102831. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  102832. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  102833. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102834. c.project = project
  102835. c.targetHttpsProxy = targetHttpsProxy
  102836. c.urlmapreference = urlmapreference
  102837. return c
  102838. }
  102839. // RequestId sets the optional parameter "requestId": An optional
  102840. // request ID to identify requests. Specify a unique request ID so that
  102841. // if you must retry your request, the server will know to ignore the
  102842. // request if it has already been completed.
  102843. //
  102844. // For example, consider a situation where you make an initial request
  102845. // and the request times out. If you make the request again with the
  102846. // same request ID, the server can check if original operation with the
  102847. // same request ID was received, and if so, will ignore the second
  102848. // request. This prevents clients from accidentally creating duplicate
  102849. // commitments.
  102850. //
  102851. // The request ID must be a valid UUID with the exception that zero UUID
  102852. // is not supported (00000000-0000-0000-0000-000000000000).
  102853. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  102854. c.urlParams_.Set("requestId", requestId)
  102855. return c
  102856. }
  102857. // Fields allows partial responses to be retrieved. See
  102858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102859. // for more information.
  102860. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  102861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102862. return c
  102863. }
  102864. // Context sets the context to be used in this call's Do method. Any
  102865. // pending HTTP request will be aborted if the provided context is
  102866. // canceled.
  102867. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  102868. c.ctx_ = ctx
  102869. return c
  102870. }
  102871. // Header returns an http.Header that can be modified by the caller to
  102872. // add HTTP headers to the request.
  102873. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  102874. if c.header_ == nil {
  102875. c.header_ = make(http.Header)
  102876. }
  102877. return c.header_
  102878. }
  102879. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  102880. reqHeaders := make(http.Header)
  102881. for k, v := range c.header_ {
  102882. reqHeaders[k] = v
  102883. }
  102884. reqHeaders.Set("User-Agent", c.s.userAgent())
  102885. var body io.Reader = nil
  102886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  102887. if err != nil {
  102888. return nil, err
  102889. }
  102890. reqHeaders.Set("Content-Type", "application/json")
  102891. c.urlParams_.Set("alt", alt)
  102892. c.urlParams_.Set("prettyPrint", "false")
  102893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  102894. urls += "?" + c.urlParams_.Encode()
  102895. req, err := http.NewRequest("POST", urls, body)
  102896. if err != nil {
  102897. return nil, err
  102898. }
  102899. req.Header = reqHeaders
  102900. googleapi.Expand(req.URL, map[string]string{
  102901. "project": c.project,
  102902. "targetHttpsProxy": c.targetHttpsProxy,
  102903. })
  102904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102905. }
  102906. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  102907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102908. // status code is an error. Response headers are in either
  102909. // *Operation.ServerResponse.Header or (if a response was returned at
  102910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102911. // to check whether the returned error was because
  102912. // http.StatusNotModified was returned.
  102913. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102914. gensupport.SetOptions(c.urlParams_, opts...)
  102915. res, err := c.doRequest("json")
  102916. if res != nil && res.StatusCode == http.StatusNotModified {
  102917. if res.Body != nil {
  102918. res.Body.Close()
  102919. }
  102920. return nil, &googleapi.Error{
  102921. Code: res.StatusCode,
  102922. Header: res.Header,
  102923. }
  102924. }
  102925. if err != nil {
  102926. return nil, err
  102927. }
  102928. defer googleapi.CloseBody(res)
  102929. if err := googleapi.CheckResponse(res); err != nil {
  102930. return nil, err
  102931. }
  102932. ret := &Operation{
  102933. ServerResponse: googleapi.ServerResponse{
  102934. Header: res.Header,
  102935. HTTPStatusCode: res.StatusCode,
  102936. },
  102937. }
  102938. target := &ret
  102939. if err := gensupport.DecodeResponse(target, res); err != nil {
  102940. return nil, err
  102941. }
  102942. return ret, nil
  102943. // {
  102944. // "description": "Changes the URL map for TargetHttpsProxy.",
  102945. // "httpMethod": "POST",
  102946. // "id": "compute.targetHttpsProxies.setUrlMap",
  102947. // "parameterOrder": [
  102948. // "project",
  102949. // "targetHttpsProxy"
  102950. // ],
  102951. // "parameters": {
  102952. // "project": {
  102953. // "description": "Project ID for this request.",
  102954. // "location": "path",
  102955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102956. // "required": true,
  102957. // "type": "string"
  102958. // },
  102959. // "requestId": {
  102960. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102961. // "location": "query",
  102962. // "type": "string"
  102963. // },
  102964. // "targetHttpsProxy": {
  102965. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  102966. // "location": "path",
  102967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102968. // "required": true,
  102969. // "type": "string"
  102970. // }
  102971. // },
  102972. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  102973. // "request": {
  102974. // "$ref": "UrlMapReference"
  102975. // },
  102976. // "response": {
  102977. // "$ref": "Operation"
  102978. // },
  102979. // "scopes": [
  102980. // "https://www.googleapis.com/auth/cloud-platform",
  102981. // "https://www.googleapis.com/auth/compute"
  102982. // ]
  102983. // }
  102984. }
  102985. // method id "compute.targetHttpsProxies.testIamPermissions":
  102986. type TargetHttpsProxiesTestIamPermissionsCall struct {
  102987. s *Service
  102988. project string
  102989. resource string
  102990. testpermissionsrequest *TestPermissionsRequest
  102991. urlParams_ gensupport.URLParams
  102992. ctx_ context.Context
  102993. header_ http.Header
  102994. }
  102995. // TestIamPermissions: Returns permissions that a caller has on the
  102996. // specified resource.
  102997. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  102998. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102999. c.project = project
  103000. c.resource = resource
  103001. c.testpermissionsrequest = testpermissionsrequest
  103002. return c
  103003. }
  103004. // Fields allows partial responses to be retrieved. See
  103005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103006. // for more information.
  103007. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  103008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103009. return c
  103010. }
  103011. // Context sets the context to be used in this call's Do method. Any
  103012. // pending HTTP request will be aborted if the provided context is
  103013. // canceled.
  103014. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  103015. c.ctx_ = ctx
  103016. return c
  103017. }
  103018. // Header returns an http.Header that can be modified by the caller to
  103019. // add HTTP headers to the request.
  103020. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  103021. if c.header_ == nil {
  103022. c.header_ = make(http.Header)
  103023. }
  103024. return c.header_
  103025. }
  103026. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  103027. reqHeaders := make(http.Header)
  103028. for k, v := range c.header_ {
  103029. reqHeaders[k] = v
  103030. }
  103031. reqHeaders.Set("User-Agent", c.s.userAgent())
  103032. var body io.Reader = nil
  103033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  103034. if err != nil {
  103035. return nil, err
  103036. }
  103037. reqHeaders.Set("Content-Type", "application/json")
  103038. c.urlParams_.Set("alt", alt)
  103039. c.urlParams_.Set("prettyPrint", "false")
  103040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  103041. urls += "?" + c.urlParams_.Encode()
  103042. req, err := http.NewRequest("POST", urls, body)
  103043. if err != nil {
  103044. return nil, err
  103045. }
  103046. req.Header = reqHeaders
  103047. googleapi.Expand(req.URL, map[string]string{
  103048. "project": c.project,
  103049. "resource": c.resource,
  103050. })
  103051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103052. }
  103053. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  103054. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  103055. // non-2xx status code is an error. Response headers are in either
  103056. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  103057. // returned at all) in error.(*googleapi.Error).Header. Use
  103058. // googleapi.IsNotModified to check whether the returned error was
  103059. // because http.StatusNotModified was returned.
  103060. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  103061. gensupport.SetOptions(c.urlParams_, opts...)
  103062. res, err := c.doRequest("json")
  103063. if res != nil && res.StatusCode == http.StatusNotModified {
  103064. if res.Body != nil {
  103065. res.Body.Close()
  103066. }
  103067. return nil, &googleapi.Error{
  103068. Code: res.StatusCode,
  103069. Header: res.Header,
  103070. }
  103071. }
  103072. if err != nil {
  103073. return nil, err
  103074. }
  103075. defer googleapi.CloseBody(res)
  103076. if err := googleapi.CheckResponse(res); err != nil {
  103077. return nil, err
  103078. }
  103079. ret := &TestPermissionsResponse{
  103080. ServerResponse: googleapi.ServerResponse{
  103081. Header: res.Header,
  103082. HTTPStatusCode: res.StatusCode,
  103083. },
  103084. }
  103085. target := &ret
  103086. if err := gensupport.DecodeResponse(target, res); err != nil {
  103087. return nil, err
  103088. }
  103089. return ret, nil
  103090. // {
  103091. // "description": "Returns permissions that a caller has on the specified resource.",
  103092. // "httpMethod": "POST",
  103093. // "id": "compute.targetHttpsProxies.testIamPermissions",
  103094. // "parameterOrder": [
  103095. // "project",
  103096. // "resource"
  103097. // ],
  103098. // "parameters": {
  103099. // "project": {
  103100. // "description": "Project ID for this request.",
  103101. // "location": "path",
  103102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103103. // "required": true,
  103104. // "type": "string"
  103105. // },
  103106. // "resource": {
  103107. // "description": "Name or id of the resource for this request.",
  103108. // "location": "path",
  103109. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103110. // "required": true,
  103111. // "type": "string"
  103112. // }
  103113. // },
  103114. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  103115. // "request": {
  103116. // "$ref": "TestPermissionsRequest"
  103117. // },
  103118. // "response": {
  103119. // "$ref": "TestPermissionsResponse"
  103120. // },
  103121. // "scopes": [
  103122. // "https://www.googleapis.com/auth/cloud-platform",
  103123. // "https://www.googleapis.com/auth/compute",
  103124. // "https://www.googleapis.com/auth/compute.readonly"
  103125. // ]
  103126. // }
  103127. }
  103128. // method id "compute.targetInstances.aggregatedList":
  103129. type TargetInstancesAggregatedListCall struct {
  103130. s *Service
  103131. project string
  103132. urlParams_ gensupport.URLParams
  103133. ifNoneMatch_ string
  103134. ctx_ context.Context
  103135. header_ http.Header
  103136. }
  103137. // AggregatedList: Retrieves an aggregated list of target instances.
  103138. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  103139. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  103140. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103141. c.project = project
  103142. return c
  103143. }
  103144. // Filter sets the optional parameter "filter": A filter expression that
  103145. // filters resources listed in the response. The expression must specify
  103146. // the field name, a comparison operator, and the value that you want to
  103147. // use for filtering. The value must be a string, a number, or a
  103148. // boolean. The comparison operator must be either =, !=, >, or <.
  103149. //
  103150. // For example, if you are filtering Compute Engine instances, you can
  103151. // exclude instances named example-instance by specifying name !=
  103152. // example-instance.
  103153. //
  103154. // You can also filter nested fields. For example, you could specify
  103155. // scheduling.automaticRestart = false to include instances only if they
  103156. // are not scheduled for automatic restarts. You can use filtering on
  103157. // nested fields to filter based on resource labels.
  103158. //
  103159. // To filter on multiple expressions, provide each separate expression
  103160. // within parentheses. For example, (scheduling.automaticRestart = true)
  103161. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103162. // AND expression. However, you can include AND and OR expressions
  103163. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103164. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103165. // true).
  103166. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  103167. c.urlParams_.Set("filter", filter)
  103168. return c
  103169. }
  103170. // MaxResults sets the optional parameter "maxResults": The maximum
  103171. // number of results per page that should be returned. If the number of
  103172. // available results is larger than maxResults, Compute Engine returns a
  103173. // nextPageToken that can be used to get the next page of results in
  103174. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103175. // (Default: 500)
  103176. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  103177. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103178. return c
  103179. }
  103180. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103181. // a certain order. By default, results are returned in alphanumerical
  103182. // order based on the resource name.
  103183. //
  103184. // You can also sort results in descending order based on the creation
  103185. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103186. // based on the creationTimestamp field in reverse chronological order
  103187. // (newest result first). Use this to sort resources like operations so
  103188. // that the newest operation is returned first.
  103189. //
  103190. // Currently, only sorting by name or creationTimestamp desc is
  103191. // supported.
  103192. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  103193. c.urlParams_.Set("orderBy", orderBy)
  103194. return c
  103195. }
  103196. // PageToken sets the optional parameter "pageToken": Specifies a page
  103197. // token to use. Set pageToken to the nextPageToken returned by a
  103198. // previous list request to get the next page of results.
  103199. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  103200. c.urlParams_.Set("pageToken", pageToken)
  103201. return c
  103202. }
  103203. // Fields allows partial responses to be retrieved. See
  103204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103205. // for more information.
  103206. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  103207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103208. return c
  103209. }
  103210. // IfNoneMatch sets the optional parameter which makes the operation
  103211. // fail if the object's ETag matches the given value. This is useful for
  103212. // getting updates only after the object has changed since the last
  103213. // request. Use googleapi.IsNotModified to check whether the response
  103214. // error from Do is the result of In-None-Match.
  103215. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  103216. c.ifNoneMatch_ = entityTag
  103217. return c
  103218. }
  103219. // Context sets the context to be used in this call's Do method. Any
  103220. // pending HTTP request will be aborted if the provided context is
  103221. // canceled.
  103222. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  103223. c.ctx_ = ctx
  103224. return c
  103225. }
  103226. // Header returns an http.Header that can be modified by the caller to
  103227. // add HTTP headers to the request.
  103228. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  103229. if c.header_ == nil {
  103230. c.header_ = make(http.Header)
  103231. }
  103232. return c.header_
  103233. }
  103234. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  103235. reqHeaders := make(http.Header)
  103236. for k, v := range c.header_ {
  103237. reqHeaders[k] = v
  103238. }
  103239. reqHeaders.Set("User-Agent", c.s.userAgent())
  103240. if c.ifNoneMatch_ != "" {
  103241. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103242. }
  103243. var body io.Reader = nil
  103244. c.urlParams_.Set("alt", alt)
  103245. c.urlParams_.Set("prettyPrint", "false")
  103246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  103247. urls += "?" + c.urlParams_.Encode()
  103248. req, err := http.NewRequest("GET", urls, body)
  103249. if err != nil {
  103250. return nil, err
  103251. }
  103252. req.Header = reqHeaders
  103253. googleapi.Expand(req.URL, map[string]string{
  103254. "project": c.project,
  103255. })
  103256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103257. }
  103258. // Do executes the "compute.targetInstances.aggregatedList" call.
  103259. // Exactly one of *TargetInstanceAggregatedList or error will be
  103260. // non-nil. Any non-2xx status code is an error. Response headers are in
  103261. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  103262. // response was returned at all) in error.(*googleapi.Error).Header. Use
  103263. // googleapi.IsNotModified to check whether the returned error was
  103264. // because http.StatusNotModified was returned.
  103265. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  103266. gensupport.SetOptions(c.urlParams_, opts...)
  103267. res, err := c.doRequest("json")
  103268. if res != nil && res.StatusCode == http.StatusNotModified {
  103269. if res.Body != nil {
  103270. res.Body.Close()
  103271. }
  103272. return nil, &googleapi.Error{
  103273. Code: res.StatusCode,
  103274. Header: res.Header,
  103275. }
  103276. }
  103277. if err != nil {
  103278. return nil, err
  103279. }
  103280. defer googleapi.CloseBody(res)
  103281. if err := googleapi.CheckResponse(res); err != nil {
  103282. return nil, err
  103283. }
  103284. ret := &TargetInstanceAggregatedList{
  103285. ServerResponse: googleapi.ServerResponse{
  103286. Header: res.Header,
  103287. HTTPStatusCode: res.StatusCode,
  103288. },
  103289. }
  103290. target := &ret
  103291. if err := gensupport.DecodeResponse(target, res); err != nil {
  103292. return nil, err
  103293. }
  103294. return ret, nil
  103295. // {
  103296. // "description": "Retrieves an aggregated list of target instances.",
  103297. // "httpMethod": "GET",
  103298. // "id": "compute.targetInstances.aggregatedList",
  103299. // "parameterOrder": [
  103300. // "project"
  103301. // ],
  103302. // "parameters": {
  103303. // "filter": {
  103304. // "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).",
  103305. // "location": "query",
  103306. // "type": "string"
  103307. // },
  103308. // "maxResults": {
  103309. // "default": "500",
  103310. // "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)",
  103311. // "format": "uint32",
  103312. // "location": "query",
  103313. // "minimum": "0",
  103314. // "type": "integer"
  103315. // },
  103316. // "orderBy": {
  103317. // "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.",
  103318. // "location": "query",
  103319. // "type": "string"
  103320. // },
  103321. // "pageToken": {
  103322. // "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.",
  103323. // "location": "query",
  103324. // "type": "string"
  103325. // },
  103326. // "project": {
  103327. // "description": "Project ID for this request.",
  103328. // "location": "path",
  103329. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103330. // "required": true,
  103331. // "type": "string"
  103332. // }
  103333. // },
  103334. // "path": "{project}/aggregated/targetInstances",
  103335. // "response": {
  103336. // "$ref": "TargetInstanceAggregatedList"
  103337. // },
  103338. // "scopes": [
  103339. // "https://www.googleapis.com/auth/cloud-platform",
  103340. // "https://www.googleapis.com/auth/compute",
  103341. // "https://www.googleapis.com/auth/compute.readonly"
  103342. // ]
  103343. // }
  103344. }
  103345. // Pages invokes f for each page of results.
  103346. // A non-nil error returned from f will halt the iteration.
  103347. // The provided context supersedes any context provided to the Context method.
  103348. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  103349. c.ctx_ = ctx
  103350. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103351. for {
  103352. x, err := c.Do()
  103353. if err != nil {
  103354. return err
  103355. }
  103356. if err := f(x); err != nil {
  103357. return err
  103358. }
  103359. if x.NextPageToken == "" {
  103360. return nil
  103361. }
  103362. c.PageToken(x.NextPageToken)
  103363. }
  103364. }
  103365. // method id "compute.targetInstances.delete":
  103366. type TargetInstancesDeleteCall struct {
  103367. s *Service
  103368. project string
  103369. zone string
  103370. targetInstance string
  103371. urlParams_ gensupport.URLParams
  103372. ctx_ context.Context
  103373. header_ http.Header
  103374. }
  103375. // Delete: Deletes the specified TargetInstance resource.
  103376. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  103377. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  103378. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103379. c.project = project
  103380. c.zone = zone
  103381. c.targetInstance = targetInstance
  103382. return c
  103383. }
  103384. // RequestId sets the optional parameter "requestId": An optional
  103385. // request ID to identify requests. Specify a unique request ID so that
  103386. // if you must retry your request, the server will know to ignore the
  103387. // request if it has already been completed.
  103388. //
  103389. // For example, consider a situation where you make an initial request
  103390. // and the request times out. If you make the request again with the
  103391. // same request ID, the server can check if original operation with the
  103392. // same request ID was received, and if so, will ignore the second
  103393. // request. This prevents clients from accidentally creating duplicate
  103394. // commitments.
  103395. //
  103396. // The request ID must be a valid UUID with the exception that zero UUID
  103397. // is not supported (00000000-0000-0000-0000-000000000000).
  103398. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  103399. c.urlParams_.Set("requestId", requestId)
  103400. return c
  103401. }
  103402. // Fields allows partial responses to be retrieved. See
  103403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103404. // for more information.
  103405. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  103406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103407. return c
  103408. }
  103409. // Context sets the context to be used in this call's Do method. Any
  103410. // pending HTTP request will be aborted if the provided context is
  103411. // canceled.
  103412. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  103413. c.ctx_ = ctx
  103414. return c
  103415. }
  103416. // Header returns an http.Header that can be modified by the caller to
  103417. // add HTTP headers to the request.
  103418. func (c *TargetInstancesDeleteCall) Header() http.Header {
  103419. if c.header_ == nil {
  103420. c.header_ = make(http.Header)
  103421. }
  103422. return c.header_
  103423. }
  103424. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  103425. reqHeaders := make(http.Header)
  103426. for k, v := range c.header_ {
  103427. reqHeaders[k] = v
  103428. }
  103429. reqHeaders.Set("User-Agent", c.s.userAgent())
  103430. var body io.Reader = nil
  103431. c.urlParams_.Set("alt", alt)
  103432. c.urlParams_.Set("prettyPrint", "false")
  103433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  103434. urls += "?" + c.urlParams_.Encode()
  103435. req, err := http.NewRequest("DELETE", urls, body)
  103436. if err != nil {
  103437. return nil, err
  103438. }
  103439. req.Header = reqHeaders
  103440. googleapi.Expand(req.URL, map[string]string{
  103441. "project": c.project,
  103442. "zone": c.zone,
  103443. "targetInstance": c.targetInstance,
  103444. })
  103445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103446. }
  103447. // Do executes the "compute.targetInstances.delete" call.
  103448. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103449. // status code is an error. Response headers are in either
  103450. // *Operation.ServerResponse.Header or (if a response was returned at
  103451. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103452. // to check whether the returned error was because
  103453. // http.StatusNotModified was returned.
  103454. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103455. gensupport.SetOptions(c.urlParams_, opts...)
  103456. res, err := c.doRequest("json")
  103457. if res != nil && res.StatusCode == http.StatusNotModified {
  103458. if res.Body != nil {
  103459. res.Body.Close()
  103460. }
  103461. return nil, &googleapi.Error{
  103462. Code: res.StatusCode,
  103463. Header: res.Header,
  103464. }
  103465. }
  103466. if err != nil {
  103467. return nil, err
  103468. }
  103469. defer googleapi.CloseBody(res)
  103470. if err := googleapi.CheckResponse(res); err != nil {
  103471. return nil, err
  103472. }
  103473. ret := &Operation{
  103474. ServerResponse: googleapi.ServerResponse{
  103475. Header: res.Header,
  103476. HTTPStatusCode: res.StatusCode,
  103477. },
  103478. }
  103479. target := &ret
  103480. if err := gensupport.DecodeResponse(target, res); err != nil {
  103481. return nil, err
  103482. }
  103483. return ret, nil
  103484. // {
  103485. // "description": "Deletes the specified TargetInstance resource.",
  103486. // "httpMethod": "DELETE",
  103487. // "id": "compute.targetInstances.delete",
  103488. // "parameterOrder": [
  103489. // "project",
  103490. // "zone",
  103491. // "targetInstance"
  103492. // ],
  103493. // "parameters": {
  103494. // "project": {
  103495. // "description": "Project ID for this request.",
  103496. // "location": "path",
  103497. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103498. // "required": true,
  103499. // "type": "string"
  103500. // },
  103501. // "requestId": {
  103502. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103503. // "location": "query",
  103504. // "type": "string"
  103505. // },
  103506. // "targetInstance": {
  103507. // "description": "Name of the TargetInstance resource to delete.",
  103508. // "location": "path",
  103509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103510. // "required": true,
  103511. // "type": "string"
  103512. // },
  103513. // "zone": {
  103514. // "description": "Name of the zone scoping this request.",
  103515. // "location": "path",
  103516. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103517. // "required": true,
  103518. // "type": "string"
  103519. // }
  103520. // },
  103521. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  103522. // "response": {
  103523. // "$ref": "Operation"
  103524. // },
  103525. // "scopes": [
  103526. // "https://www.googleapis.com/auth/cloud-platform",
  103527. // "https://www.googleapis.com/auth/compute"
  103528. // ]
  103529. // }
  103530. }
  103531. // method id "compute.targetInstances.get":
  103532. type TargetInstancesGetCall struct {
  103533. s *Service
  103534. project string
  103535. zone string
  103536. targetInstance string
  103537. urlParams_ gensupport.URLParams
  103538. ifNoneMatch_ string
  103539. ctx_ context.Context
  103540. header_ http.Header
  103541. }
  103542. // Get: Returns the specified TargetInstance resource. Gets a list of
  103543. // available target instances by making a list() request.
  103544. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  103545. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  103546. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103547. c.project = project
  103548. c.zone = zone
  103549. c.targetInstance = targetInstance
  103550. return c
  103551. }
  103552. // Fields allows partial responses to be retrieved. See
  103553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103554. // for more information.
  103555. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  103556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103557. return c
  103558. }
  103559. // IfNoneMatch sets the optional parameter which makes the operation
  103560. // fail if the object's ETag matches the given value. This is useful for
  103561. // getting updates only after the object has changed since the last
  103562. // request. Use googleapi.IsNotModified to check whether the response
  103563. // error from Do is the result of In-None-Match.
  103564. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  103565. c.ifNoneMatch_ = entityTag
  103566. return c
  103567. }
  103568. // Context sets the context to be used in this call's Do method. Any
  103569. // pending HTTP request will be aborted if the provided context is
  103570. // canceled.
  103571. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  103572. c.ctx_ = ctx
  103573. return c
  103574. }
  103575. // Header returns an http.Header that can be modified by the caller to
  103576. // add HTTP headers to the request.
  103577. func (c *TargetInstancesGetCall) Header() http.Header {
  103578. if c.header_ == nil {
  103579. c.header_ = make(http.Header)
  103580. }
  103581. return c.header_
  103582. }
  103583. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  103584. reqHeaders := make(http.Header)
  103585. for k, v := range c.header_ {
  103586. reqHeaders[k] = v
  103587. }
  103588. reqHeaders.Set("User-Agent", c.s.userAgent())
  103589. if c.ifNoneMatch_ != "" {
  103590. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103591. }
  103592. var body io.Reader = nil
  103593. c.urlParams_.Set("alt", alt)
  103594. c.urlParams_.Set("prettyPrint", "false")
  103595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  103596. urls += "?" + c.urlParams_.Encode()
  103597. req, err := http.NewRequest("GET", urls, body)
  103598. if err != nil {
  103599. return nil, err
  103600. }
  103601. req.Header = reqHeaders
  103602. googleapi.Expand(req.URL, map[string]string{
  103603. "project": c.project,
  103604. "zone": c.zone,
  103605. "targetInstance": c.targetInstance,
  103606. })
  103607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103608. }
  103609. // Do executes the "compute.targetInstances.get" call.
  103610. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  103611. // status code is an error. Response headers are in either
  103612. // *TargetInstance.ServerResponse.Header or (if a response was returned
  103613. // at all) in error.(*googleapi.Error).Header. Use
  103614. // googleapi.IsNotModified to check whether the returned error was
  103615. // because http.StatusNotModified was returned.
  103616. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  103617. gensupport.SetOptions(c.urlParams_, opts...)
  103618. res, err := c.doRequest("json")
  103619. if res != nil && res.StatusCode == http.StatusNotModified {
  103620. if res.Body != nil {
  103621. res.Body.Close()
  103622. }
  103623. return nil, &googleapi.Error{
  103624. Code: res.StatusCode,
  103625. Header: res.Header,
  103626. }
  103627. }
  103628. if err != nil {
  103629. return nil, err
  103630. }
  103631. defer googleapi.CloseBody(res)
  103632. if err := googleapi.CheckResponse(res); err != nil {
  103633. return nil, err
  103634. }
  103635. ret := &TargetInstance{
  103636. ServerResponse: googleapi.ServerResponse{
  103637. Header: res.Header,
  103638. HTTPStatusCode: res.StatusCode,
  103639. },
  103640. }
  103641. target := &ret
  103642. if err := gensupport.DecodeResponse(target, res); err != nil {
  103643. return nil, err
  103644. }
  103645. return ret, nil
  103646. // {
  103647. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  103648. // "httpMethod": "GET",
  103649. // "id": "compute.targetInstances.get",
  103650. // "parameterOrder": [
  103651. // "project",
  103652. // "zone",
  103653. // "targetInstance"
  103654. // ],
  103655. // "parameters": {
  103656. // "project": {
  103657. // "description": "Project ID for this request.",
  103658. // "location": "path",
  103659. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103660. // "required": true,
  103661. // "type": "string"
  103662. // },
  103663. // "targetInstance": {
  103664. // "description": "Name of the TargetInstance resource to return.",
  103665. // "location": "path",
  103666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103667. // "required": true,
  103668. // "type": "string"
  103669. // },
  103670. // "zone": {
  103671. // "description": "Name of the zone scoping this request.",
  103672. // "location": "path",
  103673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103674. // "required": true,
  103675. // "type": "string"
  103676. // }
  103677. // },
  103678. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  103679. // "response": {
  103680. // "$ref": "TargetInstance"
  103681. // },
  103682. // "scopes": [
  103683. // "https://www.googleapis.com/auth/cloud-platform",
  103684. // "https://www.googleapis.com/auth/compute",
  103685. // "https://www.googleapis.com/auth/compute.readonly"
  103686. // ]
  103687. // }
  103688. }
  103689. // method id "compute.targetInstances.insert":
  103690. type TargetInstancesInsertCall struct {
  103691. s *Service
  103692. project string
  103693. zone string
  103694. targetinstance *TargetInstance
  103695. urlParams_ gensupport.URLParams
  103696. ctx_ context.Context
  103697. header_ http.Header
  103698. }
  103699. // Insert: Creates a TargetInstance resource in the specified project
  103700. // and zone using the data included in the request.
  103701. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  103702. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  103703. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103704. c.project = project
  103705. c.zone = zone
  103706. c.targetinstance = targetinstance
  103707. return c
  103708. }
  103709. // RequestId sets the optional parameter "requestId": An optional
  103710. // request ID to identify requests. Specify a unique request ID so that
  103711. // if you must retry your request, the server will know to ignore the
  103712. // request if it has already been completed.
  103713. //
  103714. // For example, consider a situation where you make an initial request
  103715. // and the request times out. If you make the request again with the
  103716. // same request ID, the server can check if original operation with the
  103717. // same request ID was received, and if so, will ignore the second
  103718. // request. This prevents clients from accidentally creating duplicate
  103719. // commitments.
  103720. //
  103721. // The request ID must be a valid UUID with the exception that zero UUID
  103722. // is not supported (00000000-0000-0000-0000-000000000000).
  103723. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  103724. c.urlParams_.Set("requestId", requestId)
  103725. return c
  103726. }
  103727. // Fields allows partial responses to be retrieved. See
  103728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103729. // for more information.
  103730. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  103731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103732. return c
  103733. }
  103734. // Context sets the context to be used in this call's Do method. Any
  103735. // pending HTTP request will be aborted if the provided context is
  103736. // canceled.
  103737. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  103738. c.ctx_ = ctx
  103739. return c
  103740. }
  103741. // Header returns an http.Header that can be modified by the caller to
  103742. // add HTTP headers to the request.
  103743. func (c *TargetInstancesInsertCall) Header() http.Header {
  103744. if c.header_ == nil {
  103745. c.header_ = make(http.Header)
  103746. }
  103747. return c.header_
  103748. }
  103749. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  103750. reqHeaders := make(http.Header)
  103751. for k, v := range c.header_ {
  103752. reqHeaders[k] = v
  103753. }
  103754. reqHeaders.Set("User-Agent", c.s.userAgent())
  103755. var body io.Reader = nil
  103756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  103757. if err != nil {
  103758. return nil, err
  103759. }
  103760. reqHeaders.Set("Content-Type", "application/json")
  103761. c.urlParams_.Set("alt", alt)
  103762. c.urlParams_.Set("prettyPrint", "false")
  103763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  103764. urls += "?" + c.urlParams_.Encode()
  103765. req, err := http.NewRequest("POST", urls, body)
  103766. if err != nil {
  103767. return nil, err
  103768. }
  103769. req.Header = reqHeaders
  103770. googleapi.Expand(req.URL, map[string]string{
  103771. "project": c.project,
  103772. "zone": c.zone,
  103773. })
  103774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103775. }
  103776. // Do executes the "compute.targetInstances.insert" call.
  103777. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103778. // status code is an error. Response headers are in either
  103779. // *Operation.ServerResponse.Header or (if a response was returned at
  103780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103781. // to check whether the returned error was because
  103782. // http.StatusNotModified was returned.
  103783. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103784. gensupport.SetOptions(c.urlParams_, opts...)
  103785. res, err := c.doRequest("json")
  103786. if res != nil && res.StatusCode == http.StatusNotModified {
  103787. if res.Body != nil {
  103788. res.Body.Close()
  103789. }
  103790. return nil, &googleapi.Error{
  103791. Code: res.StatusCode,
  103792. Header: res.Header,
  103793. }
  103794. }
  103795. if err != nil {
  103796. return nil, err
  103797. }
  103798. defer googleapi.CloseBody(res)
  103799. if err := googleapi.CheckResponse(res); err != nil {
  103800. return nil, err
  103801. }
  103802. ret := &Operation{
  103803. ServerResponse: googleapi.ServerResponse{
  103804. Header: res.Header,
  103805. HTTPStatusCode: res.StatusCode,
  103806. },
  103807. }
  103808. target := &ret
  103809. if err := gensupport.DecodeResponse(target, res); err != nil {
  103810. return nil, err
  103811. }
  103812. return ret, nil
  103813. // {
  103814. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  103815. // "httpMethod": "POST",
  103816. // "id": "compute.targetInstances.insert",
  103817. // "parameterOrder": [
  103818. // "project",
  103819. // "zone"
  103820. // ],
  103821. // "parameters": {
  103822. // "project": {
  103823. // "description": "Project ID for this request.",
  103824. // "location": "path",
  103825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103826. // "required": true,
  103827. // "type": "string"
  103828. // },
  103829. // "requestId": {
  103830. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103831. // "location": "query",
  103832. // "type": "string"
  103833. // },
  103834. // "zone": {
  103835. // "description": "Name of the zone scoping this request.",
  103836. // "location": "path",
  103837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103838. // "required": true,
  103839. // "type": "string"
  103840. // }
  103841. // },
  103842. // "path": "{project}/zones/{zone}/targetInstances",
  103843. // "request": {
  103844. // "$ref": "TargetInstance"
  103845. // },
  103846. // "response": {
  103847. // "$ref": "Operation"
  103848. // },
  103849. // "scopes": [
  103850. // "https://www.googleapis.com/auth/cloud-platform",
  103851. // "https://www.googleapis.com/auth/compute"
  103852. // ]
  103853. // }
  103854. }
  103855. // method id "compute.targetInstances.list":
  103856. type TargetInstancesListCall struct {
  103857. s *Service
  103858. project string
  103859. zone string
  103860. urlParams_ gensupport.URLParams
  103861. ifNoneMatch_ string
  103862. ctx_ context.Context
  103863. header_ http.Header
  103864. }
  103865. // List: Retrieves a list of TargetInstance resources available to the
  103866. // specified project and zone.
  103867. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  103868. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  103869. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103870. c.project = project
  103871. c.zone = zone
  103872. return c
  103873. }
  103874. // Filter sets the optional parameter "filter": A filter expression that
  103875. // filters resources listed in the response. The expression must specify
  103876. // the field name, a comparison operator, and the value that you want to
  103877. // use for filtering. The value must be a string, a number, or a
  103878. // boolean. The comparison operator must be either =, !=, >, or <.
  103879. //
  103880. // For example, if you are filtering Compute Engine instances, you can
  103881. // exclude instances named example-instance by specifying name !=
  103882. // example-instance.
  103883. //
  103884. // You can also filter nested fields. For example, you could specify
  103885. // scheduling.automaticRestart = false to include instances only if they
  103886. // are not scheduled for automatic restarts. You can use filtering on
  103887. // nested fields to filter based on resource labels.
  103888. //
  103889. // To filter on multiple expressions, provide each separate expression
  103890. // within parentheses. For example, (scheduling.automaticRestart = true)
  103891. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103892. // AND expression. However, you can include AND and OR expressions
  103893. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103894. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103895. // true).
  103896. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  103897. c.urlParams_.Set("filter", filter)
  103898. return c
  103899. }
  103900. // MaxResults sets the optional parameter "maxResults": The maximum
  103901. // number of results per page that should be returned. If the number of
  103902. // available results is larger than maxResults, Compute Engine returns a
  103903. // nextPageToken that can be used to get the next page of results in
  103904. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103905. // (Default: 500)
  103906. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  103907. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103908. return c
  103909. }
  103910. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103911. // a certain order. By default, results are returned in alphanumerical
  103912. // order based on the resource name.
  103913. //
  103914. // You can also sort results in descending order based on the creation
  103915. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103916. // based on the creationTimestamp field in reverse chronological order
  103917. // (newest result first). Use this to sort resources like operations so
  103918. // that the newest operation is returned first.
  103919. //
  103920. // Currently, only sorting by name or creationTimestamp desc is
  103921. // supported.
  103922. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  103923. c.urlParams_.Set("orderBy", orderBy)
  103924. return c
  103925. }
  103926. // PageToken sets the optional parameter "pageToken": Specifies a page
  103927. // token to use. Set pageToken to the nextPageToken returned by a
  103928. // previous list request to get the next page of results.
  103929. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  103930. c.urlParams_.Set("pageToken", pageToken)
  103931. return c
  103932. }
  103933. // Fields allows partial responses to be retrieved. See
  103934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103935. // for more information.
  103936. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  103937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103938. return c
  103939. }
  103940. // IfNoneMatch sets the optional parameter which makes the operation
  103941. // fail if the object's ETag matches the given value. This is useful for
  103942. // getting updates only after the object has changed since the last
  103943. // request. Use googleapi.IsNotModified to check whether the response
  103944. // error from Do is the result of In-None-Match.
  103945. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  103946. c.ifNoneMatch_ = entityTag
  103947. return c
  103948. }
  103949. // Context sets the context to be used in this call's Do method. Any
  103950. // pending HTTP request will be aborted if the provided context is
  103951. // canceled.
  103952. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  103953. c.ctx_ = ctx
  103954. return c
  103955. }
  103956. // Header returns an http.Header that can be modified by the caller to
  103957. // add HTTP headers to the request.
  103958. func (c *TargetInstancesListCall) Header() http.Header {
  103959. if c.header_ == nil {
  103960. c.header_ = make(http.Header)
  103961. }
  103962. return c.header_
  103963. }
  103964. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  103965. reqHeaders := make(http.Header)
  103966. for k, v := range c.header_ {
  103967. reqHeaders[k] = v
  103968. }
  103969. reqHeaders.Set("User-Agent", c.s.userAgent())
  103970. if c.ifNoneMatch_ != "" {
  103971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103972. }
  103973. var body io.Reader = nil
  103974. c.urlParams_.Set("alt", alt)
  103975. c.urlParams_.Set("prettyPrint", "false")
  103976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  103977. urls += "?" + c.urlParams_.Encode()
  103978. req, err := http.NewRequest("GET", urls, body)
  103979. if err != nil {
  103980. return nil, err
  103981. }
  103982. req.Header = reqHeaders
  103983. googleapi.Expand(req.URL, map[string]string{
  103984. "project": c.project,
  103985. "zone": c.zone,
  103986. })
  103987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103988. }
  103989. // Do executes the "compute.targetInstances.list" call.
  103990. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  103991. // non-2xx status code is an error. Response headers are in either
  103992. // *TargetInstanceList.ServerResponse.Header or (if a response was
  103993. // returned at all) in error.(*googleapi.Error).Header. Use
  103994. // googleapi.IsNotModified to check whether the returned error was
  103995. // because http.StatusNotModified was returned.
  103996. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  103997. gensupport.SetOptions(c.urlParams_, opts...)
  103998. res, err := c.doRequest("json")
  103999. if res != nil && res.StatusCode == http.StatusNotModified {
  104000. if res.Body != nil {
  104001. res.Body.Close()
  104002. }
  104003. return nil, &googleapi.Error{
  104004. Code: res.StatusCode,
  104005. Header: res.Header,
  104006. }
  104007. }
  104008. if err != nil {
  104009. return nil, err
  104010. }
  104011. defer googleapi.CloseBody(res)
  104012. if err := googleapi.CheckResponse(res); err != nil {
  104013. return nil, err
  104014. }
  104015. ret := &TargetInstanceList{
  104016. ServerResponse: googleapi.ServerResponse{
  104017. Header: res.Header,
  104018. HTTPStatusCode: res.StatusCode,
  104019. },
  104020. }
  104021. target := &ret
  104022. if err := gensupport.DecodeResponse(target, res); err != nil {
  104023. return nil, err
  104024. }
  104025. return ret, nil
  104026. // {
  104027. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  104028. // "httpMethod": "GET",
  104029. // "id": "compute.targetInstances.list",
  104030. // "parameterOrder": [
  104031. // "project",
  104032. // "zone"
  104033. // ],
  104034. // "parameters": {
  104035. // "filter": {
  104036. // "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).",
  104037. // "location": "query",
  104038. // "type": "string"
  104039. // },
  104040. // "maxResults": {
  104041. // "default": "500",
  104042. // "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)",
  104043. // "format": "uint32",
  104044. // "location": "query",
  104045. // "minimum": "0",
  104046. // "type": "integer"
  104047. // },
  104048. // "orderBy": {
  104049. // "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.",
  104050. // "location": "query",
  104051. // "type": "string"
  104052. // },
  104053. // "pageToken": {
  104054. // "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.",
  104055. // "location": "query",
  104056. // "type": "string"
  104057. // },
  104058. // "project": {
  104059. // "description": "Project ID for this request.",
  104060. // "location": "path",
  104061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104062. // "required": true,
  104063. // "type": "string"
  104064. // },
  104065. // "zone": {
  104066. // "description": "Name of the zone scoping this request.",
  104067. // "location": "path",
  104068. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104069. // "required": true,
  104070. // "type": "string"
  104071. // }
  104072. // },
  104073. // "path": "{project}/zones/{zone}/targetInstances",
  104074. // "response": {
  104075. // "$ref": "TargetInstanceList"
  104076. // },
  104077. // "scopes": [
  104078. // "https://www.googleapis.com/auth/cloud-platform",
  104079. // "https://www.googleapis.com/auth/compute",
  104080. // "https://www.googleapis.com/auth/compute.readonly"
  104081. // ]
  104082. // }
  104083. }
  104084. // Pages invokes f for each page of results.
  104085. // A non-nil error returned from f will halt the iteration.
  104086. // The provided context supersedes any context provided to the Context method.
  104087. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  104088. c.ctx_ = ctx
  104089. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104090. for {
  104091. x, err := c.Do()
  104092. if err != nil {
  104093. return err
  104094. }
  104095. if err := f(x); err != nil {
  104096. return err
  104097. }
  104098. if x.NextPageToken == "" {
  104099. return nil
  104100. }
  104101. c.PageToken(x.NextPageToken)
  104102. }
  104103. }
  104104. // method id "compute.targetInstances.testIamPermissions":
  104105. type TargetInstancesTestIamPermissionsCall struct {
  104106. s *Service
  104107. project string
  104108. zone string
  104109. resource string
  104110. testpermissionsrequest *TestPermissionsRequest
  104111. urlParams_ gensupport.URLParams
  104112. ctx_ context.Context
  104113. header_ http.Header
  104114. }
  104115. // TestIamPermissions: Returns permissions that a caller has on the
  104116. // specified resource.
  104117. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  104118. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104119. c.project = project
  104120. c.zone = zone
  104121. c.resource = resource
  104122. c.testpermissionsrequest = testpermissionsrequest
  104123. return c
  104124. }
  104125. // Fields allows partial responses to be retrieved. See
  104126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104127. // for more information.
  104128. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  104129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104130. return c
  104131. }
  104132. // Context sets the context to be used in this call's Do method. Any
  104133. // pending HTTP request will be aborted if the provided context is
  104134. // canceled.
  104135. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  104136. c.ctx_ = ctx
  104137. return c
  104138. }
  104139. // Header returns an http.Header that can be modified by the caller to
  104140. // add HTTP headers to the request.
  104141. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  104142. if c.header_ == nil {
  104143. c.header_ = make(http.Header)
  104144. }
  104145. return c.header_
  104146. }
  104147. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  104148. reqHeaders := make(http.Header)
  104149. for k, v := range c.header_ {
  104150. reqHeaders[k] = v
  104151. }
  104152. reqHeaders.Set("User-Agent", c.s.userAgent())
  104153. var body io.Reader = nil
  104154. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  104155. if err != nil {
  104156. return nil, err
  104157. }
  104158. reqHeaders.Set("Content-Type", "application/json")
  104159. c.urlParams_.Set("alt", alt)
  104160. c.urlParams_.Set("prettyPrint", "false")
  104161. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  104162. urls += "?" + c.urlParams_.Encode()
  104163. req, err := http.NewRequest("POST", urls, body)
  104164. if err != nil {
  104165. return nil, err
  104166. }
  104167. req.Header = reqHeaders
  104168. googleapi.Expand(req.URL, map[string]string{
  104169. "project": c.project,
  104170. "zone": c.zone,
  104171. "resource": c.resource,
  104172. })
  104173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104174. }
  104175. // Do executes the "compute.targetInstances.testIamPermissions" call.
  104176. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  104177. // non-2xx status code is an error. Response headers are in either
  104178. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  104179. // returned at all) in error.(*googleapi.Error).Header. Use
  104180. // googleapi.IsNotModified to check whether the returned error was
  104181. // because http.StatusNotModified was returned.
  104182. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  104183. gensupport.SetOptions(c.urlParams_, opts...)
  104184. res, err := c.doRequest("json")
  104185. if res != nil && res.StatusCode == http.StatusNotModified {
  104186. if res.Body != nil {
  104187. res.Body.Close()
  104188. }
  104189. return nil, &googleapi.Error{
  104190. Code: res.StatusCode,
  104191. Header: res.Header,
  104192. }
  104193. }
  104194. if err != nil {
  104195. return nil, err
  104196. }
  104197. defer googleapi.CloseBody(res)
  104198. if err := googleapi.CheckResponse(res); err != nil {
  104199. return nil, err
  104200. }
  104201. ret := &TestPermissionsResponse{
  104202. ServerResponse: googleapi.ServerResponse{
  104203. Header: res.Header,
  104204. HTTPStatusCode: res.StatusCode,
  104205. },
  104206. }
  104207. target := &ret
  104208. if err := gensupport.DecodeResponse(target, res); err != nil {
  104209. return nil, err
  104210. }
  104211. return ret, nil
  104212. // {
  104213. // "description": "Returns permissions that a caller has on the specified resource.",
  104214. // "httpMethod": "POST",
  104215. // "id": "compute.targetInstances.testIamPermissions",
  104216. // "parameterOrder": [
  104217. // "project",
  104218. // "zone",
  104219. // "resource"
  104220. // ],
  104221. // "parameters": {
  104222. // "project": {
  104223. // "description": "Project ID for this request.",
  104224. // "location": "path",
  104225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104226. // "required": true,
  104227. // "type": "string"
  104228. // },
  104229. // "resource": {
  104230. // "description": "Name or id of the resource for this request.",
  104231. // "location": "path",
  104232. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104233. // "required": true,
  104234. // "type": "string"
  104235. // },
  104236. // "zone": {
  104237. // "description": "The name of the zone for this request.",
  104238. // "location": "path",
  104239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104240. // "required": true,
  104241. // "type": "string"
  104242. // }
  104243. // },
  104244. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  104245. // "request": {
  104246. // "$ref": "TestPermissionsRequest"
  104247. // },
  104248. // "response": {
  104249. // "$ref": "TestPermissionsResponse"
  104250. // },
  104251. // "scopes": [
  104252. // "https://www.googleapis.com/auth/cloud-platform",
  104253. // "https://www.googleapis.com/auth/compute",
  104254. // "https://www.googleapis.com/auth/compute.readonly"
  104255. // ]
  104256. // }
  104257. }
  104258. // method id "compute.targetPools.addHealthCheck":
  104259. type TargetPoolsAddHealthCheckCall struct {
  104260. s *Service
  104261. project string
  104262. region string
  104263. targetPool string
  104264. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  104265. urlParams_ gensupport.URLParams
  104266. ctx_ context.Context
  104267. header_ http.Header
  104268. }
  104269. // AddHealthCheck: Adds health check URLs to a target pool.
  104270. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  104271. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  104272. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104273. c.project = project
  104274. c.region = region
  104275. c.targetPool = targetPool
  104276. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  104277. return c
  104278. }
  104279. // RequestId sets the optional parameter "requestId": An optional
  104280. // request ID to identify requests. Specify a unique request ID so that
  104281. // if you must retry your request, the server will know to ignore the
  104282. // request if it has already been completed.
  104283. //
  104284. // For example, consider a situation where you make an initial request
  104285. // and the request times out. If you make the request again with the
  104286. // same request ID, the server can check if original operation with the
  104287. // same request ID was received, and if so, will ignore the second
  104288. // request. This prevents clients from accidentally creating duplicate
  104289. // commitments.
  104290. //
  104291. // The request ID must be a valid UUID with the exception that zero UUID
  104292. // is not supported (00000000-0000-0000-0000-000000000000).
  104293. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  104294. c.urlParams_.Set("requestId", requestId)
  104295. return c
  104296. }
  104297. // Fields allows partial responses to be retrieved. See
  104298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104299. // for more information.
  104300. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  104301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104302. return c
  104303. }
  104304. // Context sets the context to be used in this call's Do method. Any
  104305. // pending HTTP request will be aborted if the provided context is
  104306. // canceled.
  104307. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  104308. c.ctx_ = ctx
  104309. return c
  104310. }
  104311. // Header returns an http.Header that can be modified by the caller to
  104312. // add HTTP headers to the request.
  104313. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  104314. if c.header_ == nil {
  104315. c.header_ = make(http.Header)
  104316. }
  104317. return c.header_
  104318. }
  104319. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  104320. reqHeaders := make(http.Header)
  104321. for k, v := range c.header_ {
  104322. reqHeaders[k] = v
  104323. }
  104324. reqHeaders.Set("User-Agent", c.s.userAgent())
  104325. var body io.Reader = nil
  104326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  104327. if err != nil {
  104328. return nil, err
  104329. }
  104330. reqHeaders.Set("Content-Type", "application/json")
  104331. c.urlParams_.Set("alt", alt)
  104332. c.urlParams_.Set("prettyPrint", "false")
  104333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  104334. urls += "?" + c.urlParams_.Encode()
  104335. req, err := http.NewRequest("POST", urls, body)
  104336. if err != nil {
  104337. return nil, err
  104338. }
  104339. req.Header = reqHeaders
  104340. googleapi.Expand(req.URL, map[string]string{
  104341. "project": c.project,
  104342. "region": c.region,
  104343. "targetPool": c.targetPool,
  104344. })
  104345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104346. }
  104347. // Do executes the "compute.targetPools.addHealthCheck" call.
  104348. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104349. // status code is an error. Response headers are in either
  104350. // *Operation.ServerResponse.Header or (if a response was returned at
  104351. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104352. // to check whether the returned error was because
  104353. // http.StatusNotModified was returned.
  104354. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104355. gensupport.SetOptions(c.urlParams_, opts...)
  104356. res, err := c.doRequest("json")
  104357. if res != nil && res.StatusCode == http.StatusNotModified {
  104358. if res.Body != nil {
  104359. res.Body.Close()
  104360. }
  104361. return nil, &googleapi.Error{
  104362. Code: res.StatusCode,
  104363. Header: res.Header,
  104364. }
  104365. }
  104366. if err != nil {
  104367. return nil, err
  104368. }
  104369. defer googleapi.CloseBody(res)
  104370. if err := googleapi.CheckResponse(res); err != nil {
  104371. return nil, err
  104372. }
  104373. ret := &Operation{
  104374. ServerResponse: googleapi.ServerResponse{
  104375. Header: res.Header,
  104376. HTTPStatusCode: res.StatusCode,
  104377. },
  104378. }
  104379. target := &ret
  104380. if err := gensupport.DecodeResponse(target, res); err != nil {
  104381. return nil, err
  104382. }
  104383. return ret, nil
  104384. // {
  104385. // "description": "Adds health check URLs to a target pool.",
  104386. // "httpMethod": "POST",
  104387. // "id": "compute.targetPools.addHealthCheck",
  104388. // "parameterOrder": [
  104389. // "project",
  104390. // "region",
  104391. // "targetPool"
  104392. // ],
  104393. // "parameters": {
  104394. // "project": {
  104395. // "description": "Project ID for this request.",
  104396. // "location": "path",
  104397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104398. // "required": true,
  104399. // "type": "string"
  104400. // },
  104401. // "region": {
  104402. // "description": "Name of the region scoping this request.",
  104403. // "location": "path",
  104404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104405. // "required": true,
  104406. // "type": "string"
  104407. // },
  104408. // "requestId": {
  104409. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104410. // "location": "query",
  104411. // "type": "string"
  104412. // },
  104413. // "targetPool": {
  104414. // "description": "Name of the target pool to add a health check to.",
  104415. // "location": "path",
  104416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104417. // "required": true,
  104418. // "type": "string"
  104419. // }
  104420. // },
  104421. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  104422. // "request": {
  104423. // "$ref": "TargetPoolsAddHealthCheckRequest"
  104424. // },
  104425. // "response": {
  104426. // "$ref": "Operation"
  104427. // },
  104428. // "scopes": [
  104429. // "https://www.googleapis.com/auth/cloud-platform",
  104430. // "https://www.googleapis.com/auth/compute"
  104431. // ]
  104432. // }
  104433. }
  104434. // method id "compute.targetPools.addInstance":
  104435. type TargetPoolsAddInstanceCall struct {
  104436. s *Service
  104437. project string
  104438. region string
  104439. targetPool string
  104440. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  104441. urlParams_ gensupport.URLParams
  104442. ctx_ context.Context
  104443. header_ http.Header
  104444. }
  104445. // AddInstance: Adds an instance to a target pool.
  104446. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  104447. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  104448. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104449. c.project = project
  104450. c.region = region
  104451. c.targetPool = targetPool
  104452. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  104453. return c
  104454. }
  104455. // RequestId sets the optional parameter "requestId": An optional
  104456. // request ID to identify requests. Specify a unique request ID so that
  104457. // if you must retry your request, the server will know to ignore the
  104458. // request if it has already been completed.
  104459. //
  104460. // For example, consider a situation where you make an initial request
  104461. // and the request times out. If you make the request again with the
  104462. // same request ID, the server can check if original operation with the
  104463. // same request ID was received, and if so, will ignore the second
  104464. // request. This prevents clients from accidentally creating duplicate
  104465. // commitments.
  104466. //
  104467. // The request ID must be a valid UUID with the exception that zero UUID
  104468. // is not supported (00000000-0000-0000-0000-000000000000).
  104469. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  104470. c.urlParams_.Set("requestId", requestId)
  104471. return c
  104472. }
  104473. // Fields allows partial responses to be retrieved. See
  104474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104475. // for more information.
  104476. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  104477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104478. return c
  104479. }
  104480. // Context sets the context to be used in this call's Do method. Any
  104481. // pending HTTP request will be aborted if the provided context is
  104482. // canceled.
  104483. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  104484. c.ctx_ = ctx
  104485. return c
  104486. }
  104487. // Header returns an http.Header that can be modified by the caller to
  104488. // add HTTP headers to the request.
  104489. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  104490. if c.header_ == nil {
  104491. c.header_ = make(http.Header)
  104492. }
  104493. return c.header_
  104494. }
  104495. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  104496. reqHeaders := make(http.Header)
  104497. for k, v := range c.header_ {
  104498. reqHeaders[k] = v
  104499. }
  104500. reqHeaders.Set("User-Agent", c.s.userAgent())
  104501. var body io.Reader = nil
  104502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  104503. if err != nil {
  104504. return nil, err
  104505. }
  104506. reqHeaders.Set("Content-Type", "application/json")
  104507. c.urlParams_.Set("alt", alt)
  104508. c.urlParams_.Set("prettyPrint", "false")
  104509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  104510. urls += "?" + c.urlParams_.Encode()
  104511. req, err := http.NewRequest("POST", urls, body)
  104512. if err != nil {
  104513. return nil, err
  104514. }
  104515. req.Header = reqHeaders
  104516. googleapi.Expand(req.URL, map[string]string{
  104517. "project": c.project,
  104518. "region": c.region,
  104519. "targetPool": c.targetPool,
  104520. })
  104521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104522. }
  104523. // Do executes the "compute.targetPools.addInstance" call.
  104524. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104525. // status code is an error. Response headers are in either
  104526. // *Operation.ServerResponse.Header or (if a response was returned at
  104527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104528. // to check whether the returned error was because
  104529. // http.StatusNotModified was returned.
  104530. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104531. gensupport.SetOptions(c.urlParams_, opts...)
  104532. res, err := c.doRequest("json")
  104533. if res != nil && res.StatusCode == http.StatusNotModified {
  104534. if res.Body != nil {
  104535. res.Body.Close()
  104536. }
  104537. return nil, &googleapi.Error{
  104538. Code: res.StatusCode,
  104539. Header: res.Header,
  104540. }
  104541. }
  104542. if err != nil {
  104543. return nil, err
  104544. }
  104545. defer googleapi.CloseBody(res)
  104546. if err := googleapi.CheckResponse(res); err != nil {
  104547. return nil, err
  104548. }
  104549. ret := &Operation{
  104550. ServerResponse: googleapi.ServerResponse{
  104551. Header: res.Header,
  104552. HTTPStatusCode: res.StatusCode,
  104553. },
  104554. }
  104555. target := &ret
  104556. if err := gensupport.DecodeResponse(target, res); err != nil {
  104557. return nil, err
  104558. }
  104559. return ret, nil
  104560. // {
  104561. // "description": "Adds an instance to a target pool.",
  104562. // "httpMethod": "POST",
  104563. // "id": "compute.targetPools.addInstance",
  104564. // "parameterOrder": [
  104565. // "project",
  104566. // "region",
  104567. // "targetPool"
  104568. // ],
  104569. // "parameters": {
  104570. // "project": {
  104571. // "description": "Project ID for this request.",
  104572. // "location": "path",
  104573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104574. // "required": true,
  104575. // "type": "string"
  104576. // },
  104577. // "region": {
  104578. // "description": "Name of the region scoping this request.",
  104579. // "location": "path",
  104580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104581. // "required": true,
  104582. // "type": "string"
  104583. // },
  104584. // "requestId": {
  104585. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104586. // "location": "query",
  104587. // "type": "string"
  104588. // },
  104589. // "targetPool": {
  104590. // "description": "Name of the TargetPool resource to add instances to.",
  104591. // "location": "path",
  104592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104593. // "required": true,
  104594. // "type": "string"
  104595. // }
  104596. // },
  104597. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  104598. // "request": {
  104599. // "$ref": "TargetPoolsAddInstanceRequest"
  104600. // },
  104601. // "response": {
  104602. // "$ref": "Operation"
  104603. // },
  104604. // "scopes": [
  104605. // "https://www.googleapis.com/auth/cloud-platform",
  104606. // "https://www.googleapis.com/auth/compute"
  104607. // ]
  104608. // }
  104609. }
  104610. // method id "compute.targetPools.aggregatedList":
  104611. type TargetPoolsAggregatedListCall struct {
  104612. s *Service
  104613. project string
  104614. urlParams_ gensupport.URLParams
  104615. ifNoneMatch_ string
  104616. ctx_ context.Context
  104617. header_ http.Header
  104618. }
  104619. // AggregatedList: Retrieves an aggregated list of target pools.
  104620. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  104621. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  104622. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104623. c.project = project
  104624. return c
  104625. }
  104626. // Filter sets the optional parameter "filter": A filter expression that
  104627. // filters resources listed in the response. The expression must specify
  104628. // the field name, a comparison operator, and the value that you want to
  104629. // use for filtering. The value must be a string, a number, or a
  104630. // boolean. The comparison operator must be either =, !=, >, or <.
  104631. //
  104632. // For example, if you are filtering Compute Engine instances, you can
  104633. // exclude instances named example-instance by specifying name !=
  104634. // example-instance.
  104635. //
  104636. // You can also filter nested fields. For example, you could specify
  104637. // scheduling.automaticRestart = false to include instances only if they
  104638. // are not scheduled for automatic restarts. You can use filtering on
  104639. // nested fields to filter based on resource labels.
  104640. //
  104641. // To filter on multiple expressions, provide each separate expression
  104642. // within parentheses. For example, (scheduling.automaticRestart = true)
  104643. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  104644. // AND expression. However, you can include AND and OR expressions
  104645. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  104646. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  104647. // true).
  104648. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  104649. c.urlParams_.Set("filter", filter)
  104650. return c
  104651. }
  104652. // MaxResults sets the optional parameter "maxResults": The maximum
  104653. // number of results per page that should be returned. If the number of
  104654. // available results is larger than maxResults, Compute Engine returns a
  104655. // nextPageToken that can be used to get the next page of results in
  104656. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  104657. // (Default: 500)
  104658. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  104659. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  104660. return c
  104661. }
  104662. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  104663. // a certain order. By default, results are returned in alphanumerical
  104664. // order based on the resource name.
  104665. //
  104666. // You can also sort results in descending order based on the creation
  104667. // timestamp using orderBy="creationTimestamp desc". This sorts results
  104668. // based on the creationTimestamp field in reverse chronological order
  104669. // (newest result first). Use this to sort resources like operations so
  104670. // that the newest operation is returned first.
  104671. //
  104672. // Currently, only sorting by name or creationTimestamp desc is
  104673. // supported.
  104674. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  104675. c.urlParams_.Set("orderBy", orderBy)
  104676. return c
  104677. }
  104678. // PageToken sets the optional parameter "pageToken": Specifies a page
  104679. // token to use. Set pageToken to the nextPageToken returned by a
  104680. // previous list request to get the next page of results.
  104681. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  104682. c.urlParams_.Set("pageToken", pageToken)
  104683. return c
  104684. }
  104685. // Fields allows partial responses to be retrieved. See
  104686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104687. // for more information.
  104688. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  104689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104690. return c
  104691. }
  104692. // IfNoneMatch sets the optional parameter which makes the operation
  104693. // fail if the object's ETag matches the given value. This is useful for
  104694. // getting updates only after the object has changed since the last
  104695. // request. Use googleapi.IsNotModified to check whether the response
  104696. // error from Do is the result of In-None-Match.
  104697. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  104698. c.ifNoneMatch_ = entityTag
  104699. return c
  104700. }
  104701. // Context sets the context to be used in this call's Do method. Any
  104702. // pending HTTP request will be aborted if the provided context is
  104703. // canceled.
  104704. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  104705. c.ctx_ = ctx
  104706. return c
  104707. }
  104708. // Header returns an http.Header that can be modified by the caller to
  104709. // add HTTP headers to the request.
  104710. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  104711. if c.header_ == nil {
  104712. c.header_ = make(http.Header)
  104713. }
  104714. return c.header_
  104715. }
  104716. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  104717. reqHeaders := make(http.Header)
  104718. for k, v := range c.header_ {
  104719. reqHeaders[k] = v
  104720. }
  104721. reqHeaders.Set("User-Agent", c.s.userAgent())
  104722. if c.ifNoneMatch_ != "" {
  104723. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104724. }
  104725. var body io.Reader = nil
  104726. c.urlParams_.Set("alt", alt)
  104727. c.urlParams_.Set("prettyPrint", "false")
  104728. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  104729. urls += "?" + c.urlParams_.Encode()
  104730. req, err := http.NewRequest("GET", urls, body)
  104731. if err != nil {
  104732. return nil, err
  104733. }
  104734. req.Header = reqHeaders
  104735. googleapi.Expand(req.URL, map[string]string{
  104736. "project": c.project,
  104737. })
  104738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104739. }
  104740. // Do executes the "compute.targetPools.aggregatedList" call.
  104741. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  104742. // Any non-2xx status code is an error. Response headers are in either
  104743. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  104744. // returned at all) in error.(*googleapi.Error).Header. Use
  104745. // googleapi.IsNotModified to check whether the returned error was
  104746. // because http.StatusNotModified was returned.
  104747. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  104748. gensupport.SetOptions(c.urlParams_, opts...)
  104749. res, err := c.doRequest("json")
  104750. if res != nil && res.StatusCode == http.StatusNotModified {
  104751. if res.Body != nil {
  104752. res.Body.Close()
  104753. }
  104754. return nil, &googleapi.Error{
  104755. Code: res.StatusCode,
  104756. Header: res.Header,
  104757. }
  104758. }
  104759. if err != nil {
  104760. return nil, err
  104761. }
  104762. defer googleapi.CloseBody(res)
  104763. if err := googleapi.CheckResponse(res); err != nil {
  104764. return nil, err
  104765. }
  104766. ret := &TargetPoolAggregatedList{
  104767. ServerResponse: googleapi.ServerResponse{
  104768. Header: res.Header,
  104769. HTTPStatusCode: res.StatusCode,
  104770. },
  104771. }
  104772. target := &ret
  104773. if err := gensupport.DecodeResponse(target, res); err != nil {
  104774. return nil, err
  104775. }
  104776. return ret, nil
  104777. // {
  104778. // "description": "Retrieves an aggregated list of target pools.",
  104779. // "httpMethod": "GET",
  104780. // "id": "compute.targetPools.aggregatedList",
  104781. // "parameterOrder": [
  104782. // "project"
  104783. // ],
  104784. // "parameters": {
  104785. // "filter": {
  104786. // "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).",
  104787. // "location": "query",
  104788. // "type": "string"
  104789. // },
  104790. // "maxResults": {
  104791. // "default": "500",
  104792. // "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)",
  104793. // "format": "uint32",
  104794. // "location": "query",
  104795. // "minimum": "0",
  104796. // "type": "integer"
  104797. // },
  104798. // "orderBy": {
  104799. // "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.",
  104800. // "location": "query",
  104801. // "type": "string"
  104802. // },
  104803. // "pageToken": {
  104804. // "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.",
  104805. // "location": "query",
  104806. // "type": "string"
  104807. // },
  104808. // "project": {
  104809. // "description": "Project ID for this request.",
  104810. // "location": "path",
  104811. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104812. // "required": true,
  104813. // "type": "string"
  104814. // }
  104815. // },
  104816. // "path": "{project}/aggregated/targetPools",
  104817. // "response": {
  104818. // "$ref": "TargetPoolAggregatedList"
  104819. // },
  104820. // "scopes": [
  104821. // "https://www.googleapis.com/auth/cloud-platform",
  104822. // "https://www.googleapis.com/auth/compute",
  104823. // "https://www.googleapis.com/auth/compute.readonly"
  104824. // ]
  104825. // }
  104826. }
  104827. // Pages invokes f for each page of results.
  104828. // A non-nil error returned from f will halt the iteration.
  104829. // The provided context supersedes any context provided to the Context method.
  104830. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  104831. c.ctx_ = ctx
  104832. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104833. for {
  104834. x, err := c.Do()
  104835. if err != nil {
  104836. return err
  104837. }
  104838. if err := f(x); err != nil {
  104839. return err
  104840. }
  104841. if x.NextPageToken == "" {
  104842. return nil
  104843. }
  104844. c.PageToken(x.NextPageToken)
  104845. }
  104846. }
  104847. // method id "compute.targetPools.delete":
  104848. type TargetPoolsDeleteCall struct {
  104849. s *Service
  104850. project string
  104851. region string
  104852. targetPool string
  104853. urlParams_ gensupport.URLParams
  104854. ctx_ context.Context
  104855. header_ http.Header
  104856. }
  104857. // Delete: Deletes the specified target pool.
  104858. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  104859. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  104860. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104861. c.project = project
  104862. c.region = region
  104863. c.targetPool = targetPool
  104864. return c
  104865. }
  104866. // RequestId sets the optional parameter "requestId": An optional
  104867. // request ID to identify requests. Specify a unique request ID so that
  104868. // if you must retry your request, the server will know to ignore the
  104869. // request if it has already been completed.
  104870. //
  104871. // For example, consider a situation where you make an initial request
  104872. // and the request times out. If you make the request again with the
  104873. // same request ID, the server can check if original operation with the
  104874. // same request ID was received, and if so, will ignore the second
  104875. // request. This prevents clients from accidentally creating duplicate
  104876. // commitments.
  104877. //
  104878. // The request ID must be a valid UUID with the exception that zero UUID
  104879. // is not supported (00000000-0000-0000-0000-000000000000).
  104880. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  104881. c.urlParams_.Set("requestId", requestId)
  104882. return c
  104883. }
  104884. // Fields allows partial responses to be retrieved. See
  104885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104886. // for more information.
  104887. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  104888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104889. return c
  104890. }
  104891. // Context sets the context to be used in this call's Do method. Any
  104892. // pending HTTP request will be aborted if the provided context is
  104893. // canceled.
  104894. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  104895. c.ctx_ = ctx
  104896. return c
  104897. }
  104898. // Header returns an http.Header that can be modified by the caller to
  104899. // add HTTP headers to the request.
  104900. func (c *TargetPoolsDeleteCall) Header() http.Header {
  104901. if c.header_ == nil {
  104902. c.header_ = make(http.Header)
  104903. }
  104904. return c.header_
  104905. }
  104906. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  104907. reqHeaders := make(http.Header)
  104908. for k, v := range c.header_ {
  104909. reqHeaders[k] = v
  104910. }
  104911. reqHeaders.Set("User-Agent", c.s.userAgent())
  104912. var body io.Reader = nil
  104913. c.urlParams_.Set("alt", alt)
  104914. c.urlParams_.Set("prettyPrint", "false")
  104915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  104916. urls += "?" + c.urlParams_.Encode()
  104917. req, err := http.NewRequest("DELETE", urls, body)
  104918. if err != nil {
  104919. return nil, err
  104920. }
  104921. req.Header = reqHeaders
  104922. googleapi.Expand(req.URL, map[string]string{
  104923. "project": c.project,
  104924. "region": c.region,
  104925. "targetPool": c.targetPool,
  104926. })
  104927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104928. }
  104929. // Do executes the "compute.targetPools.delete" call.
  104930. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104931. // status code is an error. Response headers are in either
  104932. // *Operation.ServerResponse.Header or (if a response was returned at
  104933. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104934. // to check whether the returned error was because
  104935. // http.StatusNotModified was returned.
  104936. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104937. gensupport.SetOptions(c.urlParams_, opts...)
  104938. res, err := c.doRequest("json")
  104939. if res != nil && res.StatusCode == http.StatusNotModified {
  104940. if res.Body != nil {
  104941. res.Body.Close()
  104942. }
  104943. return nil, &googleapi.Error{
  104944. Code: res.StatusCode,
  104945. Header: res.Header,
  104946. }
  104947. }
  104948. if err != nil {
  104949. return nil, err
  104950. }
  104951. defer googleapi.CloseBody(res)
  104952. if err := googleapi.CheckResponse(res); err != nil {
  104953. return nil, err
  104954. }
  104955. ret := &Operation{
  104956. ServerResponse: googleapi.ServerResponse{
  104957. Header: res.Header,
  104958. HTTPStatusCode: res.StatusCode,
  104959. },
  104960. }
  104961. target := &ret
  104962. if err := gensupport.DecodeResponse(target, res); err != nil {
  104963. return nil, err
  104964. }
  104965. return ret, nil
  104966. // {
  104967. // "description": "Deletes the specified target pool.",
  104968. // "httpMethod": "DELETE",
  104969. // "id": "compute.targetPools.delete",
  104970. // "parameterOrder": [
  104971. // "project",
  104972. // "region",
  104973. // "targetPool"
  104974. // ],
  104975. // "parameters": {
  104976. // "project": {
  104977. // "description": "Project ID for this request.",
  104978. // "location": "path",
  104979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104980. // "required": true,
  104981. // "type": "string"
  104982. // },
  104983. // "region": {
  104984. // "description": "Name of the region scoping this request.",
  104985. // "location": "path",
  104986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104987. // "required": true,
  104988. // "type": "string"
  104989. // },
  104990. // "requestId": {
  104991. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104992. // "location": "query",
  104993. // "type": "string"
  104994. // },
  104995. // "targetPool": {
  104996. // "description": "Name of the TargetPool resource to delete.",
  104997. // "location": "path",
  104998. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104999. // "required": true,
  105000. // "type": "string"
  105001. // }
  105002. // },
  105003. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  105004. // "response": {
  105005. // "$ref": "Operation"
  105006. // },
  105007. // "scopes": [
  105008. // "https://www.googleapis.com/auth/cloud-platform",
  105009. // "https://www.googleapis.com/auth/compute"
  105010. // ]
  105011. // }
  105012. }
  105013. // method id "compute.targetPools.get":
  105014. type TargetPoolsGetCall struct {
  105015. s *Service
  105016. project string
  105017. region string
  105018. targetPool string
  105019. urlParams_ gensupport.URLParams
  105020. ifNoneMatch_ string
  105021. ctx_ context.Context
  105022. header_ http.Header
  105023. }
  105024. // Get: Returns the specified target pool. Gets a list of available
  105025. // target pools by making a list() request.
  105026. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  105027. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  105028. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105029. c.project = project
  105030. c.region = region
  105031. c.targetPool = targetPool
  105032. return c
  105033. }
  105034. // Fields allows partial responses to be retrieved. See
  105035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105036. // for more information.
  105037. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  105038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105039. return c
  105040. }
  105041. // IfNoneMatch sets the optional parameter which makes the operation
  105042. // fail if the object's ETag matches the given value. This is useful for
  105043. // getting updates only after the object has changed since the last
  105044. // request. Use googleapi.IsNotModified to check whether the response
  105045. // error from Do is the result of In-None-Match.
  105046. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  105047. c.ifNoneMatch_ = entityTag
  105048. return c
  105049. }
  105050. // Context sets the context to be used in this call's Do method. Any
  105051. // pending HTTP request will be aborted if the provided context is
  105052. // canceled.
  105053. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  105054. c.ctx_ = ctx
  105055. return c
  105056. }
  105057. // Header returns an http.Header that can be modified by the caller to
  105058. // add HTTP headers to the request.
  105059. func (c *TargetPoolsGetCall) Header() http.Header {
  105060. if c.header_ == nil {
  105061. c.header_ = make(http.Header)
  105062. }
  105063. return c.header_
  105064. }
  105065. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  105066. reqHeaders := make(http.Header)
  105067. for k, v := range c.header_ {
  105068. reqHeaders[k] = v
  105069. }
  105070. reqHeaders.Set("User-Agent", c.s.userAgent())
  105071. if c.ifNoneMatch_ != "" {
  105072. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105073. }
  105074. var body io.Reader = nil
  105075. c.urlParams_.Set("alt", alt)
  105076. c.urlParams_.Set("prettyPrint", "false")
  105077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  105078. urls += "?" + c.urlParams_.Encode()
  105079. req, err := http.NewRequest("GET", urls, body)
  105080. if err != nil {
  105081. return nil, err
  105082. }
  105083. req.Header = reqHeaders
  105084. googleapi.Expand(req.URL, map[string]string{
  105085. "project": c.project,
  105086. "region": c.region,
  105087. "targetPool": c.targetPool,
  105088. })
  105089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105090. }
  105091. // Do executes the "compute.targetPools.get" call.
  105092. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  105093. // status code is an error. Response headers are in either
  105094. // *TargetPool.ServerResponse.Header or (if a response was returned at
  105095. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105096. // to check whether the returned error was because
  105097. // http.StatusNotModified was returned.
  105098. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  105099. gensupport.SetOptions(c.urlParams_, opts...)
  105100. res, err := c.doRequest("json")
  105101. if res != nil && res.StatusCode == http.StatusNotModified {
  105102. if res.Body != nil {
  105103. res.Body.Close()
  105104. }
  105105. return nil, &googleapi.Error{
  105106. Code: res.StatusCode,
  105107. Header: res.Header,
  105108. }
  105109. }
  105110. if err != nil {
  105111. return nil, err
  105112. }
  105113. defer googleapi.CloseBody(res)
  105114. if err := googleapi.CheckResponse(res); err != nil {
  105115. return nil, err
  105116. }
  105117. ret := &TargetPool{
  105118. ServerResponse: googleapi.ServerResponse{
  105119. Header: res.Header,
  105120. HTTPStatusCode: res.StatusCode,
  105121. },
  105122. }
  105123. target := &ret
  105124. if err := gensupport.DecodeResponse(target, res); err != nil {
  105125. return nil, err
  105126. }
  105127. return ret, nil
  105128. // {
  105129. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  105130. // "httpMethod": "GET",
  105131. // "id": "compute.targetPools.get",
  105132. // "parameterOrder": [
  105133. // "project",
  105134. // "region",
  105135. // "targetPool"
  105136. // ],
  105137. // "parameters": {
  105138. // "project": {
  105139. // "description": "Project ID for this request.",
  105140. // "location": "path",
  105141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105142. // "required": true,
  105143. // "type": "string"
  105144. // },
  105145. // "region": {
  105146. // "description": "Name of the region scoping this request.",
  105147. // "location": "path",
  105148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105149. // "required": true,
  105150. // "type": "string"
  105151. // },
  105152. // "targetPool": {
  105153. // "description": "Name of the TargetPool resource to return.",
  105154. // "location": "path",
  105155. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105156. // "required": true,
  105157. // "type": "string"
  105158. // }
  105159. // },
  105160. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  105161. // "response": {
  105162. // "$ref": "TargetPool"
  105163. // },
  105164. // "scopes": [
  105165. // "https://www.googleapis.com/auth/cloud-platform",
  105166. // "https://www.googleapis.com/auth/compute",
  105167. // "https://www.googleapis.com/auth/compute.readonly"
  105168. // ]
  105169. // }
  105170. }
  105171. // method id "compute.targetPools.getHealth":
  105172. type TargetPoolsGetHealthCall struct {
  105173. s *Service
  105174. project string
  105175. region string
  105176. targetPool string
  105177. instancereference *InstanceReference
  105178. urlParams_ gensupport.URLParams
  105179. ctx_ context.Context
  105180. header_ http.Header
  105181. }
  105182. // GetHealth: Gets the most recent health check results for each IP for
  105183. // the instance that is referenced by the given target pool.
  105184. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  105185. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  105186. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105187. c.project = project
  105188. c.region = region
  105189. c.targetPool = targetPool
  105190. c.instancereference = instancereference
  105191. return c
  105192. }
  105193. // Fields allows partial responses to be retrieved. See
  105194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105195. // for more information.
  105196. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  105197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105198. return c
  105199. }
  105200. // Context sets the context to be used in this call's Do method. Any
  105201. // pending HTTP request will be aborted if the provided context is
  105202. // canceled.
  105203. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  105204. c.ctx_ = ctx
  105205. return c
  105206. }
  105207. // Header returns an http.Header that can be modified by the caller to
  105208. // add HTTP headers to the request.
  105209. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  105210. if c.header_ == nil {
  105211. c.header_ = make(http.Header)
  105212. }
  105213. return c.header_
  105214. }
  105215. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  105216. reqHeaders := make(http.Header)
  105217. for k, v := range c.header_ {
  105218. reqHeaders[k] = v
  105219. }
  105220. reqHeaders.Set("User-Agent", c.s.userAgent())
  105221. var body io.Reader = nil
  105222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  105223. if err != nil {
  105224. return nil, err
  105225. }
  105226. reqHeaders.Set("Content-Type", "application/json")
  105227. c.urlParams_.Set("alt", alt)
  105228. c.urlParams_.Set("prettyPrint", "false")
  105229. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  105230. urls += "?" + c.urlParams_.Encode()
  105231. req, err := http.NewRequest("POST", urls, body)
  105232. if err != nil {
  105233. return nil, err
  105234. }
  105235. req.Header = reqHeaders
  105236. googleapi.Expand(req.URL, map[string]string{
  105237. "project": c.project,
  105238. "region": c.region,
  105239. "targetPool": c.targetPool,
  105240. })
  105241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105242. }
  105243. // Do executes the "compute.targetPools.getHealth" call.
  105244. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  105245. // Any non-2xx status code is an error. Response headers are in either
  105246. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  105247. // returned at all) in error.(*googleapi.Error).Header. Use
  105248. // googleapi.IsNotModified to check whether the returned error was
  105249. // because http.StatusNotModified was returned.
  105250. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  105251. gensupport.SetOptions(c.urlParams_, opts...)
  105252. res, err := c.doRequest("json")
  105253. if res != nil && res.StatusCode == http.StatusNotModified {
  105254. if res.Body != nil {
  105255. res.Body.Close()
  105256. }
  105257. return nil, &googleapi.Error{
  105258. Code: res.StatusCode,
  105259. Header: res.Header,
  105260. }
  105261. }
  105262. if err != nil {
  105263. return nil, err
  105264. }
  105265. defer googleapi.CloseBody(res)
  105266. if err := googleapi.CheckResponse(res); err != nil {
  105267. return nil, err
  105268. }
  105269. ret := &TargetPoolInstanceHealth{
  105270. ServerResponse: googleapi.ServerResponse{
  105271. Header: res.Header,
  105272. HTTPStatusCode: res.StatusCode,
  105273. },
  105274. }
  105275. target := &ret
  105276. if err := gensupport.DecodeResponse(target, res); err != nil {
  105277. return nil, err
  105278. }
  105279. return ret, nil
  105280. // {
  105281. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  105282. // "httpMethod": "POST",
  105283. // "id": "compute.targetPools.getHealth",
  105284. // "parameterOrder": [
  105285. // "project",
  105286. // "region",
  105287. // "targetPool"
  105288. // ],
  105289. // "parameters": {
  105290. // "project": {
  105291. // "description": "Project ID for this request.",
  105292. // "location": "path",
  105293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105294. // "required": true,
  105295. // "type": "string"
  105296. // },
  105297. // "region": {
  105298. // "description": "Name of the region scoping this request.",
  105299. // "location": "path",
  105300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105301. // "required": true,
  105302. // "type": "string"
  105303. // },
  105304. // "targetPool": {
  105305. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  105306. // "location": "path",
  105307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105308. // "required": true,
  105309. // "type": "string"
  105310. // }
  105311. // },
  105312. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  105313. // "request": {
  105314. // "$ref": "InstanceReference"
  105315. // },
  105316. // "response": {
  105317. // "$ref": "TargetPoolInstanceHealth"
  105318. // },
  105319. // "scopes": [
  105320. // "https://www.googleapis.com/auth/cloud-platform",
  105321. // "https://www.googleapis.com/auth/compute",
  105322. // "https://www.googleapis.com/auth/compute.readonly"
  105323. // ]
  105324. // }
  105325. }
  105326. // method id "compute.targetPools.insert":
  105327. type TargetPoolsInsertCall struct {
  105328. s *Service
  105329. project string
  105330. region string
  105331. targetpool *TargetPool
  105332. urlParams_ gensupport.URLParams
  105333. ctx_ context.Context
  105334. header_ http.Header
  105335. }
  105336. // Insert: Creates a target pool in the specified project and region
  105337. // using the data included in the request.
  105338. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  105339. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  105340. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105341. c.project = project
  105342. c.region = region
  105343. c.targetpool = targetpool
  105344. return c
  105345. }
  105346. // RequestId sets the optional parameter "requestId": An optional
  105347. // request ID to identify requests. Specify a unique request ID so that
  105348. // if you must retry your request, the server will know to ignore the
  105349. // request if it has already been completed.
  105350. //
  105351. // For example, consider a situation where you make an initial request
  105352. // and the request times out. If you make the request again with the
  105353. // same request ID, the server can check if original operation with the
  105354. // same request ID was received, and if so, will ignore the second
  105355. // request. This prevents clients from accidentally creating duplicate
  105356. // commitments.
  105357. //
  105358. // The request ID must be a valid UUID with the exception that zero UUID
  105359. // is not supported (00000000-0000-0000-0000-000000000000).
  105360. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  105361. c.urlParams_.Set("requestId", requestId)
  105362. return c
  105363. }
  105364. // Fields allows partial responses to be retrieved. See
  105365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105366. // for more information.
  105367. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  105368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105369. return c
  105370. }
  105371. // Context sets the context to be used in this call's Do method. Any
  105372. // pending HTTP request will be aborted if the provided context is
  105373. // canceled.
  105374. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  105375. c.ctx_ = ctx
  105376. return c
  105377. }
  105378. // Header returns an http.Header that can be modified by the caller to
  105379. // add HTTP headers to the request.
  105380. func (c *TargetPoolsInsertCall) Header() http.Header {
  105381. if c.header_ == nil {
  105382. c.header_ = make(http.Header)
  105383. }
  105384. return c.header_
  105385. }
  105386. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  105387. reqHeaders := make(http.Header)
  105388. for k, v := range c.header_ {
  105389. reqHeaders[k] = v
  105390. }
  105391. reqHeaders.Set("User-Agent", c.s.userAgent())
  105392. var body io.Reader = nil
  105393. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  105394. if err != nil {
  105395. return nil, err
  105396. }
  105397. reqHeaders.Set("Content-Type", "application/json")
  105398. c.urlParams_.Set("alt", alt)
  105399. c.urlParams_.Set("prettyPrint", "false")
  105400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  105401. urls += "?" + c.urlParams_.Encode()
  105402. req, err := http.NewRequest("POST", urls, body)
  105403. if err != nil {
  105404. return nil, err
  105405. }
  105406. req.Header = reqHeaders
  105407. googleapi.Expand(req.URL, map[string]string{
  105408. "project": c.project,
  105409. "region": c.region,
  105410. })
  105411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105412. }
  105413. // Do executes the "compute.targetPools.insert" call.
  105414. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105415. // status code is an error. Response headers are in either
  105416. // *Operation.ServerResponse.Header or (if a response was returned at
  105417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105418. // to check whether the returned error was because
  105419. // http.StatusNotModified was returned.
  105420. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105421. gensupport.SetOptions(c.urlParams_, opts...)
  105422. res, err := c.doRequest("json")
  105423. if res != nil && res.StatusCode == http.StatusNotModified {
  105424. if res.Body != nil {
  105425. res.Body.Close()
  105426. }
  105427. return nil, &googleapi.Error{
  105428. Code: res.StatusCode,
  105429. Header: res.Header,
  105430. }
  105431. }
  105432. if err != nil {
  105433. return nil, err
  105434. }
  105435. defer googleapi.CloseBody(res)
  105436. if err := googleapi.CheckResponse(res); err != nil {
  105437. return nil, err
  105438. }
  105439. ret := &Operation{
  105440. ServerResponse: googleapi.ServerResponse{
  105441. Header: res.Header,
  105442. HTTPStatusCode: res.StatusCode,
  105443. },
  105444. }
  105445. target := &ret
  105446. if err := gensupport.DecodeResponse(target, res); err != nil {
  105447. return nil, err
  105448. }
  105449. return ret, nil
  105450. // {
  105451. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  105452. // "httpMethod": "POST",
  105453. // "id": "compute.targetPools.insert",
  105454. // "parameterOrder": [
  105455. // "project",
  105456. // "region"
  105457. // ],
  105458. // "parameters": {
  105459. // "project": {
  105460. // "description": "Project ID for this request.",
  105461. // "location": "path",
  105462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105463. // "required": true,
  105464. // "type": "string"
  105465. // },
  105466. // "region": {
  105467. // "description": "Name of the region scoping this request.",
  105468. // "location": "path",
  105469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105470. // "required": true,
  105471. // "type": "string"
  105472. // },
  105473. // "requestId": {
  105474. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105475. // "location": "query",
  105476. // "type": "string"
  105477. // }
  105478. // },
  105479. // "path": "{project}/regions/{region}/targetPools",
  105480. // "request": {
  105481. // "$ref": "TargetPool"
  105482. // },
  105483. // "response": {
  105484. // "$ref": "Operation"
  105485. // },
  105486. // "scopes": [
  105487. // "https://www.googleapis.com/auth/cloud-platform",
  105488. // "https://www.googleapis.com/auth/compute"
  105489. // ]
  105490. // }
  105491. }
  105492. // method id "compute.targetPools.list":
  105493. type TargetPoolsListCall struct {
  105494. s *Service
  105495. project string
  105496. region string
  105497. urlParams_ gensupport.URLParams
  105498. ifNoneMatch_ string
  105499. ctx_ context.Context
  105500. header_ http.Header
  105501. }
  105502. // List: Retrieves a list of target pools available to the specified
  105503. // project and region.
  105504. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  105505. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  105506. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105507. c.project = project
  105508. c.region = region
  105509. return c
  105510. }
  105511. // Filter sets the optional parameter "filter": A filter expression that
  105512. // filters resources listed in the response. The expression must specify
  105513. // the field name, a comparison operator, and the value that you want to
  105514. // use for filtering. The value must be a string, a number, or a
  105515. // boolean. The comparison operator must be either =, !=, >, or <.
  105516. //
  105517. // For example, if you are filtering Compute Engine instances, you can
  105518. // exclude instances named example-instance by specifying name !=
  105519. // example-instance.
  105520. //
  105521. // You can also filter nested fields. For example, you could specify
  105522. // scheduling.automaticRestart = false to include instances only if they
  105523. // are not scheduled for automatic restarts. You can use filtering on
  105524. // nested fields to filter based on resource labels.
  105525. //
  105526. // To filter on multiple expressions, provide each separate expression
  105527. // within parentheses. For example, (scheduling.automaticRestart = true)
  105528. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105529. // AND expression. However, you can include AND and OR expressions
  105530. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105531. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105532. // true).
  105533. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  105534. c.urlParams_.Set("filter", filter)
  105535. return c
  105536. }
  105537. // MaxResults sets the optional parameter "maxResults": The maximum
  105538. // number of results per page that should be returned. If the number of
  105539. // available results is larger than maxResults, Compute Engine returns a
  105540. // nextPageToken that can be used to get the next page of results in
  105541. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105542. // (Default: 500)
  105543. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  105544. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105545. return c
  105546. }
  105547. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105548. // a certain order. By default, results are returned in alphanumerical
  105549. // order based on the resource name.
  105550. //
  105551. // You can also sort results in descending order based on the creation
  105552. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105553. // based on the creationTimestamp field in reverse chronological order
  105554. // (newest result first). Use this to sort resources like operations so
  105555. // that the newest operation is returned first.
  105556. //
  105557. // Currently, only sorting by name or creationTimestamp desc is
  105558. // supported.
  105559. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  105560. c.urlParams_.Set("orderBy", orderBy)
  105561. return c
  105562. }
  105563. // PageToken sets the optional parameter "pageToken": Specifies a page
  105564. // token to use. Set pageToken to the nextPageToken returned by a
  105565. // previous list request to get the next page of results.
  105566. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  105567. c.urlParams_.Set("pageToken", pageToken)
  105568. return c
  105569. }
  105570. // Fields allows partial responses to be retrieved. See
  105571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105572. // for more information.
  105573. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  105574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105575. return c
  105576. }
  105577. // IfNoneMatch sets the optional parameter which makes the operation
  105578. // fail if the object's ETag matches the given value. This is useful for
  105579. // getting updates only after the object has changed since the last
  105580. // request. Use googleapi.IsNotModified to check whether the response
  105581. // error from Do is the result of In-None-Match.
  105582. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  105583. c.ifNoneMatch_ = entityTag
  105584. return c
  105585. }
  105586. // Context sets the context to be used in this call's Do method. Any
  105587. // pending HTTP request will be aborted if the provided context is
  105588. // canceled.
  105589. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  105590. c.ctx_ = ctx
  105591. return c
  105592. }
  105593. // Header returns an http.Header that can be modified by the caller to
  105594. // add HTTP headers to the request.
  105595. func (c *TargetPoolsListCall) Header() http.Header {
  105596. if c.header_ == nil {
  105597. c.header_ = make(http.Header)
  105598. }
  105599. return c.header_
  105600. }
  105601. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  105602. reqHeaders := make(http.Header)
  105603. for k, v := range c.header_ {
  105604. reqHeaders[k] = v
  105605. }
  105606. reqHeaders.Set("User-Agent", c.s.userAgent())
  105607. if c.ifNoneMatch_ != "" {
  105608. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105609. }
  105610. var body io.Reader = nil
  105611. c.urlParams_.Set("alt", alt)
  105612. c.urlParams_.Set("prettyPrint", "false")
  105613. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  105614. urls += "?" + c.urlParams_.Encode()
  105615. req, err := http.NewRequest("GET", urls, body)
  105616. if err != nil {
  105617. return nil, err
  105618. }
  105619. req.Header = reqHeaders
  105620. googleapi.Expand(req.URL, map[string]string{
  105621. "project": c.project,
  105622. "region": c.region,
  105623. })
  105624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105625. }
  105626. // Do executes the "compute.targetPools.list" call.
  105627. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  105628. // status code is an error. Response headers are in either
  105629. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  105630. // at all) in error.(*googleapi.Error).Header. Use
  105631. // googleapi.IsNotModified to check whether the returned error was
  105632. // because http.StatusNotModified was returned.
  105633. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  105634. gensupport.SetOptions(c.urlParams_, opts...)
  105635. res, err := c.doRequest("json")
  105636. if res != nil && res.StatusCode == http.StatusNotModified {
  105637. if res.Body != nil {
  105638. res.Body.Close()
  105639. }
  105640. return nil, &googleapi.Error{
  105641. Code: res.StatusCode,
  105642. Header: res.Header,
  105643. }
  105644. }
  105645. if err != nil {
  105646. return nil, err
  105647. }
  105648. defer googleapi.CloseBody(res)
  105649. if err := googleapi.CheckResponse(res); err != nil {
  105650. return nil, err
  105651. }
  105652. ret := &TargetPoolList{
  105653. ServerResponse: googleapi.ServerResponse{
  105654. Header: res.Header,
  105655. HTTPStatusCode: res.StatusCode,
  105656. },
  105657. }
  105658. target := &ret
  105659. if err := gensupport.DecodeResponse(target, res); err != nil {
  105660. return nil, err
  105661. }
  105662. return ret, nil
  105663. // {
  105664. // "description": "Retrieves a list of target pools available to the specified project and region.",
  105665. // "httpMethod": "GET",
  105666. // "id": "compute.targetPools.list",
  105667. // "parameterOrder": [
  105668. // "project",
  105669. // "region"
  105670. // ],
  105671. // "parameters": {
  105672. // "filter": {
  105673. // "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).",
  105674. // "location": "query",
  105675. // "type": "string"
  105676. // },
  105677. // "maxResults": {
  105678. // "default": "500",
  105679. // "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)",
  105680. // "format": "uint32",
  105681. // "location": "query",
  105682. // "minimum": "0",
  105683. // "type": "integer"
  105684. // },
  105685. // "orderBy": {
  105686. // "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.",
  105687. // "location": "query",
  105688. // "type": "string"
  105689. // },
  105690. // "pageToken": {
  105691. // "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.",
  105692. // "location": "query",
  105693. // "type": "string"
  105694. // },
  105695. // "project": {
  105696. // "description": "Project ID for this request.",
  105697. // "location": "path",
  105698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105699. // "required": true,
  105700. // "type": "string"
  105701. // },
  105702. // "region": {
  105703. // "description": "Name of the region scoping this request.",
  105704. // "location": "path",
  105705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105706. // "required": true,
  105707. // "type": "string"
  105708. // }
  105709. // },
  105710. // "path": "{project}/regions/{region}/targetPools",
  105711. // "response": {
  105712. // "$ref": "TargetPoolList"
  105713. // },
  105714. // "scopes": [
  105715. // "https://www.googleapis.com/auth/cloud-platform",
  105716. // "https://www.googleapis.com/auth/compute",
  105717. // "https://www.googleapis.com/auth/compute.readonly"
  105718. // ]
  105719. // }
  105720. }
  105721. // Pages invokes f for each page of results.
  105722. // A non-nil error returned from f will halt the iteration.
  105723. // The provided context supersedes any context provided to the Context method.
  105724. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  105725. c.ctx_ = ctx
  105726. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105727. for {
  105728. x, err := c.Do()
  105729. if err != nil {
  105730. return err
  105731. }
  105732. if err := f(x); err != nil {
  105733. return err
  105734. }
  105735. if x.NextPageToken == "" {
  105736. return nil
  105737. }
  105738. c.PageToken(x.NextPageToken)
  105739. }
  105740. }
  105741. // method id "compute.targetPools.removeHealthCheck":
  105742. type TargetPoolsRemoveHealthCheckCall struct {
  105743. s *Service
  105744. project string
  105745. region string
  105746. targetPool string
  105747. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  105748. urlParams_ gensupport.URLParams
  105749. ctx_ context.Context
  105750. header_ http.Header
  105751. }
  105752. // RemoveHealthCheck: Removes health check URL from a target pool.
  105753. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  105754. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  105755. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105756. c.project = project
  105757. c.region = region
  105758. c.targetPool = targetPool
  105759. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  105760. return c
  105761. }
  105762. // RequestId sets the optional parameter "requestId": An optional
  105763. // request ID to identify requests. Specify a unique request ID so that
  105764. // if you must retry your request, the server will know to ignore the
  105765. // request if it has already been completed.
  105766. //
  105767. // For example, consider a situation where you make an initial request
  105768. // and the request times out. If you make the request again with the
  105769. // same request ID, the server can check if original operation with the
  105770. // same request ID was received, and if so, will ignore the second
  105771. // request. This prevents clients from accidentally creating duplicate
  105772. // commitments.
  105773. //
  105774. // The request ID must be a valid UUID with the exception that zero UUID
  105775. // is not supported (00000000-0000-0000-0000-000000000000).
  105776. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  105777. c.urlParams_.Set("requestId", requestId)
  105778. return c
  105779. }
  105780. // Fields allows partial responses to be retrieved. See
  105781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105782. // for more information.
  105783. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  105784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105785. return c
  105786. }
  105787. // Context sets the context to be used in this call's Do method. Any
  105788. // pending HTTP request will be aborted if the provided context is
  105789. // canceled.
  105790. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  105791. c.ctx_ = ctx
  105792. return c
  105793. }
  105794. // Header returns an http.Header that can be modified by the caller to
  105795. // add HTTP headers to the request.
  105796. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  105797. if c.header_ == nil {
  105798. c.header_ = make(http.Header)
  105799. }
  105800. return c.header_
  105801. }
  105802. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  105803. reqHeaders := make(http.Header)
  105804. for k, v := range c.header_ {
  105805. reqHeaders[k] = v
  105806. }
  105807. reqHeaders.Set("User-Agent", c.s.userAgent())
  105808. var body io.Reader = nil
  105809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  105810. if err != nil {
  105811. return nil, err
  105812. }
  105813. reqHeaders.Set("Content-Type", "application/json")
  105814. c.urlParams_.Set("alt", alt)
  105815. c.urlParams_.Set("prettyPrint", "false")
  105816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  105817. urls += "?" + c.urlParams_.Encode()
  105818. req, err := http.NewRequest("POST", urls, body)
  105819. if err != nil {
  105820. return nil, err
  105821. }
  105822. req.Header = reqHeaders
  105823. googleapi.Expand(req.URL, map[string]string{
  105824. "project": c.project,
  105825. "region": c.region,
  105826. "targetPool": c.targetPool,
  105827. })
  105828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105829. }
  105830. // Do executes the "compute.targetPools.removeHealthCheck" call.
  105831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105832. // status code is an error. Response headers are in either
  105833. // *Operation.ServerResponse.Header or (if a response was returned at
  105834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105835. // to check whether the returned error was because
  105836. // http.StatusNotModified was returned.
  105837. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105838. gensupport.SetOptions(c.urlParams_, opts...)
  105839. res, err := c.doRequest("json")
  105840. if res != nil && res.StatusCode == http.StatusNotModified {
  105841. if res.Body != nil {
  105842. res.Body.Close()
  105843. }
  105844. return nil, &googleapi.Error{
  105845. Code: res.StatusCode,
  105846. Header: res.Header,
  105847. }
  105848. }
  105849. if err != nil {
  105850. return nil, err
  105851. }
  105852. defer googleapi.CloseBody(res)
  105853. if err := googleapi.CheckResponse(res); err != nil {
  105854. return nil, err
  105855. }
  105856. ret := &Operation{
  105857. ServerResponse: googleapi.ServerResponse{
  105858. Header: res.Header,
  105859. HTTPStatusCode: res.StatusCode,
  105860. },
  105861. }
  105862. target := &ret
  105863. if err := gensupport.DecodeResponse(target, res); err != nil {
  105864. return nil, err
  105865. }
  105866. return ret, nil
  105867. // {
  105868. // "description": "Removes health check URL from a target pool.",
  105869. // "httpMethod": "POST",
  105870. // "id": "compute.targetPools.removeHealthCheck",
  105871. // "parameterOrder": [
  105872. // "project",
  105873. // "region",
  105874. // "targetPool"
  105875. // ],
  105876. // "parameters": {
  105877. // "project": {
  105878. // "description": "Project ID for this request.",
  105879. // "location": "path",
  105880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105881. // "required": true,
  105882. // "type": "string"
  105883. // },
  105884. // "region": {
  105885. // "description": "Name of the region for this request.",
  105886. // "location": "path",
  105887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105888. // "required": true,
  105889. // "type": "string"
  105890. // },
  105891. // "requestId": {
  105892. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105893. // "location": "query",
  105894. // "type": "string"
  105895. // },
  105896. // "targetPool": {
  105897. // "description": "Name of the target pool to remove health checks from.",
  105898. // "location": "path",
  105899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105900. // "required": true,
  105901. // "type": "string"
  105902. // }
  105903. // },
  105904. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  105905. // "request": {
  105906. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  105907. // },
  105908. // "response": {
  105909. // "$ref": "Operation"
  105910. // },
  105911. // "scopes": [
  105912. // "https://www.googleapis.com/auth/cloud-platform",
  105913. // "https://www.googleapis.com/auth/compute"
  105914. // ]
  105915. // }
  105916. }
  105917. // method id "compute.targetPools.removeInstance":
  105918. type TargetPoolsRemoveInstanceCall struct {
  105919. s *Service
  105920. project string
  105921. region string
  105922. targetPool string
  105923. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  105924. urlParams_ gensupport.URLParams
  105925. ctx_ context.Context
  105926. header_ http.Header
  105927. }
  105928. // RemoveInstance: Removes instance URL from a target pool.
  105929. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  105930. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  105931. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105932. c.project = project
  105933. c.region = region
  105934. c.targetPool = targetPool
  105935. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  105936. return c
  105937. }
  105938. // RequestId sets the optional parameter "requestId": An optional
  105939. // request ID to identify requests. Specify a unique request ID so that
  105940. // if you must retry your request, the server will know to ignore the
  105941. // request if it has already been completed.
  105942. //
  105943. // For example, consider a situation where you make an initial request
  105944. // and the request times out. If you make the request again with the
  105945. // same request ID, the server can check if original operation with the
  105946. // same request ID was received, and if so, will ignore the second
  105947. // request. This prevents clients from accidentally creating duplicate
  105948. // commitments.
  105949. //
  105950. // The request ID must be a valid UUID with the exception that zero UUID
  105951. // is not supported (00000000-0000-0000-0000-000000000000).
  105952. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  105953. c.urlParams_.Set("requestId", requestId)
  105954. return c
  105955. }
  105956. // Fields allows partial responses to be retrieved. See
  105957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105958. // for more information.
  105959. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  105960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105961. return c
  105962. }
  105963. // Context sets the context to be used in this call's Do method. Any
  105964. // pending HTTP request will be aborted if the provided context is
  105965. // canceled.
  105966. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  105967. c.ctx_ = ctx
  105968. return c
  105969. }
  105970. // Header returns an http.Header that can be modified by the caller to
  105971. // add HTTP headers to the request.
  105972. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  105973. if c.header_ == nil {
  105974. c.header_ = make(http.Header)
  105975. }
  105976. return c.header_
  105977. }
  105978. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  105979. reqHeaders := make(http.Header)
  105980. for k, v := range c.header_ {
  105981. reqHeaders[k] = v
  105982. }
  105983. reqHeaders.Set("User-Agent", c.s.userAgent())
  105984. var body io.Reader = nil
  105985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  105986. if err != nil {
  105987. return nil, err
  105988. }
  105989. reqHeaders.Set("Content-Type", "application/json")
  105990. c.urlParams_.Set("alt", alt)
  105991. c.urlParams_.Set("prettyPrint", "false")
  105992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  105993. urls += "?" + c.urlParams_.Encode()
  105994. req, err := http.NewRequest("POST", urls, body)
  105995. if err != nil {
  105996. return nil, err
  105997. }
  105998. req.Header = reqHeaders
  105999. googleapi.Expand(req.URL, map[string]string{
  106000. "project": c.project,
  106001. "region": c.region,
  106002. "targetPool": c.targetPool,
  106003. })
  106004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106005. }
  106006. // Do executes the "compute.targetPools.removeInstance" call.
  106007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106008. // status code is an error. Response headers are in either
  106009. // *Operation.ServerResponse.Header or (if a response was returned at
  106010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106011. // to check whether the returned error was because
  106012. // http.StatusNotModified was returned.
  106013. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106014. gensupport.SetOptions(c.urlParams_, opts...)
  106015. res, err := c.doRequest("json")
  106016. if res != nil && res.StatusCode == http.StatusNotModified {
  106017. if res.Body != nil {
  106018. res.Body.Close()
  106019. }
  106020. return nil, &googleapi.Error{
  106021. Code: res.StatusCode,
  106022. Header: res.Header,
  106023. }
  106024. }
  106025. if err != nil {
  106026. return nil, err
  106027. }
  106028. defer googleapi.CloseBody(res)
  106029. if err := googleapi.CheckResponse(res); err != nil {
  106030. return nil, err
  106031. }
  106032. ret := &Operation{
  106033. ServerResponse: googleapi.ServerResponse{
  106034. Header: res.Header,
  106035. HTTPStatusCode: res.StatusCode,
  106036. },
  106037. }
  106038. target := &ret
  106039. if err := gensupport.DecodeResponse(target, res); err != nil {
  106040. return nil, err
  106041. }
  106042. return ret, nil
  106043. // {
  106044. // "description": "Removes instance URL from a target pool.",
  106045. // "httpMethod": "POST",
  106046. // "id": "compute.targetPools.removeInstance",
  106047. // "parameterOrder": [
  106048. // "project",
  106049. // "region",
  106050. // "targetPool"
  106051. // ],
  106052. // "parameters": {
  106053. // "project": {
  106054. // "description": "Project ID for this request.",
  106055. // "location": "path",
  106056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106057. // "required": true,
  106058. // "type": "string"
  106059. // },
  106060. // "region": {
  106061. // "description": "Name of the region scoping this request.",
  106062. // "location": "path",
  106063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106064. // "required": true,
  106065. // "type": "string"
  106066. // },
  106067. // "requestId": {
  106068. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106069. // "location": "query",
  106070. // "type": "string"
  106071. // },
  106072. // "targetPool": {
  106073. // "description": "Name of the TargetPool resource to remove instances from.",
  106074. // "location": "path",
  106075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106076. // "required": true,
  106077. // "type": "string"
  106078. // }
  106079. // },
  106080. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  106081. // "request": {
  106082. // "$ref": "TargetPoolsRemoveInstanceRequest"
  106083. // },
  106084. // "response": {
  106085. // "$ref": "Operation"
  106086. // },
  106087. // "scopes": [
  106088. // "https://www.googleapis.com/auth/cloud-platform",
  106089. // "https://www.googleapis.com/auth/compute"
  106090. // ]
  106091. // }
  106092. }
  106093. // method id "compute.targetPools.setBackup":
  106094. type TargetPoolsSetBackupCall struct {
  106095. s *Service
  106096. project string
  106097. region string
  106098. targetPool string
  106099. targetreference *TargetReference
  106100. urlParams_ gensupport.URLParams
  106101. ctx_ context.Context
  106102. header_ http.Header
  106103. }
  106104. // SetBackup: Changes a backup target pool's configurations.
  106105. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  106106. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  106107. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106108. c.project = project
  106109. c.region = region
  106110. c.targetPool = targetPool
  106111. c.targetreference = targetreference
  106112. return c
  106113. }
  106114. // FailoverRatio sets the optional parameter "failoverRatio": New
  106115. // failoverRatio value for the target pool.
  106116. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  106117. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  106118. return c
  106119. }
  106120. // RequestId sets the optional parameter "requestId": An optional
  106121. // request ID to identify requests. Specify a unique request ID so that
  106122. // if you must retry your request, the server will know to ignore the
  106123. // request if it has already been completed.
  106124. //
  106125. // For example, consider a situation where you make an initial request
  106126. // and the request times out. If you make the request again with the
  106127. // same request ID, the server can check if original operation with the
  106128. // same request ID was received, and if so, will ignore the second
  106129. // request. This prevents clients from accidentally creating duplicate
  106130. // commitments.
  106131. //
  106132. // The request ID must be a valid UUID with the exception that zero UUID
  106133. // is not supported (00000000-0000-0000-0000-000000000000).
  106134. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  106135. c.urlParams_.Set("requestId", requestId)
  106136. return c
  106137. }
  106138. // Fields allows partial responses to be retrieved. See
  106139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106140. // for more information.
  106141. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  106142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106143. return c
  106144. }
  106145. // Context sets the context to be used in this call's Do method. Any
  106146. // pending HTTP request will be aborted if the provided context is
  106147. // canceled.
  106148. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  106149. c.ctx_ = ctx
  106150. return c
  106151. }
  106152. // Header returns an http.Header that can be modified by the caller to
  106153. // add HTTP headers to the request.
  106154. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  106155. if c.header_ == nil {
  106156. c.header_ = make(http.Header)
  106157. }
  106158. return c.header_
  106159. }
  106160. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  106161. reqHeaders := make(http.Header)
  106162. for k, v := range c.header_ {
  106163. reqHeaders[k] = v
  106164. }
  106165. reqHeaders.Set("User-Agent", c.s.userAgent())
  106166. var body io.Reader = nil
  106167. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  106168. if err != nil {
  106169. return nil, err
  106170. }
  106171. reqHeaders.Set("Content-Type", "application/json")
  106172. c.urlParams_.Set("alt", alt)
  106173. c.urlParams_.Set("prettyPrint", "false")
  106174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  106175. urls += "?" + c.urlParams_.Encode()
  106176. req, err := http.NewRequest("POST", urls, body)
  106177. if err != nil {
  106178. return nil, err
  106179. }
  106180. req.Header = reqHeaders
  106181. googleapi.Expand(req.URL, map[string]string{
  106182. "project": c.project,
  106183. "region": c.region,
  106184. "targetPool": c.targetPool,
  106185. })
  106186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106187. }
  106188. // Do executes the "compute.targetPools.setBackup" call.
  106189. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106190. // status code is an error. Response headers are in either
  106191. // *Operation.ServerResponse.Header or (if a response was returned at
  106192. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106193. // to check whether the returned error was because
  106194. // http.StatusNotModified was returned.
  106195. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106196. gensupport.SetOptions(c.urlParams_, opts...)
  106197. res, err := c.doRequest("json")
  106198. if res != nil && res.StatusCode == http.StatusNotModified {
  106199. if res.Body != nil {
  106200. res.Body.Close()
  106201. }
  106202. return nil, &googleapi.Error{
  106203. Code: res.StatusCode,
  106204. Header: res.Header,
  106205. }
  106206. }
  106207. if err != nil {
  106208. return nil, err
  106209. }
  106210. defer googleapi.CloseBody(res)
  106211. if err := googleapi.CheckResponse(res); err != nil {
  106212. return nil, err
  106213. }
  106214. ret := &Operation{
  106215. ServerResponse: googleapi.ServerResponse{
  106216. Header: res.Header,
  106217. HTTPStatusCode: res.StatusCode,
  106218. },
  106219. }
  106220. target := &ret
  106221. if err := gensupport.DecodeResponse(target, res); err != nil {
  106222. return nil, err
  106223. }
  106224. return ret, nil
  106225. // {
  106226. // "description": "Changes a backup target pool's configurations.",
  106227. // "httpMethod": "POST",
  106228. // "id": "compute.targetPools.setBackup",
  106229. // "parameterOrder": [
  106230. // "project",
  106231. // "region",
  106232. // "targetPool"
  106233. // ],
  106234. // "parameters": {
  106235. // "failoverRatio": {
  106236. // "description": "New failoverRatio value for the target pool.",
  106237. // "format": "float",
  106238. // "location": "query",
  106239. // "type": "number"
  106240. // },
  106241. // "project": {
  106242. // "description": "Project ID for this request.",
  106243. // "location": "path",
  106244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106245. // "required": true,
  106246. // "type": "string"
  106247. // },
  106248. // "region": {
  106249. // "description": "Name of the region scoping this request.",
  106250. // "location": "path",
  106251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106252. // "required": true,
  106253. // "type": "string"
  106254. // },
  106255. // "requestId": {
  106256. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106257. // "location": "query",
  106258. // "type": "string"
  106259. // },
  106260. // "targetPool": {
  106261. // "description": "Name of the TargetPool resource to set a backup pool for.",
  106262. // "location": "path",
  106263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106264. // "required": true,
  106265. // "type": "string"
  106266. // }
  106267. // },
  106268. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  106269. // "request": {
  106270. // "$ref": "TargetReference"
  106271. // },
  106272. // "response": {
  106273. // "$ref": "Operation"
  106274. // },
  106275. // "scopes": [
  106276. // "https://www.googleapis.com/auth/cloud-platform",
  106277. // "https://www.googleapis.com/auth/compute"
  106278. // ]
  106279. // }
  106280. }
  106281. // method id "compute.targetPools.testIamPermissions":
  106282. type TargetPoolsTestIamPermissionsCall struct {
  106283. s *Service
  106284. project string
  106285. region string
  106286. resource string
  106287. testpermissionsrequest *TestPermissionsRequest
  106288. urlParams_ gensupport.URLParams
  106289. ctx_ context.Context
  106290. header_ http.Header
  106291. }
  106292. // TestIamPermissions: Returns permissions that a caller has on the
  106293. // specified resource.
  106294. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  106295. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106296. c.project = project
  106297. c.region = region
  106298. c.resource = resource
  106299. c.testpermissionsrequest = testpermissionsrequest
  106300. return c
  106301. }
  106302. // Fields allows partial responses to be retrieved. See
  106303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106304. // for more information.
  106305. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  106306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106307. return c
  106308. }
  106309. // Context sets the context to be used in this call's Do method. Any
  106310. // pending HTTP request will be aborted if the provided context is
  106311. // canceled.
  106312. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  106313. c.ctx_ = ctx
  106314. return c
  106315. }
  106316. // Header returns an http.Header that can be modified by the caller to
  106317. // add HTTP headers to the request.
  106318. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  106319. if c.header_ == nil {
  106320. c.header_ = make(http.Header)
  106321. }
  106322. return c.header_
  106323. }
  106324. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  106325. reqHeaders := make(http.Header)
  106326. for k, v := range c.header_ {
  106327. reqHeaders[k] = v
  106328. }
  106329. reqHeaders.Set("User-Agent", c.s.userAgent())
  106330. var body io.Reader = nil
  106331. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  106332. if err != nil {
  106333. return nil, err
  106334. }
  106335. reqHeaders.Set("Content-Type", "application/json")
  106336. c.urlParams_.Set("alt", alt)
  106337. c.urlParams_.Set("prettyPrint", "false")
  106338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  106339. urls += "?" + c.urlParams_.Encode()
  106340. req, err := http.NewRequest("POST", urls, body)
  106341. if err != nil {
  106342. return nil, err
  106343. }
  106344. req.Header = reqHeaders
  106345. googleapi.Expand(req.URL, map[string]string{
  106346. "project": c.project,
  106347. "region": c.region,
  106348. "resource": c.resource,
  106349. })
  106350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106351. }
  106352. // Do executes the "compute.targetPools.testIamPermissions" call.
  106353. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  106354. // non-2xx status code is an error. Response headers are in either
  106355. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  106356. // returned at all) in error.(*googleapi.Error).Header. Use
  106357. // googleapi.IsNotModified to check whether the returned error was
  106358. // because http.StatusNotModified was returned.
  106359. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  106360. gensupport.SetOptions(c.urlParams_, opts...)
  106361. res, err := c.doRequest("json")
  106362. if res != nil && res.StatusCode == http.StatusNotModified {
  106363. if res.Body != nil {
  106364. res.Body.Close()
  106365. }
  106366. return nil, &googleapi.Error{
  106367. Code: res.StatusCode,
  106368. Header: res.Header,
  106369. }
  106370. }
  106371. if err != nil {
  106372. return nil, err
  106373. }
  106374. defer googleapi.CloseBody(res)
  106375. if err := googleapi.CheckResponse(res); err != nil {
  106376. return nil, err
  106377. }
  106378. ret := &TestPermissionsResponse{
  106379. ServerResponse: googleapi.ServerResponse{
  106380. Header: res.Header,
  106381. HTTPStatusCode: res.StatusCode,
  106382. },
  106383. }
  106384. target := &ret
  106385. if err := gensupport.DecodeResponse(target, res); err != nil {
  106386. return nil, err
  106387. }
  106388. return ret, nil
  106389. // {
  106390. // "description": "Returns permissions that a caller has on the specified resource.",
  106391. // "httpMethod": "POST",
  106392. // "id": "compute.targetPools.testIamPermissions",
  106393. // "parameterOrder": [
  106394. // "project",
  106395. // "region",
  106396. // "resource"
  106397. // ],
  106398. // "parameters": {
  106399. // "project": {
  106400. // "description": "Project ID for this request.",
  106401. // "location": "path",
  106402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106403. // "required": true,
  106404. // "type": "string"
  106405. // },
  106406. // "region": {
  106407. // "description": "The name of the region for this request.",
  106408. // "location": "path",
  106409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106410. // "required": true,
  106411. // "type": "string"
  106412. // },
  106413. // "resource": {
  106414. // "description": "Name or id of the resource for this request.",
  106415. // "location": "path",
  106416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106417. // "required": true,
  106418. // "type": "string"
  106419. // }
  106420. // },
  106421. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  106422. // "request": {
  106423. // "$ref": "TestPermissionsRequest"
  106424. // },
  106425. // "response": {
  106426. // "$ref": "TestPermissionsResponse"
  106427. // },
  106428. // "scopes": [
  106429. // "https://www.googleapis.com/auth/cloud-platform",
  106430. // "https://www.googleapis.com/auth/compute",
  106431. // "https://www.googleapis.com/auth/compute.readonly"
  106432. // ]
  106433. // }
  106434. }
  106435. // method id "compute.targetSslProxies.delete":
  106436. type TargetSslProxiesDeleteCall struct {
  106437. s *Service
  106438. project string
  106439. targetSslProxy string
  106440. urlParams_ gensupport.URLParams
  106441. ctx_ context.Context
  106442. header_ http.Header
  106443. }
  106444. // Delete: Deletes the specified TargetSslProxy resource.
  106445. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  106446. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106447. c.project = project
  106448. c.targetSslProxy = targetSslProxy
  106449. return c
  106450. }
  106451. // RequestId sets the optional parameter "requestId": An optional
  106452. // request ID to identify requests. Specify a unique request ID so that
  106453. // if you must retry your request, the server will know to ignore the
  106454. // request if it has already been completed.
  106455. //
  106456. // For example, consider a situation where you make an initial request
  106457. // and the request times out. If you make the request again with the
  106458. // same request ID, the server can check if original operation with the
  106459. // same request ID was received, and if so, will ignore the second
  106460. // request. This prevents clients from accidentally creating duplicate
  106461. // commitments.
  106462. //
  106463. // The request ID must be a valid UUID with the exception that zero UUID
  106464. // is not supported (00000000-0000-0000-0000-000000000000).
  106465. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  106466. c.urlParams_.Set("requestId", requestId)
  106467. return c
  106468. }
  106469. // Fields allows partial responses to be retrieved. See
  106470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106471. // for more information.
  106472. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  106473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106474. return c
  106475. }
  106476. // Context sets the context to be used in this call's Do method. Any
  106477. // pending HTTP request will be aborted if the provided context is
  106478. // canceled.
  106479. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  106480. c.ctx_ = ctx
  106481. return c
  106482. }
  106483. // Header returns an http.Header that can be modified by the caller to
  106484. // add HTTP headers to the request.
  106485. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  106486. if c.header_ == nil {
  106487. c.header_ = make(http.Header)
  106488. }
  106489. return c.header_
  106490. }
  106491. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  106492. reqHeaders := make(http.Header)
  106493. for k, v := range c.header_ {
  106494. reqHeaders[k] = v
  106495. }
  106496. reqHeaders.Set("User-Agent", c.s.userAgent())
  106497. var body io.Reader = nil
  106498. c.urlParams_.Set("alt", alt)
  106499. c.urlParams_.Set("prettyPrint", "false")
  106500. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  106501. urls += "?" + c.urlParams_.Encode()
  106502. req, err := http.NewRequest("DELETE", urls, body)
  106503. if err != nil {
  106504. return nil, err
  106505. }
  106506. req.Header = reqHeaders
  106507. googleapi.Expand(req.URL, map[string]string{
  106508. "project": c.project,
  106509. "targetSslProxy": c.targetSslProxy,
  106510. })
  106511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106512. }
  106513. // Do executes the "compute.targetSslProxies.delete" call.
  106514. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106515. // status code is an error. Response headers are in either
  106516. // *Operation.ServerResponse.Header or (if a response was returned at
  106517. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106518. // to check whether the returned error was because
  106519. // http.StatusNotModified was returned.
  106520. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106521. gensupport.SetOptions(c.urlParams_, opts...)
  106522. res, err := c.doRequest("json")
  106523. if res != nil && res.StatusCode == http.StatusNotModified {
  106524. if res.Body != nil {
  106525. res.Body.Close()
  106526. }
  106527. return nil, &googleapi.Error{
  106528. Code: res.StatusCode,
  106529. Header: res.Header,
  106530. }
  106531. }
  106532. if err != nil {
  106533. return nil, err
  106534. }
  106535. defer googleapi.CloseBody(res)
  106536. if err := googleapi.CheckResponse(res); err != nil {
  106537. return nil, err
  106538. }
  106539. ret := &Operation{
  106540. ServerResponse: googleapi.ServerResponse{
  106541. Header: res.Header,
  106542. HTTPStatusCode: res.StatusCode,
  106543. },
  106544. }
  106545. target := &ret
  106546. if err := gensupport.DecodeResponse(target, res); err != nil {
  106547. return nil, err
  106548. }
  106549. return ret, nil
  106550. // {
  106551. // "description": "Deletes the specified TargetSslProxy resource.",
  106552. // "httpMethod": "DELETE",
  106553. // "id": "compute.targetSslProxies.delete",
  106554. // "parameterOrder": [
  106555. // "project",
  106556. // "targetSslProxy"
  106557. // ],
  106558. // "parameters": {
  106559. // "project": {
  106560. // "description": "Project ID for this request.",
  106561. // "location": "path",
  106562. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106563. // "required": true,
  106564. // "type": "string"
  106565. // },
  106566. // "requestId": {
  106567. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106568. // "location": "query",
  106569. // "type": "string"
  106570. // },
  106571. // "targetSslProxy": {
  106572. // "description": "Name of the TargetSslProxy resource to delete.",
  106573. // "location": "path",
  106574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106575. // "required": true,
  106576. // "type": "string"
  106577. // }
  106578. // },
  106579. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  106580. // "response": {
  106581. // "$ref": "Operation"
  106582. // },
  106583. // "scopes": [
  106584. // "https://www.googleapis.com/auth/cloud-platform",
  106585. // "https://www.googleapis.com/auth/compute"
  106586. // ]
  106587. // }
  106588. }
  106589. // method id "compute.targetSslProxies.get":
  106590. type TargetSslProxiesGetCall struct {
  106591. s *Service
  106592. project string
  106593. targetSslProxy string
  106594. urlParams_ gensupport.URLParams
  106595. ifNoneMatch_ string
  106596. ctx_ context.Context
  106597. header_ http.Header
  106598. }
  106599. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  106600. // available target SSL proxies by making a list() request.
  106601. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  106602. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106603. c.project = project
  106604. c.targetSslProxy = targetSslProxy
  106605. return c
  106606. }
  106607. // Fields allows partial responses to be retrieved. See
  106608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106609. // for more information.
  106610. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  106611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106612. return c
  106613. }
  106614. // IfNoneMatch sets the optional parameter which makes the operation
  106615. // fail if the object's ETag matches the given value. This is useful for
  106616. // getting updates only after the object has changed since the last
  106617. // request. Use googleapi.IsNotModified to check whether the response
  106618. // error from Do is the result of In-None-Match.
  106619. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  106620. c.ifNoneMatch_ = entityTag
  106621. return c
  106622. }
  106623. // Context sets the context to be used in this call's Do method. Any
  106624. // pending HTTP request will be aborted if the provided context is
  106625. // canceled.
  106626. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  106627. c.ctx_ = ctx
  106628. return c
  106629. }
  106630. // Header returns an http.Header that can be modified by the caller to
  106631. // add HTTP headers to the request.
  106632. func (c *TargetSslProxiesGetCall) Header() http.Header {
  106633. if c.header_ == nil {
  106634. c.header_ = make(http.Header)
  106635. }
  106636. return c.header_
  106637. }
  106638. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  106639. reqHeaders := make(http.Header)
  106640. for k, v := range c.header_ {
  106641. reqHeaders[k] = v
  106642. }
  106643. reqHeaders.Set("User-Agent", c.s.userAgent())
  106644. if c.ifNoneMatch_ != "" {
  106645. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106646. }
  106647. var body io.Reader = nil
  106648. c.urlParams_.Set("alt", alt)
  106649. c.urlParams_.Set("prettyPrint", "false")
  106650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  106651. urls += "?" + c.urlParams_.Encode()
  106652. req, err := http.NewRequest("GET", urls, body)
  106653. if err != nil {
  106654. return nil, err
  106655. }
  106656. req.Header = reqHeaders
  106657. googleapi.Expand(req.URL, map[string]string{
  106658. "project": c.project,
  106659. "targetSslProxy": c.targetSslProxy,
  106660. })
  106661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106662. }
  106663. // Do executes the "compute.targetSslProxies.get" call.
  106664. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  106665. // status code is an error. Response headers are in either
  106666. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  106667. // at all) in error.(*googleapi.Error).Header. Use
  106668. // googleapi.IsNotModified to check whether the returned error was
  106669. // because http.StatusNotModified was returned.
  106670. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  106671. gensupport.SetOptions(c.urlParams_, opts...)
  106672. res, err := c.doRequest("json")
  106673. if res != nil && res.StatusCode == http.StatusNotModified {
  106674. if res.Body != nil {
  106675. res.Body.Close()
  106676. }
  106677. return nil, &googleapi.Error{
  106678. Code: res.StatusCode,
  106679. Header: res.Header,
  106680. }
  106681. }
  106682. if err != nil {
  106683. return nil, err
  106684. }
  106685. defer googleapi.CloseBody(res)
  106686. if err := googleapi.CheckResponse(res); err != nil {
  106687. return nil, err
  106688. }
  106689. ret := &TargetSslProxy{
  106690. ServerResponse: googleapi.ServerResponse{
  106691. Header: res.Header,
  106692. HTTPStatusCode: res.StatusCode,
  106693. },
  106694. }
  106695. target := &ret
  106696. if err := gensupport.DecodeResponse(target, res); err != nil {
  106697. return nil, err
  106698. }
  106699. return ret, nil
  106700. // {
  106701. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  106702. // "httpMethod": "GET",
  106703. // "id": "compute.targetSslProxies.get",
  106704. // "parameterOrder": [
  106705. // "project",
  106706. // "targetSslProxy"
  106707. // ],
  106708. // "parameters": {
  106709. // "project": {
  106710. // "description": "Project ID for this request.",
  106711. // "location": "path",
  106712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106713. // "required": true,
  106714. // "type": "string"
  106715. // },
  106716. // "targetSslProxy": {
  106717. // "description": "Name of the TargetSslProxy resource to return.",
  106718. // "location": "path",
  106719. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106720. // "required": true,
  106721. // "type": "string"
  106722. // }
  106723. // },
  106724. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  106725. // "response": {
  106726. // "$ref": "TargetSslProxy"
  106727. // },
  106728. // "scopes": [
  106729. // "https://www.googleapis.com/auth/cloud-platform",
  106730. // "https://www.googleapis.com/auth/compute",
  106731. // "https://www.googleapis.com/auth/compute.readonly"
  106732. // ]
  106733. // }
  106734. }
  106735. // method id "compute.targetSslProxies.insert":
  106736. type TargetSslProxiesInsertCall struct {
  106737. s *Service
  106738. project string
  106739. targetsslproxy *TargetSslProxy
  106740. urlParams_ gensupport.URLParams
  106741. ctx_ context.Context
  106742. header_ http.Header
  106743. }
  106744. // Insert: Creates a TargetSslProxy resource in the specified project
  106745. // using the data included in the request.
  106746. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  106747. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106748. c.project = project
  106749. c.targetsslproxy = targetsslproxy
  106750. return c
  106751. }
  106752. // RequestId sets the optional parameter "requestId": An optional
  106753. // request ID to identify requests. Specify a unique request ID so that
  106754. // if you must retry your request, the server will know to ignore the
  106755. // request if it has already been completed.
  106756. //
  106757. // For example, consider a situation where you make an initial request
  106758. // and the request times out. If you make the request again with the
  106759. // same request ID, the server can check if original operation with the
  106760. // same request ID was received, and if so, will ignore the second
  106761. // request. This prevents clients from accidentally creating duplicate
  106762. // commitments.
  106763. //
  106764. // The request ID must be a valid UUID with the exception that zero UUID
  106765. // is not supported (00000000-0000-0000-0000-000000000000).
  106766. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  106767. c.urlParams_.Set("requestId", requestId)
  106768. return c
  106769. }
  106770. // Fields allows partial responses to be retrieved. See
  106771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106772. // for more information.
  106773. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  106774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106775. return c
  106776. }
  106777. // Context sets the context to be used in this call's Do method. Any
  106778. // pending HTTP request will be aborted if the provided context is
  106779. // canceled.
  106780. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  106781. c.ctx_ = ctx
  106782. return c
  106783. }
  106784. // Header returns an http.Header that can be modified by the caller to
  106785. // add HTTP headers to the request.
  106786. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  106787. if c.header_ == nil {
  106788. c.header_ = make(http.Header)
  106789. }
  106790. return c.header_
  106791. }
  106792. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  106793. reqHeaders := make(http.Header)
  106794. for k, v := range c.header_ {
  106795. reqHeaders[k] = v
  106796. }
  106797. reqHeaders.Set("User-Agent", c.s.userAgent())
  106798. var body io.Reader = nil
  106799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  106800. if err != nil {
  106801. return nil, err
  106802. }
  106803. reqHeaders.Set("Content-Type", "application/json")
  106804. c.urlParams_.Set("alt", alt)
  106805. c.urlParams_.Set("prettyPrint", "false")
  106806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  106807. urls += "?" + c.urlParams_.Encode()
  106808. req, err := http.NewRequest("POST", urls, body)
  106809. if err != nil {
  106810. return nil, err
  106811. }
  106812. req.Header = reqHeaders
  106813. googleapi.Expand(req.URL, map[string]string{
  106814. "project": c.project,
  106815. })
  106816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106817. }
  106818. // Do executes the "compute.targetSslProxies.insert" call.
  106819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106820. // status code is an error. Response headers are in either
  106821. // *Operation.ServerResponse.Header or (if a response was returned at
  106822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106823. // to check whether the returned error was because
  106824. // http.StatusNotModified was returned.
  106825. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106826. gensupport.SetOptions(c.urlParams_, opts...)
  106827. res, err := c.doRequest("json")
  106828. if res != nil && res.StatusCode == http.StatusNotModified {
  106829. if res.Body != nil {
  106830. res.Body.Close()
  106831. }
  106832. return nil, &googleapi.Error{
  106833. Code: res.StatusCode,
  106834. Header: res.Header,
  106835. }
  106836. }
  106837. if err != nil {
  106838. return nil, err
  106839. }
  106840. defer googleapi.CloseBody(res)
  106841. if err := googleapi.CheckResponse(res); err != nil {
  106842. return nil, err
  106843. }
  106844. ret := &Operation{
  106845. ServerResponse: googleapi.ServerResponse{
  106846. Header: res.Header,
  106847. HTTPStatusCode: res.StatusCode,
  106848. },
  106849. }
  106850. target := &ret
  106851. if err := gensupport.DecodeResponse(target, res); err != nil {
  106852. return nil, err
  106853. }
  106854. return ret, nil
  106855. // {
  106856. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  106857. // "httpMethod": "POST",
  106858. // "id": "compute.targetSslProxies.insert",
  106859. // "parameterOrder": [
  106860. // "project"
  106861. // ],
  106862. // "parameters": {
  106863. // "project": {
  106864. // "description": "Project ID for this request.",
  106865. // "location": "path",
  106866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106867. // "required": true,
  106868. // "type": "string"
  106869. // },
  106870. // "requestId": {
  106871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106872. // "location": "query",
  106873. // "type": "string"
  106874. // }
  106875. // },
  106876. // "path": "{project}/global/targetSslProxies",
  106877. // "request": {
  106878. // "$ref": "TargetSslProxy"
  106879. // },
  106880. // "response": {
  106881. // "$ref": "Operation"
  106882. // },
  106883. // "scopes": [
  106884. // "https://www.googleapis.com/auth/cloud-platform",
  106885. // "https://www.googleapis.com/auth/compute"
  106886. // ]
  106887. // }
  106888. }
  106889. // method id "compute.targetSslProxies.list":
  106890. type TargetSslProxiesListCall struct {
  106891. s *Service
  106892. project string
  106893. urlParams_ gensupport.URLParams
  106894. ifNoneMatch_ string
  106895. ctx_ context.Context
  106896. header_ http.Header
  106897. }
  106898. // List: Retrieves the list of TargetSslProxy resources available to the
  106899. // specified project.
  106900. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  106901. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106902. c.project = project
  106903. return c
  106904. }
  106905. // Filter sets the optional parameter "filter": A filter expression that
  106906. // filters resources listed in the response. The expression must specify
  106907. // the field name, a comparison operator, and the value that you want to
  106908. // use for filtering. The value must be a string, a number, or a
  106909. // boolean. The comparison operator must be either =, !=, >, or <.
  106910. //
  106911. // For example, if you are filtering Compute Engine instances, you can
  106912. // exclude instances named example-instance by specifying name !=
  106913. // example-instance.
  106914. //
  106915. // You can also filter nested fields. For example, you could specify
  106916. // scheduling.automaticRestart = false to include instances only if they
  106917. // are not scheduled for automatic restarts. You can use filtering on
  106918. // nested fields to filter based on resource labels.
  106919. //
  106920. // To filter on multiple expressions, provide each separate expression
  106921. // within parentheses. For example, (scheduling.automaticRestart = true)
  106922. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  106923. // AND expression. However, you can include AND and OR expressions
  106924. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  106925. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  106926. // true).
  106927. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  106928. c.urlParams_.Set("filter", filter)
  106929. return c
  106930. }
  106931. // MaxResults sets the optional parameter "maxResults": The maximum
  106932. // number of results per page that should be returned. If the number of
  106933. // available results is larger than maxResults, Compute Engine returns a
  106934. // nextPageToken that can be used to get the next page of results in
  106935. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  106936. // (Default: 500)
  106937. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  106938. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  106939. return c
  106940. }
  106941. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  106942. // a certain order. By default, results are returned in alphanumerical
  106943. // order based on the resource name.
  106944. //
  106945. // You can also sort results in descending order based on the creation
  106946. // timestamp using orderBy="creationTimestamp desc". This sorts results
  106947. // based on the creationTimestamp field in reverse chronological order
  106948. // (newest result first). Use this to sort resources like operations so
  106949. // that the newest operation is returned first.
  106950. //
  106951. // Currently, only sorting by name or creationTimestamp desc is
  106952. // supported.
  106953. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  106954. c.urlParams_.Set("orderBy", orderBy)
  106955. return c
  106956. }
  106957. // PageToken sets the optional parameter "pageToken": Specifies a page
  106958. // token to use. Set pageToken to the nextPageToken returned by a
  106959. // previous list request to get the next page of results.
  106960. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  106961. c.urlParams_.Set("pageToken", pageToken)
  106962. return c
  106963. }
  106964. // Fields allows partial responses to be retrieved. See
  106965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106966. // for more information.
  106967. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  106968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106969. return c
  106970. }
  106971. // IfNoneMatch sets the optional parameter which makes the operation
  106972. // fail if the object's ETag matches the given value. This is useful for
  106973. // getting updates only after the object has changed since the last
  106974. // request. Use googleapi.IsNotModified to check whether the response
  106975. // error from Do is the result of In-None-Match.
  106976. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  106977. c.ifNoneMatch_ = entityTag
  106978. return c
  106979. }
  106980. // Context sets the context to be used in this call's Do method. Any
  106981. // pending HTTP request will be aborted if the provided context is
  106982. // canceled.
  106983. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  106984. c.ctx_ = ctx
  106985. return c
  106986. }
  106987. // Header returns an http.Header that can be modified by the caller to
  106988. // add HTTP headers to the request.
  106989. func (c *TargetSslProxiesListCall) Header() http.Header {
  106990. if c.header_ == nil {
  106991. c.header_ = make(http.Header)
  106992. }
  106993. return c.header_
  106994. }
  106995. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  106996. reqHeaders := make(http.Header)
  106997. for k, v := range c.header_ {
  106998. reqHeaders[k] = v
  106999. }
  107000. reqHeaders.Set("User-Agent", c.s.userAgent())
  107001. if c.ifNoneMatch_ != "" {
  107002. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107003. }
  107004. var body io.Reader = nil
  107005. c.urlParams_.Set("alt", alt)
  107006. c.urlParams_.Set("prettyPrint", "false")
  107007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  107008. urls += "?" + c.urlParams_.Encode()
  107009. req, err := http.NewRequest("GET", urls, body)
  107010. if err != nil {
  107011. return nil, err
  107012. }
  107013. req.Header = reqHeaders
  107014. googleapi.Expand(req.URL, map[string]string{
  107015. "project": c.project,
  107016. })
  107017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107018. }
  107019. // Do executes the "compute.targetSslProxies.list" call.
  107020. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  107021. // non-2xx status code is an error. Response headers are in either
  107022. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  107023. // returned at all) in error.(*googleapi.Error).Header. Use
  107024. // googleapi.IsNotModified to check whether the returned error was
  107025. // because http.StatusNotModified was returned.
  107026. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  107027. gensupport.SetOptions(c.urlParams_, opts...)
  107028. res, err := c.doRequest("json")
  107029. if res != nil && res.StatusCode == http.StatusNotModified {
  107030. if res.Body != nil {
  107031. res.Body.Close()
  107032. }
  107033. return nil, &googleapi.Error{
  107034. Code: res.StatusCode,
  107035. Header: res.Header,
  107036. }
  107037. }
  107038. if err != nil {
  107039. return nil, err
  107040. }
  107041. defer googleapi.CloseBody(res)
  107042. if err := googleapi.CheckResponse(res); err != nil {
  107043. return nil, err
  107044. }
  107045. ret := &TargetSslProxyList{
  107046. ServerResponse: googleapi.ServerResponse{
  107047. Header: res.Header,
  107048. HTTPStatusCode: res.StatusCode,
  107049. },
  107050. }
  107051. target := &ret
  107052. if err := gensupport.DecodeResponse(target, res); err != nil {
  107053. return nil, err
  107054. }
  107055. return ret, nil
  107056. // {
  107057. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  107058. // "httpMethod": "GET",
  107059. // "id": "compute.targetSslProxies.list",
  107060. // "parameterOrder": [
  107061. // "project"
  107062. // ],
  107063. // "parameters": {
  107064. // "filter": {
  107065. // "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).",
  107066. // "location": "query",
  107067. // "type": "string"
  107068. // },
  107069. // "maxResults": {
  107070. // "default": "500",
  107071. // "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)",
  107072. // "format": "uint32",
  107073. // "location": "query",
  107074. // "minimum": "0",
  107075. // "type": "integer"
  107076. // },
  107077. // "orderBy": {
  107078. // "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.",
  107079. // "location": "query",
  107080. // "type": "string"
  107081. // },
  107082. // "pageToken": {
  107083. // "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.",
  107084. // "location": "query",
  107085. // "type": "string"
  107086. // },
  107087. // "project": {
  107088. // "description": "Project ID for this request.",
  107089. // "location": "path",
  107090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107091. // "required": true,
  107092. // "type": "string"
  107093. // }
  107094. // },
  107095. // "path": "{project}/global/targetSslProxies",
  107096. // "response": {
  107097. // "$ref": "TargetSslProxyList"
  107098. // },
  107099. // "scopes": [
  107100. // "https://www.googleapis.com/auth/cloud-platform",
  107101. // "https://www.googleapis.com/auth/compute",
  107102. // "https://www.googleapis.com/auth/compute.readonly"
  107103. // ]
  107104. // }
  107105. }
  107106. // Pages invokes f for each page of results.
  107107. // A non-nil error returned from f will halt the iteration.
  107108. // The provided context supersedes any context provided to the Context method.
  107109. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  107110. c.ctx_ = ctx
  107111. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107112. for {
  107113. x, err := c.Do()
  107114. if err != nil {
  107115. return err
  107116. }
  107117. if err := f(x); err != nil {
  107118. return err
  107119. }
  107120. if x.NextPageToken == "" {
  107121. return nil
  107122. }
  107123. c.PageToken(x.NextPageToken)
  107124. }
  107125. }
  107126. // method id "compute.targetSslProxies.setBackendService":
  107127. type TargetSslProxiesSetBackendServiceCall struct {
  107128. s *Service
  107129. project string
  107130. targetSslProxy string
  107131. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  107132. urlParams_ gensupport.URLParams
  107133. ctx_ context.Context
  107134. header_ http.Header
  107135. }
  107136. // SetBackendService: Changes the BackendService for TargetSslProxy.
  107137. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  107138. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107139. c.project = project
  107140. c.targetSslProxy = targetSslProxy
  107141. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  107142. return c
  107143. }
  107144. // RequestId sets the optional parameter "requestId": An optional
  107145. // request ID to identify requests. Specify a unique request ID so that
  107146. // if you must retry your request, the server will know to ignore the
  107147. // request if it has already been completed.
  107148. //
  107149. // For example, consider a situation where you make an initial request
  107150. // and the request times out. If you make the request again with the
  107151. // same request ID, the server can check if original operation with the
  107152. // same request ID was received, and if so, will ignore the second
  107153. // request. This prevents clients from accidentally creating duplicate
  107154. // commitments.
  107155. //
  107156. // The request ID must be a valid UUID with the exception that zero UUID
  107157. // is not supported (00000000-0000-0000-0000-000000000000).
  107158. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  107159. c.urlParams_.Set("requestId", requestId)
  107160. return c
  107161. }
  107162. // Fields allows partial responses to be retrieved. See
  107163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107164. // for more information.
  107165. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  107166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107167. return c
  107168. }
  107169. // Context sets the context to be used in this call's Do method. Any
  107170. // pending HTTP request will be aborted if the provided context is
  107171. // canceled.
  107172. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  107173. c.ctx_ = ctx
  107174. return c
  107175. }
  107176. // Header returns an http.Header that can be modified by the caller to
  107177. // add HTTP headers to the request.
  107178. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  107179. if c.header_ == nil {
  107180. c.header_ = make(http.Header)
  107181. }
  107182. return c.header_
  107183. }
  107184. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  107185. reqHeaders := make(http.Header)
  107186. for k, v := range c.header_ {
  107187. reqHeaders[k] = v
  107188. }
  107189. reqHeaders.Set("User-Agent", c.s.userAgent())
  107190. var body io.Reader = nil
  107191. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  107192. if err != nil {
  107193. return nil, err
  107194. }
  107195. reqHeaders.Set("Content-Type", "application/json")
  107196. c.urlParams_.Set("alt", alt)
  107197. c.urlParams_.Set("prettyPrint", "false")
  107198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  107199. urls += "?" + c.urlParams_.Encode()
  107200. req, err := http.NewRequest("POST", urls, body)
  107201. if err != nil {
  107202. return nil, err
  107203. }
  107204. req.Header = reqHeaders
  107205. googleapi.Expand(req.URL, map[string]string{
  107206. "project": c.project,
  107207. "targetSslProxy": c.targetSslProxy,
  107208. })
  107209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107210. }
  107211. // Do executes the "compute.targetSslProxies.setBackendService" call.
  107212. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107213. // status code is an error. Response headers are in either
  107214. // *Operation.ServerResponse.Header or (if a response was returned at
  107215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107216. // to check whether the returned error was because
  107217. // http.StatusNotModified was returned.
  107218. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107219. gensupport.SetOptions(c.urlParams_, opts...)
  107220. res, err := c.doRequest("json")
  107221. if res != nil && res.StatusCode == http.StatusNotModified {
  107222. if res.Body != nil {
  107223. res.Body.Close()
  107224. }
  107225. return nil, &googleapi.Error{
  107226. Code: res.StatusCode,
  107227. Header: res.Header,
  107228. }
  107229. }
  107230. if err != nil {
  107231. return nil, err
  107232. }
  107233. defer googleapi.CloseBody(res)
  107234. if err := googleapi.CheckResponse(res); err != nil {
  107235. return nil, err
  107236. }
  107237. ret := &Operation{
  107238. ServerResponse: googleapi.ServerResponse{
  107239. Header: res.Header,
  107240. HTTPStatusCode: res.StatusCode,
  107241. },
  107242. }
  107243. target := &ret
  107244. if err := gensupport.DecodeResponse(target, res); err != nil {
  107245. return nil, err
  107246. }
  107247. return ret, nil
  107248. // {
  107249. // "description": "Changes the BackendService for TargetSslProxy.",
  107250. // "httpMethod": "POST",
  107251. // "id": "compute.targetSslProxies.setBackendService",
  107252. // "parameterOrder": [
  107253. // "project",
  107254. // "targetSslProxy"
  107255. // ],
  107256. // "parameters": {
  107257. // "project": {
  107258. // "description": "Project ID for this request.",
  107259. // "location": "path",
  107260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107261. // "required": true,
  107262. // "type": "string"
  107263. // },
  107264. // "requestId": {
  107265. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107266. // "location": "query",
  107267. // "type": "string"
  107268. // },
  107269. // "targetSslProxy": {
  107270. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  107271. // "location": "path",
  107272. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107273. // "required": true,
  107274. // "type": "string"
  107275. // }
  107276. // },
  107277. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  107278. // "request": {
  107279. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  107280. // },
  107281. // "response": {
  107282. // "$ref": "Operation"
  107283. // },
  107284. // "scopes": [
  107285. // "https://www.googleapis.com/auth/cloud-platform",
  107286. // "https://www.googleapis.com/auth/compute"
  107287. // ]
  107288. // }
  107289. }
  107290. // method id "compute.targetSslProxies.setProxyHeader":
  107291. type TargetSslProxiesSetProxyHeaderCall struct {
  107292. s *Service
  107293. project string
  107294. targetSslProxy string
  107295. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  107296. urlParams_ gensupport.URLParams
  107297. ctx_ context.Context
  107298. header_ http.Header
  107299. }
  107300. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  107301. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  107302. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107303. c.project = project
  107304. c.targetSslProxy = targetSslProxy
  107305. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  107306. return c
  107307. }
  107308. // RequestId sets the optional parameter "requestId": An optional
  107309. // request ID to identify requests. Specify a unique request ID so that
  107310. // if you must retry your request, the server will know to ignore the
  107311. // request if it has already been completed.
  107312. //
  107313. // For example, consider a situation where you make an initial request
  107314. // and the request times out. If you make the request again with the
  107315. // same request ID, the server can check if original operation with the
  107316. // same request ID was received, and if so, will ignore the second
  107317. // request. This prevents clients from accidentally creating duplicate
  107318. // commitments.
  107319. //
  107320. // The request ID must be a valid UUID with the exception that zero UUID
  107321. // is not supported (00000000-0000-0000-0000-000000000000).
  107322. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  107323. c.urlParams_.Set("requestId", requestId)
  107324. return c
  107325. }
  107326. // Fields allows partial responses to be retrieved. See
  107327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107328. // for more information.
  107329. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  107330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107331. return c
  107332. }
  107333. // Context sets the context to be used in this call's Do method. Any
  107334. // pending HTTP request will be aborted if the provided context is
  107335. // canceled.
  107336. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  107337. c.ctx_ = ctx
  107338. return c
  107339. }
  107340. // Header returns an http.Header that can be modified by the caller to
  107341. // add HTTP headers to the request.
  107342. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  107343. if c.header_ == nil {
  107344. c.header_ = make(http.Header)
  107345. }
  107346. return c.header_
  107347. }
  107348. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  107349. reqHeaders := make(http.Header)
  107350. for k, v := range c.header_ {
  107351. reqHeaders[k] = v
  107352. }
  107353. reqHeaders.Set("User-Agent", c.s.userAgent())
  107354. var body io.Reader = nil
  107355. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  107356. if err != nil {
  107357. return nil, err
  107358. }
  107359. reqHeaders.Set("Content-Type", "application/json")
  107360. c.urlParams_.Set("alt", alt)
  107361. c.urlParams_.Set("prettyPrint", "false")
  107362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  107363. urls += "?" + c.urlParams_.Encode()
  107364. req, err := http.NewRequest("POST", urls, body)
  107365. if err != nil {
  107366. return nil, err
  107367. }
  107368. req.Header = reqHeaders
  107369. googleapi.Expand(req.URL, map[string]string{
  107370. "project": c.project,
  107371. "targetSslProxy": c.targetSslProxy,
  107372. })
  107373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107374. }
  107375. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  107376. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107377. // status code is an error. Response headers are in either
  107378. // *Operation.ServerResponse.Header or (if a response was returned at
  107379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107380. // to check whether the returned error was because
  107381. // http.StatusNotModified was returned.
  107382. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107383. gensupport.SetOptions(c.urlParams_, opts...)
  107384. res, err := c.doRequest("json")
  107385. if res != nil && res.StatusCode == http.StatusNotModified {
  107386. if res.Body != nil {
  107387. res.Body.Close()
  107388. }
  107389. return nil, &googleapi.Error{
  107390. Code: res.StatusCode,
  107391. Header: res.Header,
  107392. }
  107393. }
  107394. if err != nil {
  107395. return nil, err
  107396. }
  107397. defer googleapi.CloseBody(res)
  107398. if err := googleapi.CheckResponse(res); err != nil {
  107399. return nil, err
  107400. }
  107401. ret := &Operation{
  107402. ServerResponse: googleapi.ServerResponse{
  107403. Header: res.Header,
  107404. HTTPStatusCode: res.StatusCode,
  107405. },
  107406. }
  107407. target := &ret
  107408. if err := gensupport.DecodeResponse(target, res); err != nil {
  107409. return nil, err
  107410. }
  107411. return ret, nil
  107412. // {
  107413. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  107414. // "httpMethod": "POST",
  107415. // "id": "compute.targetSslProxies.setProxyHeader",
  107416. // "parameterOrder": [
  107417. // "project",
  107418. // "targetSslProxy"
  107419. // ],
  107420. // "parameters": {
  107421. // "project": {
  107422. // "description": "Project ID for this request.",
  107423. // "location": "path",
  107424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107425. // "required": true,
  107426. // "type": "string"
  107427. // },
  107428. // "requestId": {
  107429. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107430. // "location": "query",
  107431. // "type": "string"
  107432. // },
  107433. // "targetSslProxy": {
  107434. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  107435. // "location": "path",
  107436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107437. // "required": true,
  107438. // "type": "string"
  107439. // }
  107440. // },
  107441. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  107442. // "request": {
  107443. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  107444. // },
  107445. // "response": {
  107446. // "$ref": "Operation"
  107447. // },
  107448. // "scopes": [
  107449. // "https://www.googleapis.com/auth/cloud-platform",
  107450. // "https://www.googleapis.com/auth/compute"
  107451. // ]
  107452. // }
  107453. }
  107454. // method id "compute.targetSslProxies.setSslCertificates":
  107455. type TargetSslProxiesSetSslCertificatesCall struct {
  107456. s *Service
  107457. project string
  107458. targetSslProxy string
  107459. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  107460. urlParams_ gensupport.URLParams
  107461. ctx_ context.Context
  107462. header_ http.Header
  107463. }
  107464. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  107465. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  107466. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107467. c.project = project
  107468. c.targetSslProxy = targetSslProxy
  107469. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  107470. return c
  107471. }
  107472. // RequestId sets the optional parameter "requestId": An optional
  107473. // request ID to identify requests. Specify a unique request ID so that
  107474. // if you must retry your request, the server will know to ignore the
  107475. // request if it has already been completed.
  107476. //
  107477. // For example, consider a situation where you make an initial request
  107478. // and the request times out. If you make the request again with the
  107479. // same request ID, the server can check if original operation with the
  107480. // same request ID was received, and if so, will ignore the second
  107481. // request. This prevents clients from accidentally creating duplicate
  107482. // commitments.
  107483. //
  107484. // The request ID must be a valid UUID with the exception that zero UUID
  107485. // is not supported (00000000-0000-0000-0000-000000000000).
  107486. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  107487. c.urlParams_.Set("requestId", requestId)
  107488. return c
  107489. }
  107490. // Fields allows partial responses to be retrieved. See
  107491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107492. // for more information.
  107493. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  107494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107495. return c
  107496. }
  107497. // Context sets the context to be used in this call's Do method. Any
  107498. // pending HTTP request will be aborted if the provided context is
  107499. // canceled.
  107500. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  107501. c.ctx_ = ctx
  107502. return c
  107503. }
  107504. // Header returns an http.Header that can be modified by the caller to
  107505. // add HTTP headers to the request.
  107506. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  107507. if c.header_ == nil {
  107508. c.header_ = make(http.Header)
  107509. }
  107510. return c.header_
  107511. }
  107512. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  107513. reqHeaders := make(http.Header)
  107514. for k, v := range c.header_ {
  107515. reqHeaders[k] = v
  107516. }
  107517. reqHeaders.Set("User-Agent", c.s.userAgent())
  107518. var body io.Reader = nil
  107519. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  107520. if err != nil {
  107521. return nil, err
  107522. }
  107523. reqHeaders.Set("Content-Type", "application/json")
  107524. c.urlParams_.Set("alt", alt)
  107525. c.urlParams_.Set("prettyPrint", "false")
  107526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  107527. urls += "?" + c.urlParams_.Encode()
  107528. req, err := http.NewRequest("POST", urls, body)
  107529. if err != nil {
  107530. return nil, err
  107531. }
  107532. req.Header = reqHeaders
  107533. googleapi.Expand(req.URL, map[string]string{
  107534. "project": c.project,
  107535. "targetSslProxy": c.targetSslProxy,
  107536. })
  107537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107538. }
  107539. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  107540. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107541. // status code is an error. Response headers are in either
  107542. // *Operation.ServerResponse.Header or (if a response was returned at
  107543. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107544. // to check whether the returned error was because
  107545. // http.StatusNotModified was returned.
  107546. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107547. gensupport.SetOptions(c.urlParams_, opts...)
  107548. res, err := c.doRequest("json")
  107549. if res != nil && res.StatusCode == http.StatusNotModified {
  107550. if res.Body != nil {
  107551. res.Body.Close()
  107552. }
  107553. return nil, &googleapi.Error{
  107554. Code: res.StatusCode,
  107555. Header: res.Header,
  107556. }
  107557. }
  107558. if err != nil {
  107559. return nil, err
  107560. }
  107561. defer googleapi.CloseBody(res)
  107562. if err := googleapi.CheckResponse(res); err != nil {
  107563. return nil, err
  107564. }
  107565. ret := &Operation{
  107566. ServerResponse: googleapi.ServerResponse{
  107567. Header: res.Header,
  107568. HTTPStatusCode: res.StatusCode,
  107569. },
  107570. }
  107571. target := &ret
  107572. if err := gensupport.DecodeResponse(target, res); err != nil {
  107573. return nil, err
  107574. }
  107575. return ret, nil
  107576. // {
  107577. // "description": "Changes SslCertificates for TargetSslProxy.",
  107578. // "httpMethod": "POST",
  107579. // "id": "compute.targetSslProxies.setSslCertificates",
  107580. // "parameterOrder": [
  107581. // "project",
  107582. // "targetSslProxy"
  107583. // ],
  107584. // "parameters": {
  107585. // "project": {
  107586. // "description": "Project ID for this request.",
  107587. // "location": "path",
  107588. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107589. // "required": true,
  107590. // "type": "string"
  107591. // },
  107592. // "requestId": {
  107593. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107594. // "location": "query",
  107595. // "type": "string"
  107596. // },
  107597. // "targetSslProxy": {
  107598. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  107599. // "location": "path",
  107600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107601. // "required": true,
  107602. // "type": "string"
  107603. // }
  107604. // },
  107605. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  107606. // "request": {
  107607. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  107608. // },
  107609. // "response": {
  107610. // "$ref": "Operation"
  107611. // },
  107612. // "scopes": [
  107613. // "https://www.googleapis.com/auth/cloud-platform",
  107614. // "https://www.googleapis.com/auth/compute"
  107615. // ]
  107616. // }
  107617. }
  107618. // method id "compute.targetSslProxies.setSslPolicy":
  107619. type TargetSslProxiesSetSslPolicyCall struct {
  107620. s *Service
  107621. project string
  107622. targetSslProxy string
  107623. sslpolicyreference *SslPolicyReference
  107624. urlParams_ gensupport.URLParams
  107625. ctx_ context.Context
  107626. header_ http.Header
  107627. }
  107628. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  107629. // specifies the server-side support for SSL features. This affects
  107630. // connections between clients and the SSL proxy load balancer. They do
  107631. // not affect the connection between the load balancer and the backends.
  107632. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  107633. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107634. c.project = project
  107635. c.targetSslProxy = targetSslProxy
  107636. c.sslpolicyreference = sslpolicyreference
  107637. return c
  107638. }
  107639. // RequestId sets the optional parameter "requestId": An optional
  107640. // request ID to identify requests. Specify a unique request ID so that
  107641. // if you must retry your request, the server will know to ignore the
  107642. // request if it has already been completed.
  107643. //
  107644. // For example, consider a situation where you make an initial request
  107645. // and the request times out. If you make the request again with the
  107646. // same request ID, the server can check if original operation with the
  107647. // same request ID was received, and if so, will ignore the second
  107648. // request. This prevents clients from accidentally creating duplicate
  107649. // commitments.
  107650. //
  107651. // The request ID must be a valid UUID with the exception that zero UUID
  107652. // is not supported (00000000-0000-0000-0000-000000000000).
  107653. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  107654. c.urlParams_.Set("requestId", requestId)
  107655. return c
  107656. }
  107657. // Fields allows partial responses to be retrieved. See
  107658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107659. // for more information.
  107660. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  107661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107662. return c
  107663. }
  107664. // Context sets the context to be used in this call's Do method. Any
  107665. // pending HTTP request will be aborted if the provided context is
  107666. // canceled.
  107667. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  107668. c.ctx_ = ctx
  107669. return c
  107670. }
  107671. // Header returns an http.Header that can be modified by the caller to
  107672. // add HTTP headers to the request.
  107673. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  107674. if c.header_ == nil {
  107675. c.header_ = make(http.Header)
  107676. }
  107677. return c.header_
  107678. }
  107679. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  107680. reqHeaders := make(http.Header)
  107681. for k, v := range c.header_ {
  107682. reqHeaders[k] = v
  107683. }
  107684. reqHeaders.Set("User-Agent", c.s.userAgent())
  107685. var body io.Reader = nil
  107686. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  107687. if err != nil {
  107688. return nil, err
  107689. }
  107690. reqHeaders.Set("Content-Type", "application/json")
  107691. c.urlParams_.Set("alt", alt)
  107692. c.urlParams_.Set("prettyPrint", "false")
  107693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  107694. urls += "?" + c.urlParams_.Encode()
  107695. req, err := http.NewRequest("POST", urls, body)
  107696. if err != nil {
  107697. return nil, err
  107698. }
  107699. req.Header = reqHeaders
  107700. googleapi.Expand(req.URL, map[string]string{
  107701. "project": c.project,
  107702. "targetSslProxy": c.targetSslProxy,
  107703. })
  107704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107705. }
  107706. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  107707. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107708. // status code is an error. Response headers are in either
  107709. // *Operation.ServerResponse.Header or (if a response was returned at
  107710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107711. // to check whether the returned error was because
  107712. // http.StatusNotModified was returned.
  107713. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107714. gensupport.SetOptions(c.urlParams_, opts...)
  107715. res, err := c.doRequest("json")
  107716. if res != nil && res.StatusCode == http.StatusNotModified {
  107717. if res.Body != nil {
  107718. res.Body.Close()
  107719. }
  107720. return nil, &googleapi.Error{
  107721. Code: res.StatusCode,
  107722. Header: res.Header,
  107723. }
  107724. }
  107725. if err != nil {
  107726. return nil, err
  107727. }
  107728. defer googleapi.CloseBody(res)
  107729. if err := googleapi.CheckResponse(res); err != nil {
  107730. return nil, err
  107731. }
  107732. ret := &Operation{
  107733. ServerResponse: googleapi.ServerResponse{
  107734. Header: res.Header,
  107735. HTTPStatusCode: res.StatusCode,
  107736. },
  107737. }
  107738. target := &ret
  107739. if err := gensupport.DecodeResponse(target, res); err != nil {
  107740. return nil, err
  107741. }
  107742. return ret, nil
  107743. // {
  107744. // "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.",
  107745. // "httpMethod": "POST",
  107746. // "id": "compute.targetSslProxies.setSslPolicy",
  107747. // "parameterOrder": [
  107748. // "project",
  107749. // "targetSslProxy"
  107750. // ],
  107751. // "parameters": {
  107752. // "project": {
  107753. // "description": "Project ID for this request.",
  107754. // "location": "path",
  107755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107756. // "required": true,
  107757. // "type": "string"
  107758. // },
  107759. // "requestId": {
  107760. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107761. // "location": "query",
  107762. // "type": "string"
  107763. // },
  107764. // "targetSslProxy": {
  107765. // "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.",
  107766. // "location": "path",
  107767. // "required": true,
  107768. // "type": "string"
  107769. // }
  107770. // },
  107771. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  107772. // "request": {
  107773. // "$ref": "SslPolicyReference"
  107774. // },
  107775. // "response": {
  107776. // "$ref": "Operation"
  107777. // },
  107778. // "scopes": [
  107779. // "https://www.googleapis.com/auth/cloud-platform",
  107780. // "https://www.googleapis.com/auth/compute"
  107781. // ]
  107782. // }
  107783. }
  107784. // method id "compute.targetSslProxies.testIamPermissions":
  107785. type TargetSslProxiesTestIamPermissionsCall struct {
  107786. s *Service
  107787. project string
  107788. resource string
  107789. testpermissionsrequest *TestPermissionsRequest
  107790. urlParams_ gensupport.URLParams
  107791. ctx_ context.Context
  107792. header_ http.Header
  107793. }
  107794. // TestIamPermissions: Returns permissions that a caller has on the
  107795. // specified resource.
  107796. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  107797. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107798. c.project = project
  107799. c.resource = resource
  107800. c.testpermissionsrequest = testpermissionsrequest
  107801. return c
  107802. }
  107803. // Fields allows partial responses to be retrieved. See
  107804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107805. // for more information.
  107806. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  107807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107808. return c
  107809. }
  107810. // Context sets the context to be used in this call's Do method. Any
  107811. // pending HTTP request will be aborted if the provided context is
  107812. // canceled.
  107813. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  107814. c.ctx_ = ctx
  107815. return c
  107816. }
  107817. // Header returns an http.Header that can be modified by the caller to
  107818. // add HTTP headers to the request.
  107819. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  107820. if c.header_ == nil {
  107821. c.header_ = make(http.Header)
  107822. }
  107823. return c.header_
  107824. }
  107825. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  107826. reqHeaders := make(http.Header)
  107827. for k, v := range c.header_ {
  107828. reqHeaders[k] = v
  107829. }
  107830. reqHeaders.Set("User-Agent", c.s.userAgent())
  107831. var body io.Reader = nil
  107832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  107833. if err != nil {
  107834. return nil, err
  107835. }
  107836. reqHeaders.Set("Content-Type", "application/json")
  107837. c.urlParams_.Set("alt", alt)
  107838. c.urlParams_.Set("prettyPrint", "false")
  107839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  107840. urls += "?" + c.urlParams_.Encode()
  107841. req, err := http.NewRequest("POST", urls, body)
  107842. if err != nil {
  107843. return nil, err
  107844. }
  107845. req.Header = reqHeaders
  107846. googleapi.Expand(req.URL, map[string]string{
  107847. "project": c.project,
  107848. "resource": c.resource,
  107849. })
  107850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107851. }
  107852. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  107853. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  107854. // non-2xx status code is an error. Response headers are in either
  107855. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  107856. // returned at all) in error.(*googleapi.Error).Header. Use
  107857. // googleapi.IsNotModified to check whether the returned error was
  107858. // because http.StatusNotModified was returned.
  107859. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  107860. gensupport.SetOptions(c.urlParams_, opts...)
  107861. res, err := c.doRequest("json")
  107862. if res != nil && res.StatusCode == http.StatusNotModified {
  107863. if res.Body != nil {
  107864. res.Body.Close()
  107865. }
  107866. return nil, &googleapi.Error{
  107867. Code: res.StatusCode,
  107868. Header: res.Header,
  107869. }
  107870. }
  107871. if err != nil {
  107872. return nil, err
  107873. }
  107874. defer googleapi.CloseBody(res)
  107875. if err := googleapi.CheckResponse(res); err != nil {
  107876. return nil, err
  107877. }
  107878. ret := &TestPermissionsResponse{
  107879. ServerResponse: googleapi.ServerResponse{
  107880. Header: res.Header,
  107881. HTTPStatusCode: res.StatusCode,
  107882. },
  107883. }
  107884. target := &ret
  107885. if err := gensupport.DecodeResponse(target, res); err != nil {
  107886. return nil, err
  107887. }
  107888. return ret, nil
  107889. // {
  107890. // "description": "Returns permissions that a caller has on the specified resource.",
  107891. // "httpMethod": "POST",
  107892. // "id": "compute.targetSslProxies.testIamPermissions",
  107893. // "parameterOrder": [
  107894. // "project",
  107895. // "resource"
  107896. // ],
  107897. // "parameters": {
  107898. // "project": {
  107899. // "description": "Project ID for this request.",
  107900. // "location": "path",
  107901. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107902. // "required": true,
  107903. // "type": "string"
  107904. // },
  107905. // "resource": {
  107906. // "description": "Name or id of the resource for this request.",
  107907. // "location": "path",
  107908. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107909. // "required": true,
  107910. // "type": "string"
  107911. // }
  107912. // },
  107913. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  107914. // "request": {
  107915. // "$ref": "TestPermissionsRequest"
  107916. // },
  107917. // "response": {
  107918. // "$ref": "TestPermissionsResponse"
  107919. // },
  107920. // "scopes": [
  107921. // "https://www.googleapis.com/auth/cloud-platform",
  107922. // "https://www.googleapis.com/auth/compute",
  107923. // "https://www.googleapis.com/auth/compute.readonly"
  107924. // ]
  107925. // }
  107926. }
  107927. // method id "compute.targetTcpProxies.delete":
  107928. type TargetTcpProxiesDeleteCall struct {
  107929. s *Service
  107930. project string
  107931. targetTcpProxy string
  107932. urlParams_ gensupport.URLParams
  107933. ctx_ context.Context
  107934. header_ http.Header
  107935. }
  107936. // Delete: Deletes the specified TargetTcpProxy resource.
  107937. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  107938. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107939. c.project = project
  107940. c.targetTcpProxy = targetTcpProxy
  107941. return c
  107942. }
  107943. // RequestId sets the optional parameter "requestId": An optional
  107944. // request ID to identify requests. Specify a unique request ID so that
  107945. // if you must retry your request, the server will know to ignore the
  107946. // request if it has already been completed.
  107947. //
  107948. // For example, consider a situation where you make an initial request
  107949. // and the request times out. If you make the request again with the
  107950. // same request ID, the server can check if original operation with the
  107951. // same request ID was received, and if so, will ignore the second
  107952. // request. This prevents clients from accidentally creating duplicate
  107953. // commitments.
  107954. //
  107955. // The request ID must be a valid UUID with the exception that zero UUID
  107956. // is not supported (00000000-0000-0000-0000-000000000000).
  107957. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  107958. c.urlParams_.Set("requestId", requestId)
  107959. return c
  107960. }
  107961. // Fields allows partial responses to be retrieved. See
  107962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107963. // for more information.
  107964. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  107965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107966. return c
  107967. }
  107968. // Context sets the context to be used in this call's Do method. Any
  107969. // pending HTTP request will be aborted if the provided context is
  107970. // canceled.
  107971. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  107972. c.ctx_ = ctx
  107973. return c
  107974. }
  107975. // Header returns an http.Header that can be modified by the caller to
  107976. // add HTTP headers to the request.
  107977. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  107978. if c.header_ == nil {
  107979. c.header_ = make(http.Header)
  107980. }
  107981. return c.header_
  107982. }
  107983. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  107984. reqHeaders := make(http.Header)
  107985. for k, v := range c.header_ {
  107986. reqHeaders[k] = v
  107987. }
  107988. reqHeaders.Set("User-Agent", c.s.userAgent())
  107989. var body io.Reader = nil
  107990. c.urlParams_.Set("alt", alt)
  107991. c.urlParams_.Set("prettyPrint", "false")
  107992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  107993. urls += "?" + c.urlParams_.Encode()
  107994. req, err := http.NewRequest("DELETE", urls, body)
  107995. if err != nil {
  107996. return nil, err
  107997. }
  107998. req.Header = reqHeaders
  107999. googleapi.Expand(req.URL, map[string]string{
  108000. "project": c.project,
  108001. "targetTcpProxy": c.targetTcpProxy,
  108002. })
  108003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108004. }
  108005. // Do executes the "compute.targetTcpProxies.delete" call.
  108006. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108007. // status code is an error. Response headers are in either
  108008. // *Operation.ServerResponse.Header or (if a response was returned at
  108009. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108010. // to check whether the returned error was because
  108011. // http.StatusNotModified was returned.
  108012. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108013. gensupport.SetOptions(c.urlParams_, opts...)
  108014. res, err := c.doRequest("json")
  108015. if res != nil && res.StatusCode == http.StatusNotModified {
  108016. if res.Body != nil {
  108017. res.Body.Close()
  108018. }
  108019. return nil, &googleapi.Error{
  108020. Code: res.StatusCode,
  108021. Header: res.Header,
  108022. }
  108023. }
  108024. if err != nil {
  108025. return nil, err
  108026. }
  108027. defer googleapi.CloseBody(res)
  108028. if err := googleapi.CheckResponse(res); err != nil {
  108029. return nil, err
  108030. }
  108031. ret := &Operation{
  108032. ServerResponse: googleapi.ServerResponse{
  108033. Header: res.Header,
  108034. HTTPStatusCode: res.StatusCode,
  108035. },
  108036. }
  108037. target := &ret
  108038. if err := gensupport.DecodeResponse(target, res); err != nil {
  108039. return nil, err
  108040. }
  108041. return ret, nil
  108042. // {
  108043. // "description": "Deletes the specified TargetTcpProxy resource.",
  108044. // "httpMethod": "DELETE",
  108045. // "id": "compute.targetTcpProxies.delete",
  108046. // "parameterOrder": [
  108047. // "project",
  108048. // "targetTcpProxy"
  108049. // ],
  108050. // "parameters": {
  108051. // "project": {
  108052. // "description": "Project ID for this request.",
  108053. // "location": "path",
  108054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108055. // "required": true,
  108056. // "type": "string"
  108057. // },
  108058. // "requestId": {
  108059. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108060. // "location": "query",
  108061. // "type": "string"
  108062. // },
  108063. // "targetTcpProxy": {
  108064. // "description": "Name of the TargetTcpProxy resource to delete.",
  108065. // "location": "path",
  108066. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108067. // "required": true,
  108068. // "type": "string"
  108069. // }
  108070. // },
  108071. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  108072. // "response": {
  108073. // "$ref": "Operation"
  108074. // },
  108075. // "scopes": [
  108076. // "https://www.googleapis.com/auth/cloud-platform",
  108077. // "https://www.googleapis.com/auth/compute"
  108078. // ]
  108079. // }
  108080. }
  108081. // method id "compute.targetTcpProxies.get":
  108082. type TargetTcpProxiesGetCall struct {
  108083. s *Service
  108084. project string
  108085. targetTcpProxy string
  108086. urlParams_ gensupport.URLParams
  108087. ifNoneMatch_ string
  108088. ctx_ context.Context
  108089. header_ http.Header
  108090. }
  108091. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  108092. // available target TCP proxies by making a list() request.
  108093. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  108094. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108095. c.project = project
  108096. c.targetTcpProxy = targetTcpProxy
  108097. return c
  108098. }
  108099. // Fields allows partial responses to be retrieved. See
  108100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108101. // for more information.
  108102. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  108103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108104. return c
  108105. }
  108106. // IfNoneMatch sets the optional parameter which makes the operation
  108107. // fail if the object's ETag matches the given value. This is useful for
  108108. // getting updates only after the object has changed since the last
  108109. // request. Use googleapi.IsNotModified to check whether the response
  108110. // error from Do is the result of In-None-Match.
  108111. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  108112. c.ifNoneMatch_ = entityTag
  108113. return c
  108114. }
  108115. // Context sets the context to be used in this call's Do method. Any
  108116. // pending HTTP request will be aborted if the provided context is
  108117. // canceled.
  108118. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  108119. c.ctx_ = ctx
  108120. return c
  108121. }
  108122. // Header returns an http.Header that can be modified by the caller to
  108123. // add HTTP headers to the request.
  108124. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  108125. if c.header_ == nil {
  108126. c.header_ = make(http.Header)
  108127. }
  108128. return c.header_
  108129. }
  108130. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  108131. reqHeaders := make(http.Header)
  108132. for k, v := range c.header_ {
  108133. reqHeaders[k] = v
  108134. }
  108135. reqHeaders.Set("User-Agent", c.s.userAgent())
  108136. if c.ifNoneMatch_ != "" {
  108137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108138. }
  108139. var body io.Reader = nil
  108140. c.urlParams_.Set("alt", alt)
  108141. c.urlParams_.Set("prettyPrint", "false")
  108142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  108143. urls += "?" + c.urlParams_.Encode()
  108144. req, err := http.NewRequest("GET", urls, body)
  108145. if err != nil {
  108146. return nil, err
  108147. }
  108148. req.Header = reqHeaders
  108149. googleapi.Expand(req.URL, map[string]string{
  108150. "project": c.project,
  108151. "targetTcpProxy": c.targetTcpProxy,
  108152. })
  108153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108154. }
  108155. // Do executes the "compute.targetTcpProxies.get" call.
  108156. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  108157. // status code is an error. Response headers are in either
  108158. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  108159. // at all) in error.(*googleapi.Error).Header. Use
  108160. // googleapi.IsNotModified to check whether the returned error was
  108161. // because http.StatusNotModified was returned.
  108162. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  108163. gensupport.SetOptions(c.urlParams_, opts...)
  108164. res, err := c.doRequest("json")
  108165. if res != nil && res.StatusCode == http.StatusNotModified {
  108166. if res.Body != nil {
  108167. res.Body.Close()
  108168. }
  108169. return nil, &googleapi.Error{
  108170. Code: res.StatusCode,
  108171. Header: res.Header,
  108172. }
  108173. }
  108174. if err != nil {
  108175. return nil, err
  108176. }
  108177. defer googleapi.CloseBody(res)
  108178. if err := googleapi.CheckResponse(res); err != nil {
  108179. return nil, err
  108180. }
  108181. ret := &TargetTcpProxy{
  108182. ServerResponse: googleapi.ServerResponse{
  108183. Header: res.Header,
  108184. HTTPStatusCode: res.StatusCode,
  108185. },
  108186. }
  108187. target := &ret
  108188. if err := gensupport.DecodeResponse(target, res); err != nil {
  108189. return nil, err
  108190. }
  108191. return ret, nil
  108192. // {
  108193. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  108194. // "httpMethod": "GET",
  108195. // "id": "compute.targetTcpProxies.get",
  108196. // "parameterOrder": [
  108197. // "project",
  108198. // "targetTcpProxy"
  108199. // ],
  108200. // "parameters": {
  108201. // "project": {
  108202. // "description": "Project ID for this request.",
  108203. // "location": "path",
  108204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108205. // "required": true,
  108206. // "type": "string"
  108207. // },
  108208. // "targetTcpProxy": {
  108209. // "description": "Name of the TargetTcpProxy resource to return.",
  108210. // "location": "path",
  108211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108212. // "required": true,
  108213. // "type": "string"
  108214. // }
  108215. // },
  108216. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  108217. // "response": {
  108218. // "$ref": "TargetTcpProxy"
  108219. // },
  108220. // "scopes": [
  108221. // "https://www.googleapis.com/auth/cloud-platform",
  108222. // "https://www.googleapis.com/auth/compute",
  108223. // "https://www.googleapis.com/auth/compute.readonly"
  108224. // ]
  108225. // }
  108226. }
  108227. // method id "compute.targetTcpProxies.insert":
  108228. type TargetTcpProxiesInsertCall struct {
  108229. s *Service
  108230. project string
  108231. targettcpproxy *TargetTcpProxy
  108232. urlParams_ gensupport.URLParams
  108233. ctx_ context.Context
  108234. header_ http.Header
  108235. }
  108236. // Insert: Creates a TargetTcpProxy resource in the specified project
  108237. // using the data included in the request.
  108238. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  108239. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108240. c.project = project
  108241. c.targettcpproxy = targettcpproxy
  108242. return c
  108243. }
  108244. // RequestId sets the optional parameter "requestId": An optional
  108245. // request ID to identify requests. Specify a unique request ID so that
  108246. // if you must retry your request, the server will know to ignore the
  108247. // request if it has already been completed.
  108248. //
  108249. // For example, consider a situation where you make an initial request
  108250. // and the request times out. If you make the request again with the
  108251. // same request ID, the server can check if original operation with the
  108252. // same request ID was received, and if so, will ignore the second
  108253. // request. This prevents clients from accidentally creating duplicate
  108254. // commitments.
  108255. //
  108256. // The request ID must be a valid UUID with the exception that zero UUID
  108257. // is not supported (00000000-0000-0000-0000-000000000000).
  108258. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  108259. c.urlParams_.Set("requestId", requestId)
  108260. return c
  108261. }
  108262. // Fields allows partial responses to be retrieved. See
  108263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108264. // for more information.
  108265. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  108266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108267. return c
  108268. }
  108269. // Context sets the context to be used in this call's Do method. Any
  108270. // pending HTTP request will be aborted if the provided context is
  108271. // canceled.
  108272. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  108273. c.ctx_ = ctx
  108274. return c
  108275. }
  108276. // Header returns an http.Header that can be modified by the caller to
  108277. // add HTTP headers to the request.
  108278. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  108279. if c.header_ == nil {
  108280. c.header_ = make(http.Header)
  108281. }
  108282. return c.header_
  108283. }
  108284. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  108285. reqHeaders := make(http.Header)
  108286. for k, v := range c.header_ {
  108287. reqHeaders[k] = v
  108288. }
  108289. reqHeaders.Set("User-Agent", c.s.userAgent())
  108290. var body io.Reader = nil
  108291. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  108292. if err != nil {
  108293. return nil, err
  108294. }
  108295. reqHeaders.Set("Content-Type", "application/json")
  108296. c.urlParams_.Set("alt", alt)
  108297. c.urlParams_.Set("prettyPrint", "false")
  108298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  108299. urls += "?" + c.urlParams_.Encode()
  108300. req, err := http.NewRequest("POST", urls, body)
  108301. if err != nil {
  108302. return nil, err
  108303. }
  108304. req.Header = reqHeaders
  108305. googleapi.Expand(req.URL, map[string]string{
  108306. "project": c.project,
  108307. })
  108308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108309. }
  108310. // Do executes the "compute.targetTcpProxies.insert" call.
  108311. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108312. // status code is an error. Response headers are in either
  108313. // *Operation.ServerResponse.Header or (if a response was returned at
  108314. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108315. // to check whether the returned error was because
  108316. // http.StatusNotModified was returned.
  108317. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108318. gensupport.SetOptions(c.urlParams_, opts...)
  108319. res, err := c.doRequest("json")
  108320. if res != nil && res.StatusCode == http.StatusNotModified {
  108321. if res.Body != nil {
  108322. res.Body.Close()
  108323. }
  108324. return nil, &googleapi.Error{
  108325. Code: res.StatusCode,
  108326. Header: res.Header,
  108327. }
  108328. }
  108329. if err != nil {
  108330. return nil, err
  108331. }
  108332. defer googleapi.CloseBody(res)
  108333. if err := googleapi.CheckResponse(res); err != nil {
  108334. return nil, err
  108335. }
  108336. ret := &Operation{
  108337. ServerResponse: googleapi.ServerResponse{
  108338. Header: res.Header,
  108339. HTTPStatusCode: res.StatusCode,
  108340. },
  108341. }
  108342. target := &ret
  108343. if err := gensupport.DecodeResponse(target, res); err != nil {
  108344. return nil, err
  108345. }
  108346. return ret, nil
  108347. // {
  108348. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  108349. // "httpMethod": "POST",
  108350. // "id": "compute.targetTcpProxies.insert",
  108351. // "parameterOrder": [
  108352. // "project"
  108353. // ],
  108354. // "parameters": {
  108355. // "project": {
  108356. // "description": "Project ID for this request.",
  108357. // "location": "path",
  108358. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108359. // "required": true,
  108360. // "type": "string"
  108361. // },
  108362. // "requestId": {
  108363. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108364. // "location": "query",
  108365. // "type": "string"
  108366. // }
  108367. // },
  108368. // "path": "{project}/global/targetTcpProxies",
  108369. // "request": {
  108370. // "$ref": "TargetTcpProxy"
  108371. // },
  108372. // "response": {
  108373. // "$ref": "Operation"
  108374. // },
  108375. // "scopes": [
  108376. // "https://www.googleapis.com/auth/cloud-platform",
  108377. // "https://www.googleapis.com/auth/compute"
  108378. // ]
  108379. // }
  108380. }
  108381. // method id "compute.targetTcpProxies.list":
  108382. type TargetTcpProxiesListCall struct {
  108383. s *Service
  108384. project string
  108385. urlParams_ gensupport.URLParams
  108386. ifNoneMatch_ string
  108387. ctx_ context.Context
  108388. header_ http.Header
  108389. }
  108390. // List: Retrieves the list of TargetTcpProxy resources available to the
  108391. // specified project.
  108392. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  108393. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108394. c.project = project
  108395. return c
  108396. }
  108397. // Filter sets the optional parameter "filter": A filter expression that
  108398. // filters resources listed in the response. The expression must specify
  108399. // the field name, a comparison operator, and the value that you want to
  108400. // use for filtering. The value must be a string, a number, or a
  108401. // boolean. The comparison operator must be either =, !=, >, or <.
  108402. //
  108403. // For example, if you are filtering Compute Engine instances, you can
  108404. // exclude instances named example-instance by specifying name !=
  108405. // example-instance.
  108406. //
  108407. // You can also filter nested fields. For example, you could specify
  108408. // scheduling.automaticRestart = false to include instances only if they
  108409. // are not scheduled for automatic restarts. You can use filtering on
  108410. // nested fields to filter based on resource labels.
  108411. //
  108412. // To filter on multiple expressions, provide each separate expression
  108413. // within parentheses. For example, (scheduling.automaticRestart = true)
  108414. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108415. // AND expression. However, you can include AND and OR expressions
  108416. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108417. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108418. // true).
  108419. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  108420. c.urlParams_.Set("filter", filter)
  108421. return c
  108422. }
  108423. // MaxResults sets the optional parameter "maxResults": The maximum
  108424. // number of results per page that should be returned. If the number of
  108425. // available results is larger than maxResults, Compute Engine returns a
  108426. // nextPageToken that can be used to get the next page of results in
  108427. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108428. // (Default: 500)
  108429. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  108430. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108431. return c
  108432. }
  108433. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108434. // a certain order. By default, results are returned in alphanumerical
  108435. // order based on the resource name.
  108436. //
  108437. // You can also sort results in descending order based on the creation
  108438. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108439. // based on the creationTimestamp field in reverse chronological order
  108440. // (newest result first). Use this to sort resources like operations so
  108441. // that the newest operation is returned first.
  108442. //
  108443. // Currently, only sorting by name or creationTimestamp desc is
  108444. // supported.
  108445. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  108446. c.urlParams_.Set("orderBy", orderBy)
  108447. return c
  108448. }
  108449. // PageToken sets the optional parameter "pageToken": Specifies a page
  108450. // token to use. Set pageToken to the nextPageToken returned by a
  108451. // previous list request to get the next page of results.
  108452. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  108453. c.urlParams_.Set("pageToken", pageToken)
  108454. return c
  108455. }
  108456. // Fields allows partial responses to be retrieved. See
  108457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108458. // for more information.
  108459. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  108460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108461. return c
  108462. }
  108463. // IfNoneMatch sets the optional parameter which makes the operation
  108464. // fail if the object's ETag matches the given value. This is useful for
  108465. // getting updates only after the object has changed since the last
  108466. // request. Use googleapi.IsNotModified to check whether the response
  108467. // error from Do is the result of In-None-Match.
  108468. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  108469. c.ifNoneMatch_ = entityTag
  108470. return c
  108471. }
  108472. // Context sets the context to be used in this call's Do method. Any
  108473. // pending HTTP request will be aborted if the provided context is
  108474. // canceled.
  108475. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  108476. c.ctx_ = ctx
  108477. return c
  108478. }
  108479. // Header returns an http.Header that can be modified by the caller to
  108480. // add HTTP headers to the request.
  108481. func (c *TargetTcpProxiesListCall) Header() http.Header {
  108482. if c.header_ == nil {
  108483. c.header_ = make(http.Header)
  108484. }
  108485. return c.header_
  108486. }
  108487. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  108488. reqHeaders := make(http.Header)
  108489. for k, v := range c.header_ {
  108490. reqHeaders[k] = v
  108491. }
  108492. reqHeaders.Set("User-Agent", c.s.userAgent())
  108493. if c.ifNoneMatch_ != "" {
  108494. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108495. }
  108496. var body io.Reader = nil
  108497. c.urlParams_.Set("alt", alt)
  108498. c.urlParams_.Set("prettyPrint", "false")
  108499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  108500. urls += "?" + c.urlParams_.Encode()
  108501. req, err := http.NewRequest("GET", urls, body)
  108502. if err != nil {
  108503. return nil, err
  108504. }
  108505. req.Header = reqHeaders
  108506. googleapi.Expand(req.URL, map[string]string{
  108507. "project": c.project,
  108508. })
  108509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108510. }
  108511. // Do executes the "compute.targetTcpProxies.list" call.
  108512. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  108513. // non-2xx status code is an error. Response headers are in either
  108514. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  108515. // returned at all) in error.(*googleapi.Error).Header. Use
  108516. // googleapi.IsNotModified to check whether the returned error was
  108517. // because http.StatusNotModified was returned.
  108518. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  108519. gensupport.SetOptions(c.urlParams_, opts...)
  108520. res, err := c.doRequest("json")
  108521. if res != nil && res.StatusCode == http.StatusNotModified {
  108522. if res.Body != nil {
  108523. res.Body.Close()
  108524. }
  108525. return nil, &googleapi.Error{
  108526. Code: res.StatusCode,
  108527. Header: res.Header,
  108528. }
  108529. }
  108530. if err != nil {
  108531. return nil, err
  108532. }
  108533. defer googleapi.CloseBody(res)
  108534. if err := googleapi.CheckResponse(res); err != nil {
  108535. return nil, err
  108536. }
  108537. ret := &TargetTcpProxyList{
  108538. ServerResponse: googleapi.ServerResponse{
  108539. Header: res.Header,
  108540. HTTPStatusCode: res.StatusCode,
  108541. },
  108542. }
  108543. target := &ret
  108544. if err := gensupport.DecodeResponse(target, res); err != nil {
  108545. return nil, err
  108546. }
  108547. return ret, nil
  108548. // {
  108549. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  108550. // "httpMethod": "GET",
  108551. // "id": "compute.targetTcpProxies.list",
  108552. // "parameterOrder": [
  108553. // "project"
  108554. // ],
  108555. // "parameters": {
  108556. // "filter": {
  108557. // "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).",
  108558. // "location": "query",
  108559. // "type": "string"
  108560. // },
  108561. // "maxResults": {
  108562. // "default": "500",
  108563. // "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)",
  108564. // "format": "uint32",
  108565. // "location": "query",
  108566. // "minimum": "0",
  108567. // "type": "integer"
  108568. // },
  108569. // "orderBy": {
  108570. // "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.",
  108571. // "location": "query",
  108572. // "type": "string"
  108573. // },
  108574. // "pageToken": {
  108575. // "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.",
  108576. // "location": "query",
  108577. // "type": "string"
  108578. // },
  108579. // "project": {
  108580. // "description": "Project ID for this request.",
  108581. // "location": "path",
  108582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108583. // "required": true,
  108584. // "type": "string"
  108585. // }
  108586. // },
  108587. // "path": "{project}/global/targetTcpProxies",
  108588. // "response": {
  108589. // "$ref": "TargetTcpProxyList"
  108590. // },
  108591. // "scopes": [
  108592. // "https://www.googleapis.com/auth/cloud-platform",
  108593. // "https://www.googleapis.com/auth/compute",
  108594. // "https://www.googleapis.com/auth/compute.readonly"
  108595. // ]
  108596. // }
  108597. }
  108598. // Pages invokes f for each page of results.
  108599. // A non-nil error returned from f will halt the iteration.
  108600. // The provided context supersedes any context provided to the Context method.
  108601. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  108602. c.ctx_ = ctx
  108603. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108604. for {
  108605. x, err := c.Do()
  108606. if err != nil {
  108607. return err
  108608. }
  108609. if err := f(x); err != nil {
  108610. return err
  108611. }
  108612. if x.NextPageToken == "" {
  108613. return nil
  108614. }
  108615. c.PageToken(x.NextPageToken)
  108616. }
  108617. }
  108618. // method id "compute.targetTcpProxies.setBackendService":
  108619. type TargetTcpProxiesSetBackendServiceCall struct {
  108620. s *Service
  108621. project string
  108622. targetTcpProxy string
  108623. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  108624. urlParams_ gensupport.URLParams
  108625. ctx_ context.Context
  108626. header_ http.Header
  108627. }
  108628. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  108629. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  108630. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108631. c.project = project
  108632. c.targetTcpProxy = targetTcpProxy
  108633. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  108634. return c
  108635. }
  108636. // RequestId sets the optional parameter "requestId": An optional
  108637. // request ID to identify requests. Specify a unique request ID so that
  108638. // if you must retry your request, the server will know to ignore the
  108639. // request if it has already been completed.
  108640. //
  108641. // For example, consider a situation where you make an initial request
  108642. // and the request times out. If you make the request again with the
  108643. // same request ID, the server can check if original operation with the
  108644. // same request ID was received, and if so, will ignore the second
  108645. // request. This prevents clients from accidentally creating duplicate
  108646. // commitments.
  108647. //
  108648. // The request ID must be a valid UUID with the exception that zero UUID
  108649. // is not supported (00000000-0000-0000-0000-000000000000).
  108650. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  108651. c.urlParams_.Set("requestId", requestId)
  108652. return c
  108653. }
  108654. // Fields allows partial responses to be retrieved. See
  108655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108656. // for more information.
  108657. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  108658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108659. return c
  108660. }
  108661. // Context sets the context to be used in this call's Do method. Any
  108662. // pending HTTP request will be aborted if the provided context is
  108663. // canceled.
  108664. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  108665. c.ctx_ = ctx
  108666. return c
  108667. }
  108668. // Header returns an http.Header that can be modified by the caller to
  108669. // add HTTP headers to the request.
  108670. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  108671. if c.header_ == nil {
  108672. c.header_ = make(http.Header)
  108673. }
  108674. return c.header_
  108675. }
  108676. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  108677. reqHeaders := make(http.Header)
  108678. for k, v := range c.header_ {
  108679. reqHeaders[k] = v
  108680. }
  108681. reqHeaders.Set("User-Agent", c.s.userAgent())
  108682. var body io.Reader = nil
  108683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  108684. if err != nil {
  108685. return nil, err
  108686. }
  108687. reqHeaders.Set("Content-Type", "application/json")
  108688. c.urlParams_.Set("alt", alt)
  108689. c.urlParams_.Set("prettyPrint", "false")
  108690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  108691. urls += "?" + c.urlParams_.Encode()
  108692. req, err := http.NewRequest("POST", urls, body)
  108693. if err != nil {
  108694. return nil, err
  108695. }
  108696. req.Header = reqHeaders
  108697. googleapi.Expand(req.URL, map[string]string{
  108698. "project": c.project,
  108699. "targetTcpProxy": c.targetTcpProxy,
  108700. })
  108701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108702. }
  108703. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  108704. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108705. // status code is an error. Response headers are in either
  108706. // *Operation.ServerResponse.Header or (if a response was returned at
  108707. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108708. // to check whether the returned error was because
  108709. // http.StatusNotModified was returned.
  108710. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108711. gensupport.SetOptions(c.urlParams_, opts...)
  108712. res, err := c.doRequest("json")
  108713. if res != nil && res.StatusCode == http.StatusNotModified {
  108714. if res.Body != nil {
  108715. res.Body.Close()
  108716. }
  108717. return nil, &googleapi.Error{
  108718. Code: res.StatusCode,
  108719. Header: res.Header,
  108720. }
  108721. }
  108722. if err != nil {
  108723. return nil, err
  108724. }
  108725. defer googleapi.CloseBody(res)
  108726. if err := googleapi.CheckResponse(res); err != nil {
  108727. return nil, err
  108728. }
  108729. ret := &Operation{
  108730. ServerResponse: googleapi.ServerResponse{
  108731. Header: res.Header,
  108732. HTTPStatusCode: res.StatusCode,
  108733. },
  108734. }
  108735. target := &ret
  108736. if err := gensupport.DecodeResponse(target, res); err != nil {
  108737. return nil, err
  108738. }
  108739. return ret, nil
  108740. // {
  108741. // "description": "Changes the BackendService for TargetTcpProxy.",
  108742. // "httpMethod": "POST",
  108743. // "id": "compute.targetTcpProxies.setBackendService",
  108744. // "parameterOrder": [
  108745. // "project",
  108746. // "targetTcpProxy"
  108747. // ],
  108748. // "parameters": {
  108749. // "project": {
  108750. // "description": "Project ID for this request.",
  108751. // "location": "path",
  108752. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108753. // "required": true,
  108754. // "type": "string"
  108755. // },
  108756. // "requestId": {
  108757. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108758. // "location": "query",
  108759. // "type": "string"
  108760. // },
  108761. // "targetTcpProxy": {
  108762. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  108763. // "location": "path",
  108764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108765. // "required": true,
  108766. // "type": "string"
  108767. // }
  108768. // },
  108769. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  108770. // "request": {
  108771. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  108772. // },
  108773. // "response": {
  108774. // "$ref": "Operation"
  108775. // },
  108776. // "scopes": [
  108777. // "https://www.googleapis.com/auth/cloud-platform",
  108778. // "https://www.googleapis.com/auth/compute"
  108779. // ]
  108780. // }
  108781. }
  108782. // method id "compute.targetTcpProxies.setProxyHeader":
  108783. type TargetTcpProxiesSetProxyHeaderCall struct {
  108784. s *Service
  108785. project string
  108786. targetTcpProxy string
  108787. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  108788. urlParams_ gensupport.URLParams
  108789. ctx_ context.Context
  108790. header_ http.Header
  108791. }
  108792. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  108793. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  108794. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108795. c.project = project
  108796. c.targetTcpProxy = targetTcpProxy
  108797. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  108798. return c
  108799. }
  108800. // RequestId sets the optional parameter "requestId": An optional
  108801. // request ID to identify requests. Specify a unique request ID so that
  108802. // if you must retry your request, the server will know to ignore the
  108803. // request if it has already been completed.
  108804. //
  108805. // For example, consider a situation where you make an initial request
  108806. // and the request times out. If you make the request again with the
  108807. // same request ID, the server can check if original operation with the
  108808. // same request ID was received, and if so, will ignore the second
  108809. // request. This prevents clients from accidentally creating duplicate
  108810. // commitments.
  108811. //
  108812. // The request ID must be a valid UUID with the exception that zero UUID
  108813. // is not supported (00000000-0000-0000-0000-000000000000).
  108814. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  108815. c.urlParams_.Set("requestId", requestId)
  108816. return c
  108817. }
  108818. // Fields allows partial responses to be retrieved. See
  108819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108820. // for more information.
  108821. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  108822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108823. return c
  108824. }
  108825. // Context sets the context to be used in this call's Do method. Any
  108826. // pending HTTP request will be aborted if the provided context is
  108827. // canceled.
  108828. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  108829. c.ctx_ = ctx
  108830. return c
  108831. }
  108832. // Header returns an http.Header that can be modified by the caller to
  108833. // add HTTP headers to the request.
  108834. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  108835. if c.header_ == nil {
  108836. c.header_ = make(http.Header)
  108837. }
  108838. return c.header_
  108839. }
  108840. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  108841. reqHeaders := make(http.Header)
  108842. for k, v := range c.header_ {
  108843. reqHeaders[k] = v
  108844. }
  108845. reqHeaders.Set("User-Agent", c.s.userAgent())
  108846. var body io.Reader = nil
  108847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  108848. if err != nil {
  108849. return nil, err
  108850. }
  108851. reqHeaders.Set("Content-Type", "application/json")
  108852. c.urlParams_.Set("alt", alt)
  108853. c.urlParams_.Set("prettyPrint", "false")
  108854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  108855. urls += "?" + c.urlParams_.Encode()
  108856. req, err := http.NewRequest("POST", urls, body)
  108857. if err != nil {
  108858. return nil, err
  108859. }
  108860. req.Header = reqHeaders
  108861. googleapi.Expand(req.URL, map[string]string{
  108862. "project": c.project,
  108863. "targetTcpProxy": c.targetTcpProxy,
  108864. })
  108865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108866. }
  108867. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  108868. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108869. // status code is an error. Response headers are in either
  108870. // *Operation.ServerResponse.Header or (if a response was returned at
  108871. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108872. // to check whether the returned error was because
  108873. // http.StatusNotModified was returned.
  108874. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108875. gensupport.SetOptions(c.urlParams_, opts...)
  108876. res, err := c.doRequest("json")
  108877. if res != nil && res.StatusCode == http.StatusNotModified {
  108878. if res.Body != nil {
  108879. res.Body.Close()
  108880. }
  108881. return nil, &googleapi.Error{
  108882. Code: res.StatusCode,
  108883. Header: res.Header,
  108884. }
  108885. }
  108886. if err != nil {
  108887. return nil, err
  108888. }
  108889. defer googleapi.CloseBody(res)
  108890. if err := googleapi.CheckResponse(res); err != nil {
  108891. return nil, err
  108892. }
  108893. ret := &Operation{
  108894. ServerResponse: googleapi.ServerResponse{
  108895. Header: res.Header,
  108896. HTTPStatusCode: res.StatusCode,
  108897. },
  108898. }
  108899. target := &ret
  108900. if err := gensupport.DecodeResponse(target, res); err != nil {
  108901. return nil, err
  108902. }
  108903. return ret, nil
  108904. // {
  108905. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  108906. // "httpMethod": "POST",
  108907. // "id": "compute.targetTcpProxies.setProxyHeader",
  108908. // "parameterOrder": [
  108909. // "project",
  108910. // "targetTcpProxy"
  108911. // ],
  108912. // "parameters": {
  108913. // "project": {
  108914. // "description": "Project ID for this request.",
  108915. // "location": "path",
  108916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108917. // "required": true,
  108918. // "type": "string"
  108919. // },
  108920. // "requestId": {
  108921. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108922. // "location": "query",
  108923. // "type": "string"
  108924. // },
  108925. // "targetTcpProxy": {
  108926. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  108927. // "location": "path",
  108928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108929. // "required": true,
  108930. // "type": "string"
  108931. // }
  108932. // },
  108933. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  108934. // "request": {
  108935. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  108936. // },
  108937. // "response": {
  108938. // "$ref": "Operation"
  108939. // },
  108940. // "scopes": [
  108941. // "https://www.googleapis.com/auth/cloud-platform",
  108942. // "https://www.googleapis.com/auth/compute"
  108943. // ]
  108944. // }
  108945. }
  108946. // method id "compute.targetVpnGateways.aggregatedList":
  108947. type TargetVpnGatewaysAggregatedListCall struct {
  108948. s *Service
  108949. project string
  108950. urlParams_ gensupport.URLParams
  108951. ifNoneMatch_ string
  108952. ctx_ context.Context
  108953. header_ http.Header
  108954. }
  108955. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  108956. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  108957. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108958. c.project = project
  108959. return c
  108960. }
  108961. // Filter sets the optional parameter "filter": A filter expression that
  108962. // filters resources listed in the response. The expression must specify
  108963. // the field name, a comparison operator, and the value that you want to
  108964. // use for filtering. The value must be a string, a number, or a
  108965. // boolean. The comparison operator must be either =, !=, >, or <.
  108966. //
  108967. // For example, if you are filtering Compute Engine instances, you can
  108968. // exclude instances named example-instance by specifying name !=
  108969. // example-instance.
  108970. //
  108971. // You can also filter nested fields. For example, you could specify
  108972. // scheduling.automaticRestart = false to include instances only if they
  108973. // are not scheduled for automatic restarts. You can use filtering on
  108974. // nested fields to filter based on resource labels.
  108975. //
  108976. // To filter on multiple expressions, provide each separate expression
  108977. // within parentheses. For example, (scheduling.automaticRestart = true)
  108978. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108979. // AND expression. However, you can include AND and OR expressions
  108980. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108981. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108982. // true).
  108983. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  108984. c.urlParams_.Set("filter", filter)
  108985. return c
  108986. }
  108987. // MaxResults sets the optional parameter "maxResults": The maximum
  108988. // number of results per page that should be returned. If the number of
  108989. // available results is larger than maxResults, Compute Engine returns a
  108990. // nextPageToken that can be used to get the next page of results in
  108991. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108992. // (Default: 500)
  108993. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  108994. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108995. return c
  108996. }
  108997. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108998. // a certain order. By default, results are returned in alphanumerical
  108999. // order based on the resource name.
  109000. //
  109001. // You can also sort results in descending order based on the creation
  109002. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109003. // based on the creationTimestamp field in reverse chronological order
  109004. // (newest result first). Use this to sort resources like operations so
  109005. // that the newest operation is returned first.
  109006. //
  109007. // Currently, only sorting by name or creationTimestamp desc is
  109008. // supported.
  109009. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  109010. c.urlParams_.Set("orderBy", orderBy)
  109011. return c
  109012. }
  109013. // PageToken sets the optional parameter "pageToken": Specifies a page
  109014. // token to use. Set pageToken to the nextPageToken returned by a
  109015. // previous list request to get the next page of results.
  109016. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  109017. c.urlParams_.Set("pageToken", pageToken)
  109018. return c
  109019. }
  109020. // Fields allows partial responses to be retrieved. See
  109021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109022. // for more information.
  109023. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  109024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109025. return c
  109026. }
  109027. // IfNoneMatch sets the optional parameter which makes the operation
  109028. // fail if the object's ETag matches the given value. This is useful for
  109029. // getting updates only after the object has changed since the last
  109030. // request. Use googleapi.IsNotModified to check whether the response
  109031. // error from Do is the result of In-None-Match.
  109032. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  109033. c.ifNoneMatch_ = entityTag
  109034. return c
  109035. }
  109036. // Context sets the context to be used in this call's Do method. Any
  109037. // pending HTTP request will be aborted if the provided context is
  109038. // canceled.
  109039. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  109040. c.ctx_ = ctx
  109041. return c
  109042. }
  109043. // Header returns an http.Header that can be modified by the caller to
  109044. // add HTTP headers to the request.
  109045. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  109046. if c.header_ == nil {
  109047. c.header_ = make(http.Header)
  109048. }
  109049. return c.header_
  109050. }
  109051. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  109052. reqHeaders := make(http.Header)
  109053. for k, v := range c.header_ {
  109054. reqHeaders[k] = v
  109055. }
  109056. reqHeaders.Set("User-Agent", c.s.userAgent())
  109057. if c.ifNoneMatch_ != "" {
  109058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109059. }
  109060. var body io.Reader = nil
  109061. c.urlParams_.Set("alt", alt)
  109062. c.urlParams_.Set("prettyPrint", "false")
  109063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  109064. urls += "?" + c.urlParams_.Encode()
  109065. req, err := http.NewRequest("GET", urls, body)
  109066. if err != nil {
  109067. return nil, err
  109068. }
  109069. req.Header = reqHeaders
  109070. googleapi.Expand(req.URL, map[string]string{
  109071. "project": c.project,
  109072. })
  109073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109074. }
  109075. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  109076. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  109077. // non-nil. Any non-2xx status code is an error. Response headers are in
  109078. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  109079. // response was returned at all) in error.(*googleapi.Error).Header. Use
  109080. // googleapi.IsNotModified to check whether the returned error was
  109081. // because http.StatusNotModified was returned.
  109082. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  109083. gensupport.SetOptions(c.urlParams_, opts...)
  109084. res, err := c.doRequest("json")
  109085. if res != nil && res.StatusCode == http.StatusNotModified {
  109086. if res.Body != nil {
  109087. res.Body.Close()
  109088. }
  109089. return nil, &googleapi.Error{
  109090. Code: res.StatusCode,
  109091. Header: res.Header,
  109092. }
  109093. }
  109094. if err != nil {
  109095. return nil, err
  109096. }
  109097. defer googleapi.CloseBody(res)
  109098. if err := googleapi.CheckResponse(res); err != nil {
  109099. return nil, err
  109100. }
  109101. ret := &TargetVpnGatewayAggregatedList{
  109102. ServerResponse: googleapi.ServerResponse{
  109103. Header: res.Header,
  109104. HTTPStatusCode: res.StatusCode,
  109105. },
  109106. }
  109107. target := &ret
  109108. if err := gensupport.DecodeResponse(target, res); err != nil {
  109109. return nil, err
  109110. }
  109111. return ret, nil
  109112. // {
  109113. // "description": "Retrieves an aggregated list of target VPN gateways.",
  109114. // "httpMethod": "GET",
  109115. // "id": "compute.targetVpnGateways.aggregatedList",
  109116. // "parameterOrder": [
  109117. // "project"
  109118. // ],
  109119. // "parameters": {
  109120. // "filter": {
  109121. // "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).",
  109122. // "location": "query",
  109123. // "type": "string"
  109124. // },
  109125. // "maxResults": {
  109126. // "default": "500",
  109127. // "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)",
  109128. // "format": "uint32",
  109129. // "location": "query",
  109130. // "minimum": "0",
  109131. // "type": "integer"
  109132. // },
  109133. // "orderBy": {
  109134. // "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.",
  109135. // "location": "query",
  109136. // "type": "string"
  109137. // },
  109138. // "pageToken": {
  109139. // "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.",
  109140. // "location": "query",
  109141. // "type": "string"
  109142. // },
  109143. // "project": {
  109144. // "description": "Project ID for this request.",
  109145. // "location": "path",
  109146. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109147. // "required": true,
  109148. // "type": "string"
  109149. // }
  109150. // },
  109151. // "path": "{project}/aggregated/targetVpnGateways",
  109152. // "response": {
  109153. // "$ref": "TargetVpnGatewayAggregatedList"
  109154. // },
  109155. // "scopes": [
  109156. // "https://www.googleapis.com/auth/cloud-platform",
  109157. // "https://www.googleapis.com/auth/compute",
  109158. // "https://www.googleapis.com/auth/compute.readonly"
  109159. // ]
  109160. // }
  109161. }
  109162. // Pages invokes f for each page of results.
  109163. // A non-nil error returned from f will halt the iteration.
  109164. // The provided context supersedes any context provided to the Context method.
  109165. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  109166. c.ctx_ = ctx
  109167. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109168. for {
  109169. x, err := c.Do()
  109170. if err != nil {
  109171. return err
  109172. }
  109173. if err := f(x); err != nil {
  109174. return err
  109175. }
  109176. if x.NextPageToken == "" {
  109177. return nil
  109178. }
  109179. c.PageToken(x.NextPageToken)
  109180. }
  109181. }
  109182. // method id "compute.targetVpnGateways.delete":
  109183. type TargetVpnGatewaysDeleteCall struct {
  109184. s *Service
  109185. project string
  109186. region string
  109187. targetVpnGateway string
  109188. urlParams_ gensupport.URLParams
  109189. ctx_ context.Context
  109190. header_ http.Header
  109191. }
  109192. // Delete: Deletes the specified target VPN gateway.
  109193. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  109194. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109195. c.project = project
  109196. c.region = region
  109197. c.targetVpnGateway = targetVpnGateway
  109198. return c
  109199. }
  109200. // RequestId sets the optional parameter "requestId": An optional
  109201. // request ID to identify requests. Specify a unique request ID so that
  109202. // if you must retry your request, the server will know to ignore the
  109203. // request if it has already been completed.
  109204. //
  109205. // For example, consider a situation where you make an initial request
  109206. // and the request times out. If you make the request again with the
  109207. // same request ID, the server can check if original operation with the
  109208. // same request ID was received, and if so, will ignore the second
  109209. // request. This prevents clients from accidentally creating duplicate
  109210. // commitments.
  109211. //
  109212. // The request ID must be a valid UUID with the exception that zero UUID
  109213. // is not supported (00000000-0000-0000-0000-000000000000).
  109214. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  109215. c.urlParams_.Set("requestId", requestId)
  109216. return c
  109217. }
  109218. // Fields allows partial responses to be retrieved. See
  109219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109220. // for more information.
  109221. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  109222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109223. return c
  109224. }
  109225. // Context sets the context to be used in this call's Do method. Any
  109226. // pending HTTP request will be aborted if the provided context is
  109227. // canceled.
  109228. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  109229. c.ctx_ = ctx
  109230. return c
  109231. }
  109232. // Header returns an http.Header that can be modified by the caller to
  109233. // add HTTP headers to the request.
  109234. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  109235. if c.header_ == nil {
  109236. c.header_ = make(http.Header)
  109237. }
  109238. return c.header_
  109239. }
  109240. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  109241. reqHeaders := make(http.Header)
  109242. for k, v := range c.header_ {
  109243. reqHeaders[k] = v
  109244. }
  109245. reqHeaders.Set("User-Agent", c.s.userAgent())
  109246. var body io.Reader = nil
  109247. c.urlParams_.Set("alt", alt)
  109248. c.urlParams_.Set("prettyPrint", "false")
  109249. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  109250. urls += "?" + c.urlParams_.Encode()
  109251. req, err := http.NewRequest("DELETE", urls, body)
  109252. if err != nil {
  109253. return nil, err
  109254. }
  109255. req.Header = reqHeaders
  109256. googleapi.Expand(req.URL, map[string]string{
  109257. "project": c.project,
  109258. "region": c.region,
  109259. "targetVpnGateway": c.targetVpnGateway,
  109260. })
  109261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109262. }
  109263. // Do executes the "compute.targetVpnGateways.delete" call.
  109264. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109265. // status code is an error. Response headers are in either
  109266. // *Operation.ServerResponse.Header or (if a response was returned at
  109267. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109268. // to check whether the returned error was because
  109269. // http.StatusNotModified was returned.
  109270. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109271. gensupport.SetOptions(c.urlParams_, opts...)
  109272. res, err := c.doRequest("json")
  109273. if res != nil && res.StatusCode == http.StatusNotModified {
  109274. if res.Body != nil {
  109275. res.Body.Close()
  109276. }
  109277. return nil, &googleapi.Error{
  109278. Code: res.StatusCode,
  109279. Header: res.Header,
  109280. }
  109281. }
  109282. if err != nil {
  109283. return nil, err
  109284. }
  109285. defer googleapi.CloseBody(res)
  109286. if err := googleapi.CheckResponse(res); err != nil {
  109287. return nil, err
  109288. }
  109289. ret := &Operation{
  109290. ServerResponse: googleapi.ServerResponse{
  109291. Header: res.Header,
  109292. HTTPStatusCode: res.StatusCode,
  109293. },
  109294. }
  109295. target := &ret
  109296. if err := gensupport.DecodeResponse(target, res); err != nil {
  109297. return nil, err
  109298. }
  109299. return ret, nil
  109300. // {
  109301. // "description": "Deletes the specified target VPN gateway.",
  109302. // "httpMethod": "DELETE",
  109303. // "id": "compute.targetVpnGateways.delete",
  109304. // "parameterOrder": [
  109305. // "project",
  109306. // "region",
  109307. // "targetVpnGateway"
  109308. // ],
  109309. // "parameters": {
  109310. // "project": {
  109311. // "description": "Project ID for this request.",
  109312. // "location": "path",
  109313. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109314. // "required": true,
  109315. // "type": "string"
  109316. // },
  109317. // "region": {
  109318. // "description": "Name of the region for this request.",
  109319. // "location": "path",
  109320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109321. // "required": true,
  109322. // "type": "string"
  109323. // },
  109324. // "requestId": {
  109325. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109326. // "location": "query",
  109327. // "type": "string"
  109328. // },
  109329. // "targetVpnGateway": {
  109330. // "description": "Name of the target VPN gateway to delete.",
  109331. // "location": "path",
  109332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109333. // "required": true,
  109334. // "type": "string"
  109335. // }
  109336. // },
  109337. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  109338. // "response": {
  109339. // "$ref": "Operation"
  109340. // },
  109341. // "scopes": [
  109342. // "https://www.googleapis.com/auth/cloud-platform",
  109343. // "https://www.googleapis.com/auth/compute"
  109344. // ]
  109345. // }
  109346. }
  109347. // method id "compute.targetVpnGateways.get":
  109348. type TargetVpnGatewaysGetCall struct {
  109349. s *Service
  109350. project string
  109351. region string
  109352. targetVpnGateway string
  109353. urlParams_ gensupport.URLParams
  109354. ifNoneMatch_ string
  109355. ctx_ context.Context
  109356. header_ http.Header
  109357. }
  109358. // Get: Returns the specified target VPN gateway. Gets a list of
  109359. // available target VPN gateways by making a list() request.
  109360. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  109361. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109362. c.project = project
  109363. c.region = region
  109364. c.targetVpnGateway = targetVpnGateway
  109365. return c
  109366. }
  109367. // Fields allows partial responses to be retrieved. See
  109368. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109369. // for more information.
  109370. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  109371. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109372. return c
  109373. }
  109374. // IfNoneMatch sets the optional parameter which makes the operation
  109375. // fail if the object's ETag matches the given value. This is useful for
  109376. // getting updates only after the object has changed since the last
  109377. // request. Use googleapi.IsNotModified to check whether the response
  109378. // error from Do is the result of In-None-Match.
  109379. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  109380. c.ifNoneMatch_ = entityTag
  109381. return c
  109382. }
  109383. // Context sets the context to be used in this call's Do method. Any
  109384. // pending HTTP request will be aborted if the provided context is
  109385. // canceled.
  109386. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  109387. c.ctx_ = ctx
  109388. return c
  109389. }
  109390. // Header returns an http.Header that can be modified by the caller to
  109391. // add HTTP headers to the request.
  109392. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  109393. if c.header_ == nil {
  109394. c.header_ = make(http.Header)
  109395. }
  109396. return c.header_
  109397. }
  109398. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  109399. reqHeaders := make(http.Header)
  109400. for k, v := range c.header_ {
  109401. reqHeaders[k] = v
  109402. }
  109403. reqHeaders.Set("User-Agent", c.s.userAgent())
  109404. if c.ifNoneMatch_ != "" {
  109405. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109406. }
  109407. var body io.Reader = nil
  109408. c.urlParams_.Set("alt", alt)
  109409. c.urlParams_.Set("prettyPrint", "false")
  109410. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  109411. urls += "?" + c.urlParams_.Encode()
  109412. req, err := http.NewRequest("GET", urls, body)
  109413. if err != nil {
  109414. return nil, err
  109415. }
  109416. req.Header = reqHeaders
  109417. googleapi.Expand(req.URL, map[string]string{
  109418. "project": c.project,
  109419. "region": c.region,
  109420. "targetVpnGateway": c.targetVpnGateway,
  109421. })
  109422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109423. }
  109424. // Do executes the "compute.targetVpnGateways.get" call.
  109425. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  109426. // non-2xx status code is an error. Response headers are in either
  109427. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  109428. // returned at all) in error.(*googleapi.Error).Header. Use
  109429. // googleapi.IsNotModified to check whether the returned error was
  109430. // because http.StatusNotModified was returned.
  109431. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  109432. gensupport.SetOptions(c.urlParams_, opts...)
  109433. res, err := c.doRequest("json")
  109434. if res != nil && res.StatusCode == http.StatusNotModified {
  109435. if res.Body != nil {
  109436. res.Body.Close()
  109437. }
  109438. return nil, &googleapi.Error{
  109439. Code: res.StatusCode,
  109440. Header: res.Header,
  109441. }
  109442. }
  109443. if err != nil {
  109444. return nil, err
  109445. }
  109446. defer googleapi.CloseBody(res)
  109447. if err := googleapi.CheckResponse(res); err != nil {
  109448. return nil, err
  109449. }
  109450. ret := &TargetVpnGateway{
  109451. ServerResponse: googleapi.ServerResponse{
  109452. Header: res.Header,
  109453. HTTPStatusCode: res.StatusCode,
  109454. },
  109455. }
  109456. target := &ret
  109457. if err := gensupport.DecodeResponse(target, res); err != nil {
  109458. return nil, err
  109459. }
  109460. return ret, nil
  109461. // {
  109462. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  109463. // "httpMethod": "GET",
  109464. // "id": "compute.targetVpnGateways.get",
  109465. // "parameterOrder": [
  109466. // "project",
  109467. // "region",
  109468. // "targetVpnGateway"
  109469. // ],
  109470. // "parameters": {
  109471. // "project": {
  109472. // "description": "Project ID for this request.",
  109473. // "location": "path",
  109474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109475. // "required": true,
  109476. // "type": "string"
  109477. // },
  109478. // "region": {
  109479. // "description": "Name of the region for this request.",
  109480. // "location": "path",
  109481. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109482. // "required": true,
  109483. // "type": "string"
  109484. // },
  109485. // "targetVpnGateway": {
  109486. // "description": "Name of the target VPN gateway to return.",
  109487. // "location": "path",
  109488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109489. // "required": true,
  109490. // "type": "string"
  109491. // }
  109492. // },
  109493. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  109494. // "response": {
  109495. // "$ref": "TargetVpnGateway"
  109496. // },
  109497. // "scopes": [
  109498. // "https://www.googleapis.com/auth/cloud-platform",
  109499. // "https://www.googleapis.com/auth/compute",
  109500. // "https://www.googleapis.com/auth/compute.readonly"
  109501. // ]
  109502. // }
  109503. }
  109504. // method id "compute.targetVpnGateways.insert":
  109505. type TargetVpnGatewaysInsertCall struct {
  109506. s *Service
  109507. project string
  109508. region string
  109509. targetvpngateway *TargetVpnGateway
  109510. urlParams_ gensupport.URLParams
  109511. ctx_ context.Context
  109512. header_ http.Header
  109513. }
  109514. // Insert: Creates a target VPN gateway in the specified project and
  109515. // region using the data included in the request.
  109516. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  109517. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109518. c.project = project
  109519. c.region = region
  109520. c.targetvpngateway = targetvpngateway
  109521. return c
  109522. }
  109523. // RequestId sets the optional parameter "requestId": An optional
  109524. // request ID to identify requests. Specify a unique request ID so that
  109525. // if you must retry your request, the server will know to ignore the
  109526. // request if it has already been completed.
  109527. //
  109528. // For example, consider a situation where you make an initial request
  109529. // and the request times out. If you make the request again with the
  109530. // same request ID, the server can check if original operation with the
  109531. // same request ID was received, and if so, will ignore the second
  109532. // request. This prevents clients from accidentally creating duplicate
  109533. // commitments.
  109534. //
  109535. // The request ID must be a valid UUID with the exception that zero UUID
  109536. // is not supported (00000000-0000-0000-0000-000000000000).
  109537. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  109538. c.urlParams_.Set("requestId", requestId)
  109539. return c
  109540. }
  109541. // Fields allows partial responses to be retrieved. See
  109542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109543. // for more information.
  109544. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  109545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109546. return c
  109547. }
  109548. // Context sets the context to be used in this call's Do method. Any
  109549. // pending HTTP request will be aborted if the provided context is
  109550. // canceled.
  109551. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  109552. c.ctx_ = ctx
  109553. return c
  109554. }
  109555. // Header returns an http.Header that can be modified by the caller to
  109556. // add HTTP headers to the request.
  109557. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  109558. if c.header_ == nil {
  109559. c.header_ = make(http.Header)
  109560. }
  109561. return c.header_
  109562. }
  109563. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  109564. reqHeaders := make(http.Header)
  109565. for k, v := range c.header_ {
  109566. reqHeaders[k] = v
  109567. }
  109568. reqHeaders.Set("User-Agent", c.s.userAgent())
  109569. var body io.Reader = nil
  109570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  109571. if err != nil {
  109572. return nil, err
  109573. }
  109574. reqHeaders.Set("Content-Type", "application/json")
  109575. c.urlParams_.Set("alt", alt)
  109576. c.urlParams_.Set("prettyPrint", "false")
  109577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  109578. urls += "?" + c.urlParams_.Encode()
  109579. req, err := http.NewRequest("POST", urls, body)
  109580. if err != nil {
  109581. return nil, err
  109582. }
  109583. req.Header = reqHeaders
  109584. googleapi.Expand(req.URL, map[string]string{
  109585. "project": c.project,
  109586. "region": c.region,
  109587. })
  109588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109589. }
  109590. // Do executes the "compute.targetVpnGateways.insert" call.
  109591. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109592. // status code is an error. Response headers are in either
  109593. // *Operation.ServerResponse.Header or (if a response was returned at
  109594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109595. // to check whether the returned error was because
  109596. // http.StatusNotModified was returned.
  109597. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109598. gensupport.SetOptions(c.urlParams_, opts...)
  109599. res, err := c.doRequest("json")
  109600. if res != nil && res.StatusCode == http.StatusNotModified {
  109601. if res.Body != nil {
  109602. res.Body.Close()
  109603. }
  109604. return nil, &googleapi.Error{
  109605. Code: res.StatusCode,
  109606. Header: res.Header,
  109607. }
  109608. }
  109609. if err != nil {
  109610. return nil, err
  109611. }
  109612. defer googleapi.CloseBody(res)
  109613. if err := googleapi.CheckResponse(res); err != nil {
  109614. return nil, err
  109615. }
  109616. ret := &Operation{
  109617. ServerResponse: googleapi.ServerResponse{
  109618. Header: res.Header,
  109619. HTTPStatusCode: res.StatusCode,
  109620. },
  109621. }
  109622. target := &ret
  109623. if err := gensupport.DecodeResponse(target, res); err != nil {
  109624. return nil, err
  109625. }
  109626. return ret, nil
  109627. // {
  109628. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  109629. // "httpMethod": "POST",
  109630. // "id": "compute.targetVpnGateways.insert",
  109631. // "parameterOrder": [
  109632. // "project",
  109633. // "region"
  109634. // ],
  109635. // "parameters": {
  109636. // "project": {
  109637. // "description": "Project ID for this request.",
  109638. // "location": "path",
  109639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109640. // "required": true,
  109641. // "type": "string"
  109642. // },
  109643. // "region": {
  109644. // "description": "Name of the region for this request.",
  109645. // "location": "path",
  109646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109647. // "required": true,
  109648. // "type": "string"
  109649. // },
  109650. // "requestId": {
  109651. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109652. // "location": "query",
  109653. // "type": "string"
  109654. // }
  109655. // },
  109656. // "path": "{project}/regions/{region}/targetVpnGateways",
  109657. // "request": {
  109658. // "$ref": "TargetVpnGateway"
  109659. // },
  109660. // "response": {
  109661. // "$ref": "Operation"
  109662. // },
  109663. // "scopes": [
  109664. // "https://www.googleapis.com/auth/cloud-platform",
  109665. // "https://www.googleapis.com/auth/compute"
  109666. // ]
  109667. // }
  109668. }
  109669. // method id "compute.targetVpnGateways.list":
  109670. type TargetVpnGatewaysListCall struct {
  109671. s *Service
  109672. project string
  109673. region string
  109674. urlParams_ gensupport.URLParams
  109675. ifNoneMatch_ string
  109676. ctx_ context.Context
  109677. header_ http.Header
  109678. }
  109679. // List: Retrieves a list of target VPN gateways available to the
  109680. // specified project and region.
  109681. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  109682. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109683. c.project = project
  109684. c.region = region
  109685. return c
  109686. }
  109687. // Filter sets the optional parameter "filter": A filter expression that
  109688. // filters resources listed in the response. The expression must specify
  109689. // the field name, a comparison operator, and the value that you want to
  109690. // use for filtering. The value must be a string, a number, or a
  109691. // boolean. The comparison operator must be either =, !=, >, or <.
  109692. //
  109693. // For example, if you are filtering Compute Engine instances, you can
  109694. // exclude instances named example-instance by specifying name !=
  109695. // example-instance.
  109696. //
  109697. // You can also filter nested fields. For example, you could specify
  109698. // scheduling.automaticRestart = false to include instances only if they
  109699. // are not scheduled for automatic restarts. You can use filtering on
  109700. // nested fields to filter based on resource labels.
  109701. //
  109702. // To filter on multiple expressions, provide each separate expression
  109703. // within parentheses. For example, (scheduling.automaticRestart = true)
  109704. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109705. // AND expression. However, you can include AND and OR expressions
  109706. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109707. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109708. // true).
  109709. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  109710. c.urlParams_.Set("filter", filter)
  109711. return c
  109712. }
  109713. // MaxResults sets the optional parameter "maxResults": The maximum
  109714. // number of results per page that should be returned. If the number of
  109715. // available results is larger than maxResults, Compute Engine returns a
  109716. // nextPageToken that can be used to get the next page of results in
  109717. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109718. // (Default: 500)
  109719. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  109720. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109721. return c
  109722. }
  109723. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109724. // a certain order. By default, results are returned in alphanumerical
  109725. // order based on the resource name.
  109726. //
  109727. // You can also sort results in descending order based on the creation
  109728. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109729. // based on the creationTimestamp field in reverse chronological order
  109730. // (newest result first). Use this to sort resources like operations so
  109731. // that the newest operation is returned first.
  109732. //
  109733. // Currently, only sorting by name or creationTimestamp desc is
  109734. // supported.
  109735. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  109736. c.urlParams_.Set("orderBy", orderBy)
  109737. return c
  109738. }
  109739. // PageToken sets the optional parameter "pageToken": Specifies a page
  109740. // token to use. Set pageToken to the nextPageToken returned by a
  109741. // previous list request to get the next page of results.
  109742. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  109743. c.urlParams_.Set("pageToken", pageToken)
  109744. return c
  109745. }
  109746. // Fields allows partial responses to be retrieved. See
  109747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109748. // for more information.
  109749. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  109750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109751. return c
  109752. }
  109753. // IfNoneMatch sets the optional parameter which makes the operation
  109754. // fail if the object's ETag matches the given value. This is useful for
  109755. // getting updates only after the object has changed since the last
  109756. // request. Use googleapi.IsNotModified to check whether the response
  109757. // error from Do is the result of In-None-Match.
  109758. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  109759. c.ifNoneMatch_ = entityTag
  109760. return c
  109761. }
  109762. // Context sets the context to be used in this call's Do method. Any
  109763. // pending HTTP request will be aborted if the provided context is
  109764. // canceled.
  109765. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  109766. c.ctx_ = ctx
  109767. return c
  109768. }
  109769. // Header returns an http.Header that can be modified by the caller to
  109770. // add HTTP headers to the request.
  109771. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  109772. if c.header_ == nil {
  109773. c.header_ = make(http.Header)
  109774. }
  109775. return c.header_
  109776. }
  109777. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  109778. reqHeaders := make(http.Header)
  109779. for k, v := range c.header_ {
  109780. reqHeaders[k] = v
  109781. }
  109782. reqHeaders.Set("User-Agent", c.s.userAgent())
  109783. if c.ifNoneMatch_ != "" {
  109784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109785. }
  109786. var body io.Reader = nil
  109787. c.urlParams_.Set("alt", alt)
  109788. c.urlParams_.Set("prettyPrint", "false")
  109789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  109790. urls += "?" + c.urlParams_.Encode()
  109791. req, err := http.NewRequest("GET", urls, body)
  109792. if err != nil {
  109793. return nil, err
  109794. }
  109795. req.Header = reqHeaders
  109796. googleapi.Expand(req.URL, map[string]string{
  109797. "project": c.project,
  109798. "region": c.region,
  109799. })
  109800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109801. }
  109802. // Do executes the "compute.targetVpnGateways.list" call.
  109803. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  109804. // non-2xx status code is an error. Response headers are in either
  109805. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  109806. // returned at all) in error.(*googleapi.Error).Header. Use
  109807. // googleapi.IsNotModified to check whether the returned error was
  109808. // because http.StatusNotModified was returned.
  109809. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  109810. gensupport.SetOptions(c.urlParams_, opts...)
  109811. res, err := c.doRequest("json")
  109812. if res != nil && res.StatusCode == http.StatusNotModified {
  109813. if res.Body != nil {
  109814. res.Body.Close()
  109815. }
  109816. return nil, &googleapi.Error{
  109817. Code: res.StatusCode,
  109818. Header: res.Header,
  109819. }
  109820. }
  109821. if err != nil {
  109822. return nil, err
  109823. }
  109824. defer googleapi.CloseBody(res)
  109825. if err := googleapi.CheckResponse(res); err != nil {
  109826. return nil, err
  109827. }
  109828. ret := &TargetVpnGatewayList{
  109829. ServerResponse: googleapi.ServerResponse{
  109830. Header: res.Header,
  109831. HTTPStatusCode: res.StatusCode,
  109832. },
  109833. }
  109834. target := &ret
  109835. if err := gensupport.DecodeResponse(target, res); err != nil {
  109836. return nil, err
  109837. }
  109838. return ret, nil
  109839. // {
  109840. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  109841. // "httpMethod": "GET",
  109842. // "id": "compute.targetVpnGateways.list",
  109843. // "parameterOrder": [
  109844. // "project",
  109845. // "region"
  109846. // ],
  109847. // "parameters": {
  109848. // "filter": {
  109849. // "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).",
  109850. // "location": "query",
  109851. // "type": "string"
  109852. // },
  109853. // "maxResults": {
  109854. // "default": "500",
  109855. // "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)",
  109856. // "format": "uint32",
  109857. // "location": "query",
  109858. // "minimum": "0",
  109859. // "type": "integer"
  109860. // },
  109861. // "orderBy": {
  109862. // "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.",
  109863. // "location": "query",
  109864. // "type": "string"
  109865. // },
  109866. // "pageToken": {
  109867. // "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.",
  109868. // "location": "query",
  109869. // "type": "string"
  109870. // },
  109871. // "project": {
  109872. // "description": "Project ID for this request.",
  109873. // "location": "path",
  109874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109875. // "required": true,
  109876. // "type": "string"
  109877. // },
  109878. // "region": {
  109879. // "description": "Name of the region for this request.",
  109880. // "location": "path",
  109881. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109882. // "required": true,
  109883. // "type": "string"
  109884. // }
  109885. // },
  109886. // "path": "{project}/regions/{region}/targetVpnGateways",
  109887. // "response": {
  109888. // "$ref": "TargetVpnGatewayList"
  109889. // },
  109890. // "scopes": [
  109891. // "https://www.googleapis.com/auth/cloud-platform",
  109892. // "https://www.googleapis.com/auth/compute",
  109893. // "https://www.googleapis.com/auth/compute.readonly"
  109894. // ]
  109895. // }
  109896. }
  109897. // Pages invokes f for each page of results.
  109898. // A non-nil error returned from f will halt the iteration.
  109899. // The provided context supersedes any context provided to the Context method.
  109900. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  109901. c.ctx_ = ctx
  109902. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109903. for {
  109904. x, err := c.Do()
  109905. if err != nil {
  109906. return err
  109907. }
  109908. if err := f(x); err != nil {
  109909. return err
  109910. }
  109911. if x.NextPageToken == "" {
  109912. return nil
  109913. }
  109914. c.PageToken(x.NextPageToken)
  109915. }
  109916. }
  109917. // method id "compute.targetVpnGateways.setLabels":
  109918. type TargetVpnGatewaysSetLabelsCall struct {
  109919. s *Service
  109920. project string
  109921. region string
  109922. resource string
  109923. regionsetlabelsrequest *RegionSetLabelsRequest
  109924. urlParams_ gensupport.URLParams
  109925. ctx_ context.Context
  109926. header_ http.Header
  109927. }
  109928. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  109929. // labels, read the Labeling Resources documentation.
  109930. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  109931. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109932. c.project = project
  109933. c.region = region
  109934. c.resource = resource
  109935. c.regionsetlabelsrequest = regionsetlabelsrequest
  109936. return c
  109937. }
  109938. // RequestId sets the optional parameter "requestId": An optional
  109939. // request ID to identify requests. Specify a unique request ID so that
  109940. // if you must retry your request, the server will know to ignore the
  109941. // request if it has already been completed.
  109942. //
  109943. // For example, consider a situation where you make an initial request
  109944. // and the request times out. If you make the request again with the
  109945. // same request ID, the server can check if original operation with the
  109946. // same request ID was received, and if so, will ignore the second
  109947. // request. This prevents clients from accidentally creating duplicate
  109948. // commitments.
  109949. //
  109950. // The request ID must be a valid UUID with the exception that zero UUID
  109951. // is not supported (00000000-0000-0000-0000-000000000000).
  109952. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  109953. c.urlParams_.Set("requestId", requestId)
  109954. return c
  109955. }
  109956. // Fields allows partial responses to be retrieved. See
  109957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109958. // for more information.
  109959. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  109960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109961. return c
  109962. }
  109963. // Context sets the context to be used in this call's Do method. Any
  109964. // pending HTTP request will be aborted if the provided context is
  109965. // canceled.
  109966. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  109967. c.ctx_ = ctx
  109968. return c
  109969. }
  109970. // Header returns an http.Header that can be modified by the caller to
  109971. // add HTTP headers to the request.
  109972. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  109973. if c.header_ == nil {
  109974. c.header_ = make(http.Header)
  109975. }
  109976. return c.header_
  109977. }
  109978. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  109979. reqHeaders := make(http.Header)
  109980. for k, v := range c.header_ {
  109981. reqHeaders[k] = v
  109982. }
  109983. reqHeaders.Set("User-Agent", c.s.userAgent())
  109984. var body io.Reader = nil
  109985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  109986. if err != nil {
  109987. return nil, err
  109988. }
  109989. reqHeaders.Set("Content-Type", "application/json")
  109990. c.urlParams_.Set("alt", alt)
  109991. c.urlParams_.Set("prettyPrint", "false")
  109992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  109993. urls += "?" + c.urlParams_.Encode()
  109994. req, err := http.NewRequest("POST", urls, body)
  109995. if err != nil {
  109996. return nil, err
  109997. }
  109998. req.Header = reqHeaders
  109999. googleapi.Expand(req.URL, map[string]string{
  110000. "project": c.project,
  110001. "region": c.region,
  110002. "resource": c.resource,
  110003. })
  110004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110005. }
  110006. // Do executes the "compute.targetVpnGateways.setLabels" call.
  110007. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110008. // status code is an error. Response headers are in either
  110009. // *Operation.ServerResponse.Header or (if a response was returned at
  110010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110011. // to check whether the returned error was because
  110012. // http.StatusNotModified was returned.
  110013. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110014. gensupport.SetOptions(c.urlParams_, opts...)
  110015. res, err := c.doRequest("json")
  110016. if res != nil && res.StatusCode == http.StatusNotModified {
  110017. if res.Body != nil {
  110018. res.Body.Close()
  110019. }
  110020. return nil, &googleapi.Error{
  110021. Code: res.StatusCode,
  110022. Header: res.Header,
  110023. }
  110024. }
  110025. if err != nil {
  110026. return nil, err
  110027. }
  110028. defer googleapi.CloseBody(res)
  110029. if err := googleapi.CheckResponse(res); err != nil {
  110030. return nil, err
  110031. }
  110032. ret := &Operation{
  110033. ServerResponse: googleapi.ServerResponse{
  110034. Header: res.Header,
  110035. HTTPStatusCode: res.StatusCode,
  110036. },
  110037. }
  110038. target := &ret
  110039. if err := gensupport.DecodeResponse(target, res); err != nil {
  110040. return nil, err
  110041. }
  110042. return ret, nil
  110043. // {
  110044. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  110045. // "httpMethod": "POST",
  110046. // "id": "compute.targetVpnGateways.setLabels",
  110047. // "parameterOrder": [
  110048. // "project",
  110049. // "region",
  110050. // "resource"
  110051. // ],
  110052. // "parameters": {
  110053. // "project": {
  110054. // "description": "Project ID for this request.",
  110055. // "location": "path",
  110056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110057. // "required": true,
  110058. // "type": "string"
  110059. // },
  110060. // "region": {
  110061. // "description": "The region for this request.",
  110062. // "location": "path",
  110063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110064. // "required": true,
  110065. // "type": "string"
  110066. // },
  110067. // "requestId": {
  110068. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110069. // "location": "query",
  110070. // "type": "string"
  110071. // },
  110072. // "resource": {
  110073. // "description": "Name or id of the resource for this request.",
  110074. // "location": "path",
  110075. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110076. // "required": true,
  110077. // "type": "string"
  110078. // }
  110079. // },
  110080. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  110081. // "request": {
  110082. // "$ref": "RegionSetLabelsRequest"
  110083. // },
  110084. // "response": {
  110085. // "$ref": "Operation"
  110086. // },
  110087. // "scopes": [
  110088. // "https://www.googleapis.com/auth/cloud-platform",
  110089. // "https://www.googleapis.com/auth/compute"
  110090. // ]
  110091. // }
  110092. }
  110093. // method id "compute.targetVpnGateways.testIamPermissions":
  110094. type TargetVpnGatewaysTestIamPermissionsCall struct {
  110095. s *Service
  110096. project string
  110097. region string
  110098. resource string
  110099. testpermissionsrequest *TestPermissionsRequest
  110100. urlParams_ gensupport.URLParams
  110101. ctx_ context.Context
  110102. header_ http.Header
  110103. }
  110104. // TestIamPermissions: Returns permissions that a caller has on the
  110105. // specified resource.
  110106. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  110107. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110108. c.project = project
  110109. c.region = region
  110110. c.resource = resource
  110111. c.testpermissionsrequest = testpermissionsrequest
  110112. return c
  110113. }
  110114. // Fields allows partial responses to be retrieved. See
  110115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110116. // for more information.
  110117. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  110118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110119. return c
  110120. }
  110121. // Context sets the context to be used in this call's Do method. Any
  110122. // pending HTTP request will be aborted if the provided context is
  110123. // canceled.
  110124. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  110125. c.ctx_ = ctx
  110126. return c
  110127. }
  110128. // Header returns an http.Header that can be modified by the caller to
  110129. // add HTTP headers to the request.
  110130. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  110131. if c.header_ == nil {
  110132. c.header_ = make(http.Header)
  110133. }
  110134. return c.header_
  110135. }
  110136. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110137. reqHeaders := make(http.Header)
  110138. for k, v := range c.header_ {
  110139. reqHeaders[k] = v
  110140. }
  110141. reqHeaders.Set("User-Agent", c.s.userAgent())
  110142. var body io.Reader = nil
  110143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110144. if err != nil {
  110145. return nil, err
  110146. }
  110147. reqHeaders.Set("Content-Type", "application/json")
  110148. c.urlParams_.Set("alt", alt)
  110149. c.urlParams_.Set("prettyPrint", "false")
  110150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  110151. urls += "?" + c.urlParams_.Encode()
  110152. req, err := http.NewRequest("POST", urls, body)
  110153. if err != nil {
  110154. return nil, err
  110155. }
  110156. req.Header = reqHeaders
  110157. googleapi.Expand(req.URL, map[string]string{
  110158. "project": c.project,
  110159. "region": c.region,
  110160. "resource": c.resource,
  110161. })
  110162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110163. }
  110164. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  110165. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110166. // non-2xx status code is an error. Response headers are in either
  110167. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110168. // returned at all) in error.(*googleapi.Error).Header. Use
  110169. // googleapi.IsNotModified to check whether the returned error was
  110170. // because http.StatusNotModified was returned.
  110171. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110172. gensupport.SetOptions(c.urlParams_, opts...)
  110173. res, err := c.doRequest("json")
  110174. if res != nil && res.StatusCode == http.StatusNotModified {
  110175. if res.Body != nil {
  110176. res.Body.Close()
  110177. }
  110178. return nil, &googleapi.Error{
  110179. Code: res.StatusCode,
  110180. Header: res.Header,
  110181. }
  110182. }
  110183. if err != nil {
  110184. return nil, err
  110185. }
  110186. defer googleapi.CloseBody(res)
  110187. if err := googleapi.CheckResponse(res); err != nil {
  110188. return nil, err
  110189. }
  110190. ret := &TestPermissionsResponse{
  110191. ServerResponse: googleapi.ServerResponse{
  110192. Header: res.Header,
  110193. HTTPStatusCode: res.StatusCode,
  110194. },
  110195. }
  110196. target := &ret
  110197. if err := gensupport.DecodeResponse(target, res); err != nil {
  110198. return nil, err
  110199. }
  110200. return ret, nil
  110201. // {
  110202. // "description": "Returns permissions that a caller has on the specified resource.",
  110203. // "httpMethod": "POST",
  110204. // "id": "compute.targetVpnGateways.testIamPermissions",
  110205. // "parameterOrder": [
  110206. // "project",
  110207. // "region",
  110208. // "resource"
  110209. // ],
  110210. // "parameters": {
  110211. // "project": {
  110212. // "description": "Project ID for this request.",
  110213. // "location": "path",
  110214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110215. // "required": true,
  110216. // "type": "string"
  110217. // },
  110218. // "region": {
  110219. // "description": "The name of the region for this request.",
  110220. // "location": "path",
  110221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110222. // "required": true,
  110223. // "type": "string"
  110224. // },
  110225. // "resource": {
  110226. // "description": "Name or id of the resource for this request.",
  110227. // "location": "path",
  110228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110229. // "required": true,
  110230. // "type": "string"
  110231. // }
  110232. // },
  110233. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  110234. // "request": {
  110235. // "$ref": "TestPermissionsRequest"
  110236. // },
  110237. // "response": {
  110238. // "$ref": "TestPermissionsResponse"
  110239. // },
  110240. // "scopes": [
  110241. // "https://www.googleapis.com/auth/cloud-platform",
  110242. // "https://www.googleapis.com/auth/compute",
  110243. // "https://www.googleapis.com/auth/compute.readonly"
  110244. // ]
  110245. // }
  110246. }
  110247. // method id "compute.urlMaps.delete":
  110248. type UrlMapsDeleteCall struct {
  110249. s *Service
  110250. project string
  110251. urlMap string
  110252. urlParams_ gensupport.URLParams
  110253. ctx_ context.Context
  110254. header_ http.Header
  110255. }
  110256. // Delete: Deletes the specified UrlMap resource.
  110257. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  110258. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  110259. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110260. c.project = project
  110261. c.urlMap = urlMap
  110262. return c
  110263. }
  110264. // RequestId sets the optional parameter "requestId": An optional
  110265. // request ID to identify requests. Specify a unique request ID so that
  110266. // if you must retry your request, the server will know to ignore the
  110267. // request if it has already been completed.
  110268. //
  110269. // For example, consider a situation where you make an initial request
  110270. // and the request times out. If you make the request again with the
  110271. // same request ID, the server can check if original operation with the
  110272. // same request ID was received, and if so, will ignore the second
  110273. // request. This prevents clients from accidentally creating duplicate
  110274. // commitments.
  110275. //
  110276. // The request ID must be a valid UUID with the exception that zero UUID
  110277. // is not supported (00000000-0000-0000-0000-000000000000).
  110278. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  110279. c.urlParams_.Set("requestId", requestId)
  110280. return c
  110281. }
  110282. // Fields allows partial responses to be retrieved. See
  110283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110284. // for more information.
  110285. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  110286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110287. return c
  110288. }
  110289. // Context sets the context to be used in this call's Do method. Any
  110290. // pending HTTP request will be aborted if the provided context is
  110291. // canceled.
  110292. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  110293. c.ctx_ = ctx
  110294. return c
  110295. }
  110296. // Header returns an http.Header that can be modified by the caller to
  110297. // add HTTP headers to the request.
  110298. func (c *UrlMapsDeleteCall) Header() http.Header {
  110299. if c.header_ == nil {
  110300. c.header_ = make(http.Header)
  110301. }
  110302. return c.header_
  110303. }
  110304. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  110305. reqHeaders := make(http.Header)
  110306. for k, v := range c.header_ {
  110307. reqHeaders[k] = v
  110308. }
  110309. reqHeaders.Set("User-Agent", c.s.userAgent())
  110310. var body io.Reader = nil
  110311. c.urlParams_.Set("alt", alt)
  110312. c.urlParams_.Set("prettyPrint", "false")
  110313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  110314. urls += "?" + c.urlParams_.Encode()
  110315. req, err := http.NewRequest("DELETE", urls, body)
  110316. if err != nil {
  110317. return nil, err
  110318. }
  110319. req.Header = reqHeaders
  110320. googleapi.Expand(req.URL, map[string]string{
  110321. "project": c.project,
  110322. "urlMap": c.urlMap,
  110323. })
  110324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110325. }
  110326. // Do executes the "compute.urlMaps.delete" call.
  110327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110328. // status code is an error. Response headers are in either
  110329. // *Operation.ServerResponse.Header or (if a response was returned at
  110330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110331. // to check whether the returned error was because
  110332. // http.StatusNotModified was returned.
  110333. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110334. gensupport.SetOptions(c.urlParams_, opts...)
  110335. res, err := c.doRequest("json")
  110336. if res != nil && res.StatusCode == http.StatusNotModified {
  110337. if res.Body != nil {
  110338. res.Body.Close()
  110339. }
  110340. return nil, &googleapi.Error{
  110341. Code: res.StatusCode,
  110342. Header: res.Header,
  110343. }
  110344. }
  110345. if err != nil {
  110346. return nil, err
  110347. }
  110348. defer googleapi.CloseBody(res)
  110349. if err := googleapi.CheckResponse(res); err != nil {
  110350. return nil, err
  110351. }
  110352. ret := &Operation{
  110353. ServerResponse: googleapi.ServerResponse{
  110354. Header: res.Header,
  110355. HTTPStatusCode: res.StatusCode,
  110356. },
  110357. }
  110358. target := &ret
  110359. if err := gensupport.DecodeResponse(target, res); err != nil {
  110360. return nil, err
  110361. }
  110362. return ret, nil
  110363. // {
  110364. // "description": "Deletes the specified UrlMap resource.",
  110365. // "httpMethod": "DELETE",
  110366. // "id": "compute.urlMaps.delete",
  110367. // "parameterOrder": [
  110368. // "project",
  110369. // "urlMap"
  110370. // ],
  110371. // "parameters": {
  110372. // "project": {
  110373. // "description": "Project ID for this request.",
  110374. // "location": "path",
  110375. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110376. // "required": true,
  110377. // "type": "string"
  110378. // },
  110379. // "requestId": {
  110380. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110381. // "location": "query",
  110382. // "type": "string"
  110383. // },
  110384. // "urlMap": {
  110385. // "description": "Name of the UrlMap resource to delete.",
  110386. // "location": "path",
  110387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110388. // "required": true,
  110389. // "type": "string"
  110390. // }
  110391. // },
  110392. // "path": "{project}/global/urlMaps/{urlMap}",
  110393. // "response": {
  110394. // "$ref": "Operation"
  110395. // },
  110396. // "scopes": [
  110397. // "https://www.googleapis.com/auth/cloud-platform",
  110398. // "https://www.googleapis.com/auth/compute"
  110399. // ]
  110400. // }
  110401. }
  110402. // method id "compute.urlMaps.get":
  110403. type UrlMapsGetCall struct {
  110404. s *Service
  110405. project string
  110406. urlMap string
  110407. urlParams_ gensupport.URLParams
  110408. ifNoneMatch_ string
  110409. ctx_ context.Context
  110410. header_ http.Header
  110411. }
  110412. // Get: Returns the specified UrlMap resource. Gets a list of available
  110413. // URL maps by making a list() request.
  110414. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  110415. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  110416. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110417. c.project = project
  110418. c.urlMap = urlMap
  110419. return c
  110420. }
  110421. // Fields allows partial responses to be retrieved. See
  110422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110423. // for more information.
  110424. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  110425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110426. return c
  110427. }
  110428. // IfNoneMatch sets the optional parameter which makes the operation
  110429. // fail if the object's ETag matches the given value. This is useful for
  110430. // getting updates only after the object has changed since the last
  110431. // request. Use googleapi.IsNotModified to check whether the response
  110432. // error from Do is the result of In-None-Match.
  110433. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  110434. c.ifNoneMatch_ = entityTag
  110435. return c
  110436. }
  110437. // Context sets the context to be used in this call's Do method. Any
  110438. // pending HTTP request will be aborted if the provided context is
  110439. // canceled.
  110440. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  110441. c.ctx_ = ctx
  110442. return c
  110443. }
  110444. // Header returns an http.Header that can be modified by the caller to
  110445. // add HTTP headers to the request.
  110446. func (c *UrlMapsGetCall) Header() http.Header {
  110447. if c.header_ == nil {
  110448. c.header_ = make(http.Header)
  110449. }
  110450. return c.header_
  110451. }
  110452. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  110453. reqHeaders := make(http.Header)
  110454. for k, v := range c.header_ {
  110455. reqHeaders[k] = v
  110456. }
  110457. reqHeaders.Set("User-Agent", c.s.userAgent())
  110458. if c.ifNoneMatch_ != "" {
  110459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110460. }
  110461. var body io.Reader = nil
  110462. c.urlParams_.Set("alt", alt)
  110463. c.urlParams_.Set("prettyPrint", "false")
  110464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  110465. urls += "?" + c.urlParams_.Encode()
  110466. req, err := http.NewRequest("GET", urls, body)
  110467. if err != nil {
  110468. return nil, err
  110469. }
  110470. req.Header = reqHeaders
  110471. googleapi.Expand(req.URL, map[string]string{
  110472. "project": c.project,
  110473. "urlMap": c.urlMap,
  110474. })
  110475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110476. }
  110477. // Do executes the "compute.urlMaps.get" call.
  110478. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  110479. // code is an error. Response headers are in either
  110480. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  110481. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  110482. // check whether the returned error was because http.StatusNotModified
  110483. // was returned.
  110484. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  110485. gensupport.SetOptions(c.urlParams_, opts...)
  110486. res, err := c.doRequest("json")
  110487. if res != nil && res.StatusCode == http.StatusNotModified {
  110488. if res.Body != nil {
  110489. res.Body.Close()
  110490. }
  110491. return nil, &googleapi.Error{
  110492. Code: res.StatusCode,
  110493. Header: res.Header,
  110494. }
  110495. }
  110496. if err != nil {
  110497. return nil, err
  110498. }
  110499. defer googleapi.CloseBody(res)
  110500. if err := googleapi.CheckResponse(res); err != nil {
  110501. return nil, err
  110502. }
  110503. ret := &UrlMap{
  110504. ServerResponse: googleapi.ServerResponse{
  110505. Header: res.Header,
  110506. HTTPStatusCode: res.StatusCode,
  110507. },
  110508. }
  110509. target := &ret
  110510. if err := gensupport.DecodeResponse(target, res); err != nil {
  110511. return nil, err
  110512. }
  110513. return ret, nil
  110514. // {
  110515. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  110516. // "httpMethod": "GET",
  110517. // "id": "compute.urlMaps.get",
  110518. // "parameterOrder": [
  110519. // "project",
  110520. // "urlMap"
  110521. // ],
  110522. // "parameters": {
  110523. // "project": {
  110524. // "description": "Project ID for this request.",
  110525. // "location": "path",
  110526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110527. // "required": true,
  110528. // "type": "string"
  110529. // },
  110530. // "urlMap": {
  110531. // "description": "Name of the UrlMap resource to return.",
  110532. // "location": "path",
  110533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110534. // "required": true,
  110535. // "type": "string"
  110536. // }
  110537. // },
  110538. // "path": "{project}/global/urlMaps/{urlMap}",
  110539. // "response": {
  110540. // "$ref": "UrlMap"
  110541. // },
  110542. // "scopes": [
  110543. // "https://www.googleapis.com/auth/cloud-platform",
  110544. // "https://www.googleapis.com/auth/compute",
  110545. // "https://www.googleapis.com/auth/compute.readonly"
  110546. // ]
  110547. // }
  110548. }
  110549. // method id "compute.urlMaps.insert":
  110550. type UrlMapsInsertCall struct {
  110551. s *Service
  110552. project string
  110553. urlmap *UrlMap
  110554. urlParams_ gensupport.URLParams
  110555. ctx_ context.Context
  110556. header_ http.Header
  110557. }
  110558. // Insert: Creates a UrlMap resource in the specified project using the
  110559. // data included in the request.
  110560. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  110561. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  110562. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110563. c.project = project
  110564. c.urlmap = urlmap
  110565. return c
  110566. }
  110567. // RequestId sets the optional parameter "requestId": An optional
  110568. // request ID to identify requests. Specify a unique request ID so that
  110569. // if you must retry your request, the server will know to ignore the
  110570. // request if it has already been completed.
  110571. //
  110572. // For example, consider a situation where you make an initial request
  110573. // and the request times out. If you make the request again with the
  110574. // same request ID, the server can check if original operation with the
  110575. // same request ID was received, and if so, will ignore the second
  110576. // request. This prevents clients from accidentally creating duplicate
  110577. // commitments.
  110578. //
  110579. // The request ID must be a valid UUID with the exception that zero UUID
  110580. // is not supported (00000000-0000-0000-0000-000000000000).
  110581. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  110582. c.urlParams_.Set("requestId", requestId)
  110583. return c
  110584. }
  110585. // Fields allows partial responses to be retrieved. See
  110586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110587. // for more information.
  110588. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  110589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110590. return c
  110591. }
  110592. // Context sets the context to be used in this call's Do method. Any
  110593. // pending HTTP request will be aborted if the provided context is
  110594. // canceled.
  110595. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  110596. c.ctx_ = ctx
  110597. return c
  110598. }
  110599. // Header returns an http.Header that can be modified by the caller to
  110600. // add HTTP headers to the request.
  110601. func (c *UrlMapsInsertCall) Header() http.Header {
  110602. if c.header_ == nil {
  110603. c.header_ = make(http.Header)
  110604. }
  110605. return c.header_
  110606. }
  110607. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  110608. reqHeaders := make(http.Header)
  110609. for k, v := range c.header_ {
  110610. reqHeaders[k] = v
  110611. }
  110612. reqHeaders.Set("User-Agent", c.s.userAgent())
  110613. var body io.Reader = nil
  110614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  110615. if err != nil {
  110616. return nil, err
  110617. }
  110618. reqHeaders.Set("Content-Type", "application/json")
  110619. c.urlParams_.Set("alt", alt)
  110620. c.urlParams_.Set("prettyPrint", "false")
  110621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  110622. urls += "?" + c.urlParams_.Encode()
  110623. req, err := http.NewRequest("POST", urls, body)
  110624. if err != nil {
  110625. return nil, err
  110626. }
  110627. req.Header = reqHeaders
  110628. googleapi.Expand(req.URL, map[string]string{
  110629. "project": c.project,
  110630. })
  110631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110632. }
  110633. // Do executes the "compute.urlMaps.insert" call.
  110634. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110635. // status code is an error. Response headers are in either
  110636. // *Operation.ServerResponse.Header or (if a response was returned at
  110637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110638. // to check whether the returned error was because
  110639. // http.StatusNotModified was returned.
  110640. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110641. gensupport.SetOptions(c.urlParams_, opts...)
  110642. res, err := c.doRequest("json")
  110643. if res != nil && res.StatusCode == http.StatusNotModified {
  110644. if res.Body != nil {
  110645. res.Body.Close()
  110646. }
  110647. return nil, &googleapi.Error{
  110648. Code: res.StatusCode,
  110649. Header: res.Header,
  110650. }
  110651. }
  110652. if err != nil {
  110653. return nil, err
  110654. }
  110655. defer googleapi.CloseBody(res)
  110656. if err := googleapi.CheckResponse(res); err != nil {
  110657. return nil, err
  110658. }
  110659. ret := &Operation{
  110660. ServerResponse: googleapi.ServerResponse{
  110661. Header: res.Header,
  110662. HTTPStatusCode: res.StatusCode,
  110663. },
  110664. }
  110665. target := &ret
  110666. if err := gensupport.DecodeResponse(target, res); err != nil {
  110667. return nil, err
  110668. }
  110669. return ret, nil
  110670. // {
  110671. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  110672. // "httpMethod": "POST",
  110673. // "id": "compute.urlMaps.insert",
  110674. // "parameterOrder": [
  110675. // "project"
  110676. // ],
  110677. // "parameters": {
  110678. // "project": {
  110679. // "description": "Project ID for this request.",
  110680. // "location": "path",
  110681. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110682. // "required": true,
  110683. // "type": "string"
  110684. // },
  110685. // "requestId": {
  110686. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110687. // "location": "query",
  110688. // "type": "string"
  110689. // }
  110690. // },
  110691. // "path": "{project}/global/urlMaps",
  110692. // "request": {
  110693. // "$ref": "UrlMap"
  110694. // },
  110695. // "response": {
  110696. // "$ref": "Operation"
  110697. // },
  110698. // "scopes": [
  110699. // "https://www.googleapis.com/auth/cloud-platform",
  110700. // "https://www.googleapis.com/auth/compute"
  110701. // ]
  110702. // }
  110703. }
  110704. // method id "compute.urlMaps.invalidateCache":
  110705. type UrlMapsInvalidateCacheCall struct {
  110706. s *Service
  110707. project string
  110708. urlMap string
  110709. cacheinvalidationrule *CacheInvalidationRule
  110710. urlParams_ gensupport.URLParams
  110711. ctx_ context.Context
  110712. header_ http.Header
  110713. }
  110714. // InvalidateCache: Initiates a cache invalidation operation,
  110715. // invalidating the specified path, scoped to the specified UrlMap.
  110716. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  110717. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110718. c.project = project
  110719. c.urlMap = urlMap
  110720. c.cacheinvalidationrule = cacheinvalidationrule
  110721. return c
  110722. }
  110723. // RequestId sets the optional parameter "requestId": An optional
  110724. // request ID to identify requests. Specify a unique request ID so that
  110725. // if you must retry your request, the server will know to ignore the
  110726. // request if it has already been completed.
  110727. //
  110728. // For example, consider a situation where you make an initial request
  110729. // and the request times out. If you make the request again with the
  110730. // same request ID, the server can check if original operation with the
  110731. // same request ID was received, and if so, will ignore the second
  110732. // request. This prevents clients from accidentally creating duplicate
  110733. // commitments.
  110734. //
  110735. // The request ID must be a valid UUID with the exception that zero UUID
  110736. // is not supported (00000000-0000-0000-0000-000000000000).
  110737. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  110738. c.urlParams_.Set("requestId", requestId)
  110739. return c
  110740. }
  110741. // Fields allows partial responses to be retrieved. See
  110742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110743. // for more information.
  110744. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  110745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110746. return c
  110747. }
  110748. // Context sets the context to be used in this call's Do method. Any
  110749. // pending HTTP request will be aborted if the provided context is
  110750. // canceled.
  110751. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  110752. c.ctx_ = ctx
  110753. return c
  110754. }
  110755. // Header returns an http.Header that can be modified by the caller to
  110756. // add HTTP headers to the request.
  110757. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  110758. if c.header_ == nil {
  110759. c.header_ = make(http.Header)
  110760. }
  110761. return c.header_
  110762. }
  110763. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  110764. reqHeaders := make(http.Header)
  110765. for k, v := range c.header_ {
  110766. reqHeaders[k] = v
  110767. }
  110768. reqHeaders.Set("User-Agent", c.s.userAgent())
  110769. var body io.Reader = nil
  110770. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  110771. if err != nil {
  110772. return nil, err
  110773. }
  110774. reqHeaders.Set("Content-Type", "application/json")
  110775. c.urlParams_.Set("alt", alt)
  110776. c.urlParams_.Set("prettyPrint", "false")
  110777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  110778. urls += "?" + c.urlParams_.Encode()
  110779. req, err := http.NewRequest("POST", urls, body)
  110780. if err != nil {
  110781. return nil, err
  110782. }
  110783. req.Header = reqHeaders
  110784. googleapi.Expand(req.URL, map[string]string{
  110785. "project": c.project,
  110786. "urlMap": c.urlMap,
  110787. })
  110788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110789. }
  110790. // Do executes the "compute.urlMaps.invalidateCache" call.
  110791. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110792. // status code is an error. Response headers are in either
  110793. // *Operation.ServerResponse.Header or (if a response was returned at
  110794. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110795. // to check whether the returned error was because
  110796. // http.StatusNotModified was returned.
  110797. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110798. gensupport.SetOptions(c.urlParams_, opts...)
  110799. res, err := c.doRequest("json")
  110800. if res != nil && res.StatusCode == http.StatusNotModified {
  110801. if res.Body != nil {
  110802. res.Body.Close()
  110803. }
  110804. return nil, &googleapi.Error{
  110805. Code: res.StatusCode,
  110806. Header: res.Header,
  110807. }
  110808. }
  110809. if err != nil {
  110810. return nil, err
  110811. }
  110812. defer googleapi.CloseBody(res)
  110813. if err := googleapi.CheckResponse(res); err != nil {
  110814. return nil, err
  110815. }
  110816. ret := &Operation{
  110817. ServerResponse: googleapi.ServerResponse{
  110818. Header: res.Header,
  110819. HTTPStatusCode: res.StatusCode,
  110820. },
  110821. }
  110822. target := &ret
  110823. if err := gensupport.DecodeResponse(target, res); err != nil {
  110824. return nil, err
  110825. }
  110826. return ret, nil
  110827. // {
  110828. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  110829. // "httpMethod": "POST",
  110830. // "id": "compute.urlMaps.invalidateCache",
  110831. // "parameterOrder": [
  110832. // "project",
  110833. // "urlMap"
  110834. // ],
  110835. // "parameters": {
  110836. // "project": {
  110837. // "description": "Project ID for this request.",
  110838. // "location": "path",
  110839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110840. // "required": true,
  110841. // "type": "string"
  110842. // },
  110843. // "requestId": {
  110844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110845. // "location": "query",
  110846. // "type": "string"
  110847. // },
  110848. // "urlMap": {
  110849. // "description": "Name of the UrlMap scoping this request.",
  110850. // "location": "path",
  110851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110852. // "required": true,
  110853. // "type": "string"
  110854. // }
  110855. // },
  110856. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  110857. // "request": {
  110858. // "$ref": "CacheInvalidationRule"
  110859. // },
  110860. // "response": {
  110861. // "$ref": "Operation"
  110862. // },
  110863. // "scopes": [
  110864. // "https://www.googleapis.com/auth/cloud-platform",
  110865. // "https://www.googleapis.com/auth/compute"
  110866. // ]
  110867. // }
  110868. }
  110869. // method id "compute.urlMaps.list":
  110870. type UrlMapsListCall struct {
  110871. s *Service
  110872. project string
  110873. urlParams_ gensupport.URLParams
  110874. ifNoneMatch_ string
  110875. ctx_ context.Context
  110876. header_ http.Header
  110877. }
  110878. // List: Retrieves the list of UrlMap resources available to the
  110879. // specified project.
  110880. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  110881. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  110882. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110883. c.project = project
  110884. return c
  110885. }
  110886. // Filter sets the optional parameter "filter": A filter expression that
  110887. // filters resources listed in the response. The expression must specify
  110888. // the field name, a comparison operator, and the value that you want to
  110889. // use for filtering. The value must be a string, a number, or a
  110890. // boolean. The comparison operator must be either =, !=, >, or <.
  110891. //
  110892. // For example, if you are filtering Compute Engine instances, you can
  110893. // exclude instances named example-instance by specifying name !=
  110894. // example-instance.
  110895. //
  110896. // You can also filter nested fields. For example, you could specify
  110897. // scheduling.automaticRestart = false to include instances only if they
  110898. // are not scheduled for automatic restarts. You can use filtering on
  110899. // nested fields to filter based on resource labels.
  110900. //
  110901. // To filter on multiple expressions, provide each separate expression
  110902. // within parentheses. For example, (scheduling.automaticRestart = true)
  110903. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110904. // AND expression. However, you can include AND and OR expressions
  110905. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110906. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110907. // true).
  110908. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  110909. c.urlParams_.Set("filter", filter)
  110910. return c
  110911. }
  110912. // MaxResults sets the optional parameter "maxResults": The maximum
  110913. // number of results per page that should be returned. If the number of
  110914. // available results is larger than maxResults, Compute Engine returns a
  110915. // nextPageToken that can be used to get the next page of results in
  110916. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110917. // (Default: 500)
  110918. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  110919. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110920. return c
  110921. }
  110922. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110923. // a certain order. By default, results are returned in alphanumerical
  110924. // order based on the resource name.
  110925. //
  110926. // You can also sort results in descending order based on the creation
  110927. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110928. // based on the creationTimestamp field in reverse chronological order
  110929. // (newest result first). Use this to sort resources like operations so
  110930. // that the newest operation is returned first.
  110931. //
  110932. // Currently, only sorting by name or creationTimestamp desc is
  110933. // supported.
  110934. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  110935. c.urlParams_.Set("orderBy", orderBy)
  110936. return c
  110937. }
  110938. // PageToken sets the optional parameter "pageToken": Specifies a page
  110939. // token to use. Set pageToken to the nextPageToken returned by a
  110940. // previous list request to get the next page of results.
  110941. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  110942. c.urlParams_.Set("pageToken", pageToken)
  110943. return c
  110944. }
  110945. // Fields allows partial responses to be retrieved. See
  110946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110947. // for more information.
  110948. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  110949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110950. return c
  110951. }
  110952. // IfNoneMatch sets the optional parameter which makes the operation
  110953. // fail if the object's ETag matches the given value. This is useful for
  110954. // getting updates only after the object has changed since the last
  110955. // request. Use googleapi.IsNotModified to check whether the response
  110956. // error from Do is the result of In-None-Match.
  110957. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  110958. c.ifNoneMatch_ = entityTag
  110959. return c
  110960. }
  110961. // Context sets the context to be used in this call's Do method. Any
  110962. // pending HTTP request will be aborted if the provided context is
  110963. // canceled.
  110964. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  110965. c.ctx_ = ctx
  110966. return c
  110967. }
  110968. // Header returns an http.Header that can be modified by the caller to
  110969. // add HTTP headers to the request.
  110970. func (c *UrlMapsListCall) Header() http.Header {
  110971. if c.header_ == nil {
  110972. c.header_ = make(http.Header)
  110973. }
  110974. return c.header_
  110975. }
  110976. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  110977. reqHeaders := make(http.Header)
  110978. for k, v := range c.header_ {
  110979. reqHeaders[k] = v
  110980. }
  110981. reqHeaders.Set("User-Agent", c.s.userAgent())
  110982. if c.ifNoneMatch_ != "" {
  110983. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110984. }
  110985. var body io.Reader = nil
  110986. c.urlParams_.Set("alt", alt)
  110987. c.urlParams_.Set("prettyPrint", "false")
  110988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  110989. urls += "?" + c.urlParams_.Encode()
  110990. req, err := http.NewRequest("GET", urls, body)
  110991. if err != nil {
  110992. return nil, err
  110993. }
  110994. req.Header = reqHeaders
  110995. googleapi.Expand(req.URL, map[string]string{
  110996. "project": c.project,
  110997. })
  110998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110999. }
  111000. // Do executes the "compute.urlMaps.list" call.
  111001. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  111002. // status code is an error. Response headers are in either
  111003. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  111004. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111005. // to check whether the returned error was because
  111006. // http.StatusNotModified was returned.
  111007. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  111008. gensupport.SetOptions(c.urlParams_, opts...)
  111009. res, err := c.doRequest("json")
  111010. if res != nil && res.StatusCode == http.StatusNotModified {
  111011. if res.Body != nil {
  111012. res.Body.Close()
  111013. }
  111014. return nil, &googleapi.Error{
  111015. Code: res.StatusCode,
  111016. Header: res.Header,
  111017. }
  111018. }
  111019. if err != nil {
  111020. return nil, err
  111021. }
  111022. defer googleapi.CloseBody(res)
  111023. if err := googleapi.CheckResponse(res); err != nil {
  111024. return nil, err
  111025. }
  111026. ret := &UrlMapList{
  111027. ServerResponse: googleapi.ServerResponse{
  111028. Header: res.Header,
  111029. HTTPStatusCode: res.StatusCode,
  111030. },
  111031. }
  111032. target := &ret
  111033. if err := gensupport.DecodeResponse(target, res); err != nil {
  111034. return nil, err
  111035. }
  111036. return ret, nil
  111037. // {
  111038. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  111039. // "httpMethod": "GET",
  111040. // "id": "compute.urlMaps.list",
  111041. // "parameterOrder": [
  111042. // "project"
  111043. // ],
  111044. // "parameters": {
  111045. // "filter": {
  111046. // "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).",
  111047. // "location": "query",
  111048. // "type": "string"
  111049. // },
  111050. // "maxResults": {
  111051. // "default": "500",
  111052. // "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)",
  111053. // "format": "uint32",
  111054. // "location": "query",
  111055. // "minimum": "0",
  111056. // "type": "integer"
  111057. // },
  111058. // "orderBy": {
  111059. // "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.",
  111060. // "location": "query",
  111061. // "type": "string"
  111062. // },
  111063. // "pageToken": {
  111064. // "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.",
  111065. // "location": "query",
  111066. // "type": "string"
  111067. // },
  111068. // "project": {
  111069. // "description": "Project ID for this request.",
  111070. // "location": "path",
  111071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111072. // "required": true,
  111073. // "type": "string"
  111074. // }
  111075. // },
  111076. // "path": "{project}/global/urlMaps",
  111077. // "response": {
  111078. // "$ref": "UrlMapList"
  111079. // },
  111080. // "scopes": [
  111081. // "https://www.googleapis.com/auth/cloud-platform",
  111082. // "https://www.googleapis.com/auth/compute",
  111083. // "https://www.googleapis.com/auth/compute.readonly"
  111084. // ]
  111085. // }
  111086. }
  111087. // Pages invokes f for each page of results.
  111088. // A non-nil error returned from f will halt the iteration.
  111089. // The provided context supersedes any context provided to the Context method.
  111090. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  111091. c.ctx_ = ctx
  111092. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111093. for {
  111094. x, err := c.Do()
  111095. if err != nil {
  111096. return err
  111097. }
  111098. if err := f(x); err != nil {
  111099. return err
  111100. }
  111101. if x.NextPageToken == "" {
  111102. return nil
  111103. }
  111104. c.PageToken(x.NextPageToken)
  111105. }
  111106. }
  111107. // method id "compute.urlMaps.patch":
  111108. type UrlMapsPatchCall struct {
  111109. s *Service
  111110. project string
  111111. urlMap string
  111112. urlmap *UrlMap
  111113. urlParams_ gensupport.URLParams
  111114. ctx_ context.Context
  111115. header_ http.Header
  111116. }
  111117. // Patch: Patches the specified UrlMap resource with the data included
  111118. // in the request. This method supports PATCH semantics and uses the
  111119. // JSON merge patch format and processing rules.
  111120. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  111121. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  111122. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111123. c.project = project
  111124. c.urlMap = urlMap
  111125. c.urlmap = urlmap
  111126. return c
  111127. }
  111128. // RequestId sets the optional parameter "requestId": An optional
  111129. // request ID to identify requests. Specify a unique request ID so that
  111130. // if you must retry your request, the server will know to ignore the
  111131. // request if it has already been completed.
  111132. //
  111133. // For example, consider a situation where you make an initial request
  111134. // and the request times out. If you make the request again with the
  111135. // same request ID, the server can check if original operation with the
  111136. // same request ID was received, and if so, will ignore the second
  111137. // request. This prevents clients from accidentally creating duplicate
  111138. // commitments.
  111139. //
  111140. // The request ID must be a valid UUID with the exception that zero UUID
  111141. // is not supported (00000000-0000-0000-0000-000000000000).
  111142. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  111143. c.urlParams_.Set("requestId", requestId)
  111144. return c
  111145. }
  111146. // Fields allows partial responses to be retrieved. See
  111147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111148. // for more information.
  111149. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  111150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111151. return c
  111152. }
  111153. // Context sets the context to be used in this call's Do method. Any
  111154. // pending HTTP request will be aborted if the provided context is
  111155. // canceled.
  111156. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  111157. c.ctx_ = ctx
  111158. return c
  111159. }
  111160. // Header returns an http.Header that can be modified by the caller to
  111161. // add HTTP headers to the request.
  111162. func (c *UrlMapsPatchCall) Header() http.Header {
  111163. if c.header_ == nil {
  111164. c.header_ = make(http.Header)
  111165. }
  111166. return c.header_
  111167. }
  111168. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  111169. reqHeaders := make(http.Header)
  111170. for k, v := range c.header_ {
  111171. reqHeaders[k] = v
  111172. }
  111173. reqHeaders.Set("User-Agent", c.s.userAgent())
  111174. var body io.Reader = nil
  111175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  111176. if err != nil {
  111177. return nil, err
  111178. }
  111179. reqHeaders.Set("Content-Type", "application/json")
  111180. c.urlParams_.Set("alt", alt)
  111181. c.urlParams_.Set("prettyPrint", "false")
  111182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  111183. urls += "?" + c.urlParams_.Encode()
  111184. req, err := http.NewRequest("PATCH", urls, body)
  111185. if err != nil {
  111186. return nil, err
  111187. }
  111188. req.Header = reqHeaders
  111189. googleapi.Expand(req.URL, map[string]string{
  111190. "project": c.project,
  111191. "urlMap": c.urlMap,
  111192. })
  111193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111194. }
  111195. // Do executes the "compute.urlMaps.patch" call.
  111196. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111197. // status code is an error. Response headers are in either
  111198. // *Operation.ServerResponse.Header or (if a response was returned at
  111199. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111200. // to check whether the returned error was because
  111201. // http.StatusNotModified was returned.
  111202. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111203. gensupport.SetOptions(c.urlParams_, opts...)
  111204. res, err := c.doRequest("json")
  111205. if res != nil && res.StatusCode == http.StatusNotModified {
  111206. if res.Body != nil {
  111207. res.Body.Close()
  111208. }
  111209. return nil, &googleapi.Error{
  111210. Code: res.StatusCode,
  111211. Header: res.Header,
  111212. }
  111213. }
  111214. if err != nil {
  111215. return nil, err
  111216. }
  111217. defer googleapi.CloseBody(res)
  111218. if err := googleapi.CheckResponse(res); err != nil {
  111219. return nil, err
  111220. }
  111221. ret := &Operation{
  111222. ServerResponse: googleapi.ServerResponse{
  111223. Header: res.Header,
  111224. HTTPStatusCode: res.StatusCode,
  111225. },
  111226. }
  111227. target := &ret
  111228. if err := gensupport.DecodeResponse(target, res); err != nil {
  111229. return nil, err
  111230. }
  111231. return ret, nil
  111232. // {
  111233. // "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.",
  111234. // "httpMethod": "PATCH",
  111235. // "id": "compute.urlMaps.patch",
  111236. // "parameterOrder": [
  111237. // "project",
  111238. // "urlMap"
  111239. // ],
  111240. // "parameters": {
  111241. // "project": {
  111242. // "description": "Project ID for this request.",
  111243. // "location": "path",
  111244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111245. // "required": true,
  111246. // "type": "string"
  111247. // },
  111248. // "requestId": {
  111249. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111250. // "location": "query",
  111251. // "type": "string"
  111252. // },
  111253. // "urlMap": {
  111254. // "description": "Name of the UrlMap resource to patch.",
  111255. // "location": "path",
  111256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111257. // "required": true,
  111258. // "type": "string"
  111259. // }
  111260. // },
  111261. // "path": "{project}/global/urlMaps/{urlMap}",
  111262. // "request": {
  111263. // "$ref": "UrlMap"
  111264. // },
  111265. // "response": {
  111266. // "$ref": "Operation"
  111267. // },
  111268. // "scopes": [
  111269. // "https://www.googleapis.com/auth/cloud-platform",
  111270. // "https://www.googleapis.com/auth/compute"
  111271. // ]
  111272. // }
  111273. }
  111274. // method id "compute.urlMaps.testIamPermissions":
  111275. type UrlMapsTestIamPermissionsCall struct {
  111276. s *Service
  111277. project string
  111278. resource string
  111279. testpermissionsrequest *TestPermissionsRequest
  111280. urlParams_ gensupport.URLParams
  111281. ctx_ context.Context
  111282. header_ http.Header
  111283. }
  111284. // TestIamPermissions: Returns permissions that a caller has on the
  111285. // specified resource.
  111286. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  111287. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111288. c.project = project
  111289. c.resource = resource
  111290. c.testpermissionsrequest = testpermissionsrequest
  111291. return c
  111292. }
  111293. // Fields allows partial responses to be retrieved. See
  111294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111295. // for more information.
  111296. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  111297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111298. return c
  111299. }
  111300. // Context sets the context to be used in this call's Do method. Any
  111301. // pending HTTP request will be aborted if the provided context is
  111302. // canceled.
  111303. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  111304. c.ctx_ = ctx
  111305. return c
  111306. }
  111307. // Header returns an http.Header that can be modified by the caller to
  111308. // add HTTP headers to the request.
  111309. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  111310. if c.header_ == nil {
  111311. c.header_ = make(http.Header)
  111312. }
  111313. return c.header_
  111314. }
  111315. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  111316. reqHeaders := make(http.Header)
  111317. for k, v := range c.header_ {
  111318. reqHeaders[k] = v
  111319. }
  111320. reqHeaders.Set("User-Agent", c.s.userAgent())
  111321. var body io.Reader = nil
  111322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  111323. if err != nil {
  111324. return nil, err
  111325. }
  111326. reqHeaders.Set("Content-Type", "application/json")
  111327. c.urlParams_.Set("alt", alt)
  111328. c.urlParams_.Set("prettyPrint", "false")
  111329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  111330. urls += "?" + c.urlParams_.Encode()
  111331. req, err := http.NewRequest("POST", urls, body)
  111332. if err != nil {
  111333. return nil, err
  111334. }
  111335. req.Header = reqHeaders
  111336. googleapi.Expand(req.URL, map[string]string{
  111337. "project": c.project,
  111338. "resource": c.resource,
  111339. })
  111340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111341. }
  111342. // Do executes the "compute.urlMaps.testIamPermissions" call.
  111343. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  111344. // non-2xx status code is an error. Response headers are in either
  111345. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  111346. // returned at all) in error.(*googleapi.Error).Header. Use
  111347. // googleapi.IsNotModified to check whether the returned error was
  111348. // because http.StatusNotModified was returned.
  111349. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  111350. gensupport.SetOptions(c.urlParams_, opts...)
  111351. res, err := c.doRequest("json")
  111352. if res != nil && res.StatusCode == http.StatusNotModified {
  111353. if res.Body != nil {
  111354. res.Body.Close()
  111355. }
  111356. return nil, &googleapi.Error{
  111357. Code: res.StatusCode,
  111358. Header: res.Header,
  111359. }
  111360. }
  111361. if err != nil {
  111362. return nil, err
  111363. }
  111364. defer googleapi.CloseBody(res)
  111365. if err := googleapi.CheckResponse(res); err != nil {
  111366. return nil, err
  111367. }
  111368. ret := &TestPermissionsResponse{
  111369. ServerResponse: googleapi.ServerResponse{
  111370. Header: res.Header,
  111371. HTTPStatusCode: res.StatusCode,
  111372. },
  111373. }
  111374. target := &ret
  111375. if err := gensupport.DecodeResponse(target, res); err != nil {
  111376. return nil, err
  111377. }
  111378. return ret, nil
  111379. // {
  111380. // "description": "Returns permissions that a caller has on the specified resource.",
  111381. // "httpMethod": "POST",
  111382. // "id": "compute.urlMaps.testIamPermissions",
  111383. // "parameterOrder": [
  111384. // "project",
  111385. // "resource"
  111386. // ],
  111387. // "parameters": {
  111388. // "project": {
  111389. // "description": "Project ID for this request.",
  111390. // "location": "path",
  111391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111392. // "required": true,
  111393. // "type": "string"
  111394. // },
  111395. // "resource": {
  111396. // "description": "Name or id of the resource for this request.",
  111397. // "location": "path",
  111398. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111399. // "required": true,
  111400. // "type": "string"
  111401. // }
  111402. // },
  111403. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  111404. // "request": {
  111405. // "$ref": "TestPermissionsRequest"
  111406. // },
  111407. // "response": {
  111408. // "$ref": "TestPermissionsResponse"
  111409. // },
  111410. // "scopes": [
  111411. // "https://www.googleapis.com/auth/cloud-platform",
  111412. // "https://www.googleapis.com/auth/compute",
  111413. // "https://www.googleapis.com/auth/compute.readonly"
  111414. // ]
  111415. // }
  111416. }
  111417. // method id "compute.urlMaps.update":
  111418. type UrlMapsUpdateCall struct {
  111419. s *Service
  111420. project string
  111421. urlMap string
  111422. urlmap *UrlMap
  111423. urlParams_ gensupport.URLParams
  111424. ctx_ context.Context
  111425. header_ http.Header
  111426. }
  111427. // Update: Updates the specified UrlMap resource with the data included
  111428. // in the request.
  111429. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  111430. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  111431. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111432. c.project = project
  111433. c.urlMap = urlMap
  111434. c.urlmap = urlmap
  111435. return c
  111436. }
  111437. // RequestId sets the optional parameter "requestId": An optional
  111438. // request ID to identify requests. Specify a unique request ID so that
  111439. // if you must retry your request, the server will know to ignore the
  111440. // request if it has already been completed.
  111441. //
  111442. // For example, consider a situation where you make an initial request
  111443. // and the request times out. If you make the request again with the
  111444. // same request ID, the server can check if original operation with the
  111445. // same request ID was received, and if so, will ignore the second
  111446. // request. This prevents clients from accidentally creating duplicate
  111447. // commitments.
  111448. //
  111449. // The request ID must be a valid UUID with the exception that zero UUID
  111450. // is not supported (00000000-0000-0000-0000-000000000000).
  111451. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  111452. c.urlParams_.Set("requestId", requestId)
  111453. return c
  111454. }
  111455. // Fields allows partial responses to be retrieved. See
  111456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111457. // for more information.
  111458. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  111459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111460. return c
  111461. }
  111462. // Context sets the context to be used in this call's Do method. Any
  111463. // pending HTTP request will be aborted if the provided context is
  111464. // canceled.
  111465. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  111466. c.ctx_ = ctx
  111467. return c
  111468. }
  111469. // Header returns an http.Header that can be modified by the caller to
  111470. // add HTTP headers to the request.
  111471. func (c *UrlMapsUpdateCall) Header() http.Header {
  111472. if c.header_ == nil {
  111473. c.header_ = make(http.Header)
  111474. }
  111475. return c.header_
  111476. }
  111477. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  111478. reqHeaders := make(http.Header)
  111479. for k, v := range c.header_ {
  111480. reqHeaders[k] = v
  111481. }
  111482. reqHeaders.Set("User-Agent", c.s.userAgent())
  111483. var body io.Reader = nil
  111484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  111485. if err != nil {
  111486. return nil, err
  111487. }
  111488. reqHeaders.Set("Content-Type", "application/json")
  111489. c.urlParams_.Set("alt", alt)
  111490. c.urlParams_.Set("prettyPrint", "false")
  111491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  111492. urls += "?" + c.urlParams_.Encode()
  111493. req, err := http.NewRequest("PUT", urls, body)
  111494. if err != nil {
  111495. return nil, err
  111496. }
  111497. req.Header = reqHeaders
  111498. googleapi.Expand(req.URL, map[string]string{
  111499. "project": c.project,
  111500. "urlMap": c.urlMap,
  111501. })
  111502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111503. }
  111504. // Do executes the "compute.urlMaps.update" call.
  111505. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111506. // status code is an error. Response headers are in either
  111507. // *Operation.ServerResponse.Header or (if a response was returned at
  111508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111509. // to check whether the returned error was because
  111510. // http.StatusNotModified was returned.
  111511. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111512. gensupport.SetOptions(c.urlParams_, opts...)
  111513. res, err := c.doRequest("json")
  111514. if res != nil && res.StatusCode == http.StatusNotModified {
  111515. if res.Body != nil {
  111516. res.Body.Close()
  111517. }
  111518. return nil, &googleapi.Error{
  111519. Code: res.StatusCode,
  111520. Header: res.Header,
  111521. }
  111522. }
  111523. if err != nil {
  111524. return nil, err
  111525. }
  111526. defer googleapi.CloseBody(res)
  111527. if err := googleapi.CheckResponse(res); err != nil {
  111528. return nil, err
  111529. }
  111530. ret := &Operation{
  111531. ServerResponse: googleapi.ServerResponse{
  111532. Header: res.Header,
  111533. HTTPStatusCode: res.StatusCode,
  111534. },
  111535. }
  111536. target := &ret
  111537. if err := gensupport.DecodeResponse(target, res); err != nil {
  111538. return nil, err
  111539. }
  111540. return ret, nil
  111541. // {
  111542. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  111543. // "httpMethod": "PUT",
  111544. // "id": "compute.urlMaps.update",
  111545. // "parameterOrder": [
  111546. // "project",
  111547. // "urlMap"
  111548. // ],
  111549. // "parameters": {
  111550. // "project": {
  111551. // "description": "Project ID for this request.",
  111552. // "location": "path",
  111553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111554. // "required": true,
  111555. // "type": "string"
  111556. // },
  111557. // "requestId": {
  111558. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111559. // "location": "query",
  111560. // "type": "string"
  111561. // },
  111562. // "urlMap": {
  111563. // "description": "Name of the UrlMap resource to update.",
  111564. // "location": "path",
  111565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111566. // "required": true,
  111567. // "type": "string"
  111568. // }
  111569. // },
  111570. // "path": "{project}/global/urlMaps/{urlMap}",
  111571. // "request": {
  111572. // "$ref": "UrlMap"
  111573. // },
  111574. // "response": {
  111575. // "$ref": "Operation"
  111576. // },
  111577. // "scopes": [
  111578. // "https://www.googleapis.com/auth/cloud-platform",
  111579. // "https://www.googleapis.com/auth/compute"
  111580. // ]
  111581. // }
  111582. }
  111583. // method id "compute.urlMaps.validate":
  111584. type UrlMapsValidateCall struct {
  111585. s *Service
  111586. project string
  111587. urlMap string
  111588. urlmapsvalidaterequest *UrlMapsValidateRequest
  111589. urlParams_ gensupport.URLParams
  111590. ctx_ context.Context
  111591. header_ http.Header
  111592. }
  111593. // Validate: Runs static validation for the UrlMap. In particular, the
  111594. // tests of the provided UrlMap will be run. Calling this method does
  111595. // NOT create the UrlMap.
  111596. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  111597. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  111598. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111599. c.project = project
  111600. c.urlMap = urlMap
  111601. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  111602. return c
  111603. }
  111604. // Fields allows partial responses to be retrieved. See
  111605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111606. // for more information.
  111607. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  111608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111609. return c
  111610. }
  111611. // Context sets the context to be used in this call's Do method. Any
  111612. // pending HTTP request will be aborted if the provided context is
  111613. // canceled.
  111614. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  111615. c.ctx_ = ctx
  111616. return c
  111617. }
  111618. // Header returns an http.Header that can be modified by the caller to
  111619. // add HTTP headers to the request.
  111620. func (c *UrlMapsValidateCall) Header() http.Header {
  111621. if c.header_ == nil {
  111622. c.header_ = make(http.Header)
  111623. }
  111624. return c.header_
  111625. }
  111626. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  111627. reqHeaders := make(http.Header)
  111628. for k, v := range c.header_ {
  111629. reqHeaders[k] = v
  111630. }
  111631. reqHeaders.Set("User-Agent", c.s.userAgent())
  111632. var body io.Reader = nil
  111633. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  111634. if err != nil {
  111635. return nil, err
  111636. }
  111637. reqHeaders.Set("Content-Type", "application/json")
  111638. c.urlParams_.Set("alt", alt)
  111639. c.urlParams_.Set("prettyPrint", "false")
  111640. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  111641. urls += "?" + c.urlParams_.Encode()
  111642. req, err := http.NewRequest("POST", urls, body)
  111643. if err != nil {
  111644. return nil, err
  111645. }
  111646. req.Header = reqHeaders
  111647. googleapi.Expand(req.URL, map[string]string{
  111648. "project": c.project,
  111649. "urlMap": c.urlMap,
  111650. })
  111651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111652. }
  111653. // Do executes the "compute.urlMaps.validate" call.
  111654. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  111655. // non-2xx status code is an error. Response headers are in either
  111656. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  111657. // returned at all) in error.(*googleapi.Error).Header. Use
  111658. // googleapi.IsNotModified to check whether the returned error was
  111659. // because http.StatusNotModified was returned.
  111660. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  111661. gensupport.SetOptions(c.urlParams_, opts...)
  111662. res, err := c.doRequest("json")
  111663. if res != nil && res.StatusCode == http.StatusNotModified {
  111664. if res.Body != nil {
  111665. res.Body.Close()
  111666. }
  111667. return nil, &googleapi.Error{
  111668. Code: res.StatusCode,
  111669. Header: res.Header,
  111670. }
  111671. }
  111672. if err != nil {
  111673. return nil, err
  111674. }
  111675. defer googleapi.CloseBody(res)
  111676. if err := googleapi.CheckResponse(res); err != nil {
  111677. return nil, err
  111678. }
  111679. ret := &UrlMapsValidateResponse{
  111680. ServerResponse: googleapi.ServerResponse{
  111681. Header: res.Header,
  111682. HTTPStatusCode: res.StatusCode,
  111683. },
  111684. }
  111685. target := &ret
  111686. if err := gensupport.DecodeResponse(target, res); err != nil {
  111687. return nil, err
  111688. }
  111689. return ret, nil
  111690. // {
  111691. // "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.",
  111692. // "httpMethod": "POST",
  111693. // "id": "compute.urlMaps.validate",
  111694. // "parameterOrder": [
  111695. // "project",
  111696. // "urlMap"
  111697. // ],
  111698. // "parameters": {
  111699. // "project": {
  111700. // "description": "Project ID for this request.",
  111701. // "location": "path",
  111702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111703. // "required": true,
  111704. // "type": "string"
  111705. // },
  111706. // "urlMap": {
  111707. // "description": "Name of the UrlMap resource to be validated as.",
  111708. // "location": "path",
  111709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111710. // "required": true,
  111711. // "type": "string"
  111712. // }
  111713. // },
  111714. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  111715. // "request": {
  111716. // "$ref": "UrlMapsValidateRequest"
  111717. // },
  111718. // "response": {
  111719. // "$ref": "UrlMapsValidateResponse"
  111720. // },
  111721. // "scopes": [
  111722. // "https://www.googleapis.com/auth/cloud-platform",
  111723. // "https://www.googleapis.com/auth/compute"
  111724. // ]
  111725. // }
  111726. }
  111727. // method id "compute.vpnTunnels.aggregatedList":
  111728. type VpnTunnelsAggregatedListCall struct {
  111729. s *Service
  111730. project string
  111731. urlParams_ gensupport.URLParams
  111732. ifNoneMatch_ string
  111733. ctx_ context.Context
  111734. header_ http.Header
  111735. }
  111736. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  111737. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  111738. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111739. c.project = project
  111740. return c
  111741. }
  111742. // Filter sets the optional parameter "filter": A filter expression that
  111743. // filters resources listed in the response. The expression must specify
  111744. // the field name, a comparison operator, and the value that you want to
  111745. // use for filtering. The value must be a string, a number, or a
  111746. // boolean. The comparison operator must be either =, !=, >, or <.
  111747. //
  111748. // For example, if you are filtering Compute Engine instances, you can
  111749. // exclude instances named example-instance by specifying name !=
  111750. // example-instance.
  111751. //
  111752. // You can also filter nested fields. For example, you could specify
  111753. // scheduling.automaticRestart = false to include instances only if they
  111754. // are not scheduled for automatic restarts. You can use filtering on
  111755. // nested fields to filter based on resource labels.
  111756. //
  111757. // To filter on multiple expressions, provide each separate expression
  111758. // within parentheses. For example, (scheduling.automaticRestart = true)
  111759. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111760. // AND expression. However, you can include AND and OR expressions
  111761. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111762. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111763. // true).
  111764. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  111765. c.urlParams_.Set("filter", filter)
  111766. return c
  111767. }
  111768. // MaxResults sets the optional parameter "maxResults": The maximum
  111769. // number of results per page that should be returned. If the number of
  111770. // available results is larger than maxResults, Compute Engine returns a
  111771. // nextPageToken that can be used to get the next page of results in
  111772. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111773. // (Default: 500)
  111774. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  111775. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111776. return c
  111777. }
  111778. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111779. // a certain order. By default, results are returned in alphanumerical
  111780. // order based on the resource name.
  111781. //
  111782. // You can also sort results in descending order based on the creation
  111783. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111784. // based on the creationTimestamp field in reverse chronological order
  111785. // (newest result first). Use this to sort resources like operations so
  111786. // that the newest operation is returned first.
  111787. //
  111788. // Currently, only sorting by name or creationTimestamp desc is
  111789. // supported.
  111790. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  111791. c.urlParams_.Set("orderBy", orderBy)
  111792. return c
  111793. }
  111794. // PageToken sets the optional parameter "pageToken": Specifies a page
  111795. // token to use. Set pageToken to the nextPageToken returned by a
  111796. // previous list request to get the next page of results.
  111797. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  111798. c.urlParams_.Set("pageToken", pageToken)
  111799. return c
  111800. }
  111801. // Fields allows partial responses to be retrieved. See
  111802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111803. // for more information.
  111804. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  111805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111806. return c
  111807. }
  111808. // IfNoneMatch sets the optional parameter which makes the operation
  111809. // fail if the object's ETag matches the given value. This is useful for
  111810. // getting updates only after the object has changed since the last
  111811. // request. Use googleapi.IsNotModified to check whether the response
  111812. // error from Do is the result of In-None-Match.
  111813. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  111814. c.ifNoneMatch_ = entityTag
  111815. return c
  111816. }
  111817. // Context sets the context to be used in this call's Do method. Any
  111818. // pending HTTP request will be aborted if the provided context is
  111819. // canceled.
  111820. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  111821. c.ctx_ = ctx
  111822. return c
  111823. }
  111824. // Header returns an http.Header that can be modified by the caller to
  111825. // add HTTP headers to the request.
  111826. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  111827. if c.header_ == nil {
  111828. c.header_ = make(http.Header)
  111829. }
  111830. return c.header_
  111831. }
  111832. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  111833. reqHeaders := make(http.Header)
  111834. for k, v := range c.header_ {
  111835. reqHeaders[k] = v
  111836. }
  111837. reqHeaders.Set("User-Agent", c.s.userAgent())
  111838. if c.ifNoneMatch_ != "" {
  111839. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111840. }
  111841. var body io.Reader = nil
  111842. c.urlParams_.Set("alt", alt)
  111843. c.urlParams_.Set("prettyPrint", "false")
  111844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  111845. urls += "?" + c.urlParams_.Encode()
  111846. req, err := http.NewRequest("GET", urls, body)
  111847. if err != nil {
  111848. return nil, err
  111849. }
  111850. req.Header = reqHeaders
  111851. googleapi.Expand(req.URL, map[string]string{
  111852. "project": c.project,
  111853. })
  111854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111855. }
  111856. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  111857. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  111858. // non-2xx status code is an error. Response headers are in either
  111859. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  111860. // returned at all) in error.(*googleapi.Error).Header. Use
  111861. // googleapi.IsNotModified to check whether the returned error was
  111862. // because http.StatusNotModified was returned.
  111863. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  111864. gensupport.SetOptions(c.urlParams_, opts...)
  111865. res, err := c.doRequest("json")
  111866. if res != nil && res.StatusCode == http.StatusNotModified {
  111867. if res.Body != nil {
  111868. res.Body.Close()
  111869. }
  111870. return nil, &googleapi.Error{
  111871. Code: res.StatusCode,
  111872. Header: res.Header,
  111873. }
  111874. }
  111875. if err != nil {
  111876. return nil, err
  111877. }
  111878. defer googleapi.CloseBody(res)
  111879. if err := googleapi.CheckResponse(res); err != nil {
  111880. return nil, err
  111881. }
  111882. ret := &VpnTunnelAggregatedList{
  111883. ServerResponse: googleapi.ServerResponse{
  111884. Header: res.Header,
  111885. HTTPStatusCode: res.StatusCode,
  111886. },
  111887. }
  111888. target := &ret
  111889. if err := gensupport.DecodeResponse(target, res); err != nil {
  111890. return nil, err
  111891. }
  111892. return ret, nil
  111893. // {
  111894. // "description": "Retrieves an aggregated list of VPN tunnels.",
  111895. // "httpMethod": "GET",
  111896. // "id": "compute.vpnTunnels.aggregatedList",
  111897. // "parameterOrder": [
  111898. // "project"
  111899. // ],
  111900. // "parameters": {
  111901. // "filter": {
  111902. // "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).",
  111903. // "location": "query",
  111904. // "type": "string"
  111905. // },
  111906. // "maxResults": {
  111907. // "default": "500",
  111908. // "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)",
  111909. // "format": "uint32",
  111910. // "location": "query",
  111911. // "minimum": "0",
  111912. // "type": "integer"
  111913. // },
  111914. // "orderBy": {
  111915. // "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.",
  111916. // "location": "query",
  111917. // "type": "string"
  111918. // },
  111919. // "pageToken": {
  111920. // "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.",
  111921. // "location": "query",
  111922. // "type": "string"
  111923. // },
  111924. // "project": {
  111925. // "description": "Project ID for this request.",
  111926. // "location": "path",
  111927. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111928. // "required": true,
  111929. // "type": "string"
  111930. // }
  111931. // },
  111932. // "path": "{project}/aggregated/vpnTunnels",
  111933. // "response": {
  111934. // "$ref": "VpnTunnelAggregatedList"
  111935. // },
  111936. // "scopes": [
  111937. // "https://www.googleapis.com/auth/cloud-platform",
  111938. // "https://www.googleapis.com/auth/compute",
  111939. // "https://www.googleapis.com/auth/compute.readonly"
  111940. // ]
  111941. // }
  111942. }
  111943. // Pages invokes f for each page of results.
  111944. // A non-nil error returned from f will halt the iteration.
  111945. // The provided context supersedes any context provided to the Context method.
  111946. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  111947. c.ctx_ = ctx
  111948. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111949. for {
  111950. x, err := c.Do()
  111951. if err != nil {
  111952. return err
  111953. }
  111954. if err := f(x); err != nil {
  111955. return err
  111956. }
  111957. if x.NextPageToken == "" {
  111958. return nil
  111959. }
  111960. c.PageToken(x.NextPageToken)
  111961. }
  111962. }
  111963. // method id "compute.vpnTunnels.delete":
  111964. type VpnTunnelsDeleteCall struct {
  111965. s *Service
  111966. project string
  111967. region string
  111968. vpnTunnel string
  111969. urlParams_ gensupport.URLParams
  111970. ctx_ context.Context
  111971. header_ http.Header
  111972. }
  111973. // Delete: Deletes the specified VpnTunnel resource.
  111974. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  111975. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111976. c.project = project
  111977. c.region = region
  111978. c.vpnTunnel = vpnTunnel
  111979. return c
  111980. }
  111981. // RequestId sets the optional parameter "requestId": An optional
  111982. // request ID to identify requests. Specify a unique request ID so that
  111983. // if you must retry your request, the server will know to ignore the
  111984. // request if it has already been completed.
  111985. //
  111986. // For example, consider a situation where you make an initial request
  111987. // and the request times out. If you make the request again with the
  111988. // same request ID, the server can check if original operation with the
  111989. // same request ID was received, and if so, will ignore the second
  111990. // request. This prevents clients from accidentally creating duplicate
  111991. // commitments.
  111992. //
  111993. // The request ID must be a valid UUID with the exception that zero UUID
  111994. // is not supported (00000000-0000-0000-0000-000000000000).
  111995. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  111996. c.urlParams_.Set("requestId", requestId)
  111997. return c
  111998. }
  111999. // Fields allows partial responses to be retrieved. See
  112000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112001. // for more information.
  112002. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  112003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112004. return c
  112005. }
  112006. // Context sets the context to be used in this call's Do method. Any
  112007. // pending HTTP request will be aborted if the provided context is
  112008. // canceled.
  112009. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  112010. c.ctx_ = ctx
  112011. return c
  112012. }
  112013. // Header returns an http.Header that can be modified by the caller to
  112014. // add HTTP headers to the request.
  112015. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  112016. if c.header_ == nil {
  112017. c.header_ = make(http.Header)
  112018. }
  112019. return c.header_
  112020. }
  112021. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  112022. reqHeaders := make(http.Header)
  112023. for k, v := range c.header_ {
  112024. reqHeaders[k] = v
  112025. }
  112026. reqHeaders.Set("User-Agent", c.s.userAgent())
  112027. var body io.Reader = nil
  112028. c.urlParams_.Set("alt", alt)
  112029. c.urlParams_.Set("prettyPrint", "false")
  112030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  112031. urls += "?" + c.urlParams_.Encode()
  112032. req, err := http.NewRequest("DELETE", urls, body)
  112033. if err != nil {
  112034. return nil, err
  112035. }
  112036. req.Header = reqHeaders
  112037. googleapi.Expand(req.URL, map[string]string{
  112038. "project": c.project,
  112039. "region": c.region,
  112040. "vpnTunnel": c.vpnTunnel,
  112041. })
  112042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112043. }
  112044. // Do executes the "compute.vpnTunnels.delete" call.
  112045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112046. // status code is an error. Response headers are in either
  112047. // *Operation.ServerResponse.Header or (if a response was returned at
  112048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112049. // to check whether the returned error was because
  112050. // http.StatusNotModified was returned.
  112051. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112052. gensupport.SetOptions(c.urlParams_, opts...)
  112053. res, err := c.doRequest("json")
  112054. if res != nil && res.StatusCode == http.StatusNotModified {
  112055. if res.Body != nil {
  112056. res.Body.Close()
  112057. }
  112058. return nil, &googleapi.Error{
  112059. Code: res.StatusCode,
  112060. Header: res.Header,
  112061. }
  112062. }
  112063. if err != nil {
  112064. return nil, err
  112065. }
  112066. defer googleapi.CloseBody(res)
  112067. if err := googleapi.CheckResponse(res); err != nil {
  112068. return nil, err
  112069. }
  112070. ret := &Operation{
  112071. ServerResponse: googleapi.ServerResponse{
  112072. Header: res.Header,
  112073. HTTPStatusCode: res.StatusCode,
  112074. },
  112075. }
  112076. target := &ret
  112077. if err := gensupport.DecodeResponse(target, res); err != nil {
  112078. return nil, err
  112079. }
  112080. return ret, nil
  112081. // {
  112082. // "description": "Deletes the specified VpnTunnel resource.",
  112083. // "httpMethod": "DELETE",
  112084. // "id": "compute.vpnTunnels.delete",
  112085. // "parameterOrder": [
  112086. // "project",
  112087. // "region",
  112088. // "vpnTunnel"
  112089. // ],
  112090. // "parameters": {
  112091. // "project": {
  112092. // "description": "Project ID for this request.",
  112093. // "location": "path",
  112094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112095. // "required": true,
  112096. // "type": "string"
  112097. // },
  112098. // "region": {
  112099. // "description": "Name of the region for this request.",
  112100. // "location": "path",
  112101. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112102. // "required": true,
  112103. // "type": "string"
  112104. // },
  112105. // "requestId": {
  112106. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112107. // "location": "query",
  112108. // "type": "string"
  112109. // },
  112110. // "vpnTunnel": {
  112111. // "description": "Name of the VpnTunnel resource to delete.",
  112112. // "location": "path",
  112113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112114. // "required": true,
  112115. // "type": "string"
  112116. // }
  112117. // },
  112118. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  112119. // "response": {
  112120. // "$ref": "Operation"
  112121. // },
  112122. // "scopes": [
  112123. // "https://www.googleapis.com/auth/cloud-platform",
  112124. // "https://www.googleapis.com/auth/compute"
  112125. // ]
  112126. // }
  112127. }
  112128. // method id "compute.vpnTunnels.get":
  112129. type VpnTunnelsGetCall struct {
  112130. s *Service
  112131. project string
  112132. region string
  112133. vpnTunnel string
  112134. urlParams_ gensupport.URLParams
  112135. ifNoneMatch_ string
  112136. ctx_ context.Context
  112137. header_ http.Header
  112138. }
  112139. // Get: Returns the specified VpnTunnel resource. Gets a list of
  112140. // available VPN tunnels by making a list() request.
  112141. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  112142. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112143. c.project = project
  112144. c.region = region
  112145. c.vpnTunnel = vpnTunnel
  112146. return c
  112147. }
  112148. // Fields allows partial responses to be retrieved. See
  112149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112150. // for more information.
  112151. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  112152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112153. return c
  112154. }
  112155. // IfNoneMatch sets the optional parameter which makes the operation
  112156. // fail if the object's ETag matches the given value. This is useful for
  112157. // getting updates only after the object has changed since the last
  112158. // request. Use googleapi.IsNotModified to check whether the response
  112159. // error from Do is the result of In-None-Match.
  112160. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  112161. c.ifNoneMatch_ = entityTag
  112162. return c
  112163. }
  112164. // Context sets the context to be used in this call's Do method. Any
  112165. // pending HTTP request will be aborted if the provided context is
  112166. // canceled.
  112167. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  112168. c.ctx_ = ctx
  112169. return c
  112170. }
  112171. // Header returns an http.Header that can be modified by the caller to
  112172. // add HTTP headers to the request.
  112173. func (c *VpnTunnelsGetCall) Header() http.Header {
  112174. if c.header_ == nil {
  112175. c.header_ = make(http.Header)
  112176. }
  112177. return c.header_
  112178. }
  112179. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  112180. reqHeaders := make(http.Header)
  112181. for k, v := range c.header_ {
  112182. reqHeaders[k] = v
  112183. }
  112184. reqHeaders.Set("User-Agent", c.s.userAgent())
  112185. if c.ifNoneMatch_ != "" {
  112186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112187. }
  112188. var body io.Reader = nil
  112189. c.urlParams_.Set("alt", alt)
  112190. c.urlParams_.Set("prettyPrint", "false")
  112191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  112192. urls += "?" + c.urlParams_.Encode()
  112193. req, err := http.NewRequest("GET", urls, body)
  112194. if err != nil {
  112195. return nil, err
  112196. }
  112197. req.Header = reqHeaders
  112198. googleapi.Expand(req.URL, map[string]string{
  112199. "project": c.project,
  112200. "region": c.region,
  112201. "vpnTunnel": c.vpnTunnel,
  112202. })
  112203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112204. }
  112205. // Do executes the "compute.vpnTunnels.get" call.
  112206. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  112207. // status code is an error. Response headers are in either
  112208. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  112209. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112210. // to check whether the returned error was because
  112211. // http.StatusNotModified was returned.
  112212. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  112213. gensupport.SetOptions(c.urlParams_, opts...)
  112214. res, err := c.doRequest("json")
  112215. if res != nil && res.StatusCode == http.StatusNotModified {
  112216. if res.Body != nil {
  112217. res.Body.Close()
  112218. }
  112219. return nil, &googleapi.Error{
  112220. Code: res.StatusCode,
  112221. Header: res.Header,
  112222. }
  112223. }
  112224. if err != nil {
  112225. return nil, err
  112226. }
  112227. defer googleapi.CloseBody(res)
  112228. if err := googleapi.CheckResponse(res); err != nil {
  112229. return nil, err
  112230. }
  112231. ret := &VpnTunnel{
  112232. ServerResponse: googleapi.ServerResponse{
  112233. Header: res.Header,
  112234. HTTPStatusCode: res.StatusCode,
  112235. },
  112236. }
  112237. target := &ret
  112238. if err := gensupport.DecodeResponse(target, res); err != nil {
  112239. return nil, err
  112240. }
  112241. return ret, nil
  112242. // {
  112243. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  112244. // "httpMethod": "GET",
  112245. // "id": "compute.vpnTunnels.get",
  112246. // "parameterOrder": [
  112247. // "project",
  112248. // "region",
  112249. // "vpnTunnel"
  112250. // ],
  112251. // "parameters": {
  112252. // "project": {
  112253. // "description": "Project ID for this request.",
  112254. // "location": "path",
  112255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112256. // "required": true,
  112257. // "type": "string"
  112258. // },
  112259. // "region": {
  112260. // "description": "Name of the region for this request.",
  112261. // "location": "path",
  112262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112263. // "required": true,
  112264. // "type": "string"
  112265. // },
  112266. // "vpnTunnel": {
  112267. // "description": "Name of the VpnTunnel resource to return.",
  112268. // "location": "path",
  112269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112270. // "required": true,
  112271. // "type": "string"
  112272. // }
  112273. // },
  112274. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  112275. // "response": {
  112276. // "$ref": "VpnTunnel"
  112277. // },
  112278. // "scopes": [
  112279. // "https://www.googleapis.com/auth/cloud-platform",
  112280. // "https://www.googleapis.com/auth/compute",
  112281. // "https://www.googleapis.com/auth/compute.readonly"
  112282. // ]
  112283. // }
  112284. }
  112285. // method id "compute.vpnTunnels.insert":
  112286. type VpnTunnelsInsertCall struct {
  112287. s *Service
  112288. project string
  112289. region string
  112290. vpntunnel *VpnTunnel
  112291. urlParams_ gensupport.URLParams
  112292. ctx_ context.Context
  112293. header_ http.Header
  112294. }
  112295. // Insert: Creates a VpnTunnel resource in the specified project and
  112296. // region using the data included in the request.
  112297. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  112298. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112299. c.project = project
  112300. c.region = region
  112301. c.vpntunnel = vpntunnel
  112302. return c
  112303. }
  112304. // RequestId sets the optional parameter "requestId": An optional
  112305. // request ID to identify requests. Specify a unique request ID so that
  112306. // if you must retry your request, the server will know to ignore the
  112307. // request if it has already been completed.
  112308. //
  112309. // For example, consider a situation where you make an initial request
  112310. // and the request times out. If you make the request again with the
  112311. // same request ID, the server can check if original operation with the
  112312. // same request ID was received, and if so, will ignore the second
  112313. // request. This prevents clients from accidentally creating duplicate
  112314. // commitments.
  112315. //
  112316. // The request ID must be a valid UUID with the exception that zero UUID
  112317. // is not supported (00000000-0000-0000-0000-000000000000).
  112318. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  112319. c.urlParams_.Set("requestId", requestId)
  112320. return c
  112321. }
  112322. // Fields allows partial responses to be retrieved. See
  112323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112324. // for more information.
  112325. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  112326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112327. return c
  112328. }
  112329. // Context sets the context to be used in this call's Do method. Any
  112330. // pending HTTP request will be aborted if the provided context is
  112331. // canceled.
  112332. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  112333. c.ctx_ = ctx
  112334. return c
  112335. }
  112336. // Header returns an http.Header that can be modified by the caller to
  112337. // add HTTP headers to the request.
  112338. func (c *VpnTunnelsInsertCall) Header() http.Header {
  112339. if c.header_ == nil {
  112340. c.header_ = make(http.Header)
  112341. }
  112342. return c.header_
  112343. }
  112344. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  112345. reqHeaders := make(http.Header)
  112346. for k, v := range c.header_ {
  112347. reqHeaders[k] = v
  112348. }
  112349. reqHeaders.Set("User-Agent", c.s.userAgent())
  112350. var body io.Reader = nil
  112351. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  112352. if err != nil {
  112353. return nil, err
  112354. }
  112355. reqHeaders.Set("Content-Type", "application/json")
  112356. c.urlParams_.Set("alt", alt)
  112357. c.urlParams_.Set("prettyPrint", "false")
  112358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  112359. urls += "?" + c.urlParams_.Encode()
  112360. req, err := http.NewRequest("POST", urls, body)
  112361. if err != nil {
  112362. return nil, err
  112363. }
  112364. req.Header = reqHeaders
  112365. googleapi.Expand(req.URL, map[string]string{
  112366. "project": c.project,
  112367. "region": c.region,
  112368. })
  112369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112370. }
  112371. // Do executes the "compute.vpnTunnels.insert" call.
  112372. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112373. // status code is an error. Response headers are in either
  112374. // *Operation.ServerResponse.Header or (if a response was returned at
  112375. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112376. // to check whether the returned error was because
  112377. // http.StatusNotModified was returned.
  112378. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112379. gensupport.SetOptions(c.urlParams_, opts...)
  112380. res, err := c.doRequest("json")
  112381. if res != nil && res.StatusCode == http.StatusNotModified {
  112382. if res.Body != nil {
  112383. res.Body.Close()
  112384. }
  112385. return nil, &googleapi.Error{
  112386. Code: res.StatusCode,
  112387. Header: res.Header,
  112388. }
  112389. }
  112390. if err != nil {
  112391. return nil, err
  112392. }
  112393. defer googleapi.CloseBody(res)
  112394. if err := googleapi.CheckResponse(res); err != nil {
  112395. return nil, err
  112396. }
  112397. ret := &Operation{
  112398. ServerResponse: googleapi.ServerResponse{
  112399. Header: res.Header,
  112400. HTTPStatusCode: res.StatusCode,
  112401. },
  112402. }
  112403. target := &ret
  112404. if err := gensupport.DecodeResponse(target, res); err != nil {
  112405. return nil, err
  112406. }
  112407. return ret, nil
  112408. // {
  112409. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  112410. // "httpMethod": "POST",
  112411. // "id": "compute.vpnTunnels.insert",
  112412. // "parameterOrder": [
  112413. // "project",
  112414. // "region"
  112415. // ],
  112416. // "parameters": {
  112417. // "project": {
  112418. // "description": "Project ID for this request.",
  112419. // "location": "path",
  112420. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112421. // "required": true,
  112422. // "type": "string"
  112423. // },
  112424. // "region": {
  112425. // "description": "Name of the region for this request.",
  112426. // "location": "path",
  112427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112428. // "required": true,
  112429. // "type": "string"
  112430. // },
  112431. // "requestId": {
  112432. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112433. // "location": "query",
  112434. // "type": "string"
  112435. // }
  112436. // },
  112437. // "path": "{project}/regions/{region}/vpnTunnels",
  112438. // "request": {
  112439. // "$ref": "VpnTunnel"
  112440. // },
  112441. // "response": {
  112442. // "$ref": "Operation"
  112443. // },
  112444. // "scopes": [
  112445. // "https://www.googleapis.com/auth/cloud-platform",
  112446. // "https://www.googleapis.com/auth/compute"
  112447. // ]
  112448. // }
  112449. }
  112450. // method id "compute.vpnTunnels.list":
  112451. type VpnTunnelsListCall struct {
  112452. s *Service
  112453. project string
  112454. region string
  112455. urlParams_ gensupport.URLParams
  112456. ifNoneMatch_ string
  112457. ctx_ context.Context
  112458. header_ http.Header
  112459. }
  112460. // List: Retrieves a list of VpnTunnel resources contained in the
  112461. // specified project and region.
  112462. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  112463. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112464. c.project = project
  112465. c.region = region
  112466. return c
  112467. }
  112468. // Filter sets the optional parameter "filter": A filter expression that
  112469. // filters resources listed in the response. The expression must specify
  112470. // the field name, a comparison operator, and the value that you want to
  112471. // use for filtering. The value must be a string, a number, or a
  112472. // boolean. The comparison operator must be either =, !=, >, or <.
  112473. //
  112474. // For example, if you are filtering Compute Engine instances, you can
  112475. // exclude instances named example-instance by specifying name !=
  112476. // example-instance.
  112477. //
  112478. // You can also filter nested fields. For example, you could specify
  112479. // scheduling.automaticRestart = false to include instances only if they
  112480. // are not scheduled for automatic restarts. You can use filtering on
  112481. // nested fields to filter based on resource labels.
  112482. //
  112483. // To filter on multiple expressions, provide each separate expression
  112484. // within parentheses. For example, (scheduling.automaticRestart = true)
  112485. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112486. // AND expression. However, you can include AND and OR expressions
  112487. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112488. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112489. // true).
  112490. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  112491. c.urlParams_.Set("filter", filter)
  112492. return c
  112493. }
  112494. // MaxResults sets the optional parameter "maxResults": The maximum
  112495. // number of results per page that should be returned. If the number of
  112496. // available results is larger than maxResults, Compute Engine returns a
  112497. // nextPageToken that can be used to get the next page of results in
  112498. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112499. // (Default: 500)
  112500. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  112501. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112502. return c
  112503. }
  112504. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112505. // a certain order. By default, results are returned in alphanumerical
  112506. // order based on the resource name.
  112507. //
  112508. // You can also sort results in descending order based on the creation
  112509. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112510. // based on the creationTimestamp field in reverse chronological order
  112511. // (newest result first). Use this to sort resources like operations so
  112512. // that the newest operation is returned first.
  112513. //
  112514. // Currently, only sorting by name or creationTimestamp desc is
  112515. // supported.
  112516. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  112517. c.urlParams_.Set("orderBy", orderBy)
  112518. return c
  112519. }
  112520. // PageToken sets the optional parameter "pageToken": Specifies a page
  112521. // token to use. Set pageToken to the nextPageToken returned by a
  112522. // previous list request to get the next page of results.
  112523. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  112524. c.urlParams_.Set("pageToken", pageToken)
  112525. return c
  112526. }
  112527. // Fields allows partial responses to be retrieved. See
  112528. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112529. // for more information.
  112530. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  112531. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112532. return c
  112533. }
  112534. // IfNoneMatch sets the optional parameter which makes the operation
  112535. // fail if the object's ETag matches the given value. This is useful for
  112536. // getting updates only after the object has changed since the last
  112537. // request. Use googleapi.IsNotModified to check whether the response
  112538. // error from Do is the result of In-None-Match.
  112539. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  112540. c.ifNoneMatch_ = entityTag
  112541. return c
  112542. }
  112543. // Context sets the context to be used in this call's Do method. Any
  112544. // pending HTTP request will be aborted if the provided context is
  112545. // canceled.
  112546. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  112547. c.ctx_ = ctx
  112548. return c
  112549. }
  112550. // Header returns an http.Header that can be modified by the caller to
  112551. // add HTTP headers to the request.
  112552. func (c *VpnTunnelsListCall) Header() http.Header {
  112553. if c.header_ == nil {
  112554. c.header_ = make(http.Header)
  112555. }
  112556. return c.header_
  112557. }
  112558. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  112559. reqHeaders := make(http.Header)
  112560. for k, v := range c.header_ {
  112561. reqHeaders[k] = v
  112562. }
  112563. reqHeaders.Set("User-Agent", c.s.userAgent())
  112564. if c.ifNoneMatch_ != "" {
  112565. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112566. }
  112567. var body io.Reader = nil
  112568. c.urlParams_.Set("alt", alt)
  112569. c.urlParams_.Set("prettyPrint", "false")
  112570. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  112571. urls += "?" + c.urlParams_.Encode()
  112572. req, err := http.NewRequest("GET", urls, body)
  112573. if err != nil {
  112574. return nil, err
  112575. }
  112576. req.Header = reqHeaders
  112577. googleapi.Expand(req.URL, map[string]string{
  112578. "project": c.project,
  112579. "region": c.region,
  112580. })
  112581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112582. }
  112583. // Do executes the "compute.vpnTunnels.list" call.
  112584. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  112585. // status code is an error. Response headers are in either
  112586. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  112587. // at all) in error.(*googleapi.Error).Header. Use
  112588. // googleapi.IsNotModified to check whether the returned error was
  112589. // because http.StatusNotModified was returned.
  112590. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  112591. gensupport.SetOptions(c.urlParams_, opts...)
  112592. res, err := c.doRequest("json")
  112593. if res != nil && res.StatusCode == http.StatusNotModified {
  112594. if res.Body != nil {
  112595. res.Body.Close()
  112596. }
  112597. return nil, &googleapi.Error{
  112598. Code: res.StatusCode,
  112599. Header: res.Header,
  112600. }
  112601. }
  112602. if err != nil {
  112603. return nil, err
  112604. }
  112605. defer googleapi.CloseBody(res)
  112606. if err := googleapi.CheckResponse(res); err != nil {
  112607. return nil, err
  112608. }
  112609. ret := &VpnTunnelList{
  112610. ServerResponse: googleapi.ServerResponse{
  112611. Header: res.Header,
  112612. HTTPStatusCode: res.StatusCode,
  112613. },
  112614. }
  112615. target := &ret
  112616. if err := gensupport.DecodeResponse(target, res); err != nil {
  112617. return nil, err
  112618. }
  112619. return ret, nil
  112620. // {
  112621. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  112622. // "httpMethod": "GET",
  112623. // "id": "compute.vpnTunnels.list",
  112624. // "parameterOrder": [
  112625. // "project",
  112626. // "region"
  112627. // ],
  112628. // "parameters": {
  112629. // "filter": {
  112630. // "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).",
  112631. // "location": "query",
  112632. // "type": "string"
  112633. // },
  112634. // "maxResults": {
  112635. // "default": "500",
  112636. // "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)",
  112637. // "format": "uint32",
  112638. // "location": "query",
  112639. // "minimum": "0",
  112640. // "type": "integer"
  112641. // },
  112642. // "orderBy": {
  112643. // "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.",
  112644. // "location": "query",
  112645. // "type": "string"
  112646. // },
  112647. // "pageToken": {
  112648. // "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.",
  112649. // "location": "query",
  112650. // "type": "string"
  112651. // },
  112652. // "project": {
  112653. // "description": "Project ID for this request.",
  112654. // "location": "path",
  112655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112656. // "required": true,
  112657. // "type": "string"
  112658. // },
  112659. // "region": {
  112660. // "description": "Name of the region for this request.",
  112661. // "location": "path",
  112662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112663. // "required": true,
  112664. // "type": "string"
  112665. // }
  112666. // },
  112667. // "path": "{project}/regions/{region}/vpnTunnels",
  112668. // "response": {
  112669. // "$ref": "VpnTunnelList"
  112670. // },
  112671. // "scopes": [
  112672. // "https://www.googleapis.com/auth/cloud-platform",
  112673. // "https://www.googleapis.com/auth/compute",
  112674. // "https://www.googleapis.com/auth/compute.readonly"
  112675. // ]
  112676. // }
  112677. }
  112678. // Pages invokes f for each page of results.
  112679. // A non-nil error returned from f will halt the iteration.
  112680. // The provided context supersedes any context provided to the Context method.
  112681. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  112682. c.ctx_ = ctx
  112683. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112684. for {
  112685. x, err := c.Do()
  112686. if err != nil {
  112687. return err
  112688. }
  112689. if err := f(x); err != nil {
  112690. return err
  112691. }
  112692. if x.NextPageToken == "" {
  112693. return nil
  112694. }
  112695. c.PageToken(x.NextPageToken)
  112696. }
  112697. }
  112698. // method id "compute.vpnTunnels.setLabels":
  112699. type VpnTunnelsSetLabelsCall struct {
  112700. s *Service
  112701. project string
  112702. region string
  112703. resource string
  112704. regionsetlabelsrequest *RegionSetLabelsRequest
  112705. urlParams_ gensupport.URLParams
  112706. ctx_ context.Context
  112707. header_ http.Header
  112708. }
  112709. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  112710. // labels, read the Labeling Resources documentation.
  112711. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  112712. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112713. c.project = project
  112714. c.region = region
  112715. c.resource = resource
  112716. c.regionsetlabelsrequest = regionsetlabelsrequest
  112717. return c
  112718. }
  112719. // RequestId sets the optional parameter "requestId": An optional
  112720. // request ID to identify requests. Specify a unique request ID so that
  112721. // if you must retry your request, the server will know to ignore the
  112722. // request if it has already been completed.
  112723. //
  112724. // For example, consider a situation where you make an initial request
  112725. // and the request times out. If you make the request again with the
  112726. // same request ID, the server can check if original operation with the
  112727. // same request ID was received, and if so, will ignore the second
  112728. // request. This prevents clients from accidentally creating duplicate
  112729. // commitments.
  112730. //
  112731. // The request ID must be a valid UUID with the exception that zero UUID
  112732. // is not supported (00000000-0000-0000-0000-000000000000).
  112733. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  112734. c.urlParams_.Set("requestId", requestId)
  112735. return c
  112736. }
  112737. // Fields allows partial responses to be retrieved. See
  112738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112739. // for more information.
  112740. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  112741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112742. return c
  112743. }
  112744. // Context sets the context to be used in this call's Do method. Any
  112745. // pending HTTP request will be aborted if the provided context is
  112746. // canceled.
  112747. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  112748. c.ctx_ = ctx
  112749. return c
  112750. }
  112751. // Header returns an http.Header that can be modified by the caller to
  112752. // add HTTP headers to the request.
  112753. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  112754. if c.header_ == nil {
  112755. c.header_ = make(http.Header)
  112756. }
  112757. return c.header_
  112758. }
  112759. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  112760. reqHeaders := make(http.Header)
  112761. for k, v := range c.header_ {
  112762. reqHeaders[k] = v
  112763. }
  112764. reqHeaders.Set("User-Agent", c.s.userAgent())
  112765. var body io.Reader = nil
  112766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  112767. if err != nil {
  112768. return nil, err
  112769. }
  112770. reqHeaders.Set("Content-Type", "application/json")
  112771. c.urlParams_.Set("alt", alt)
  112772. c.urlParams_.Set("prettyPrint", "false")
  112773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  112774. urls += "?" + c.urlParams_.Encode()
  112775. req, err := http.NewRequest("POST", urls, body)
  112776. if err != nil {
  112777. return nil, err
  112778. }
  112779. req.Header = reqHeaders
  112780. googleapi.Expand(req.URL, map[string]string{
  112781. "project": c.project,
  112782. "region": c.region,
  112783. "resource": c.resource,
  112784. })
  112785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112786. }
  112787. // Do executes the "compute.vpnTunnels.setLabels" call.
  112788. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112789. // status code is an error. Response headers are in either
  112790. // *Operation.ServerResponse.Header or (if a response was returned at
  112791. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112792. // to check whether the returned error was because
  112793. // http.StatusNotModified was returned.
  112794. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112795. gensupport.SetOptions(c.urlParams_, opts...)
  112796. res, err := c.doRequest("json")
  112797. if res != nil && res.StatusCode == http.StatusNotModified {
  112798. if res.Body != nil {
  112799. res.Body.Close()
  112800. }
  112801. return nil, &googleapi.Error{
  112802. Code: res.StatusCode,
  112803. Header: res.Header,
  112804. }
  112805. }
  112806. if err != nil {
  112807. return nil, err
  112808. }
  112809. defer googleapi.CloseBody(res)
  112810. if err := googleapi.CheckResponse(res); err != nil {
  112811. return nil, err
  112812. }
  112813. ret := &Operation{
  112814. ServerResponse: googleapi.ServerResponse{
  112815. Header: res.Header,
  112816. HTTPStatusCode: res.StatusCode,
  112817. },
  112818. }
  112819. target := &ret
  112820. if err := gensupport.DecodeResponse(target, res); err != nil {
  112821. return nil, err
  112822. }
  112823. return ret, nil
  112824. // {
  112825. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  112826. // "httpMethod": "POST",
  112827. // "id": "compute.vpnTunnels.setLabels",
  112828. // "parameterOrder": [
  112829. // "project",
  112830. // "region",
  112831. // "resource"
  112832. // ],
  112833. // "parameters": {
  112834. // "project": {
  112835. // "description": "Project ID for this request.",
  112836. // "location": "path",
  112837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112838. // "required": true,
  112839. // "type": "string"
  112840. // },
  112841. // "region": {
  112842. // "description": "The region for this request.",
  112843. // "location": "path",
  112844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112845. // "required": true,
  112846. // "type": "string"
  112847. // },
  112848. // "requestId": {
  112849. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112850. // "location": "query",
  112851. // "type": "string"
  112852. // },
  112853. // "resource": {
  112854. // "description": "Name or id of the resource for this request.",
  112855. // "location": "path",
  112856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112857. // "required": true,
  112858. // "type": "string"
  112859. // }
  112860. // },
  112861. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  112862. // "request": {
  112863. // "$ref": "RegionSetLabelsRequest"
  112864. // },
  112865. // "response": {
  112866. // "$ref": "Operation"
  112867. // },
  112868. // "scopes": [
  112869. // "https://www.googleapis.com/auth/cloud-platform",
  112870. // "https://www.googleapis.com/auth/compute"
  112871. // ]
  112872. // }
  112873. }
  112874. // method id "compute.vpnTunnels.testIamPermissions":
  112875. type VpnTunnelsTestIamPermissionsCall struct {
  112876. s *Service
  112877. project string
  112878. region string
  112879. resource string
  112880. testpermissionsrequest *TestPermissionsRequest
  112881. urlParams_ gensupport.URLParams
  112882. ctx_ context.Context
  112883. header_ http.Header
  112884. }
  112885. // TestIamPermissions: Returns permissions that a caller has on the
  112886. // specified resource.
  112887. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  112888. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112889. c.project = project
  112890. c.region = region
  112891. c.resource = resource
  112892. c.testpermissionsrequest = testpermissionsrequest
  112893. return c
  112894. }
  112895. // Fields allows partial responses to be retrieved. See
  112896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112897. // for more information.
  112898. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  112899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112900. return c
  112901. }
  112902. // Context sets the context to be used in this call's Do method. Any
  112903. // pending HTTP request will be aborted if the provided context is
  112904. // canceled.
  112905. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  112906. c.ctx_ = ctx
  112907. return c
  112908. }
  112909. // Header returns an http.Header that can be modified by the caller to
  112910. // add HTTP headers to the request.
  112911. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  112912. if c.header_ == nil {
  112913. c.header_ = make(http.Header)
  112914. }
  112915. return c.header_
  112916. }
  112917. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  112918. reqHeaders := make(http.Header)
  112919. for k, v := range c.header_ {
  112920. reqHeaders[k] = v
  112921. }
  112922. reqHeaders.Set("User-Agent", c.s.userAgent())
  112923. var body io.Reader = nil
  112924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  112925. if err != nil {
  112926. return nil, err
  112927. }
  112928. reqHeaders.Set("Content-Type", "application/json")
  112929. c.urlParams_.Set("alt", alt)
  112930. c.urlParams_.Set("prettyPrint", "false")
  112931. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  112932. urls += "?" + c.urlParams_.Encode()
  112933. req, err := http.NewRequest("POST", urls, body)
  112934. if err != nil {
  112935. return nil, err
  112936. }
  112937. req.Header = reqHeaders
  112938. googleapi.Expand(req.URL, map[string]string{
  112939. "project": c.project,
  112940. "region": c.region,
  112941. "resource": c.resource,
  112942. })
  112943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112944. }
  112945. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  112946. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  112947. // non-2xx status code is an error. Response headers are in either
  112948. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  112949. // returned at all) in error.(*googleapi.Error).Header. Use
  112950. // googleapi.IsNotModified to check whether the returned error was
  112951. // because http.StatusNotModified was returned.
  112952. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  112953. gensupport.SetOptions(c.urlParams_, opts...)
  112954. res, err := c.doRequest("json")
  112955. if res != nil && res.StatusCode == http.StatusNotModified {
  112956. if res.Body != nil {
  112957. res.Body.Close()
  112958. }
  112959. return nil, &googleapi.Error{
  112960. Code: res.StatusCode,
  112961. Header: res.Header,
  112962. }
  112963. }
  112964. if err != nil {
  112965. return nil, err
  112966. }
  112967. defer googleapi.CloseBody(res)
  112968. if err := googleapi.CheckResponse(res); err != nil {
  112969. return nil, err
  112970. }
  112971. ret := &TestPermissionsResponse{
  112972. ServerResponse: googleapi.ServerResponse{
  112973. Header: res.Header,
  112974. HTTPStatusCode: res.StatusCode,
  112975. },
  112976. }
  112977. target := &ret
  112978. if err := gensupport.DecodeResponse(target, res); err != nil {
  112979. return nil, err
  112980. }
  112981. return ret, nil
  112982. // {
  112983. // "description": "Returns permissions that a caller has on the specified resource.",
  112984. // "httpMethod": "POST",
  112985. // "id": "compute.vpnTunnels.testIamPermissions",
  112986. // "parameterOrder": [
  112987. // "project",
  112988. // "region",
  112989. // "resource"
  112990. // ],
  112991. // "parameters": {
  112992. // "project": {
  112993. // "description": "Project ID for this request.",
  112994. // "location": "path",
  112995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112996. // "required": true,
  112997. // "type": "string"
  112998. // },
  112999. // "region": {
  113000. // "description": "The name of the region for this request.",
  113001. // "location": "path",
  113002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113003. // "required": true,
  113004. // "type": "string"
  113005. // },
  113006. // "resource": {
  113007. // "description": "Name or id of the resource for this request.",
  113008. // "location": "path",
  113009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113010. // "required": true,
  113011. // "type": "string"
  113012. // }
  113013. // },
  113014. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  113015. // "request": {
  113016. // "$ref": "TestPermissionsRequest"
  113017. // },
  113018. // "response": {
  113019. // "$ref": "TestPermissionsResponse"
  113020. // },
  113021. // "scopes": [
  113022. // "https://www.googleapis.com/auth/cloud-platform",
  113023. // "https://www.googleapis.com/auth/compute",
  113024. // "https://www.googleapis.com/auth/compute.readonly"
  113025. // ]
  113026. // }
  113027. }
  113028. // method id "compute.zoneOperations.delete":
  113029. type ZoneOperationsDeleteCall struct {
  113030. s *Service
  113031. project string
  113032. zone string
  113033. operation string
  113034. urlParams_ gensupport.URLParams
  113035. ctx_ context.Context
  113036. header_ http.Header
  113037. }
  113038. // Delete: Deletes the specified zone-specific Operations resource.
  113039. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  113040. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  113041. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113042. c.project = project
  113043. c.zone = zone
  113044. c.operation = operation
  113045. return c
  113046. }
  113047. // Fields allows partial responses to be retrieved. See
  113048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113049. // for more information.
  113050. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  113051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113052. return c
  113053. }
  113054. // Context sets the context to be used in this call's Do method. Any
  113055. // pending HTTP request will be aborted if the provided context is
  113056. // canceled.
  113057. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  113058. c.ctx_ = ctx
  113059. return c
  113060. }
  113061. // Header returns an http.Header that can be modified by the caller to
  113062. // add HTTP headers to the request.
  113063. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  113064. if c.header_ == nil {
  113065. c.header_ = make(http.Header)
  113066. }
  113067. return c.header_
  113068. }
  113069. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  113070. reqHeaders := make(http.Header)
  113071. for k, v := range c.header_ {
  113072. reqHeaders[k] = v
  113073. }
  113074. reqHeaders.Set("User-Agent", c.s.userAgent())
  113075. var body io.Reader = nil
  113076. c.urlParams_.Set("alt", alt)
  113077. c.urlParams_.Set("prettyPrint", "false")
  113078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  113079. urls += "?" + c.urlParams_.Encode()
  113080. req, err := http.NewRequest("DELETE", urls, body)
  113081. if err != nil {
  113082. return nil, err
  113083. }
  113084. req.Header = reqHeaders
  113085. googleapi.Expand(req.URL, map[string]string{
  113086. "project": c.project,
  113087. "zone": c.zone,
  113088. "operation": c.operation,
  113089. })
  113090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113091. }
  113092. // Do executes the "compute.zoneOperations.delete" call.
  113093. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  113094. gensupport.SetOptions(c.urlParams_, opts...)
  113095. res, err := c.doRequest("json")
  113096. if err != nil {
  113097. return err
  113098. }
  113099. defer googleapi.CloseBody(res)
  113100. if err := googleapi.CheckResponse(res); err != nil {
  113101. return err
  113102. }
  113103. return nil
  113104. // {
  113105. // "description": "Deletes the specified zone-specific Operations resource.",
  113106. // "httpMethod": "DELETE",
  113107. // "id": "compute.zoneOperations.delete",
  113108. // "parameterOrder": [
  113109. // "project",
  113110. // "zone",
  113111. // "operation"
  113112. // ],
  113113. // "parameters": {
  113114. // "operation": {
  113115. // "description": "Name of the Operations resource to delete.",
  113116. // "location": "path",
  113117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113118. // "required": true,
  113119. // "type": "string"
  113120. // },
  113121. // "project": {
  113122. // "description": "Project ID for this request.",
  113123. // "location": "path",
  113124. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113125. // "required": true,
  113126. // "type": "string"
  113127. // },
  113128. // "zone": {
  113129. // "description": "Name of the zone for this request.",
  113130. // "location": "path",
  113131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113132. // "required": true,
  113133. // "type": "string"
  113134. // }
  113135. // },
  113136. // "path": "{project}/zones/{zone}/operations/{operation}",
  113137. // "scopes": [
  113138. // "https://www.googleapis.com/auth/cloud-platform",
  113139. // "https://www.googleapis.com/auth/compute"
  113140. // ]
  113141. // }
  113142. }
  113143. // method id "compute.zoneOperations.get":
  113144. type ZoneOperationsGetCall struct {
  113145. s *Service
  113146. project string
  113147. zone string
  113148. operation string
  113149. urlParams_ gensupport.URLParams
  113150. ifNoneMatch_ string
  113151. ctx_ context.Context
  113152. header_ http.Header
  113153. }
  113154. // Get: Retrieves the specified zone-specific Operations resource.
  113155. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  113156. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  113157. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113158. c.project = project
  113159. c.zone = zone
  113160. c.operation = operation
  113161. return c
  113162. }
  113163. // Fields allows partial responses to be retrieved. See
  113164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113165. // for more information.
  113166. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  113167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113168. return c
  113169. }
  113170. // IfNoneMatch sets the optional parameter which makes the operation
  113171. // fail if the object's ETag matches the given value. This is useful for
  113172. // getting updates only after the object has changed since the last
  113173. // request. Use googleapi.IsNotModified to check whether the response
  113174. // error from Do is the result of In-None-Match.
  113175. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  113176. c.ifNoneMatch_ = entityTag
  113177. return c
  113178. }
  113179. // Context sets the context to be used in this call's Do method. Any
  113180. // pending HTTP request will be aborted if the provided context is
  113181. // canceled.
  113182. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  113183. c.ctx_ = ctx
  113184. return c
  113185. }
  113186. // Header returns an http.Header that can be modified by the caller to
  113187. // add HTTP headers to the request.
  113188. func (c *ZoneOperationsGetCall) Header() http.Header {
  113189. if c.header_ == nil {
  113190. c.header_ = make(http.Header)
  113191. }
  113192. return c.header_
  113193. }
  113194. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  113195. reqHeaders := make(http.Header)
  113196. for k, v := range c.header_ {
  113197. reqHeaders[k] = v
  113198. }
  113199. reqHeaders.Set("User-Agent", c.s.userAgent())
  113200. if c.ifNoneMatch_ != "" {
  113201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113202. }
  113203. var body io.Reader = nil
  113204. c.urlParams_.Set("alt", alt)
  113205. c.urlParams_.Set("prettyPrint", "false")
  113206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  113207. urls += "?" + c.urlParams_.Encode()
  113208. req, err := http.NewRequest("GET", urls, body)
  113209. if err != nil {
  113210. return nil, err
  113211. }
  113212. req.Header = reqHeaders
  113213. googleapi.Expand(req.URL, map[string]string{
  113214. "project": c.project,
  113215. "zone": c.zone,
  113216. "operation": c.operation,
  113217. })
  113218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113219. }
  113220. // Do executes the "compute.zoneOperations.get" call.
  113221. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113222. // status code is an error. Response headers are in either
  113223. // *Operation.ServerResponse.Header or (if a response was returned at
  113224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113225. // to check whether the returned error was because
  113226. // http.StatusNotModified was returned.
  113227. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113228. gensupport.SetOptions(c.urlParams_, opts...)
  113229. res, err := c.doRequest("json")
  113230. if res != nil && res.StatusCode == http.StatusNotModified {
  113231. if res.Body != nil {
  113232. res.Body.Close()
  113233. }
  113234. return nil, &googleapi.Error{
  113235. Code: res.StatusCode,
  113236. Header: res.Header,
  113237. }
  113238. }
  113239. if err != nil {
  113240. return nil, err
  113241. }
  113242. defer googleapi.CloseBody(res)
  113243. if err := googleapi.CheckResponse(res); err != nil {
  113244. return nil, err
  113245. }
  113246. ret := &Operation{
  113247. ServerResponse: googleapi.ServerResponse{
  113248. Header: res.Header,
  113249. HTTPStatusCode: res.StatusCode,
  113250. },
  113251. }
  113252. target := &ret
  113253. if err := gensupport.DecodeResponse(target, res); err != nil {
  113254. return nil, err
  113255. }
  113256. return ret, nil
  113257. // {
  113258. // "description": "Retrieves the specified zone-specific Operations resource.",
  113259. // "httpMethod": "GET",
  113260. // "id": "compute.zoneOperations.get",
  113261. // "parameterOrder": [
  113262. // "project",
  113263. // "zone",
  113264. // "operation"
  113265. // ],
  113266. // "parameters": {
  113267. // "operation": {
  113268. // "description": "Name of the Operations resource to return.",
  113269. // "location": "path",
  113270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113271. // "required": true,
  113272. // "type": "string"
  113273. // },
  113274. // "project": {
  113275. // "description": "Project ID for this request.",
  113276. // "location": "path",
  113277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113278. // "required": true,
  113279. // "type": "string"
  113280. // },
  113281. // "zone": {
  113282. // "description": "Name of the zone for this request.",
  113283. // "location": "path",
  113284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113285. // "required": true,
  113286. // "type": "string"
  113287. // }
  113288. // },
  113289. // "path": "{project}/zones/{zone}/operations/{operation}",
  113290. // "response": {
  113291. // "$ref": "Operation"
  113292. // },
  113293. // "scopes": [
  113294. // "https://www.googleapis.com/auth/cloud-platform",
  113295. // "https://www.googleapis.com/auth/compute",
  113296. // "https://www.googleapis.com/auth/compute.readonly"
  113297. // ]
  113298. // }
  113299. }
  113300. // method id "compute.zoneOperations.list":
  113301. type ZoneOperationsListCall struct {
  113302. s *Service
  113303. project string
  113304. zone string
  113305. urlParams_ gensupport.URLParams
  113306. ifNoneMatch_ string
  113307. ctx_ context.Context
  113308. header_ http.Header
  113309. }
  113310. // List: Retrieves a list of Operation resources contained within the
  113311. // specified zone.
  113312. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  113313. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  113314. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113315. c.project = project
  113316. c.zone = zone
  113317. return c
  113318. }
  113319. // Filter sets the optional parameter "filter": A filter expression that
  113320. // filters resources listed in the response. The expression must specify
  113321. // the field name, a comparison operator, and the value that you want to
  113322. // use for filtering. The value must be a string, a number, or a
  113323. // boolean. The comparison operator must be either =, !=, >, or <.
  113324. //
  113325. // For example, if you are filtering Compute Engine instances, you can
  113326. // exclude instances named example-instance by specifying name !=
  113327. // example-instance.
  113328. //
  113329. // You can also filter nested fields. For example, you could specify
  113330. // scheduling.automaticRestart = false to include instances only if they
  113331. // are not scheduled for automatic restarts. You can use filtering on
  113332. // nested fields to filter based on resource labels.
  113333. //
  113334. // To filter on multiple expressions, provide each separate expression
  113335. // within parentheses. For example, (scheduling.automaticRestart = true)
  113336. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113337. // AND expression. However, you can include AND and OR expressions
  113338. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113339. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113340. // true).
  113341. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  113342. c.urlParams_.Set("filter", filter)
  113343. return c
  113344. }
  113345. // MaxResults sets the optional parameter "maxResults": The maximum
  113346. // number of results per page that should be returned. If the number of
  113347. // available results is larger than maxResults, Compute Engine returns a
  113348. // nextPageToken that can be used to get the next page of results in
  113349. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113350. // (Default: 500)
  113351. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  113352. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113353. return c
  113354. }
  113355. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113356. // a certain order. By default, results are returned in alphanumerical
  113357. // order based on the resource name.
  113358. //
  113359. // You can also sort results in descending order based on the creation
  113360. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113361. // based on the creationTimestamp field in reverse chronological order
  113362. // (newest result first). Use this to sort resources like operations so
  113363. // that the newest operation is returned first.
  113364. //
  113365. // Currently, only sorting by name or creationTimestamp desc is
  113366. // supported.
  113367. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  113368. c.urlParams_.Set("orderBy", orderBy)
  113369. return c
  113370. }
  113371. // PageToken sets the optional parameter "pageToken": Specifies a page
  113372. // token to use. Set pageToken to the nextPageToken returned by a
  113373. // previous list request to get the next page of results.
  113374. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  113375. c.urlParams_.Set("pageToken", pageToken)
  113376. return c
  113377. }
  113378. // Fields allows partial responses to be retrieved. See
  113379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113380. // for more information.
  113381. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  113382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113383. return c
  113384. }
  113385. // IfNoneMatch sets the optional parameter which makes the operation
  113386. // fail if the object's ETag matches the given value. This is useful for
  113387. // getting updates only after the object has changed since the last
  113388. // request. Use googleapi.IsNotModified to check whether the response
  113389. // error from Do is the result of In-None-Match.
  113390. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  113391. c.ifNoneMatch_ = entityTag
  113392. return c
  113393. }
  113394. // Context sets the context to be used in this call's Do method. Any
  113395. // pending HTTP request will be aborted if the provided context is
  113396. // canceled.
  113397. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  113398. c.ctx_ = ctx
  113399. return c
  113400. }
  113401. // Header returns an http.Header that can be modified by the caller to
  113402. // add HTTP headers to the request.
  113403. func (c *ZoneOperationsListCall) Header() http.Header {
  113404. if c.header_ == nil {
  113405. c.header_ = make(http.Header)
  113406. }
  113407. return c.header_
  113408. }
  113409. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  113410. reqHeaders := make(http.Header)
  113411. for k, v := range c.header_ {
  113412. reqHeaders[k] = v
  113413. }
  113414. reqHeaders.Set("User-Agent", c.s.userAgent())
  113415. if c.ifNoneMatch_ != "" {
  113416. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113417. }
  113418. var body io.Reader = nil
  113419. c.urlParams_.Set("alt", alt)
  113420. c.urlParams_.Set("prettyPrint", "false")
  113421. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  113422. urls += "?" + c.urlParams_.Encode()
  113423. req, err := http.NewRequest("GET", urls, body)
  113424. if err != nil {
  113425. return nil, err
  113426. }
  113427. req.Header = reqHeaders
  113428. googleapi.Expand(req.URL, map[string]string{
  113429. "project": c.project,
  113430. "zone": c.zone,
  113431. })
  113432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113433. }
  113434. // Do executes the "compute.zoneOperations.list" call.
  113435. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  113436. // status code is an error. Response headers are in either
  113437. // *OperationList.ServerResponse.Header or (if a response was returned
  113438. // at all) in error.(*googleapi.Error).Header. Use
  113439. // googleapi.IsNotModified to check whether the returned error was
  113440. // because http.StatusNotModified was returned.
  113441. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  113442. gensupport.SetOptions(c.urlParams_, opts...)
  113443. res, err := c.doRequest("json")
  113444. if res != nil && res.StatusCode == http.StatusNotModified {
  113445. if res.Body != nil {
  113446. res.Body.Close()
  113447. }
  113448. return nil, &googleapi.Error{
  113449. Code: res.StatusCode,
  113450. Header: res.Header,
  113451. }
  113452. }
  113453. if err != nil {
  113454. return nil, err
  113455. }
  113456. defer googleapi.CloseBody(res)
  113457. if err := googleapi.CheckResponse(res); err != nil {
  113458. return nil, err
  113459. }
  113460. ret := &OperationList{
  113461. ServerResponse: googleapi.ServerResponse{
  113462. Header: res.Header,
  113463. HTTPStatusCode: res.StatusCode,
  113464. },
  113465. }
  113466. target := &ret
  113467. if err := gensupport.DecodeResponse(target, res); err != nil {
  113468. return nil, err
  113469. }
  113470. return ret, nil
  113471. // {
  113472. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  113473. // "httpMethod": "GET",
  113474. // "id": "compute.zoneOperations.list",
  113475. // "parameterOrder": [
  113476. // "project",
  113477. // "zone"
  113478. // ],
  113479. // "parameters": {
  113480. // "filter": {
  113481. // "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).",
  113482. // "location": "query",
  113483. // "type": "string"
  113484. // },
  113485. // "maxResults": {
  113486. // "default": "500",
  113487. // "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)",
  113488. // "format": "uint32",
  113489. // "location": "query",
  113490. // "minimum": "0",
  113491. // "type": "integer"
  113492. // },
  113493. // "orderBy": {
  113494. // "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.",
  113495. // "location": "query",
  113496. // "type": "string"
  113497. // },
  113498. // "pageToken": {
  113499. // "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.",
  113500. // "location": "query",
  113501. // "type": "string"
  113502. // },
  113503. // "project": {
  113504. // "description": "Project ID for this request.",
  113505. // "location": "path",
  113506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113507. // "required": true,
  113508. // "type": "string"
  113509. // },
  113510. // "zone": {
  113511. // "description": "Name of the zone for request.",
  113512. // "location": "path",
  113513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113514. // "required": true,
  113515. // "type": "string"
  113516. // }
  113517. // },
  113518. // "path": "{project}/zones/{zone}/operations",
  113519. // "response": {
  113520. // "$ref": "OperationList"
  113521. // },
  113522. // "scopes": [
  113523. // "https://www.googleapis.com/auth/cloud-platform",
  113524. // "https://www.googleapis.com/auth/compute",
  113525. // "https://www.googleapis.com/auth/compute.readonly"
  113526. // ]
  113527. // }
  113528. }
  113529. // Pages invokes f for each page of results.
  113530. // A non-nil error returned from f will halt the iteration.
  113531. // The provided context supersedes any context provided to the Context method.
  113532. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  113533. c.ctx_ = ctx
  113534. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113535. for {
  113536. x, err := c.Do()
  113537. if err != nil {
  113538. return err
  113539. }
  113540. if err := f(x); err != nil {
  113541. return err
  113542. }
  113543. if x.NextPageToken == "" {
  113544. return nil
  113545. }
  113546. c.PageToken(x.NextPageToken)
  113547. }
  113548. }
  113549. // method id "compute.zones.get":
  113550. type ZonesGetCall struct {
  113551. s *Service
  113552. project string
  113553. zone string
  113554. urlParams_ gensupport.URLParams
  113555. ifNoneMatch_ string
  113556. ctx_ context.Context
  113557. header_ http.Header
  113558. }
  113559. // Get: Returns the specified Zone resource. Gets a list of available
  113560. // zones by making a list() request.
  113561. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  113562. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  113563. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113564. c.project = project
  113565. c.zone = zone
  113566. return c
  113567. }
  113568. // Fields allows partial responses to be retrieved. See
  113569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113570. // for more information.
  113571. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  113572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113573. return c
  113574. }
  113575. // IfNoneMatch sets the optional parameter which makes the operation
  113576. // fail if the object's ETag matches the given value. This is useful for
  113577. // getting updates only after the object has changed since the last
  113578. // request. Use googleapi.IsNotModified to check whether the response
  113579. // error from Do is the result of In-None-Match.
  113580. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  113581. c.ifNoneMatch_ = entityTag
  113582. return c
  113583. }
  113584. // Context sets the context to be used in this call's Do method. Any
  113585. // pending HTTP request will be aborted if the provided context is
  113586. // canceled.
  113587. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  113588. c.ctx_ = ctx
  113589. return c
  113590. }
  113591. // Header returns an http.Header that can be modified by the caller to
  113592. // add HTTP headers to the request.
  113593. func (c *ZonesGetCall) Header() http.Header {
  113594. if c.header_ == nil {
  113595. c.header_ = make(http.Header)
  113596. }
  113597. return c.header_
  113598. }
  113599. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  113600. reqHeaders := make(http.Header)
  113601. for k, v := range c.header_ {
  113602. reqHeaders[k] = v
  113603. }
  113604. reqHeaders.Set("User-Agent", c.s.userAgent())
  113605. if c.ifNoneMatch_ != "" {
  113606. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113607. }
  113608. var body io.Reader = nil
  113609. c.urlParams_.Set("alt", alt)
  113610. c.urlParams_.Set("prettyPrint", "false")
  113611. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  113612. urls += "?" + c.urlParams_.Encode()
  113613. req, err := http.NewRequest("GET", urls, body)
  113614. if err != nil {
  113615. return nil, err
  113616. }
  113617. req.Header = reqHeaders
  113618. googleapi.Expand(req.URL, map[string]string{
  113619. "project": c.project,
  113620. "zone": c.zone,
  113621. })
  113622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113623. }
  113624. // Do executes the "compute.zones.get" call.
  113625. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  113626. // code is an error. Response headers are in either
  113627. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  113628. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  113629. // whether the returned error was because http.StatusNotModified was
  113630. // returned.
  113631. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  113632. gensupport.SetOptions(c.urlParams_, opts...)
  113633. res, err := c.doRequest("json")
  113634. if res != nil && res.StatusCode == http.StatusNotModified {
  113635. if res.Body != nil {
  113636. res.Body.Close()
  113637. }
  113638. return nil, &googleapi.Error{
  113639. Code: res.StatusCode,
  113640. Header: res.Header,
  113641. }
  113642. }
  113643. if err != nil {
  113644. return nil, err
  113645. }
  113646. defer googleapi.CloseBody(res)
  113647. if err := googleapi.CheckResponse(res); err != nil {
  113648. return nil, err
  113649. }
  113650. ret := &Zone{
  113651. ServerResponse: googleapi.ServerResponse{
  113652. Header: res.Header,
  113653. HTTPStatusCode: res.StatusCode,
  113654. },
  113655. }
  113656. target := &ret
  113657. if err := gensupport.DecodeResponse(target, res); err != nil {
  113658. return nil, err
  113659. }
  113660. return ret, nil
  113661. // {
  113662. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  113663. // "httpMethod": "GET",
  113664. // "id": "compute.zones.get",
  113665. // "parameterOrder": [
  113666. // "project",
  113667. // "zone"
  113668. // ],
  113669. // "parameters": {
  113670. // "project": {
  113671. // "description": "Project ID for this request.",
  113672. // "location": "path",
  113673. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113674. // "required": true,
  113675. // "type": "string"
  113676. // },
  113677. // "zone": {
  113678. // "description": "Name of the zone resource to return.",
  113679. // "location": "path",
  113680. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113681. // "required": true,
  113682. // "type": "string"
  113683. // }
  113684. // },
  113685. // "path": "{project}/zones/{zone}",
  113686. // "response": {
  113687. // "$ref": "Zone"
  113688. // },
  113689. // "scopes": [
  113690. // "https://www.googleapis.com/auth/cloud-platform",
  113691. // "https://www.googleapis.com/auth/compute",
  113692. // "https://www.googleapis.com/auth/compute.readonly"
  113693. // ]
  113694. // }
  113695. }
  113696. // method id "compute.zones.list":
  113697. type ZonesListCall struct {
  113698. s *Service
  113699. project string
  113700. urlParams_ gensupport.URLParams
  113701. ifNoneMatch_ string
  113702. ctx_ context.Context
  113703. header_ http.Header
  113704. }
  113705. // List: Retrieves the list of Zone resources available to the specified
  113706. // project.
  113707. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  113708. func (r *ZonesService) List(project string) *ZonesListCall {
  113709. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113710. c.project = project
  113711. return c
  113712. }
  113713. // Filter sets the optional parameter "filter": A filter expression that
  113714. // filters resources listed in the response. The expression must specify
  113715. // the field name, a comparison operator, and the value that you want to
  113716. // use for filtering. The value must be a string, a number, or a
  113717. // boolean. The comparison operator must be either =, !=, >, or <.
  113718. //
  113719. // For example, if you are filtering Compute Engine instances, you can
  113720. // exclude instances named example-instance by specifying name !=
  113721. // example-instance.
  113722. //
  113723. // You can also filter nested fields. For example, you could specify
  113724. // scheduling.automaticRestart = false to include instances only if they
  113725. // are not scheduled for automatic restarts. You can use filtering on
  113726. // nested fields to filter based on resource labels.
  113727. //
  113728. // To filter on multiple expressions, provide each separate expression
  113729. // within parentheses. For example, (scheduling.automaticRestart = true)
  113730. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113731. // AND expression. However, you can include AND and OR expressions
  113732. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113733. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113734. // true).
  113735. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  113736. c.urlParams_.Set("filter", filter)
  113737. return c
  113738. }
  113739. // MaxResults sets the optional parameter "maxResults": The maximum
  113740. // number of results per page that should be returned. If the number of
  113741. // available results is larger than maxResults, Compute Engine returns a
  113742. // nextPageToken that can be used to get the next page of results in
  113743. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113744. // (Default: 500)
  113745. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  113746. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113747. return c
  113748. }
  113749. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113750. // a certain order. By default, results are returned in alphanumerical
  113751. // order based on the resource name.
  113752. //
  113753. // You can also sort results in descending order based on the creation
  113754. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113755. // based on the creationTimestamp field in reverse chronological order
  113756. // (newest result first). Use this to sort resources like operations so
  113757. // that the newest operation is returned first.
  113758. //
  113759. // Currently, only sorting by name or creationTimestamp desc is
  113760. // supported.
  113761. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  113762. c.urlParams_.Set("orderBy", orderBy)
  113763. return c
  113764. }
  113765. // PageToken sets the optional parameter "pageToken": Specifies a page
  113766. // token to use. Set pageToken to the nextPageToken returned by a
  113767. // previous list request to get the next page of results.
  113768. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  113769. c.urlParams_.Set("pageToken", pageToken)
  113770. return c
  113771. }
  113772. // Fields allows partial responses to be retrieved. See
  113773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113774. // for more information.
  113775. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  113776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113777. return c
  113778. }
  113779. // IfNoneMatch sets the optional parameter which makes the operation
  113780. // fail if the object's ETag matches the given value. This is useful for
  113781. // getting updates only after the object has changed since the last
  113782. // request. Use googleapi.IsNotModified to check whether the response
  113783. // error from Do is the result of In-None-Match.
  113784. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  113785. c.ifNoneMatch_ = entityTag
  113786. return c
  113787. }
  113788. // Context sets the context to be used in this call's Do method. Any
  113789. // pending HTTP request will be aborted if the provided context is
  113790. // canceled.
  113791. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  113792. c.ctx_ = ctx
  113793. return c
  113794. }
  113795. // Header returns an http.Header that can be modified by the caller to
  113796. // add HTTP headers to the request.
  113797. func (c *ZonesListCall) Header() http.Header {
  113798. if c.header_ == nil {
  113799. c.header_ = make(http.Header)
  113800. }
  113801. return c.header_
  113802. }
  113803. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  113804. reqHeaders := make(http.Header)
  113805. for k, v := range c.header_ {
  113806. reqHeaders[k] = v
  113807. }
  113808. reqHeaders.Set("User-Agent", c.s.userAgent())
  113809. if c.ifNoneMatch_ != "" {
  113810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113811. }
  113812. var body io.Reader = nil
  113813. c.urlParams_.Set("alt", alt)
  113814. c.urlParams_.Set("prettyPrint", "false")
  113815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  113816. urls += "?" + c.urlParams_.Encode()
  113817. req, err := http.NewRequest("GET", urls, body)
  113818. if err != nil {
  113819. return nil, err
  113820. }
  113821. req.Header = reqHeaders
  113822. googleapi.Expand(req.URL, map[string]string{
  113823. "project": c.project,
  113824. })
  113825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113826. }
  113827. // Do executes the "compute.zones.list" call.
  113828. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  113829. // code is an error. Response headers are in either
  113830. // *ZoneList.ServerResponse.Header or (if a response was returned at
  113831. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113832. // to check whether the returned error was because
  113833. // http.StatusNotModified was returned.
  113834. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  113835. gensupport.SetOptions(c.urlParams_, opts...)
  113836. res, err := c.doRequest("json")
  113837. if res != nil && res.StatusCode == http.StatusNotModified {
  113838. if res.Body != nil {
  113839. res.Body.Close()
  113840. }
  113841. return nil, &googleapi.Error{
  113842. Code: res.StatusCode,
  113843. Header: res.Header,
  113844. }
  113845. }
  113846. if err != nil {
  113847. return nil, err
  113848. }
  113849. defer googleapi.CloseBody(res)
  113850. if err := googleapi.CheckResponse(res); err != nil {
  113851. return nil, err
  113852. }
  113853. ret := &ZoneList{
  113854. ServerResponse: googleapi.ServerResponse{
  113855. Header: res.Header,
  113856. HTTPStatusCode: res.StatusCode,
  113857. },
  113858. }
  113859. target := &ret
  113860. if err := gensupport.DecodeResponse(target, res); err != nil {
  113861. return nil, err
  113862. }
  113863. return ret, nil
  113864. // {
  113865. // "description": "Retrieves the list of Zone resources available to the specified project.",
  113866. // "httpMethod": "GET",
  113867. // "id": "compute.zones.list",
  113868. // "parameterOrder": [
  113869. // "project"
  113870. // ],
  113871. // "parameters": {
  113872. // "filter": {
  113873. // "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).",
  113874. // "location": "query",
  113875. // "type": "string"
  113876. // },
  113877. // "maxResults": {
  113878. // "default": "500",
  113879. // "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)",
  113880. // "format": "uint32",
  113881. // "location": "query",
  113882. // "minimum": "0",
  113883. // "type": "integer"
  113884. // },
  113885. // "orderBy": {
  113886. // "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.",
  113887. // "location": "query",
  113888. // "type": "string"
  113889. // },
  113890. // "pageToken": {
  113891. // "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.",
  113892. // "location": "query",
  113893. // "type": "string"
  113894. // },
  113895. // "project": {
  113896. // "description": "Project ID for this request.",
  113897. // "location": "path",
  113898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113899. // "required": true,
  113900. // "type": "string"
  113901. // }
  113902. // },
  113903. // "path": "{project}/zones",
  113904. // "response": {
  113905. // "$ref": "ZoneList"
  113906. // },
  113907. // "scopes": [
  113908. // "https://www.googleapis.com/auth/cloud-platform",
  113909. // "https://www.googleapis.com/auth/compute",
  113910. // "https://www.googleapis.com/auth/compute.readonly"
  113911. // ]
  113912. // }
  113913. }
  113914. // Pages invokes f for each page of results.
  113915. // A non-nil error returned from f will halt the iteration.
  113916. // The provided context supersedes any context provided to the Context method.
  113917. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  113918. c.ctx_ = ctx
  113919. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113920. for {
  113921. x, err := c.Do()
  113922. if err != nil {
  113923. return err
  113924. }
  113925. if err := f(x); err != nil {
  113926. return err
  113927. }
  113928. if x.NextPageToken == "" {
  113929. return nil
  113930. }
  113931. c.PageToken(x.NextPageToken)
  113932. }
  113933. }